diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-12-27 17:45:09 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-12-27 17:45:09 +0000 |
commit | e0ee5cf7c8cae4be0e4eaab3eb71779ee6272976 (patch) | |
tree | e365d0453133cded2963987c708da82a6ff27c90 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | |
parent | 2ff37b8615e19131148142de72ebd2d000a8ddbb (diff) | |
download | bcm5719-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.cpp | 2 |
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); |