Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78258 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2009-08-05 23:16:16 +00:00
parent 70cd88fb7b
commit d7f2a6cb3f
18 changed files with 84 additions and 58 deletions
+3 -2
View File
@@ -217,7 +217,7 @@ LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes,
*E = ElementTypes + ElementCount; I != E; ++I)
Tys.push_back(unwrap(*I));
return wrap(StructType::get(Tys, Packed != 0));
return wrap(StructType::get(getGlobalContext(), Tys, Packed != 0));
}
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy) {
@@ -411,7 +411,8 @@ LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy,
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
int Packed) {
return wrap(ConstantStruct::get(unwrap<Constant>(ConstantVals, Count),
return wrap(ConstantStruct::get(getGlobalContext(),
unwrap<Constant>(ConstantVals, Count),
Count, Packed != 0));
}