[PATCH]: Bug 18941 : clang fails to emit S file textually

Saleem Abdulrasool compnerd at compnerd.org
Tue Mar 11 18:59:16 PDT 2014


On Tue, Mar 11, 2014 at 6:42 PM, lin zuojian <manjian2006 at gmail.com> wrote:

> Hi,
>     here's my patch & testcase. I don't know where to put the testcase
>     file.So I just drop it to the root path.
>

This is a known issue" and is considered a feature.  There was previous
discussion on this topic on llvmdev.  If you wish to do this, simply
compile with -S -fno-integrated-as and clang should do what you desire.


> Index: lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
> ===================================================================
> --- lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp      (revision 203630)
> +++ lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp      (working copy)
> @@ -78,6 +78,11 @@
>    if (isNullTerminated)
>      Str = Str.substr(0, Str.size()-1);
>
> +  // If the output streamer is actually a .s file, just emit the blob
> textually.
> +  if (OutStreamer.hasRawTextSupport()) {
> +     OutStreamer.EmitRawText(Str);
> +     return;
> +  }
>    // If the output streamer does not have mature MC support or the
> integrated
>    // assembler has been disabled, just emit the blob textually.
>    // Otherwise parse the asm and emit it via MC support.
> Index: test-emit-s-file.cpp
> ===================================================================
> --- test-emit-s-file.cpp        (revision 0)
> +++ test-emit-s-file.cpp        (working copy)
> @@ -0,0 +1,9 @@
> +// RUN: clang -S -o - %s | FileCheck %s
> +void foo() {
> +  // CHECK:vp8_block_coeff EQU $8
> +  asm("\n"
> +      "vp8_block_coeff"
> +      " EQU %0"
> +      :
> +      : "i"(8));
> +}
>
> ---
> Regards
> lin zuojian
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140311/94158c42/attachment.html>


More information about the llvm-commits mailing list