Questions tagged [llvm-gcc]

llvm-gcc is a modified version of gcc that compiles C/ObjC programs into native objects, LLVM bitcode or LLVM assembly language, depending upon the options.

llvm-gcc is a modified version of gcc that compiles C/ObjC programs into native objects, LLVM bitcode or LLVM assembly language, depending upon the options.

218 questions
1
vote
1 answer

How to change the operand type in the instruction from 32bit to 64bit in LLVM?

I am a newbie to LLVM. And I am trying to change the type of the loop variable (PHINode). For example, I have an IR as follows: for.cond1.preheader: ; preds = %entry, %for.inc15 %k.03 = phi i32 [ 0, %entry ], [ %inc16,…
devin_123
  • 11
  • 1
1
vote
0 answers

How to pass parent thread id to LLVM function hook in Child thread?

I have a hook function like this void newThreadCreated(void *ptid) {} I want to insert this function into child thread's function. The issue is how to pass parent thread id (ptid) to this function. Any concrete solution or thoughts? Thanks in…
ruke
  • 55
  • 5
1
vote
1 answer

LLVM - How to pass arguments to a function call | error: Calling a function with a bad signature

void print(char *s) { printf("%s\n", s); } I want to insert a call to the function above in an llvm pass. Here's my llvm pass code Function *printFunc = M.getFunction("print"); if (printFunc) { IRBuilder<>…
james ku
  • 13
  • 3
1
vote
0 answers

Expected relocatable expression

I'm trying to compile a sample from Multiboot 2 specification on MacOS using LLVM but I failed at the start. I want to create an object file from boot.S with included multiboot2.h so I call gcc -m32 boot.S but it crashes with error: boot.S:57:15:…
Denis Sologub
  • 7,277
  • 11
  • 56
  • 123
1
vote
1 answer

Build throwing error "Command ... llvm-gcc-4.2 failed with exit code 1"

Here's the log from the build. This is a brand new project in Xcode 4, so the only non-regular things in it are as follows: A .c file A .a library A bunch of header files I've been playing with the build settings and searching for answers for a…
SeniorShizzle
  • 984
  • 1
  • 11
  • 27
1
vote
1 answer

Calling LLVM bitcode function in LLVM 2.8

I'm trying to read and call a function parsed from LLVM bitcode in LLVM 2.8. I have everything working apart from the actual call, which crashes the program. First I have this C code: void hello() {} I've compiled this with: llvm-gcc -c -emit-llvm…
zmthy
  • 568
  • 3
  • 13
1
vote
2 answers

How to tell the GCC compiler that code should be generated serial, i.e., without jumps

How to tell the GCC compiler that code should be generated serial, i.e., without jumps. I'm working on a project that embeds inline assembly into a C source code (or LLVM IR). My implementation depends on code between the inline assembly to be…
Shuzheng
  • 11,288
  • 20
  • 88
  • 186
1
vote
1 answer

Create functions in llvm pass with arguments and return type of type uint32_t and long double

Is there any way to create a function with return type and arguments as uint32_t and long double? For example, we can create argument of type int as follows: std::vectorFuncTy_args; FuncTy_args.push_back(IntegerType::get(M.getContext(),…
pavikirthi
  • 1,569
  • 3
  • 17
  • 26
1
vote
0 answers

convert formal argument to local variable in LLVM

I am doing a project on LLVM. I'm trying to make a pass: For a function, if the arguments(parameters) are constants, it will make a new function that the constants are converted to a local variable, and deleted from arguments. For example: void…
Tyan9072
  • 11
  • 1
1
vote
1 answer

Can I use Numba on OS X?

Numa requires llvmlite, which only works with LLVM up to version 3.7.1. But my version of LLVM, according to llvm-gcc -v is Apple LLVM version 7.3.0 (clang-703.0.29) Is this version incompatible with llvmlite? Is Apple's versioning different from…
orome
  • 45,163
  • 57
  • 202
  • 418
1
vote
1 answer

Issue with LLVM FunctionPass iterator?

I have a very basic pass that need to print how many BasicBlocks are there in a Function. #include "llvm/Pass.h" #include "llvm/IR/Function.h" #include "llvm/IR/BasicBlock.h" #include "llvm/Support/raw_ostream.h" #include "iostream" using namespace…
Awaid Shaheen
  • 95
  • 1
  • 9
1
vote
1 answer

configure: error: Building in the source directory is not supported in this release

I am trying to build the iPhone toolchain under Ubuntu 10.04 and I encountered an error: mohit@mohit-laptop:~/Documents/toolchain/iphone-dev/llvm-gcc-4.0-iphone$ ./configure --enable-llvm=`llvm-config --obj-root`…
Mohit Deshpande
  • 53,877
  • 76
  • 193
  • 251
1
vote
0 answers

‘gcroot’ attribute directive ignored

I get this warning when compiling: main.c:20:12: warning: ‘gcroot’ attribute directive ignored [-Wattributes] struct C __attribute__((gcroot)) *garbage = new_C(0); Is this attribute no longer supported?
Olle Härstedt
  • 3,799
  • 1
  • 24
  • 57
1
vote
1 answer

-bash: opt: command not found in MAC OS X Yosemite

I am trying to run a LLVM pass and have the following version of gcc: Configured with: -- prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM…
Austin
  • 135
  • 4
  • 17
1
vote
0 answers

Apple Mach-O linker exits error code 1 (possibly a failed assert)

Has anyone had any experience with this crash from the XCode 4.2 linker: Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1 No other information was generated, even with -v verbose turned on, however I noticed this showing up in the…
SMGreenfield
  • 1,680
  • 19
  • 35