Skip to content

Commit 66b4724

Browse files
devurandomNeopallium
authored andcommitted
Anonymous structs have to be retrieved using getAnon instead of get (LLVM 3.0)
Signed-off-by: Robert G. Jakabosky <[email protected]>
1 parent 96be72c commit 66b4724

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm-lua/LLVMDumper.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ llvm::GlobalVariable *LLVMDumper::dump_constants(Proto *p) {
252252
if(str_padding != NULL) {
253253
tmp_struct.push_back(str_padding);
254254
}
255-
value = llvm::ConstantStruct::get(getCtx(), tmp_struct, false);
255+
value = llvm::ConstantStruct::getAnon(getCtx(), tmp_struct, false);
256256
break;
257257
case LUA_TBOOLEAN:
258258
const_type = TYPE_BOOLEAN;
@@ -261,7 +261,7 @@ llvm::GlobalVariable *LLVMDumper::dump_constants(Proto *p) {
261261
if(bool_padding != NULL) {
262262
tmp_struct.push_back(bool_padding);
263263
}
264-
value = llvm::ConstantStruct::get(getCtx(), tmp_struct, false);
264+
value = llvm::ConstantStruct::getAnon(getCtx(), tmp_struct, false);
265265
break;
266266
case LUA_TNUMBER:
267267
const_type = TYPE_NUMBER;
@@ -270,7 +270,7 @@ llvm::GlobalVariable *LLVMDumper::dump_constants(Proto *p) {
270270
if(num_padding != NULL) {
271271
tmp_struct.push_back(num_padding);
272272
}
273-
value = llvm::ConstantStruct::get(getCtx(), tmp_struct, false);
273+
value = llvm::ConstantStruct::getAnon(getCtx(), tmp_struct, false);
274274
break;
275275
case LUA_TNIL:
276276
default:
@@ -280,7 +280,7 @@ llvm::GlobalVariable *LLVMDumper::dump_constants(Proto *p) {
280280
if(bool_padding != NULL) {
281281
tmp_struct.push_back(bool_padding);
282282
}
283-
value = llvm::ConstantStruct::get(getCtx(), tmp_struct, false);
283+
value = llvm::ConstantStruct::getAnon(getCtx(), tmp_struct, false);
284284
break;
285285
}
286286
tmp_struct.clear();
@@ -290,7 +290,7 @@ llvm::GlobalVariable *LLVMDumper::dump_constants(Proto *p) {
290290
array_struct_fields.push_back(llvm::ConstantStruct::get(type, tmp_struct));
291291
}
292292

293-
array_struct = llvm::ConstantStruct::get(getCtx(), array_struct_fields, false);
293+
array_struct = llvm::ConstantStruct::getAnon(getCtx(), array_struct_fields, false);
294294
constant = new llvm::GlobalVariable(*M, array_struct->getType(), true,
295295
llvm::GlobalValue::InternalLinkage, array_struct, ".constants");
296296
//constant->setAlignment(32);
@@ -312,7 +312,7 @@ llvm::GlobalVariable *LLVMDumper::dump_locvars(Proto *p) {
312312
array_struct_fields.push_back(llvm::ConstantStruct::get(Ty_jit_LocVar, tmp_struct));
313313
}
314314

315-
array_struct = llvm::ConstantStruct::get(getCtx(), array_struct_fields, false);
315+
array_struct = llvm::ConstantStruct::getAnon(getCtx(), array_struct_fields, false);
316316
constant = new llvm::GlobalVariable(*M, array_struct->getType(), true,
317317
llvm::GlobalValue::InternalLinkage, array_struct, ".locvars");
318318
//constant->setAlignment(32);
@@ -328,7 +328,7 @@ llvm::GlobalVariable *LLVMDumper::dump_upvalues(Proto *p) {
328328
array_struct_fields.push_back(get_global_str(getstr(p->upvalues[i])));
329329
}
330330

331-
array_struct = llvm::ConstantStruct::get(getCtx(), array_struct_fields, false);
331+
array_struct = llvm::ConstantStruct::getAnon(getCtx(), array_struct_fields, false);
332332
constant = new llvm::GlobalVariable(*M, array_struct->getType(), true,
333333
llvm::GlobalValue::InternalLinkage, array_struct, ".upvalues");
334334
//constant->setAlignment(32);

0 commit comments

Comments
 (0)