[llvm-dev] FAIL: Why does the output of "llc -march=cpp .." fail to compile with clang 3.8

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Sun Feb 26 05:06:07 PST 2017


Last time someone discovered the CppBackend does not work [1] it was
decided to remove it [2].

Michael

[1] http://lists.llvm.org/pipermail/llvm-dev/2016-May/098981.html
[2] https://reviews.llvm.org/rL268631


2017-02-26 12:53 GMT+01:00 James Courtier-Dutton via llvm-dev
<llvm-dev at lists.llvm.org>:
> It seems that -march=cpp is broken.
> the -march=cpp  is very useful for people trying to understand the builder API.
> But, if the output of -march=cpp  does not even compile, it obviously
> creates code that is broken, so defeats the object of helping people
> understand the builder API.
>
> Why isn't -march=cpp  tested at all?
>
> See detail below.
>
> Kind Regards
>
> James
>
>
>
> Take a very simple example:
>
> Source code for  test.c:
> void munge(int *P) {
>   P[0] = P[1] + P[2];
> }
>
> compile with:
> clang -c -emit-llvm -o test.bc test.c
> test that the .bc output looks sensible
> llvm-dis-3.8 test.bc
> <snip>
> ; Function Attrs: nounwind uwtable
> define void @_Z5mungePi(i32* %P) #0 {
>   %1 = alloca i32*, align 8
>   store i32* %P, i32** %1, align 8
>   %2 = load i32*, i32** %1, align 8
>   %3 = getelementptr inbounds i32, i32* %2, i64 1
>   %4 = load i32, i32* %3, align 4
> <snip>
>
>
> So, that looks good.
> compile to -march=cpp
> llc-3.8 -march=cpp -o test.cpp test.bc
>
> So, we should now end up with some CPP code that uses the builder
> interface to generate the .bc file.
> The problem is, test.cpp  does not even compile.
>
> the -march=cpp  is very useful for people trying to understand the builder API.
>
> But, if the output of -march=cpp  does not even compile, it obviously
> creates code that is broken, so defeats the object of helping people
> understand the builder API.
>
> Why isn't -march=cpp  tested at all?
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list