diff options
| author | 2017-01-14 19:55:43 +0000 | |
|---|---|---|
| committer | 2017-01-14 19:55:43 +0000 | |
| commit | bd3306aecb3a15e8967143b8cdbbccf2b1b19b74 (patch) | |
| tree | 309a8132b44564b9e634c0da6815187ce8eab27c /gnu/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp | |
| parent | killp -a should not kill the window if only one pane. (diff) | |
| download | wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.tar.xz wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.zip | |
Import LLVM 3.9.1 including clang and lld.
Diffstat (limited to 'gnu/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp')
| -rw-r--r-- | gnu/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/gnu/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp b/gnu/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp index f0b720151b1..5cc51cd7a99 100644 --- a/gnu/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp +++ b/gnu/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp @@ -76,7 +76,7 @@ createLoweredInitializer(ArrayType *NewType, Constant *OriginalInitializer) { static Instruction * createReplacementInstr(ConstantExpr *CE, Instruction *Instr) { - IRBuilder<true,NoFolder> Builder(Instr); + IRBuilder<NoFolder> Builder(Instr); unsigned OpCode = CE->getOpcode(); switch (OpCode) { case Instruction::GetElementPtr: { @@ -179,7 +179,6 @@ static bool isZeroLengthArray(Type *Ty) { bool XCoreLowerThreadLocal::lowerGlobal(GlobalVariable *GV) { Module *M = GV->getParent(); - LLVMContext &Ctx = M->getContext(); if (!GV->isThreadLocal()) return false; @@ -189,7 +188,7 @@ bool XCoreLowerThreadLocal::lowerGlobal(GlobalVariable *GV) { return false; // Create replacement global. - ArrayType *NewType = createLoweredType(GV->getType()->getElementType()); + ArrayType *NewType = createLoweredType(GV->getValueType()); Constant *NewInitializer = nullptr; if (GV->hasInitializer()) NewInitializer = createLoweredInitializer(NewType, @@ -210,11 +209,8 @@ bool XCoreLowerThreadLocal::lowerGlobal(GlobalVariable *GV) { Function *GetID = Intrinsic::getDeclaration(GV->getParent(), Intrinsic::xcore_getid); Value *ThreadID = Builder.CreateCall(GetID, {}); - SmallVector<Value *, 2> Indices; - Indices.push_back(Constant::getNullValue(Type::getInt64Ty(Ctx))); - Indices.push_back(ThreadID); - Value *Addr = - Builder.CreateInBoundsGEP(NewGV->getValueType(), NewGV, Indices); + Value *Addr = Builder.CreateInBoundsGEP(NewGV->getValueType(), NewGV, + {Builder.getInt64(0), ThreadID}); U->replaceUsesOfWith(GV, Addr); } |
