Darwin 'as' silently ignores the '.ident' directive.
authorJim Grosbach <grosbach@apple.com>
Tue, 8 Mar 2011 19:17:19 +0000 (19:17 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 8 Mar 2011 19:17:19 +0000 (19:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127258 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCParser/DarwinAsmParser.cpp

index 44f234566afdcdbe1a94b8a420adf95786ffb002..e1f49c2609dad972e9c0e70e32b54c8e05b7d2b4 100644 (file)
@@ -100,6 +100,8 @@ public:
     AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveText>(".text");
     AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveThreadInitFunc>(".thread_init_func");
     AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveTLV>(".tlv");
+
+    AddDirectiveHandler<&DarwinAsmParser::ParseSectionDirectiveIdent>(".ident");
   }
 
   bool ParseDirectiveDesc(StringRef, SMLoc);
@@ -277,6 +279,11 @@ public:
     return ParseSectionSwitch("__DATA", "__thread_vars",
                               MCSectionMachO::S_THREAD_LOCAL_VARIABLES);
   }
+  bool ParseSectionDirectiveIdent(StringRef, SMLoc) {
+    // Darwin silently ignores the .ident directive.
+    getParser().EatToEndOfStatement();
+    return false;
+  }
   bool ParseSectionDirectiveThreadInitFunc(StringRef, SMLoc) {
     return ParseSectionSwitch("__DATA", "__thread_init",
                          MCSectionMachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS);