From e0ee5cf7c8cae4be0e4eaab3eb71779ee6272976 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Tue, 27 Dec 2016 17:45:09 +0000 Subject: [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 --- llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp') 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); -- cgit v1.2.3