summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-11-14 17:12:32 +0000
committerTeresa Johnson <tejohnson@google.com>2016-11-14 17:12:32 +0000
commit8e04a1bfa5642252bf93644e99329043e7205b6b (patch)
treee59348a55495aac9730e02b34799fb024ef10681 /include
parent28b89d61a665dc5598e4b5be9647cb7270f5f63c (diff)
downloadllvm-8e04a1bfa5642252bf93644e99329043e7205b6b.tar.gz
Restore "[ThinLTO] Prevent exporting of locals used/defined in module level asm"
This restores the rest of r286297 (part was restored in r286475). Specifically, it restores the part requiring adding a dependency from the Analysis to Object library (downstream use changed to correctly model split BitReader vs BitWriter libraries). Original description of this part of patch follows: Module level asm may also contain defs of values. We need to prevent export of any refs to local values defined in module level asm (e.g. a ref in normal IR), since that also requires renaming/promotion of the local. To do that, the summary index builder looks at all values in the module level asm string that are not marked Weak or Global, which is exactly the set of locals that are defined. A summary is created for each of these local defs and flagged as NoRename. This required adding handling to the BitcodeWriter to look at GV declarations to see if they have a summary (rather than skipping them all). Finally, added an assert to IRObjectFile::CollectAsmUndefinedRefs to ensure that an MCAsmParser is available, otherwise the module asm parse would silently fail. Initialized the asm parser in the opt tool for use in testing this fix. Fixes PR30610. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286844 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/TargetRegistry.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/Support/TargetRegistry.h b/include/llvm/Support/TargetRegistry.h
index f868c07df182..954cdb13abaf 100644
--- a/include/llvm/Support/TargetRegistry.h
+++ b/include/llvm/Support/TargetRegistry.h
@@ -280,6 +280,9 @@ public:
/// hasMCAsmBackend - Check if this target supports .o generation.
bool hasMCAsmBackend() const { return MCAsmBackendCtorFn != nullptr; }
+ /// hasMCAsmParser - Check if this target supports assembly parsing.
+ bool hasMCAsmParser() const { return MCAsmParserCtorFn != nullptr; }
+
/// @}
/// @name Feature Constructors
/// @{