llvm Questions

1

Solved

I wrote the following short Assembly LLVM code (I know it's not efficent only for testing purposes): define void @main() { label_41: %t22 = add i32 0, 0 label_43: %t23 = add i32 0, 0 } When I try ...
Poultryman asked 4/7, 2023 at 13:42

3

Solved

http://klee.llvm.org/ is a program analysis tool that works by symbolic execution and constraint solving, finding possible inputs that will cause a program to crash, and outputting these as test ca...
Zuniga asked 21/4, 2011 at 10:11

3

I'm using some LLVM tools (like llvm-nm) as static libraries. I.e. i copied source llvm-nm.cpp, renamed main(..) to llvm_nm(..) and compiled it as static library. I'd like to forward standard outpu...
Highjack asked 11/10, 2014 at 17:14

2

Solved

How to determine all global variables of a LLVM module? I want to modify them using a module pass.
File asked 6/3, 2017 at 8:46

2

Solved

I am doing my dissertation and I have to parse and tokenize the source code into individual functions. For every function I would like to extract names of types, called function names and type cast...
Omnipotent asked 5/6, 2016 at 16:10

0

I would like to understand how LLVM decides what size memory regions allocated with alloca should have. As can be seen in this example, when generating code for x86-64 it appears to always select a...
Wingspan asked 19/5, 2023 at 19:24

1

Solved

For context, suppose that I'm writing a bytecode interpreter, where the instructions follow one of two formats: +---+--------+------+------+----------------+ | 1 | opcode | treg | areg | unused | +...
Asare asked 18/5, 2023 at 10:36

4

Solved

Im writing an compiler in Python, using llvmlite to generate intermediate LLVM IR. Lexer and parser are finished, now im doing code generation. The compiler will be dynamic and weakly typed, so i w...
Fuddyduddy asked 16/4, 2016 at 0:13

4

Solved

In the following header file I'd like to get the corresponding +reflect comment to the class and member variable: #ifndef __HEADER_FOO #define __HEADER_FOO //+reflect class Foo { public: privat...
Eley asked 29/9, 2013 at 14:16

3

I wrote a few own passes for llvm, in order to use them with clang. I integrated them in llvm (not dynamically loaded). They are even listed in the Optimizations available: section when I type: o...
Homoeroticism asked 17/4, 2014 at 10:34

3

Solved

I'm trying to write a simple "modern" LLVM pass and use it with Clang. I want it to be able to be run with a command like: clang -Xclang -load -Xclang libMyPass.so file.cpp There are a lot of manu...
Hazelhazelnut asked 30/1, 2019 at 19:17

4

(Ubuntu 16.04.1) By default on 16.04.1 clang is picking the gcc tool chain for 5.4. Unfortunately I have a library that requires pre-5.0 ABI and I do NOT have access to the source, nor has the imp...
Cashmere asked 30/8, 2016 at 3:31

4

Solved

I've just built LLVM/Clang compiler-rt and tried the -fsanitize option. But strangely the link failed since it cannot find libclang_rt.san-x86_64.a. /usr/bin/ld: cannot find /home/hongxu/RESEARCH/...
Moralist asked 1/4, 2015 at 13:55

1

Solved

thread_local int* tls = nullptr; // using libcontext to jump stack. void jump_stack(); void* test() { // before jump_stack, assume we are at thread 1. int *cur_tls = tls; jump_stack(); // after...
Hiss asked 28/2, 2023 at 12:24

1

Solved

The C++20 standard states in [vector.overview]/4: An incomplete type T may be used when instantiating vector if the allocator meets the allocator completeness requirements. T shall be complete bef...
Amulet asked 27/1, 2023 at 11:28

2

I am trying to understand the LLVM IR generated from a C++ program int add(int *x); int func() { int T; T=25; return add(&T); } The generated IR is: define i32 @_Z4funcv() local_unnamed...
Hamm asked 28/8, 2018 at 19:8

3

Solved

Is it possible to pass structure by parameter ? Is it compatible with the C abi ? [edit] Basically, I would like to have a C++ POD which would contain two members (the structure would be a fat p...
Mady asked 6/10, 2012 at 1:20

1

Solved

I'm generating LLVM IR for JIT purposes, and I notice that LLVM's calling conventions don't seem to match the C calling conventions when aggregate values are involved. For instance, when I declare ...
Repine asked 11/9, 2016 at 16:4

14

Solved

Currently I am interested in ARM in general and specifically iPhone/Android targets. But I just want to know more about clang, since it feels to play important role in the years to come. I tried cl...
Macilroy asked 23/2, 2013 at 3:58

3

Solved

I started studying cmake about 2 weeks ago and like it. Thus far, I have been successful in building and packaging (with the native system packaging format) libc++abi, libc++, llvm 3.4 all with cma...
Shirr asked 14/3, 2014 at 18:7

3

Solved

I want to get my Python script working on a bare metal device like microcontroller WITHOUT the need for an interpreter. I know there are already JIT compilers for Python like PyPy, and interpreters...
Swayne asked 11/8, 2020 at 15:37

1

Solved

This function: pub fn g(n: u64) -> u32 { n.trailing_zeros() } generates assembly with a branch: playground::g: testq %rdi, %rdi je .LBB0_1 bsfq %rdi, %rax retq .LBB0_1: movl $64, %eax r...
Characharabanc asked 29/11, 2022 at 20:37

1

I have a pretty simple CMake-based project that builds one lib and a small executable that uses it. It builds fine on Linux with GCC, but fails on Mac OS with loads of errors of the following kind....
Brie asked 11/8, 2022 at 23:59

2

Solved

I admit the answer to this may be 'some very specific magic', but I'm kind of shocked by what I've observed here. I was wondering if anyone had insight to how these types of optimizations work. I f...
Sanasanabria asked 13/11, 2022 at 0:39

2

Solved

I built llvm-6.0.0 from source and everything works fine. I'm just wondering how come its size is so huge (42G). Can I easily erase some object files or other to make the build directory smaller? ...
Quicklime asked 7/5, 2019 at 6:34

© 2022 - 2025 — McMap. All rights reserved.