summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-22 11:41:10 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-22 11:41:10 +0000
commit3edd9bb7a3da8526eb2f4a5dae2962a987d3d566 (patch)
treee8c2a4ed790801bb1a2f09f4bb5c158b517d1b0d /include
parentf3d2ef0c9712381a105118336975adcfbf733db0 (diff)
downloadllvm-3edd9bb7a3da8526eb2f4a5dae2962a987d3d566.tar.gz
llvm-3edd9bb7a3da8526eb2f4a5dae2962a987d3d566.tar.bz2
llvm-3edd9bb7a3da8526eb2f4a5dae2962a987d3d566.tar.xz
llvm-mc/Mach-O: Improve symbol table support:
- Honor .globl. - Set symbol type and section correctly ('nm' now works), and order symbols appropriately. - Take care to the string table so that the .o matches 'as' exactly (for ease of testing). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCAssembler.h11
-rw-r--r--include/llvm/MC/MCSymbol.h7
2 files changed, 14 insertions, 4 deletions
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h
index d4a8efe01d..bcd678deaa 100644
--- a/include/llvm/MC/MCAssembler.h
+++ b/include/llvm/MC/MCAssembler.h
@@ -312,6 +312,10 @@ public:
/// Offset - The offset to apply to the fragment address to form this symbol's
/// value.
uint64_t Offset;
+
+ /// IsExternal - True if this symbol is visible outside this translation
+ /// unit.
+ unsigned IsExternal : 1;
public:
// Only for use as sentinel.
@@ -330,6 +334,13 @@ public:
uint64_t getOffset() const { return Offset; }
void setOffset(uint64_t Value) { Offset = Value; }
+ /// @}
+ /// @name Symbol Attributes
+ /// @{
+
+ bool isExternal() const { return IsExternal; }
+ void setExternal(bool Value) { IsExternal = Value; }
+
/// @}
};
diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h
index 2b570a7ad3..122e897a92 100644
--- a/include/llvm/MC/MCSymbol.h
+++ b/include/llvm/MC/MCSymbol.h
@@ -43,7 +43,7 @@ namespace llvm {
/// undefined symbols, and the special AbsolutePseudoSection value for
/// absolute symbols.
const MCSection *Section;
-
+
/// IsTemporary - True if this is an assembler temporary label, which
/// typically does not survive in the .o file's symbol table. Usually
/// "Lfoo" or ".foo".
@@ -52,8 +52,7 @@ namespace llvm {
private: // MCContext creates and uniques these.
friend class MCContext;
MCSymbol(const StringRef &_Name, bool _IsTemporary)
- : Name(_Name), Section(0),
- IsTemporary(_IsTemporary) {}
+ : Name(_Name), Section(0), IsTemporary(_IsTemporary) {}
MCSymbol(const MCSymbol&); // DO NOT IMPLEMENT
void operator=(const MCSymbol&); // DO NOT IMPLEMENT
@@ -61,7 +60,7 @@ namespace llvm {
/// getName - Get the symbol name.
const std::string &getName() const { return Name; }
- /// @name Symbol Location Functions
+ /// @name Symbol Type
/// @{
/// isUndefined - Check if this symbol undefined (i.e., implicitly defined).