summaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils/GlobalStatus.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-12-30 11:46:15 +0000
committerdim <dim@FreeBSD.org>2015-12-30 11:46:15 +0000
commite194cd6d03d91631334d9d5e55b506036f423cc8 (patch)
treefcfbb4df56a744f4ddc6122c50521dd3f1c5e196 /lib/Transforms/Utils/GlobalStatus.cpp
parent1f8fab1f5d4699e0d1676fd4e5150ed8635f5035 (diff)
downloadFreeBSD-src-e194cd6d03d91631334d9d5e55b506036f423cc8.zip
FreeBSD-src-e194cd6d03d91631334d9d5e55b506036f423cc8.tar.gz
Vendor import of llvm trunk r256633:
https://llvm.org/svn/llvm-project/llvm/trunk@256633
Diffstat (limited to 'lib/Transforms/Utils/GlobalStatus.cpp')
-rw-r--r--lib/Transforms/Utils/GlobalStatus.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/GlobalStatus.cpp b/lib/Transforms/Utils/GlobalStatus.cpp
index 44b7d25..3893a75 100644
--- a/lib/Transforms/Utils/GlobalStatus.cpp
+++ b/lib/Transforms/Utils/GlobalStatus.cpp
@@ -49,6 +49,10 @@ bool llvm::isSafeToDestroyConstant(const Constant *C) {
static bool analyzeGlobalAux(const Value *V, GlobalStatus &GS,
SmallPtrSetImpl<const PHINode *> &PhiUsers) {
+ if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
+ if (GV->isExternallyInitialized())
+ GS.StoredType = GlobalStatus::StoredOnce;
+
for (const Use &U : V->uses()) {
const User *UR = U.getUser();
if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(UR)) {
OpenPOWER on IntegriCloud