Merge remote-tracking branch 'redstar/issue133'.

This commit is contained in:
David Nadlinger
2013-04-01 21:22:38 +02:00

View File

@@ -678,6 +678,7 @@ LLConstant* DtoConstString(const char* str)
#endif
llvm::GlobalVariable* gvar = new llvm::GlobalVariable(
*gIR->module, init->getType(), true, llvm::GlobalValue::InternalLinkage, init, ".str");
gvar->setUnnamedAddr(true);
LLConstant* idxs[] = { DtoConstUint(0), DtoConstUint(0) };
return DtoConstSlice(
DtoConstSize_t(s.size()),
@@ -697,6 +698,7 @@ LLConstant* DtoConstStringPtr(const char* str, const char* section)
llvm::GlobalVariable* gvar = new llvm::GlobalVariable(
*gIR->module, init->getType(), true, llvm::GlobalValue::InternalLinkage, init, ".str");
if (section) gvar->setSection(section);
gvar->setUnnamedAddr(true);
LLConstant* idxs[] = { DtoConstUint(0), DtoConstUint(0) };
return llvm::ConstantExpr::getGetElementPtr(gvar, idxs, true);
}