summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-12-27 17:45:09 +0000
committerTeresa Johnson <tejohnson@google.com>2016-12-27 17:45:09 +0000
commite0ee5cf7c8cae4be0e4eaab3eb71779ee6272976 (patch)
treee365d0453133cded2963987c708da82a6ff27c90 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
parent2ff37b8615e19131148142de72ebd2d000a8ddbb (diff)
downloadbcm5719-llvm-e0ee5cf7c8cae4be0e4eaab3eb71779ee6272976.tar.gz
bcm5719-llvm-e0ee5cf7c8cae4be0e4eaab3eb71779ee6272976.zip
[ThinLTO] Fix "||" vs "|" mixup.
The effect of the bug was that we would incorrectly create summaries for global and weak values defined in module asm (since we were essentially testing for bit 1 which is SF_Undefined, and the RecordStreamer ignores local undefined references). This would have resulted in conservatively disabling importing of anything referencing globals and weaks defined in module asm. Added these cases to the test which now fails without this bug fix. Fixes PR31459. llvm-svn: 290610
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/ModuleSummaryAnalysis.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index cc256f9c829..1d2ffc1abe1 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -284,7 +284,7 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex(
Triple(M.getTargetTriple()), M.getModuleInlineAsm(),
[&M, &Index](StringRef Name, object::BasicSymbolRef::Flags Flags) {
// Symbols not marked as Weak or Global are local definitions.
- if (Flags & (object::BasicSymbolRef::SF_Weak ||
+ if (Flags & (object::BasicSymbolRef::SF_Weak |
object::BasicSymbolRef::SF_Global))
return;
GlobalValue *GV = M.getNamedValue(Name);
OpenPOWER on IntegriCloud