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

Eric Astor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 13 15:31:57 PDT 2021


epastor created this revision.
Herald added a subscriber: hiraditya.
epastor requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104206

Files:
  llvm/lib/MC/MCParser/COFFMasmParser.cpp
  llvm/test/tools/llvm-ml/ml32-context.asm


Index: llvm/test/tools/llvm-ml/ml32-context.asm
===================================================================
--- /dev/null
+++ 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
Index: llvm/lib/MC/MCParser/COFFMasmParser.cpp
===================================================================
--- llvm/lib/MC/MCParser/COFFMasmParser.cpp
+++ llvm/lib/MC/MCParser/COFFMasmParser.cpp
@@ -138,14 +138,14 @@
 
     // 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");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104206.351746.patch
Type: text/x-patch
Size: 1724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210613/d1a6065b/attachment.bin>


More information about the llvm-commits mailing list