summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2015-06-19 02:12:07 +0000
committerTobias Grosser <tobias@grosser.es>2015-06-19 02:12:07 +0000
commitcdb89147c8cfe50ee5c1bb386ba07644655a4539 (patch)
treeddf0f60c2788c965a7e8f63edc3d412f25b90d72 /llvm/lib/IR
parent572e03a3965d783ea51d1844d202d822ad6e8f8c (diff)
downloadbcm5719-llvm-cdb89147c8cfe50ee5c1bb386ba07644655a4539.tar.gz
bcm5719-llvm-cdb89147c8cfe50ee5c1bb386ba07644655a4539.zip
IRBuilder: Allow globals to be constructed in a specific address space
llvm-svn: 240113
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/IRBuilder.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/IR/IRBuilder.cpp b/llvm/lib/IR/IRBuilder.cpp
index 335cf363c36..bddb278dee7 100644
--- a/llvm/lib/IR/IRBuilder.cpp
+++ b/llvm/lib/IR/IRBuilder.cpp
@@ -25,13 +25,15 @@ using namespace llvm;
/// specified. If Name is specified, it is the name of the global variable
/// created.
GlobalVariable *IRBuilderBase::CreateGlobalString(StringRef Str,
- const Twine &Name) {
+ const Twine &Name,
+ unsigned AddressSpace) {
Constant *StrConstant = ConstantDataArray::getString(Context, Str);
Module &M = *BB->getParent()->getParent();
GlobalVariable *GV = new GlobalVariable(M, StrConstant->getType(),
true, GlobalValue::PrivateLinkage,
- StrConstant);
- GV->setName(Name);
+ StrConstant, Name, nullptr,
+ GlobalVariable::NotThreadLocal,
+ AddressSpace);
GV->setUnnamedAddr(true);
return GV;
}
OpenPOWER on IntegriCloud