Displaying 1 result from an estimated 1 matches for "tegoth".
Did you mean:
goth
2016 May 26
0
c++ programs type name changed in llvm ir after linking
...)
{
A *p = new A;
p->f();
return 0;
}
b.cpp
#include <iostream>
using namespace std;
class X {
public:
virtual int g();
};
int X::g()
{
cout << "X:\tg\n";
return 0;
}
I use the following commands to compile these two files separately and then
link them tegother:
clang++ -c -emit-llvm -o b.bc b.cpp
clang++ -c -emit-llvm -o main.bc main.cpp
llvm-link -o whole.bc b.bc main.bc
opt -mem2reg -o whole.mem2reg.bc whole.bc
llvm-dis -o whole.mem2reg.ll whole.mem2reg.bc
In the file whole.mem2reg.ll, type "class.A" has been replaced by "class.X"...