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 | a7869e76385e11c27369415cf60fcff0471119e0 (patch) | |
| tree | 92ab55443a974812de4c74371c71115f47ec78ae /lib | |
| parent | c93fae3679c1b0ce8da92aaf825630fcc8580a00 (diff) | |
| download | external_llvm-a7869e76385e11c27369415cf60fcff0471119e0.zip external_llvm-a7869e76385e11c27369415cf60fcff0471119e0.tar.gz external_llvm-a7869e76385e11c27369415cf60fcff0471119e0.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); } |
