[PATCH] D45164: [MC] Change AsmParser to leverage Assembler during evaluation

Nirav Dave via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 30 12:26:10 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC331218: [MC] Change AsmParser to leverage Assembler during evaluation (authored by niravd, committed by ).
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D45164?vs=143128&id=144613#toc

Repository:
  rC Clang

https://reviews.llvm.org/D45164

Files:
  test/CodeGen/asm-parser-info.S
  tools/driver/cc1as_main.cpp


Index: test/CodeGen/asm-parser-info.S
===================================================================
--- test/CodeGen/asm-parser-info.S
+++ test/CodeGen/asm-parser-info.S
@@ -0,0 +1,12 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang --target=x86_64-unknown-linux-gnu -c %s -o /dev/null
+
+// Check that cc1as can use assembler info in object generation.
+.data
+	
+foo:
+.if . - foo == 0
+    .byte 0xaa
+.else
+    .byte 0x00
+.endif
Index: tools/driver/cc1as_main.cpp
===================================================================
--- tools/driver/cc1as_main.cpp
+++ tools/driver/cc1as_main.cpp
@@ -435,6 +435,9 @@
     Str.get()->InitSections(Opts.NoExecStack);
   }
 
+  // Assembly to object compilation should leverage assembly info.
+  Str->setUseAssemblerInfoForParsing(true);
+
   bool Failed = false;
 
   std::unique_ptr<MCAsmParser> Parser(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45164.144613.patch
Type: text/x-patch
Size: 870 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180430/7320ad4d/attachment.bin>


More information about the cfe-commits mailing list