diff options
author | Micah Villmow <villmow@gmail.com> | 2012-10-11 17:21:41 +0000 |
---|---|---|
committer | Micah Villmow <villmow@gmail.com> | 2012-10-11 17:21:41 +0000 |
commit | f3840d2c16a4ec4c879a8ded402835746de380f8 (patch) | |
tree | 705fb3f3aea368f4880d2d672312e6b783528718 /include/llvm/Transforms | |
parent | ebba49395c189364c9ef77fb4c432856330ceca1 (diff) |
Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r-- | include/llvm/Transforms/Utils/Local.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index 21dd3fbe11..fd1b5556ef 100644 --- a/include/llvm/Transforms/Utils/Local.h +++ b/include/llvm/Transforms/Utils/Local.h @@ -186,7 +186,8 @@ Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &TD, User *GEP, bool isInBounds = cast<GEPOperator>(GEP)->isInBounds() && !NoAssumptions; // Build a mask for high order bits. - unsigned IntPtrWidth = TD.getPointerSizeInBits(); + unsigned AS = cast<GEPOperator>(GEP)->getPointerAddressSpace(); + unsigned IntPtrWidth = TD.getPointerSizeInBits(AS); uint64_t PtrSizeMask = ~0ULL >> (64-IntPtrWidth); for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e; |