Questions tagged [llvm-clang]

Clang is the C language family front-end for the LLVM compiler. (The C language family includes C, C++, Objective-C, and Objective-C++.)

Clang refers to the C language family front-end for the LLVM (originally known as "low level virtual machine") compiler. The C language family consists of C, C++, Objective-C, and Objective-C++.

High-level features of clang include better compile-time performance than gcc, helpful error and warning messages, and a static analyzer to automatically detect software bugs.

1101 questions
0
votes
1 answer

llvm module can not be found

I tried to follow the instructions in http://releases.llvm.org/2.6/docs/tutorial/JITTutorial1.html to have make my own function and produce llvm IR. However, executing c++ -g tut1.cpp llvm-config --cxxflags --ldflags --libs core -o tut1, I am…
user3126804
  • 119
  • 3
  • 10
0
votes
1 answer

Errors related to OpenMP and C++ while building LLVM/Clang with OpenMP

I'm trying to compile LLVM, Clang, OpenMP (from the LLVM project) and libc++ (libcxx) from source on Fedora 25. The default GCC 6.3 is being to used to build them. I issue cmake ../llvm -DCMAKE_BUILD_TYPE=Release…
Aditya Kashi
  • 266
  • 2
  • 13
0
votes
0 answers

LLVM Link IR files with debugged information

I have multiple .cpp files that I am converting into LLVM IR .ll and then trying to link them with llvm-link before the pass and I could easily link my files without debugging flag -g. However if I convert .cpp into .ll with debugging flag and then…
Nik391
  • 517
  • 2
  • 7
  • 24
0
votes
1 answer

How to get the address of a global variable in LLVM?

Let x be the address of a global variable g in a program at run-time. LLVM IR produces a store instruction as shown below: store i32 30, i32* @g, align 4 I am writing an LLVM pass which will instrument the program such that x is passed to an…
sherlock
  • 2,397
  • 3
  • 27
  • 44
0
votes
1 answer

iOS: Undefined symbols for architecture i386

I'm trying to implement ios-oauthconsumer but I'm getting this error: Undefined symbols for architecture i386: "_OBJC_CLASS_$_OAMutableURLRequest", referenced from: objc-class-ref in ViewController.o "_OBJC_CLASS_$_OAConsumer", referenced…
user2924482
  • 8,380
  • 23
  • 89
  • 173
0
votes
0 answers

C++Builder 10.2 64-Bit - How to set the packet alignment?

I'm busy with trying to compile a C++Builder 10.2 32-Bit DLL Project as a 64-Bit DLL. This DLL is a plugin for some other proprietary software. Stated in the SDK for this application is: Set the “Struct Member Alignment” for the 64‐bit version of…
FlKo
  • 805
  • 1
  • 10
  • 27
0
votes
1 answer

Is it possible to insert a "sub" label into a BasicBlock in LLVM?

Suppose I've a BasicBlock with label, e.g., entry. Now, I would like to insert a "sub" label into this BasicBlock without breaking up the block into two parts. In assembly, it would look like: entry: ... .mylabel1: ... .mylabel2: ... Is it possible…
Shuzheng
  • 11,288
  • 20
  • 88
  • 186
0
votes
1 answer

Undefined symbol for LLVM plugin

I trying to build an open source LLVM plugin (https://github.com/HewlettPackard/Atlas). But when I try to build using the llvm plugin I get an "error: unable to load plugin... undefined symbol:…
Nachshon Cohen
  • 113
  • 2
  • 10
0
votes
1 answer

Incorrect installation of llvm from source with homebrew?

I wanted to use new features of clang so I installed llvm (with the tooling) using brew install llvm. I was surprised because the installation took so little amount of time which was because brew info llvm reveals that I installed the bottled…
ELEC
  • 255
  • 3
  • 14
0
votes
1 answer

Exception during running custom clang Frontend tool on some input files

I have written a custom clang Frontend tool according to the following link. http://clang.llvm.org/docs/RAVFrontendAction.html Now I am giving clang source code itself to my frontend tool for static analysis. My tool is throwing an exception for…
Hemant
  • 767
  • 6
  • 20
0
votes
1 answer

clang with -Weverything flag not catching nonexistent elements in vector

I'm learning C++ from Stroustrup's Programming Principles and Practice Using C++, 2nd Edition book. The following code snippet: #include "include/std_lib_facilities.h" int main() { vector v = { 5, 7, 9, 4, 6, 8 }; vector
Lanti
  • 2,299
  • 2
  • 36
  • 69
0
votes
0 answers

How to define and handle custom pragma #mypragma in Clang and LLVM IR?

I want to allow compilation of my own pragma in C/Cpp files such as #pragma mypragma and I want to handle it in this way -- upon identification of this pragma, I want to insert a function call and delete some code in the original source file. My…
Shail Dave
  • 63
  • 1
  • 5
0
votes
1 answer

Compile a library with clang (from LLVM byte code)

I have a library foo in foo.c: int foo() { return 0; } I want to compile to a static objectfoo.o. When I do it directly like the following, this works. clang -c foo.c -o foo.o However, I want to go via the llvm byte code: clang -emit-llvm -c foo.c…
Razer
  • 7,843
  • 16
  • 55
  • 103
0
votes
1 answer

llvm/ExecutionEngine/JITSymbol.h not found

I compiled the llvm3.9.1 from the source. After I install it. I check the /usr/local/include file, and find the llvm/ExecutionEngine/JITSymbol.h is missing, instead JITSymbolFlags.h is there. I also download the older version llvm3.9.0 and…
user3130007
  • 663
  • 3
  • 8
  • 17
0
votes
1 answer

llvm code optimization options do not work

I am reading about LLVM Code optimization.I tried to apply opt command options on a number of examples but they do not have any effect. For example.Here is a c++ code called deadCode.cpp: #include int square(int x){ return x*x; } int…