diff options
author | Chris Lattner <sabre@nondot.org> | 2011-06-20 04:01:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-06-20 04:01:31 +0000 |
commit | cc19efaa97b3e1c2988042d716577831e813fdb9 (patch) | |
tree | 3edc88953e56373d3c3f53af5360a45cc8da8156 /llvm/lib/Bitcode | |
parent | 789adbb3ed2dcbf4b8c481a86c3641b240b6425f (diff) | |
download | bcm5719-llvm-cc19efaa97b3e1c2988042d716577831e813fdb9.tar.gz bcm5719-llvm-cc19efaa97b3e1c2988042d716577831e813fdb9.zip |
Revamp the "ConstantStruct::get" methods. Previously, these were scattered
all over the place in different styles and variants. Standardize on two
preferred entrypoints: one that takes a StructType and ArrayRef, and one that
takes StructType and varargs.
In cases where there isn't a struct type convenient, we now add a
ConstantStruct::getAnon method (whose name will make more sense after a few
more patches land).
It would be "really really nice" if the ConstantStruct::get and
ConstantVector::get methods didn't make temporary std::vectors.
llvm-svn: 133412
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 88c157532a5..ff67bc92fe1 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -292,11 +292,9 @@ void BitcodeReaderValueList::ResolveConstantForwardRefs() { // Make the new constant. Constant *NewC; if (ConstantArray *UserCA = dyn_cast<ConstantArray>(UserC)) { - NewC = ConstantArray::get(UserCA->getType(), &NewOps[0], - NewOps.size()); + NewC = ConstantArray::get(UserCA->getType(), &NewOps[0], NewOps.size()); } else if (ConstantStruct *UserCS = dyn_cast<ConstantStruct>(UserC)) { - NewC = ConstantStruct::get(Context, &NewOps[0], NewOps.size(), - UserCS->getType()->isPacked()); + NewC = ConstantStruct::get(UserCS->getType(), NewOps); } else if (isa<ConstantVector>(UserC)) { NewC = ConstantVector::get(NewOps); } else { |