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
0 answers

Can clang static analysis be challenged with various flows

I wonder if currently there is support for clang static analysis with various flows checking. For example - there is a checker to check for zero division, but can clang find a flow which a divider can evaluate to zero ? simple example: in the bellow…
yehudahs
  • 2,488
  • 8
  • 34
  • 54
0
votes
0 answers

llvm-as error converting IR to Bitcode

I tried to convert an LLVM-IR file to bitcode with llvm-as, but it returned an error: llvm-as-3.4: test.ll:70:9: error: expected type declare "__mtest__" void @__Init() The function void @__Init() is from my code, but there is no option to add an…
valiant wang
  • 75
  • 10
0
votes
1 answer

XCode use of undeclared identifier, only appears if the file is opened

When I clean, build and run my XCode project all goes well, but if I open a file that calls the function, an Use of undeclared identifier 'func()' appears. This is the whole implementation: The function is called: func(); And 'func()' is decleared…
user1447414
  • 1,306
  • 2
  • 12
  • 25
0
votes
0 answers

LLVM CFG for multiple files

I am trying to generate a CFG from 3 C source files using LLVM tools. clang -emit-llvm -c a.c b.c c.c main.c Thereafter I use llvm-link to link the bytecode together. llvm-link -o out a.bc b.bc c.bc main.bc However by doing this I get an …
nkigen
  • 410
  • 1
  • 6
  • 15
0
votes
1 answer

How to use clang post compilation from source?

I have downloaded LLVM 3.6 + CFE + Compiler-RT. Post compilation, below are the list of executables generated: llvm-3.6.0/build/bin -rwxrwxr-x 1 dipanjan dipanjan 51113672 Aug 4 15:25 arcmt-test -rwxrwxr-x 1 dipanjan dipanjan 36545319 Aug 4 14:25…
sherlock
  • 2,397
  • 3
  • 27
  • 44
0
votes
2 answers

error: object of type 'llvm::SourceMgr::SrcBuffer' cannot be assigned because its copy assignment operator is implicitly deleted

I faced this error when I was compiling with clang. It will be appreciate if any body can help. Working on 32 bit windows 7 platform and using Codelite to compile the error happend in section below: typename iterator_traits<_BI1>::difference_type…
0
votes
2 answers

Terminator found in the middle of a basic block

All went fine until my project won't compile.I see those things on two of my files. Terminator found in the middle of a basic block! label %50 LLVM ERROR: Broken function found, compilation aborted! Terminator found in the middle of a basic…
Stefan Scoarta
  • 781
  • 9
  • 21
0
votes
1 answer

Run All LLVM Passes

I've got a LLVM Module and I was wondering if there was an easy way to run all LLVM optimizations passes using the C++ API for -O3 (without having to register each pass individually).
agg212
  • 407
  • 1
  • 4
  • 17
0
votes
1 answer

Check if SIMD machine is generated for LLVM IR

I have a C++ program that uses the LLVM libraries to generate an LLVM IR module and it compiles and executes it. The code uses vector types and I want to check if it translates to SIMD instructions correctly on my architecture. How do I find this…
user855
  • 19,048
  • 38
  • 98
  • 162
0
votes
1 answer

Has anyone compiled FreeBSD with LTO-capable linker?

Has anyone enabled the libLTO when compiling the FreeBSD kernel(in order to compute a whole-program call graph). I want to compile the FreeBSD kernel using the libTO tool from the llvm/clang compiler suite. If anyone has previously done this work…
0
votes
1 answer

LLVM passes 0 as argument to external function call

Ok, maybe somebody can help me. I am writing a small LLVM IR testprogram: ; ModuleID = 'main' target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-cygwin" define i32 @my_main() { entry: %0 = alloca i64 store…
Rick
  • 680
  • 1
  • 7
  • 20
0
votes
1 answer

LLVM tutorial 3.6 linker error when trying to compile output from chapter 8

I am working through the llvm tutorial: http://llvm.org/releases/3.6.0/docs/tutorial/index.html The code from chapter 8 compiles just fine and emits the IR however I am unable to compile the emitted IR. The code listing is copy and pasted to reduce…
Shawn
  • 402
  • 4
  • 17
0
votes
1 answer

building llvm/clang 3.6 on windows 7 with mingw64

I pulled the latest svn repositories and did manage to build the same code with Visual Studio. But I'm trying to use the YouCompleteMe plugin for vim, which needs clang built with mingw64. The Visual Studio build did not work. Here is the error. …
Timothy Wright
  • 351
  • 2
  • 11
0
votes
1 answer

Compiling CppUTest and typecast errors

I have never used any unit test framework with C++. Now I took CppUTest version 3.6. I am trying to compile library according to README_InstallCppUTest.txt file: ./configure => OK make => Not OK src/CppUTest/JUnitTestOutput.cpp:170:29: error: use of…
Pasi
  • 181
  • 2
  • 7
0
votes
1 answer

Make fails to build simple Hello Pass in LLVM

I have installed LLVM and Clang on Ubutnu 14.04 machine following this tutorial. I can successfully compile and run the example given at the tutorial. Now when I try to build the simple Hello Pass given here, where it says to just run gmake in the…
user1343318
  • 2,093
  • 6
  • 32
  • 59