Category "llvm"

clang DeclContext::getParent() not returning parent RecordDecl for nested structs

I'm using the following code get parent struct of a nested struct using clang libtooling. bool VisitRecordDecl(clang::RecordDecl *RD) { llvm::outs() <<

Building rust with LLVM Fork

Following the instructions here, I have tried building rust with a fork of LLVM which has a back-end for a new target. I have: Recursively cloned the Rust repos

Link nasm with ld.lld linker

I have main.s file. extern printf extern exit section .data fmt: db "hi!", 0xa section .text global _start _start: mov rax, 0 mov rdi, fmt call printf

How to use F.getValueSymbolTable()

I wanna get all the local variables in a function. void getLocalVariables(Function &F) { ValueSymbolTable *vst = F.getValueSymbolTable(); for (auto vs :

【SOLVED】LLVM DILocation: extract information from metadata

I wanna get value and 861 from a return instruction, for example ret i32 %3, !dbg !861 and it's metadata !861 = !DILocation(line: 8, column: 5, scope: !857). Bu

relocation R_X86_64_32 against symbol `G8' can not be used when making a PIE object; recompile with -fPIE

I'm trying to compile lambda-expressions from scheme to llvm-ir and am having trouble with position independet code. source: (lambda (x) (display x)) targe

ld: Invalid value (Producer: 'LLVM13.0.0-rust-1.57.0-nightly' Reader: 'LLVM APPLE_1_1300.0.29.3_0') for architecture arm64

Trying to install and work with zkgroup. Build, run for specific iOS device working fine. But generic archiving is not working. Error text: ld: Invalid value (P

How to deal with undefined symbols when loading Mono libraries in Linux

I'm porting my Windows Mono application to Linux, one step at a time, first to WSL Linux under Windows 10, then hopefully to Real Ubuntu. Everything described

Does the C++ standard allow for an uninitialized bool to crash a program?

I know that an "undefined behaviour" in C++ can pretty much allow the compiler to do anything it wants. However, I had a crash that surprised me, as I assumed t

How can I write an LLVM pass to detect redundant conditions in C / C + +

I want to write an LLVM pass to detect redundant condition pattern like this in c++. int a = ... , b = ..., c = ... //first if condition if(a == b + 1 - c){

macos llvm-symbolizer not found

I am trying to use address sanitization when calling my program with clang, however it doesn't seem to be installed. If I type which llvm-symbolizer I get llvm-

Building LLVM eats up all the RAM

I have been trying to install LLVM on my system [i7 + 16GB RAM]. I have been following this tutorial : LLVM Install. But in building, it eats up all the RAM and

How to convert a Control Flow Graph back into its source code? e.g., C/C++

I have already generated the corresponding CFG of my source code. Then, I want to modify the CFG (merge some nodes). In then end, I need to convert the modified

Linking EFI application with LLVM on MacOS

I'm attempting to cross-compile and link a very simple EFI application that is using the EFI headers from the Zircon kernel. Despite my best efforts, I am unabl

Switching between GCC and Clang/LLVM using CMake

I have a number of projects built using CMake and I'd like to be able to easily switch between using GCC or Clang/LLVM to compile them. I believe (please correc

Bazel 0.29.1 LLVM-7.0 on Centos 7

So I have a docker with CentOS 7 which has installed bazel. I've installed devtoolset-8, llvm-toolset-7.0 and centos-release-scl. I've also installed bazel 0.29

Unable to link libclang with cmake on VS2017

A while ago I wrote a code generation program to use in my 3D game engine. I added a target to my cmake files, linked libclang with it as I'm using that for par

Confused about LLVM Arrays

I'm kind of confused on what are the steps to create, store and get values from LLVM arrays, so far I'm creating it with: auto type = llvm::ArrayType::get(<