summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-06-15 18:33:28 +0000
committerJim Grosbach <grosbach@apple.com>2011-06-15 18:33:28 +0000
commite82b8eeaa2d36ee52690ae19bca9735629b6003e (patch)
tree89b7d51d52090f5fc5485c76297c220228b9abbb /include
parent2f473cee286e9c71ee8e7d6b1c46b05f2aed7336 (diff)
downloadllvm-e82b8eeaa2d36ee52690ae19bca9735629b6003e.tar.gz
llvm-e82b8eeaa2d36ee52690ae19bca9735629b6003e.tar.bz2
llvm-e82b8eeaa2d36ee52690ae19bca9735629b6003e.tar.xz
Diagnostic for undefined assembler local symbols.
Re-apply 133010, with fixes for inline assembler. Original commit message: "When an assembler local symbol is used but not defined in a module, a Darwin assembler wants to issue a diagnostic to that effect." Added fix to only perform the check when finalizing, as otherwise we're not done and undefined symbols may simply not have been encountered yet. Passes "make check" and a self-host check on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCContext.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/llvm/MC/MCContext.h b/include/llvm/MC/MCContext.h
index 070089e2c9..43a9ce6cfa 100644
--- a/include/llvm/MC/MCContext.h
+++ b/include/llvm/MC/MCContext.h
@@ -39,6 +39,9 @@ namespace llvm {
class MCContext {
MCContext(const MCContext&); // DO NOT IMPLEMENT
MCContext &operator=(const MCContext&); // DO NOT IMPLEMENT
+ public:
+ typedef StringMap<MCSymbol*, BumpPtrAllocator&> SymbolTable;
+ private:
/// The MCAsmInfo for this target.
const MCAsmInfo &MAI;
@@ -52,7 +55,7 @@ namespace llvm {
BumpPtrAllocator Allocator;
/// Symbols - Bindings of names to symbols.
- StringMap<MCSymbol*, BumpPtrAllocator&> Symbols;
+ SymbolTable Symbols;
/// UsedNames - Keeps tracks of names that were used both for used declared
/// and artificial symbols.
@@ -142,6 +145,14 @@ namespace llvm {
/// LookupSymbol - Get the symbol for \p Name, or null.
MCSymbol *LookupSymbol(StringRef Name) const;
+ /// getSymbols - Get a reference for the symbol table for clients that
+ /// want to, for example, iterate over all symbols. 'const' because we
+ /// still want any modifications to the table itself to use the MCContext
+ /// APIs.
+ const SymbolTable &getSymbols() const {
+ return Symbols;
+ }
+
/// @}
/// @name Section Management