diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-06-29 23:43:14 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-06-29 23:43:14 +0000 |
commit | dce0f3c556474092f10b082adff0a2a58f428317 (patch) | |
tree | f154cc397370fd3b59e2dd20eacb0b3c8f866358 /include | |
parent | 9146d0e89c051ea7accf185d97317306c2532c27 (diff) | |
download | external_llvm-dce0f3c556474092f10b082adff0a2a58f428317.zip external_llvm-dce0f3c556474092f10b082adff0a2a58f428317.tar.gz external_llvm-dce0f3c556474092f10b082adff0a2a58f428317.tar.bz2 |
llvm-mc: Diagnose misuse (mix) of defined symbols and labels.
- For example, we diagnose errors on:
--
a:
a = 10
--
- For now we reject code like:
--
.long a
a = 10
--
which "as" accepts (on Darwin).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74476 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCContext.h | 2 | ||||
-rw-r--r-- | include/llvm/MC/MCSymbol.h | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/MC/MCContext.h b/include/llvm/MC/MCContext.h index 13180e8..846e195 100644 --- a/include/llvm/MC/MCContext.h +++ b/include/llvm/MC/MCContext.h @@ -31,6 +31,8 @@ namespace llvm { StringMap<MCSymbol*> Symbols; /// SymbolValues - Bindings of symbols to values. + // + // FIXME: Is there a good reason to not just put this in the MCSymbol? DenseMap<MCSymbol*, MCValue> SymbolValues; /// Allocator - Allocator object used for creating machine code objects. diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h index 06f50ae..fcfc9d6 100644 --- a/include/llvm/MC/MCSymbol.h +++ b/include/llvm/MC/MCSymbol.h @@ -17,14 +17,18 @@ namespace llvm { MCSection *Section; std::string Name; unsigned IsTemporary : 1; + unsigned IsExternal : 1; public: MCSymbol(const char *_Name, bool _IsTemporary) - : Section(0), Name(_Name), IsTemporary(_IsTemporary) {} + : Section(0), Name(_Name), IsTemporary(_IsTemporary), IsExternal(false) {} MCSection *getSection() const { return Section; } void setSection(MCSection *Value) { Section = Value; } + bool isExternal() const { return IsExternal; } + void setExternal(bool Value) { IsExternal = Value; } + const std::string &getName() const { return Name; } }; |