Actually privatize a IntegerTypes, and fix a few bugs exposed by this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78955 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2009-08-13 23:27:32 +00:00
parent ec9b26100e
commit 0e275dc538
11 changed files with 110 additions and 70 deletions

View File

@@ -1150,7 +1150,7 @@ bool LLParser::ParseTypeRec(PATypeHolder &Result) {
break;
case lltok::kw_opaque:
// TypeRec ::= 'opaque'
Result = OpaqueType::get();
Result = OpaqueType::get(Context);
Lex.Lex();
break;
case lltok::lbrace:
@@ -1180,7 +1180,7 @@ bool LLParser::ParseTypeRec(PATypeHolder &Result) {
if (const Type *T = M->getTypeByName(Lex.getStrVal())) {
Result = T;
} else {
Result = OpaqueType::get();
Result = OpaqueType::get(Context);
ForwardRefTypes.insert(std::make_pair(Lex.getStrVal(),
std::make_pair(Result,
Lex.getLoc())));
@@ -1199,7 +1199,7 @@ bool LLParser::ParseTypeRec(PATypeHolder &Result) {
if (I != ForwardRefTypeIDs.end())
Result = I->second.first;
else {
Result = OpaqueType::get();
Result = OpaqueType::get(Context);
ForwardRefTypeIDs.insert(std::make_pair(Lex.getUIntVal(),
std::make_pair(Result,
Lex.getLoc())));
@@ -1212,7 +1212,7 @@ bool LLParser::ParseTypeRec(PATypeHolder &Result) {
Lex.Lex();
unsigned Val;
if (ParseUInt32(Val)) return true;
OpaqueType *OT = OpaqueType::get(); //Use temporary placeholder.
OpaqueType *OT = OpaqueType::get(Context); //Use temporary placeholder.
UpRefs.push_back(UpRefRecord(Lex.getLoc(), Val, OT));
Result = OT;
break;