mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-23 02:32:11 +00:00
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
This commit is contained in:
parent
276dcbdc8d
commit
495304e351
@ -221,8 +221,9 @@ public:
|
|||||||
bool isPacked=false);
|
bool isPacked=false);
|
||||||
|
|
||||||
/// StructType::get - This static method is a convenience method for
|
/// StructType::get - This static method is a convenience method for
|
||||||
/// creating structure types by specifying the elements as arguments. Note
|
/// creating structure types by specifying the elements as arguments.
|
||||||
/// that this method always returns a non-packed struct.
|
/// Note that this method always returns a non-packed struct. To get
|
||||||
|
/// an empty struct, pass NULL, NULL.
|
||||||
static StructType *get(const Type *type, ...) END_WITH_NULL;
|
static StructType *get(const Type *type, ...) END_WITH_NULL;
|
||||||
|
|
||||||
// Iterator access to the elements
|
// Iterator access to the elements
|
||||||
|
@ -1252,9 +1252,10 @@ StructType *StructType::get(const Type *type, ...) {
|
|||||||
va_list ap;
|
va_list ap;
|
||||||
std::vector<const llvm::Type*> StructFields;
|
std::vector<const llvm::Type*> StructFields;
|
||||||
va_start(ap, type);
|
va_start(ap, type);
|
||||||
do {
|
while (type) {
|
||||||
StructFields.push_back(type);
|
StructFields.push_back(type);
|
||||||
} while ((type = va_arg(ap, llvm::Type*)));
|
type = va_arg(ap, llvm::Type*);
|
||||||
|
}
|
||||||
return llvm::StructType::get(StructFields);
|
return llvm::StructType::get(StructFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user