Enable target dependent directive parsing to hook before standard parser in
authorAkira Hatanaka <ahatanaka@mips.com>
Thu, 5 Jul 2012 19:09:33 +0000 (19:09 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Thu, 5 Jul 2012 19:09:33 +0000 (19:09 +0000)
AsmParser::ParseStatement.

Patch by Vladimir Medic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159768 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCParser/AsmParser.cpp

index 744514af6c5dbbfb124eb44ebc21a494d8be1e0f..a559158c6c60ff579d00f88a10a6e81cdc86b927 100644 (file)
@@ -1167,6 +1167,11 @@ bool AsmParser::ParseStatement() {
 
   // Otherwise, we have a normal instruction or directive.
   if (IDVal[0] == '.' && IDVal != ".") {
+
+    // Target hook for parsing target specific directives.
+    if (!getTargetParser().ParseDirective(ID))
+      return false;
+
     // Assembler features
     if (IDVal == ".set" || IDVal == ".equ")
       return ParseDirectiveSet(IDVal, true);
@@ -1292,9 +1297,6 @@ bool AsmParser::ParseStatement() {
     if (Handler.first)
       return (*Handler.second)(Handler.first, IDVal, IDLoc);
 
-    // Target hook for parsing target specific directives.
-    if (!getTargetParser().ParseDirective(ID))
-      return false;
 
     return Error(IDLoc, "unknown directive");
   }