summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-06-12 03:25:05 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2015-06-12 03:25:05 +0000
commit005354b1f4fc896d70c2c5139f6c512ca8a8926b (patch)
treed26668520ce262217b1b12c6b9d70f50391f3298 /llvm/lib
parent43a65d9529c24c3253d385cde91cf4c9dad4155e (diff)
downloadbcm5719-llvm-005354b1f4fc896d70c2c5139f6c512ca8a8926b.tar.gz
bcm5719-llvm-005354b1f4fc896d70c2c5139f6c512ca8a8926b.zip
LowerBitSets: Give names to aliases of unnamed bitset element objects.
It is valid for globals to be unnamed, but aliases must have a name. To avoid creating invalid IR, we need to assign names to any aliases we create that point to unnamed objects that have been moved into combined globals. llvm-svn: 239590
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/LowerBitSets.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/LowerBitSets.cpp b/llvm/lib/Transforms/IPO/LowerBitSets.cpp
index bffeebb6e2e..dec583b0e2d 100644
--- a/llvm/lib/Transforms/IPO/LowerBitSets.cpp
+++ b/llvm/lib/Transforms/IPO/LowerBitSets.cpp
@@ -556,8 +556,9 @@ void LowerBitSets::buildBitSetsFromGlobals(
} else {
GlobalAlias *GAlias =
GlobalAlias::create(Globals[I]->getType(), Globals[I]->getLinkage(),
- "", CombinedGlobalElemPtr, M);
- GAlias->takeName(Globals[I]);
+ "data", CombinedGlobalElemPtr, M);
+ if (Globals[I]->hasName())
+ GAlias->takeName(Globals[I]);
Globals[I]->replaceAllUsesWith(GAlias);
}
Globals[I]->eraseFromParent();
OpenPOWER on IntegriCloud