[llvm-dev] Is the CppBackend still supported?

Jonathan Roelofs via llvm-dev llvm-dev at lists.llvm.org
Tue May 3 12:30:09 PDT 2016



On 5/3/16 1:13 PM, Justin Bogner via llvm-dev wrote:
> Stanislav Manilov via llvm-dev <llvm-dev at lists.llvm.org> writes:
>> Hello,
>>
>> I was trying to compile a simple program with the CppBackend like so:
>>
>> $ clang str_arg.c -emit-llvm -S
>> $ llc -march=cpp str_arg.ll
>>
>> It produces a file `str_arg.cpp` as expected, however it doesn't seem that
>> the resulting file is correct. For once, it includes
>> `<llvm/Analysis/Verifier.h>` which seems to have been moved to
>> `llvm/IR/Verifier.h` as far back as 2013.
>>
>> My question is this: is the CppBackend supposed to work? If so, what am I
>> missing?
>
> It is supposed to work, but it's definitely broken. I suppose nobody
> motivated to fix it has noticed :(
>
> Feel free to file a bug on llvm.org/bugs or to try to fix these issues
> and send patches. Sorry I don't have a better answer for you.

I'm not motivated enough to fix it either, but maybe it would be a good 
idea to have a unit test for it that takes in the bitcode we use to 
check all of the backward compatibility guarantees, and makes sure that 
it is capable of round-tripping them.


Jon

>
>> Listing of str_arg.c:
>>
>>      #include <stdio.h>
>>
>>      void i(unsigned index, char *string) {
>>        printf("%d %s\n", index, string);
>>      }
>>
>>      int main() {
>>        i(10, "foo");
>>        return 0;
>>      }
>>
>> clang version:
>>
>>      clang version 3.7.1 (http://llvm.org/git/clang.git
>> 0dbefa1b83eb90f7a06b5df5df254ce32be3db4b) (http://llvm.org/git/llvm.git
>> 33c352b3eda89abc24e7511d9045fa2e499a42e3)
>>      Target: x86_64-unknown-linux-gnu
>>      Thread model: posix
>>
>> llc version:
>>
>>      LLVM (http://llvm.org/):
>>        LLVM version 3.7.1
>>        Optimized build.
>>        Built Apr  4 2016 (15:04:44).
>>        Default target: x86_64-unknown-linux-gnu
>>        Host CPU: ivybridge
>>
>>        Registered Targets:
>>          aarch64    - AArch64 (little endian)
>>          aarch64_be - AArch64 (big endian)
>>          amdgcn     - AMD GCN GPUs
>>          arm        - ARM
>>          arm64      - ARM64 (little endian)
>>          armeb      - ARM (big endian)
>>          bpf        - BPF (host endian)
>>          bpfeb      - BPF (big endian)
>>          bpfel      - BPF (little endian)
>>          cpp        - C++ backend
>>          hexagon    - Hexagon
>>          mips       - Mips
>>          mips64     - Mips64 [experimental]
>>          mips64el   - Mips64el [experimental]
>>          mipsel     - Mipsel
>>          msp430     - MSP430 [experimental]
>>          nvptx      - NVIDIA PTX 32-bit
>>          nvptx64    - NVIDIA PTX 64-bit
>>          ppc32      - PowerPC 32
>>          ppc64      - PowerPC 64
>>          ppc64le    - PowerPC 64 LE
>>          r600       - AMD GPUs HD2XXX-HD6XXX
>>          sparc      - Sparc
>>          sparcel    - Sparc LE
>>          sparcv9    - Sparc V9
>>          systemz    - SystemZ
>>          thumb      - Thumb
>>          thumbeb    - Thumb (big endian)
>>          x86        - 32-bit X86: Pentium-Pro and above
>>          x86-64     - 64-bit X86: EM64T and AMD64
>>          xcore      - XCore
>>
>> Kind regards,
>>   - Stan
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded


More information about the llvm-dev mailing list