add llvm-mc support for parsing the .subsections_via_symbols directive.
[oota-llvm.git] / tools / llvm-mc / AsmParser.cpp
index a2cdea4c4dc03af5eb7c582007a377dabbedd2a9..fe9d4f3352ffc9c6dc1964c4ea49a629ab44cf78 100644 (file)
@@ -527,6 +527,9 @@ bool AsmParser::ParseStatement() {
     if (!strcmp(IDVal, ".zerofill"))
       return ParseDirectiveDarwinZerofill();
 
+    if (!strcmp(IDVal, ".subsections_via_symbols"))
+      return ParseDirectiveDarwinSubsectionsViaSymbols();
+
     Warning(IDLoc, "ignoring directive for now");
     EatToEndOfStatement();
     return false;
@@ -1052,3 +1055,16 @@ bool AsmParser::ParseDirectiveDarwinZerofill() {
 
   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;
+}