[llvm-bugs] [Bug 35190] New: Allow clang-cl.exe /c -emit-llvm

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 3 01:21:42 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=35190

            Bug ID: 35190
           Summary: Allow clang-cl.exe /c -emit-llvm
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andreas.haferburg at gmx.de
                CC: llvm-bugs at lists.llvm.org

There is no `-emit-llvm` flag in gcc, but the GCC driver was extended to
support `-emit-llvm`. The equivalent for cl.exe would be `/c -emit-llvm`, but
it doesn't work.

What I found very surprising is that `clang-cl /c -Xclang -emit-llvm
hello_world.c` doesn't even work. Maybe that is a bug.

All the examples on https://clang.llvm.org/docs/UsersManual.html are written
for clang.exe, and they don't work anymore for clang-cl.exe.

The workaround for getting clang-cl.exe to emit IR is to run `clang-cl.exe
-###`, and then replace the `-emit-obj` with `-emit-llvm`, which I personally
find quite unintuitive.

The goal for clang-cl.exe is to be compatible with cl.exe. But in my opinion,
it should also remain compatible with LLVM: clang.exe should be LLVM+gcc, and
clang-cl.exe should be LLVM+cl.

Cf. https://bugs.llvm.org/show_bug.cgi?id=35120

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171103/03e9bcee/attachment-0001.html>


More information about the llvm-bugs mailing list