llvm

How to use LLVM's libcxx & libcxxabi in cmake project?

别等时光非礼了梦想. 提交于 2019-12-11 17:54:29
问题 Currently I'm running Debian stretch with the system's default compiler GCC 6.3.0. But I have a project using cmake (ceph's master branch) that depends on C++17, which requires non default includes and libraries. So I decided to use Clang/LLVM to build it. I downloaded and installed Clang/LLVM, compiled it and installed it below /usr/local . Now my question is, how to instruct cmake to use the includes from /usr/local/include/c++/v1/ and the libraries from /usr/local/lib ? 来源: https:/

Text corruption in LLVM 7.0.1 installer

拜拜、爱过 提交于 2019-12-11 17:42:11
问题 I have tried install llvm 7.0.1 on Windows 10. But the installer has text corruption like below. It make so harder to install. How do I fix it? I using Windows 10 1809, chcp is 65001. I using Japanese. I have enabled "Use Unicode UTF-8 for worldwide language support" in Region settings". Is this change cause of the error? But A installer of other application does not be text curruption. Update: The Picture of installer with compatibility mode (Windows XP SP3) 回答1: That LLVM installer is not a

Redundant basic blocks in llvm IR

∥☆過路亽.° 提交于 2019-12-11 17:15:26
问题 I was just playing around with a program and watching its IR in llvm and I noticed certain basic blocks that don't make sense to me. My code: void proc() { int i, j, k, m, n, l; k = 119; for (i = 20; i < 200; i++) { for (j = 13; j < 130; j++) { l = 80; } } } Corresponding IR: store i32 119, i32* %3, align 4 store i32 20, i32* %1, align 4 br label %7 ; <label>:7: ; preds = %19, %0 %8 = load i32, i32* %1, align 4 %9 = icmp slt i32 %8, 200 br i1 %9, label %10, label %22 ; <label>:10: ; preds =

fatal error: error in backend: Cannot select: 0x7793fa0: f64 = xor 0x74291b0, Constant:i8<-3>

时光怂恿深爱的人放手 提交于 2019-12-11 17:10:09
问题 This is the error message when I use the following command: clang++ test.cpp -mypass -fno-use-cxa-atexit to compile my test.cpp source file directly with my transform pass. Error message: fatal error: error in backend: Cannot select: 0x7793fa0: f64 = xor 0x74291b0, Constant:i8<-3> 0x74291b0: f64,ch = load<LD8[%1064](align=1)> 0x732b440, 0x74317d0, undef:i64 0x74317d0: i64 = add 0x7794390, 0x7428f10 0x7794390: i64 = shl 0x7464360, Constant:i8<3> 0x7464360: i64 = sign_extend 0x7430d50 0x7430d50

How to get variable definition line number etc. using dbg metadata?

纵然是瞬间 提交于 2019-12-11 14:36:48
问题 As far as I know, when I need to get the line number of a local variable I had to look for the invocation of the llvm.dbg.declare intrinsics and get the dbg metadata(since AllocaInst itself does not contain any dbg info). However there seems no guarantee that this CallInst is the next instruction of the the AllocaInst , and I have to traverse the instruction in a specified function, which is inefficient. So I'm wondering whether there is a method for AllocaInst to get the llvm.dbg.declare

Duplicate protocol definition warning

孤人 提交于 2019-12-11 14:32:29
问题 First, I have seen this question as well as this, but my problem is not addressed there. I have a protocol ProtocolA defined in its own header file. Then I have two classes ClassA and ClassB which both conform to this protocol so the protocol-header is imported in their header files. Now it gets a bit complicated. ClassA is used (and thus imported) in a third ClassC . This class conforms to a second protocol ProtocolB . This protocol also has its own header file where it uses and imports

How get IR value from llvm.dbg.declare

谁说我不能喝 提交于 2019-12-11 13:55:31
问题 Given a llvm.dbg.declare , how can I get its llvm value? e.g. call void @llvm.dbg.declare(metadata !{i32** %r}, metadata !23), !dbg !24 I want get the Value i32** %r , not the metadata !{i32** %r} . Please give me the code! Thanks! 回答1: metadata !{i32** %r} is the 1st operand of the call instruction, and i32** %r is the 1st operand of the metadata. So something like this should work: CallInst I = ... // get the @llvm.dbg.declare call Value* referredValue = cast<MDNode>(I->getOperand(0))-

Include Z3 in a C++ project

◇◆丶佛笑我妖孽 提交于 2019-12-11 13:52:28
问题 I want to use Z3 in a llvm project(file directory copied from its sample project). What I did now is just simply include z3++.h without adding any other code in the source file and want to pass the compilation. But I don't know how to deal with modifying makefile to make it work. I tried a few times it reports error like "exception handling disabled, use -fexceptions to enable" and other linking errors. Can someone give me a hint on how to change the makefile to make it work? 回答1: It's not

homebrew llvm build cannot find iOS simulator library containing _wordexp symbol

試著忘記壹切 提交于 2019-12-11 12:48:26
问题 I'm working on touching up homebrew's (OS X package manager) llvm formula. Unfortunately, something about the parts I added broke the build in a way I just cannot figure out. tl;dr ld asks for a library containing a _wordexp symbol for iOS simulator, and I have absolutely no clue where it is, if it exists Compilation consistently fails for me when the compiler is attempting to link the address sanitizer dylib for iOS Simulator. Reproduction steps (OS X only as far as I know, don't have *nix

Clang not generating debug info on -g flag

只谈情不闲聊 提交于 2019-12-11 12:43:09
问题 When using clang v8.0.0 on Windows (from llvm prebuilt binaries) with -g or -gline-tables-only source map tables are not being aren't picked up by gdb or lldb debuggers. Upon including -g flag file grows in size (which is to be expected) yet neither gdb nor lldb pickes the source up When compiled with gcc though (with -g flag) source files are detected by debugger. I have tried running the same command ( clang -g <codefile> ) on macOS High Sierra ( clang -v says it is Apple LLVM version 10.0