llvm

LLVM how to get callsite file name and line number

我只是一个虾纸丫 提交于 2019-12-22 18:43:00
问题 I am very very new to LLVM, and it's my first time to write C++ I need to find several function info related to LLVM CallSite, however, I have checked the source code here: LLVM CallSite Source Code Still don't know where to get call site file name (eg. CallSite is in example.c file), call site line number (eg. at line 18 in the whole program) Do you know how can I get call site file name and line number? 回答1: You can get this information by retrieving debug information from the called

How can I get the list of function calls that are performed in each function of a program, from the intermediate representation of LLVM?

霸气de小男生 提交于 2019-12-22 18:29:57
问题 I am trying to build a simple version of a code analysis tool with LLVM. I have a few .ll files which contain the intermediate LLVM representation of certain programs. How can I get the list of function calls that are performed in each function of a program, from the intermediate representation of LLVM? The input parameter I have is an instance of the LLVM: Module class which represents the program. Then, I get the list of functions present in the program with the function getFunctionList ().

How can I get the list of function calls that are performed in each function of a program, from the intermediate representation of LLVM?

时间秒杀一切 提交于 2019-12-22 18:29:32
问题 I am trying to build a simple version of a code analysis tool with LLVM. I have a few .ll files which contain the intermediate LLVM representation of certain programs. How can I get the list of function calls that are performed in each function of a program, from the intermediate representation of LLVM? The input parameter I have is an instance of the LLVM: Module class which represents the program. Then, I get the list of functions present in the program with the function getFunctionList ().

How to tell clang that my LLVM Target should use 16-bit 'int'?

天涯浪子 提交于 2019-12-22 17:59:55
问题 For my PIC Backend, I want 'int' to be 16 bits. How can I / my target tell clang what should be the size of 'int'? Defining 16-bit registers only seems not sufficient. Currently "clang -O2 -emit-llvm -target pic" converts int foo(int a, int b) { return a + b; } to this IR code, using 32-bit integers: ; ModuleID = '../test/sum.c' source_filename = "../test/sum.c" target datalayout = "e-m:e-p:16:16-i16:16-a:0:16-n16-S16" target triple = "pic" ; Function Attrs: norecurse nounwind readnone define

List of valid ASCII characters for Objective-C literals and identifiers?

一曲冷凌霜 提交于 2019-12-22 17:38:28
问题 These variable names below are ALL VALID in xCode (compiler builds them without a second thought). NSString * ª_name = @"something"; NSString * ø_name = @"something"; NSString * ƒ_name = @"something"; NSString * Ç_name = @"something"; NSString * ç_name = @"something"; NSString * º_name = @"something"; NSString * ı_name = @"something"; NSString * ·name = @"SHIFT+OPTION+9"; // Personal favourite NSString * π_name = @"something"; NSString * æ_name = @"something"; Is there a list somewhere I can

List of valid ASCII characters for Objective-C literals and identifiers?

ぐ巨炮叔叔 提交于 2019-12-22 17:38:05
问题 These variable names below are ALL VALID in xCode (compiler builds them without a second thought). NSString * ª_name = @"something"; NSString * ø_name = @"something"; NSString * ƒ_name = @"something"; NSString * Ç_name = @"something"; NSString * ç_name = @"something"; NSString * º_name = @"something"; NSString * ı_name = @"something"; NSString * ·name = @"SHIFT+OPTION+9"; // Personal favourite NSString * π_name = @"something"; NSString * æ_name = @"something"; Is there a list somewhere I can

Proper way of compiling OpenCL applications and using available compiler options

早过忘川 提交于 2019-12-22 12:30:45
问题 I am a newbie in OpenCL stuffs. Whats is the best way to compiler an OpenCL project ? Using a supported compiler ( GCC or Clang ): When we use a compiler like gcc or clang , how do we control these options? Are they have to be set inside the source code, or, likewise the normal compilation flow we can pass them on the command line. Looking at the Khornos-Manual-1.2, there are a few options provided for cl_int clBuildProgram for optimizations. : gcc|clang -O3 -I<INCLUDES> OpenCL_app.c

Proper way of compiling OpenCL applications and using available compiler options

一曲冷凌霜 提交于 2019-12-22 12:30:37
问题 I am a newbie in OpenCL stuffs. Whats is the best way to compiler an OpenCL project ? Using a supported compiler ( GCC or Clang ): When we use a compiler like gcc or clang , how do we control these options? Are they have to be set inside the source code, or, likewise the normal compilation flow we can pass them on the command line. Looking at the Khornos-Manual-1.2, there are a few options provided for cl_int clBuildProgram for optimizations. : gcc|clang -O3 -I<INCLUDES> OpenCL_app.c

LLVM Error : External function could not be resolved

混江龙づ霸主 提交于 2019-12-22 11:20:44
问题 I am reading the LLVM's Kaleidoscope tutorial (http://llvm.org/docs/tutorial/index.html). I wanted to compile and test the language. After some compiler's errors (EngineBuilder and Module's constructor, linking libs...), the example program was built. Then, I tried the language. I got a few problems with InitializeNativeTargets, DataLayoutPass... But I managed to correct them. Howewer, I don't manage to resolve one error. When I write extern printd(x); printd(5); , the program doesn't work :

No rule to make target `/Makefile', needed by `Makefile'

☆樱花仙子☆ 提交于 2019-12-22 08:46:10
问题 I'm trying to 'make' using a pretty simple makefile. My makefile is named 'Makefile' so I'm simply using the command 'make'. I get this strange error: make: *** No rule to make target `/Makefile', needed by `Makefile'. Stop. If, however, I use make -f "full-path-to-makefile" it actually does run (with odd consequences...). I should say that I'm running all this from the directory where the Makefile lies, of course. I'm working on Mac OSX, using tcsh. Edit: I'm working in the LLVM framework,