From b065b06c12dba6001b8140df2744d0c856ef6ea1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 20 Jun 2011 04:01:31 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133412 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/LLParser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/AsmParser') diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 7b7e785..170ec44 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -1987,8 +1987,8 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) { ParseToken(lltok::rbrace, "expected end of struct constant")) return true; - ID.ConstantVal = ConstantStruct::get(Context, Elts.data(), - Elts.size(), false); + // FIXME: Get this type from context instead of reconstructing it! + ID.ConstantVal = ConstantStruct::getAnon(Context, Elts); ID.Kind = ValID::t_Constant; return false; } @@ -2007,8 +2007,8 @@ bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) { return true; if (isPackedStruct) { - ID.ConstantVal = - ConstantStruct::get(Context, Elts.data(), Elts.size(), true); + // FIXME: Get this type from context instead of reconstructing it! + ID.ConstantVal = ConstantStruct::getAnon(Context, Elts, true); ID.Kind = ValID::t_Constant; return false; } -- cgit v1.1