diff options
author | Duncan Sands <baldrick@free.fr> | 2008-03-21 15:53:17 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-03-21 15:53:17 +0000 |
commit | 495304e35125ee951bc7667554bf8c9e3009e311 (patch) | |
tree | 92ab55443a974812de4c74371c71115f47ec78ae /lib | |
parent | 276dcbdc8db6614cfd5004dc7dc35e437ddf9c58 (diff) | |
download | external_llvm-495304e35125ee951bc7667554bf8c9e3009e311.zip external_llvm-495304e35125ee951bc7667554bf8c9e3009e311.tar.gz external_llvm-495304e35125ee951bc7667554bf8c9e3009e311.tar.bz2 |
Make it possible to get an empty struct using
the new StructType::get method. The second NULL
is to pacify the gcc warning mechanism. This
patch compiles but is otherwise untested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48645 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Type.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 4554826..829923e 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -1252,9 +1252,10 @@ StructType *StructType::get(const Type *type, ...) { va_list ap; std::vector<const llvm::Type*> StructFields; va_start(ap, type); - do { + while (type) { StructFields.push_back(type); - } while ((type = va_arg(ap, llvm::Type*))); + type = va_arg(ap, llvm::Type*); + } return llvm::StructType::get(StructFields); } |