diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-05-05 19:01:00 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-05-05 19:01:00 +0000 |
commit | c304718fd8fa25f3f36f47f3de0e0cfe7578bc9e (patch) | |
tree | ca18393d0b2db358867f51a1d2196e783d779e86 /lib/MC/MCMachOStreamer.cpp | |
parent | 8d627d31531ad45fecca82d52cd34092c7c4cc1d (diff) |
MC: Reject attempts to define a variable symbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103111 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCMachOStreamer.cpp')
-rw-r--r-- | lib/MC/MCMachOStreamer.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp index cfb39598f5..b4bd557535 100644 --- a/lib/MC/MCMachOStreamer.cpp +++ b/lib/MC/MCMachOStreamer.cpp @@ -162,6 +162,8 @@ void MCMachOStreamer::SwitchSection(const MCSection *Section) { void MCMachOStreamer::EmitLabel(MCSymbol *Symbol) { assert(Symbol->isUndefined() && "Cannot define a symbol twice!"); + assert(!Symbol->isVariable() && "Cannot emit a variable symbol!"); + assert(CurSection && "Cannot emit before setting section!"); // FIXME: This is wasteful, we don't necessarily need to create a data // fragment. Instead, we should mark the symbol as pointing into the data @@ -190,10 +192,6 @@ void MCMachOStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) { } void MCMachOStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) { - // Only absolute symbols can be redefined. - assert((Symbol->isUndefined() || Symbol->isAbsolute()) && - "Cannot define a symbol twice!"); - // FIXME: Lift context changes into super class. // FIXME: Set associated section. Symbol->setVariableValue(AddValueSymbols(Value)); |