6,565 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-2
votes
0
answers
52
views
How to Implement Object-Oriented Programming (OOP) in LLVM? [closed]
I have finished reading "Crafting Interpreters" and the introductory tutorials on LLVM IR. However, when I tried to implement a compiler for an object-oriented language myself, I found that ...
Advice
0
votes
1
replies
43
views
Is there a char* type in the LLVM C++ API
I wanna make a function starting with a function prototype as usual in the LLVM C++ API and I want one of the accepted arguments of the function to be a char*. Can someone guide me on how I can do ...
3
votes
1
answer
213
views
How to figure out why Rust failed to vectorize and fix it?
How do I know if rustc or LLVM is doing the vectorizing?
How can I fix this specific example?
Here's a simplified piece of extremely performance-sensitive decompression code I would like to use:
pub ...
0
votes
0
answers
36
views
Getting "error: No instructions defined!" while building an LLVM backend based on GlobalISel
I am writing an LLVM backend from scratch for a RISC style target architecture, so far I have mostly been able to understand the high level flow of how LLVM IR is converted to MIR, MC and finally to ...
0
votes
1
answer
37
views
Custom LLVM backend: error: unable to interface with target machine
Background
I am writing a custom, globalISel only, backend for a currently unsupported processor. I have progressed to the point where I can run
> clang -target xxx -emit-llvm file.c
> llc -...
0
votes
1
answer
93
views
How does `mlir::cast` transform objects to derived classes?
The LLVM Programmers Manual gives some brief idea of how llvm::cast works:
cast<>:
The cast<> operator is a "checked cast" operation. It converts a pointer or reference from a base class ...
9
votes
1
answer
519
views
Link a symbol in C++ to a metadata-defined address
Background
I am working on a C++ project that is injected (via our own loader program that creates the process and loads the code and patches from a DLL the project is compiled to) into a closed-...
0
votes
0
answers
53
views
How to get xPack LLVM clang working with Eclipse on Windows10?
On Wondows10 I have installed:
xPack tools including
@xpack-dev-tools/arm-none-eabi-gcc
@xpack-dev-tools/clang
@xpack-dev-tools/cmake
@xpack-dev-tools/openocd
@xpack-dev-tools/qemu-arm
@xpack-dev-...
0
votes
0
answers
31
views
Perf probe fails because of missing symbol, although its listed under functions (clang)
I'm trying to instrument clang with perf to mesure how much a certain llvm pass runs for (since -ftime-report seems to give inconsistent metrics and can't be used on multi file compilations). I have ...
6
votes
0
answers
280
views
AddressSanitizer callstack not printing symbols with GCC
I'm using AddressSanitizer with GCC on Rocky 8 Linux and not seeing symbols in the callstack when it detects an error.
GCC is version 8.5
llvm-symbolizer reports LLVM version 19.1.7
In my environment, ...
1
vote
0
answers
18
views
clang produces malformed object files when cross-compiling
I'm seeing a problem when using clang to cross-compile for ppc64. Here's an example.
Given a simple c file:
// test.c
int foobar(int v) {
return v+1;
}
Build it like this:
$ clang --target=ppc64 -...
0
votes
1
answer
49
views
Error while writing my own Load Instruction counter pass
I am trying to write a llvm pass that counts the number of load instructions.
LoadCounter.cpp
#include "llvm/Transforms/Utils/LoadCounter.h"
#include "llvm/IR/InstIterator.h"
using ...
2
votes
2
answers
152
views
LLVM's Libunwind Registers_mips_o32.jumpto returns to the wrong place
In my project, I have written my own implementation of the higher levels of the Itanium abi (__cxa_throw, etc). However, when it came to stack unwinding, I decided that this would be too much for me ...
0
votes
1
answer
91
views
Is it ok to use GNU tools on LLVM binaries?
In the process of my work, I need to build Linux versions of our codebase & release. The toolchain is LLVM/clang. I also have GNU tools installed on my system. I sometimes need to strip symbols ...
Brie's user avatar
- 2,396
-1
votes
1
answer
132
views
LLVM generates stack usage on simple RISC-V function where GCC doesn't
I have a simple function:
extern "C" Variant test_bool(bool arg) {
return arg;
}
Built with mostly standard settings (I removed part of the paths):
zig c++ -target riscv64-linux-musl -I/...