summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCMachOStreamer.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-22 07:22:36 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-22 07:22:36 +0000
commit6860ac7375966b81791b009a4a60b12fea85c0ce (patch)
tree303c56cf9fc2f25ad601d6748f6e84a520fe9141 /llvm/lib/MC/MCMachOStreamer.cpp
parent81c05241022578ed8b0e48f212e16d69b13deba3 (diff)
downloadbcm5719-llvm-6860ac7375966b81791b009a4a60b12fea85c0ce.tar.gz
bcm5719-llvm-6860ac7375966b81791b009a4a60b12fea85c0ce.zip
llvm-mc: Clean up some handling of symbol/section association to be more correct
(external was really undefined and there wasn't an explicit representation for absolute symbols). - This still needs some cleanup to how the absolute "pseudo" section is dealt with, but I haven't figured out the nicest approach yet. llvm-svn: 79733
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 316051ce01d..421faef6aa4 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -91,15 +91,12 @@ void MCMachOStreamer::SwitchSection(const MCSection *Section) {
}
void MCMachOStreamer::EmitLabel(MCSymbol *Symbol) {
- assert(Symbol->getSection() == 0 && "Cannot emit a symbol twice!");
+ assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
assert(CurSection && "Cannot emit before setting section!");
- assert(!getContext().GetSymbolValue(Symbol) &&
- "Cannot emit symbol which was directly assigned to!");
llvm_unreachable("FIXME: Not yet implemented!");
- Symbol->setSection(CurSection);
- Symbol->setExternal(false);
+ Symbol->setSection(*CurSection);
}
void MCMachOStreamer::EmitAssemblerFlag(AssemblerFlag Flag) {
@@ -109,7 +106,9 @@ void MCMachOStreamer::EmitAssemblerFlag(AssemblerFlag Flag) {
void MCMachOStreamer::EmitAssignment(MCSymbol *Symbol,
const MCValue &Value,
bool MakeAbsolute) {
- assert(!Symbol->getSection() && "Cannot assign to a label!");
+ // Only absolute symbols can be redefined.
+ assert((Symbol->isUndefined() || Symbol->isAbsolute()) &&
+ "Cannot define a symbol twice!");
llvm_unreachable("FIXME: Not yet implemented!");
}
OpenPOWER on IntegriCloud