llvm

LLVM instrumentation

a 夏天 提交于 2019-12-13 08:48:30
问题 Recently, I am doing some research with LLVM . At first, I want to write a pass to instrument .bc file. Thus, it will record the execution path of the basic block of my .bc file. Then, I want to term this .bc file into .exe file. Please give me your suggestions and if you have some examples for instrumentation of LLVM, please show me. 回答1: LLVM already comes with a number of instrumentation tools built-in. Take a look in the lib/Transforms/Instrumentation directory in the source tree. One of

LLVM front end register class error OpenCL — GPU target

╄→гoц情女王★ 提交于 2019-12-13 06:56:25
问题 I've recently been encountering this error when compiling OpenCL kernel files with my LLVM_IR pass: aoc: ../../../TargetRegisterInfo.cpp:89: const llvm::TargetRegisterClass* llvm::TargetRegisterInfo::getMinimalPhysRegClass(unsigned int, llvm::EVT) const: Assertion `BestRC && "Couldn't find the register class"' failed. I'm not sure what this means. What I've read from the documention doesn't make a lot of sense. Basically it means the backend doesn't know what type to place into the register?

Does liblldb-core.a really need to be 763MB in size?

荒凉一梦 提交于 2019-12-13 06:03:39
问题 This definitely takes the cake in terms of being the largest single piece of executable code I have ever seen. Now it was a bit easier to get this whole thing built on my Mac here (I have been trying to build LLDB on a Linux as well, and currently I'm fighting with linking to Python there), for which I am thankful, but this astoundingly large executable file has me second-guessing myself... Did I do something wrong? What is inside of this monstrous archive? I did run this: % otool -TV liblldb

LLVM CommandLine: how to reset arguments?

删除回忆录丶 提交于 2019-12-13 04:41:55
问题 I have two static libs that use LLVM command line to parse arguments: // lib1 void main(int argc, const char **argv) { cl::opt<bool>LibOption1( ... ) // arg1 cl::ParseCommandLineOptions(argc, argv, "lib1\n"); } . // lib2 void main(int argc, const char **argv) { // need to reset arguments list here .. cl::opt<bool>LibOption2( ... ) // arg2 cl::ParseCommandLineOptions(argc, argv, "lib2\n"); // crash here! } The app is linked against two this libs and they parse arguments just fine if having

LLVM what does i32 (…)** mean in type define?

情到浓时终转凉″ 提交于 2019-12-13 04:21:24
问题 I create a class called student: class Student{ public: int getNumber() const { return number; } virtual void setNumber(int number) { Student::number = number; } private: int number; }; and converted it to IR, but there's one part confused me a lot: %class.Student = type <{ i32 (...)**, i32, [4 x i8] }> I believe the i32 (...)** part is for v-table, the i32 part is for int number and the [4 x i8] part is for alignment. But I searched the language references and could not find what i32 (...)**

How to do type checking with the LLVM C++ API?

夙愿已清 提交于 2019-12-13 04:18:13
问题 I've just started learning the LLVM C++ API, and I'm a bit confused about how to do type checking. There's an example my instructor has provided to me about storing a variable in stack memory as follows: llvm::AllocaInst *Alloca; Alloca = llvm::Builder.CreateAlloca(llvm::IntegerType::get(getGlobalContext(), 32), nullptr, "variable_name"); I understand this, but in the next part it talks about type checking before assigning a value to a variable. To assign a value in a Decaf statement of the

llvm: value of pointer operation

不打扰是莪最后的温柔 提交于 2019-12-13 03:57:39
问题 I try to learm llvm assembly language. Since I did not find any tutorial for it, my way to learn is writing simple C functions, and let clang reveal the corresponding llvm code with: clang -S -emit-llvm simple.c I am now trying to learn how to use pointers. So I tested the following C function: int getVal(int* ptr) { return *ptr; } which generated the following llvm: define i32 @getVal(i32*) #0 { %2 = alloca i32*, align 8 store i32* %0, i32** %2, align 8 %3 = load i32*, i32** %2, align 8 %4 =

llvm Linking CXX shared library ../../lib/libLTO.so undefiened refernece to target

可紊 提交于 2019-12-13 03:46:15
问题 i tried to install tiramisu compiler and once trying install it's sub-modules ( (ISL, LLVM and Halide) by using this command dina@dina-VBox:~/tiramisu$ ./utils/scripts/install_submodules.sh ./ i get the error Done installing isl #### Installing LLVM #### cd .//3rdParty/llvm .//utils/scripts/functions.sh: line 6: cd: .//3rdParty/llvm: No such file or directory and to fix it i used the command shared on the answer here ./utils/scripts/install_submodules.sh $PWD it worked better then the first

upgrading Xcode 4.0.1 to 4.1 giving compilation error for iPhone sdk

做~自己de王妃 提交于 2019-12-13 03:12:30
问题 I have new changed the Snow leopard with Lion OS x and Xcode 4.0.1 with 4.1. The iPhone code was working fine on Xcode 4.0.1. Now in Xcode 4.1 it giving errors mostly related to LLVM GCC 4.2. I have tried with changing the compiler's different options available. Can body know the issue and help me out of this. 回答1: I think you want to change the compiler version on the target and double click it then you have to change it from there.Try it,i may solve your problem. http://useyourloaf.com/blog

Completely static linking with clang

与世无争的帅哥 提交于 2019-12-13 02:59:42
问题 How can I generate completely static binaries with clang? I have used the following command: clang -flto <source files> -o <executable output> -fuse-ld=lld -static-libgcc -lc -Bstatic -m32 And yet, the generated output depends on a certain .so file: $ ldd <executable output file> linux-gate.so.1 => (0xf77dd000) libc.so.6 => /lib/libc.so.6 (0xf75f0000) /lib/ld-linux.so.2 (0x5663b000) The following answer tries to answer the question but doesn't directly address the problem. Is it even possible