// symbol section in the constructor and initialize it here?
virtual void EmitLabel(MCSymbol *Symbol) = 0;
+ /// SubsectionsViaSymbols - Note in the output that the conventions used in
+ /// in the assembly file allows the bytes of a section to be divided up at
+ /// the boundaries of the symbols by a link editor for processing as atoms.
+ virtual void SubsectionsViaSymbols(void) = 0;
+
/// EmitAssignment - Emit an assignment of @param Value to @param Symbol.
///
/// This corresponds to an assembler statement such as:
virtual void EmitLabel(MCSymbol *Symbol);
+ virtual void SubsectionsViaSymbols(void);
+
virtual void EmitAssignment(MCSymbol *Symbol, const MCValue &Value,
bool MakeAbsolute = false);
Symbol->setExternal(false);
}
+void MCAsmStreamer::SubsectionsViaSymbols(void) {
+ OS << ".subsections_via_symbols\n";
+}
+
void MCAsmStreamer::EmitAssignment(MCSymbol *Symbol, const MCValue &Value,
bool MakeAbsolute) {
assert(!Symbol->getSection() && "Cannot assign to a label!");
--- /dev/null
+# RUN: llvm-mc %s | FileCheck %s
+
+# CHECK: TEST0:
+# CHECK: .subsections_via_symbols
+TEST0:
+ .subsections_via_symbols
if (!strcmp(IDVal, ".zerofill"))
return ParseDirectiveDarwinZerofill();
+ if (!strcmp(IDVal, ".subsections_via_symbols"))
+ return ParseDirectiveDarwinSubsectionsViaSymbols();
+
Warning(IDLoc, "ignoring directive for now");
EatToEndOfStatement();
return false;
return false;
}
+
+/// ParseDirectiveDarwinSubsectionsViaSymbols
+/// ::= .subsections_via_symbols
+bool AsmParser::ParseDirectiveDarwinSubsectionsViaSymbols() {
+ if (Lexer.isNot(asmtok::EndOfStatement))
+ return TokError("unexpected token in '.subsections_via_symbols' directive");
+
+ Lexer.Lex();
+
+ Out.SubsectionsViaSymbols();
+
+ return false;
+}
bool ParseDirectiveComm(bool IsLocal); // ".comm" and ".lcomm"
bool ParseDirectiveDarwinZerofill(); // Darwin specific ".zerofill"
+
+ // Darwin specific ".subsections_via_symbols"
+ bool ParseDirectiveDarwinSubsectionsViaSymbols();
};
} // end namespace llvm