summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalMerge.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-04-02 18:55:32 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-04-02 18:55:32 +0000
commit4a2e73b06677a199591f004f8812811ec01e2e1f (patch)
treef6f2245fabc75040cc51b867a134d553cd36919a /llvm/lib/CodeGen/GlobalMerge.cpp
parente3b172afc33004cb11299e21dbea1dbb4cc4dc27 (diff)
downloadbcm5719-llvm-4a2e73b06677a199591f004f8812811ec01e2e1f.tar.gz
bcm5719-llvm-4a2e73b06677a199591f004f8812811ec01e2e1f.zip
[opaque pointer type] API migration for GEP constant factories
Require the pointee type to be passed explicitly and assert that it is correct. For now it's possible to pass nullptr here (and I've done so in a few places in this patch) but eventually that will be disallowed once all clients have been updated or removed. It'll be a long road to get all the way there... but if you have the cahnce to update your callers to pass the type explicitly without depending on a pointer's element type, that would be a good thing to do soon and a necessary thing to do eventually. llvm-svn: 233938
Diffstat (limited to 'llvm/lib/CodeGen/GlobalMerge.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalMerge.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalMerge.cpp b/llvm/lib/CodeGen/GlobalMerge.cpp
index 32543b7723a..41953839010 100644
--- a/llvm/lib/CodeGen/GlobalMerge.cpp
+++ b/llvm/lib/CodeGen/GlobalMerge.cpp
@@ -222,7 +222,8 @@ bool GlobalMerge::doMerge(SmallVectorImpl<GlobalVariable*> &Globals,
ConstantInt::get(Int32Ty, 0),
ConstantInt::get(Int32Ty, k-i)
};
- Constant *GEP = ConstantExpr::getInBoundsGetElementPtr(MergedGV, Idx);
+ Constant *GEP =
+ ConstantExpr::getInBoundsGetElementPtr(MergedTy, MergedGV, Idx);
Globals[k]->replaceAllUsesWith(GEP);
Globals[k]->eraseFromParent();
OpenPOWER on IntegriCloud