void MCAsmStreamer::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!");
OS << *Symbol << ":";
}
void MCAsmStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
- // Only absolute symbols can be redefined.
- assert((Symbol->isUndefined() || Symbol->isAbsolute()) &&
- "Cannot define a symbol twice!");
-
OS << *Symbol << " = " << *Value;
EmitEOL();
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
}
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));
// FIXME: This doesn't diagnose assignment to a symbol which has been
// implicitly marked as external.
MCSymbol *Sym = CreateSymbol(IDVal);
- if (!Sym->isUndefined())
+ if (!Sym->isUndefined() || Sym->isVariable())
return Error(IDLoc, "invalid symbol redefinition");
// Emit the label.