summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSean Silva <chisophugis@gmail.com>2015-09-28 19:02:11 +0000
committerSean Silva <chisophugis@gmail.com>2015-09-28 19:02:11 +0000
commitace7818ce655617386852450a3c9679ffbc742d9 (patch)
treea68683f45a9c87d14f9080d222725482ec385dce /llvm/lib/Transforms
parentf74cc40e34f5cf2b42e94b0c2e13d89d7fce14e0 (diff)
downloadbcm5719-llvm-ace7818ce655617386852450a3c9679ffbc742d9.tar.gz
bcm5719-llvm-ace7818ce655617386852450a3c9679ffbc742d9.zip
[GlobalOpt] Sort members of llvm.used deterministically
Patch by Jake VanAdrighem! Summary: Fix the way we sort the llvm.used and llvm.compiler.used members. This bug seems to have been introduced in rL183756 through a set of improper casts to GlobalValue*. In subsequent patches this problem was missed and transformed into a getName call on a ConstantExpr. Reviewers: silvas Subscribers: silvas, llvm-commits Differential Revision: http://reviews.llvm.org/D12851 llvm-svn: 248728
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index c60b3ccc298..a4b8408b1bf 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -2712,7 +2712,8 @@ static bool EvaluateStaticConstructor(Function *F, const DataLayout &DL,
}
static int compareNames(Constant *const *A, Constant *const *B) {
- return (*A)->getName().compare((*B)->getName());
+ return (*A)->stripPointerCasts()->getName().compare(
+ (*B)->stripPointerCasts()->getName());
}
static void setUsedInitializer(GlobalVariable &V,
OpenPOWER on IntegriCloud