[llvm] d81c059 - [ms] [llvm-ml] Fix capitalization of the ignored CPU directives

Eric Astor via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 13 15:37:00 PDT 2021


Author: Eric Astor
Date: 2021-06-13T18:34:42-04:00
New Revision: d81c059c3ed22e7f52eb995599e576abd30eb895

URL: https://github.com/llvm/llvm-project/commit/d81c059c3ed22e7f52eb995599e576abd30eb895
DIFF: https://github.com/llvm/llvm-project/commit/d81c059c3ed22e7f52eb995599e576abd30eb895.diff

LOG: [ms] [llvm-ml] Fix capitalization of the ignored CPU directives

These directives are matched in lowercase, so make sure to use lowercase for their P suffix.

Differential Revision: https://reviews.llvm.org/D104206

Added: 
    llvm/test/tools/llvm-ml/ml32-context.asm

Modified: 
    llvm/lib/MC/MCParser/COFFMasmParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/MCParser/COFFMasmParser.cpp b/llvm/lib/MC/MCParser/COFFMasmParser.cpp
index 95128cf7d1845..f745605b6b359 100644
--- a/llvm/lib/MC/MCParser/COFFMasmParser.cpp
+++ b/llvm/lib/MC/MCParser/COFFMasmParser.cpp
@@ -138,14 +138,14 @@ class COFFMasmParser : public MCAsmParserExtension {
 
     // Processor directives; all ignored
     addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".386");
-    addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".386P");
+    addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".386p");
     addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".387");
     addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".486");
-    addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".486P");
+    addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".486p");
     addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".586");
-    addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".586P");
+    addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".586p");
     addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".686");
-    addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".686P");
+    addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".686p");
     addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".k3d");
     addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".mmx");
     addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".xmm");

diff  --git a/llvm/test/tools/llvm-ml/ml32-context.asm b/llvm/test/tools/llvm-ml/ml32-context.asm
new file mode 100644
index 0000000000000..ab949e577689c
--- /dev/null
+++ b/llvm/test/tools/llvm-ml/ml32-context.asm
@@ -0,0 +1,12 @@
+# RUN: llvm-ml -m32 -filetype=s %s /Fo - | FileCheck %s
+
+.386p
+.model flat
+
+.code
+mov eax, eax
+end
+
+; CHECK-NOT: 386p
+; CHECK-NOT: model
+; CHECK-NOT: flat


        


More information about the llvm-commits mailing list