Questions tagged [llvm]
LLVM is a compiler infrastructure written in C++ that is designed for compile-time, link-time, run-time, and "idle-time" optimization of programs written in arbitrary programming languages.
17 questions
1vote
3answers
259views
Get call graph / path of C with function pointer
I have a C codebase with function calls made through function pointers. I tried using LLVM AST and IR with Python to generate a function call graph, but handling the function pointer calls requires ...
0votes
1answer
533views
Implementing heap-allocated closures in LLVM
I'm writing my own F#-esque language and I'm using LLVM for code generation. I want my language to support continuation passing style and I think I've got TCO figured out but I cannot figure out how ...
0votes
1answer
316views
Clang compiler is unstable for me, backtrace msg asks me to open a GitHub issue. How often should I post my issue?
This question is about how to be a good citizen in an open source community, and do my part to effectively participate, to advance the project/not harass people. I am building a medium-sized C++ ...
-3votes
1answer
388views
What programming languages besides Apple Swift & Objective-C use the Llvm compile-time Automatic Reference Counting exclusively for memory management?
Are there other general purpose programming languages besides Objective-C +ARC and Swift which target the llvm and use static compile time Automatic Reference Counting for memory management?
3votes
4answers
2kviews
GCC or Clang to output bytecode for a VM?
Long story short, I wanted to use C as a scripting language and in a portable manner so I created a register-based, JITless VM to accomplish this. I've formalized the VM's ISA, script file format, ...
1vote
1answer
1kviews
Is it feasible to write an IR-to-assembly compiler as opposed to an LLVM backend?
I've made a virtual processor with a simple instruction set and memory model as a learning exercise (and mostly just for fun). I can write programs in its assembly language, assemble them with my ...
18votes
1answer
4kviews
Why does LLVM have an assembly-like IR rather than a tree-like IR? Or: why do projects target LLVM IR instead of clang's AST?
Why is LLVM's intermediate representation (LLVM IR) assembly-like rather than tree-like? Alternatively, why do language implementations target LLVM IR rather than clang's AST? I'm not trying to ask ...
0votes
2answers
321views
How does the LLVM compiler treat arithmetic operations in parentheses?
When it sees the parentheses, does it have the machine do the operations in the parentheses first, or does it distribute out the parentheses? Like, if I have the following line of code: int i = 2 * (...
10votes
1answer
325views
Machine code JITs and the Execution Disable bit
How is runtime-generated machine-code (such as the output of a JIT), actually executed by the CPU if the CPU/OS has an Execution Disable bit? As far as I know, many modern processors and Operating ...
4votes
1answer
2kviews
How do I add link-time optimization capabilities to my LLVM-based compiler?
I am designing and implementing a programming language, and I am using LLVM for native code generation. Among others, performance is a key feature of the language, and as such, I am looking to ...
1vote
1answer
358views
LLVM case: is the success due to the algorithms? [closed]
I'm not sure if this is a subjective question, I hope not but I'm not proficient with LLVM so I'm just wondering: how come it's become so popular and so widespread used in the industry? Were the ...
3votes
2answers
4kviews
Learning YACC nowadays, does it make sense? [closed]
I have a huge project that is using YACC and I would need to fix a bug in it. I might ask someone else who wrote that to fix it but I'm interested in how compilers work. Does it make sense to learn ...
22votes
3answers
37kviews
How to run C++ code in browser using asm.js?
An asm.js application is very fast (near native C++ speed): http://kripken.github.io/mloc_emscripten_talk/micro4b.png But how is it possible to write one in C++, convert it to LLVM code, then do ...
26votes
4answers
13kviews
GCC vs clang/LLVM -- pros and cons of each [closed]
What are the pros and cons of GCC vs clang/LLVM?
12votes
4answers
2kviews
In what way(s) is LLVM Low Level?
In what way(s) is LLVM (Low Level Virtual Machine) Low Level? (At the time of writing, I did not find this expansion of the abbreviation "LLVM" on its web site, but on Wikipedia.) Is it called "Low ...