Displaying 2 results from an estimated 2 matches for "main_b".
Did you mean:
main__
2015 Apr 14
5
[LLVMdev] [cfe-dev] A problem with names that can not be demangled.
...>
> --------------- t1.cpp ---------
>
> static void Bye(int* ba1) { ba1[0] /= ba1[2] - 2; }
>
> void main_a( int* inB) { void (*func)(int*) = Bye; func(inB); }
>
> --------------- t2.cpp ---------
>
> static void Bye(int* ba1) { ba1[0] *= ba1[2] + 2; }
>
> void main_b( int* inB) { void (*func)(int*) = Bye; func(inB+1); }
>
>
>
> --------- cmd sequence -------
>
> $ clang++ -c -emit-llvm t1.cpp -o t1.bc
>
> $ clang++ -c -emit-llvm t1.cpp -o t2.bc
>
> $ llvm-link t1.bc t2.bc -o t23.bc
>
> $ clang -c t23.bc
>
> $ nm t23.o
&...
2015 Apr 14
0
[LLVMdev] [cfe-dev] A problem with names that can not be demangled.
...Say we have two files with the same named static symbol Bye
--------------- t1.cpp ---------
static void Bye(int* ba1) { ba1[0] /= ba1[2] - 2; }
void main_a( int* inB) { void (*func)(int*) = Bye; func(inB); }
--------------- t2.cpp ---------
static void Bye(int* ba1) { ba1[0] *= ba1[2] + 2; }
void main_b( int* inB) { void (*func)(int*) = Bye; func(inB+1); }
--------- cmd sequence -------
$ clang++ -c -emit-llvm t1.cpp -o t1.bc
$ clang++ -c -emit-llvm t1.cpp -o t2.bc
$ llvm-link t1.bc t2.bc -o t23.bc
$ clang -c t23.bc
$ nm t23.o
t1.o and t2.o have the same named function “_ZL3ByePi”. In order to d...