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
11
votes
1 answer

Specify CUDA compiler in CMake

I am trying to build a cuda project using clang-3.9 based on the following documentation. But I want to use cmake to build my project. I have already set CMAKE_CC_COMPILER and CMAKE_CXX_COMPILER to clang and clang++ respectively. But the problem is…
Johns Paul
  • 633
  • 6
  • 22
11
votes
1 answer

Why empty functions aren't removed as dead code in LLVM IR?

Starting with this simple C program: void nothing(void) {} int main() { int i; for (i = 0; i < 10; ++i) { nothing(); } return 0; } My passes output as follows: Note: IR statements are in Green. ; Function Attrs: nounwind readnone ssp…
Ahmed Ghoneim
  • 6,834
  • 9
  • 49
  • 79
11
votes
4 answers

What is the LLVM version bundled with Xcode?

Up to Xcode 6 when typing clang --version we got the information on what LLVM version it was built: Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) But now with Xcode 7 we only get the following: Apple LLVM version 7.0.0…
Kevin MOLCARD
  • 2,168
  • 3
  • 22
  • 35
11
votes
1 answer

Clang -Wweak-vtables and pure abstract class

With regard to previous questions on this topic: This a follow up of the question that I've asked recently: clang: no out-of-line virtual method definitions (pure abstract C++ class) and which was marked as duplicate of this question: What is the…
banach-space
  • 1,781
  • 1
  • 12
  • 27
11
votes
2 answers

po object results in error: cannot find interface declaration for '$__lldb_objc_class'

I'm having this weird functionality in the debug console. say you have the following code: anIssue.issueID=[issueDictionary objectForKey:@"uniqueId"]; the po of the issueDictionary function correctly: { Title = "december 2012"; …
LolaRun
  • 5,526
  • 6
  • 33
  • 45
11
votes
1 answer

How to tell clang not to save registers to stack?

The Goal I'm currently trying out avr-llvm (a llvm that supports AVR as a target). My main goal is to use it's hopefully better optimizer (compared to the one of gcc) to achieve smaller binaries. If you know a little about AVRs you know that you've…
SDwarfs
  • 3,189
  • 5
  • 31
  • 53
10
votes
1 answer

What are the possible arguments can be passed to the option of -Xclang of the Clang compiler?

I'm using Clang as a front-end of my static analysis tool. I noticed that there is the option -Xclang that allows me to manually manage LLVM passes triggered by Clang. -Xclang Pass to the clang compiler I already knew that…
Trung Ta
  • 1,582
  • 1
  • 16
  • 25
10
votes
3 answers

How to create category for external headers in clang-format?

I want to configure clang-format to sort in C++ the included headers as follows: main header (associated with the current cpp file), local headers included via "", other headers included via <>, headers from specific external libraries (e.g. boost,…
eclipse
  • 693
  • 9
  • 30
10
votes
3 answers

How to install LLVMgold.so for clang+llvm binary package?

I would like to use llvm control flow integrity and I used the clang+llvm binary packaged version 7.0.1 shipped for Ubuntu 14.04. When I use clang++ with options '-fsanitize=cfi -flto -fvisibility=hidden' I get the following error: /usr/bin/ld:…
masec
  • 584
  • 5
  • 16
10
votes
4 answers

Compilation failing on EnableABIBreakingChecks

I recently installed LLVM v8.0.0 (on RHEL 7.4). I am going through the LLVM Kaleidoscope tutorial to learn how to use the system, but am running into an issue linking. Per the tutorial (end of chapter 2), I run: clang++ -g -O3 kld.cpp `llvm-config…
baum
  • 959
  • 13
  • 27
10
votes
1 answer

C++ code segfaults when compiled -O with Apple's LLVM compiler, but not with g++ -7.2.0

Update: I've created an even more M, but still CVE that reproduces the crash. Summary: removed all use of the Bool* bools_ field in Base class (but it still must be defined or the crash does not happen). Also removed Base::Initialize() and the…
fizzixgal
  • 133
  • 6
10
votes
0 answers

How to ignore warnings in headers that are part of a clang C++ module?

We're using clang with -fmodule and -fcxx-module to enable module support as documented at http://clang.llvm.org/docs/Modules.html. We're already seeing a significant improvement in build times by defining module maps for our core…
Mike Weller
  • 45,401
  • 15
  • 131
  • 151
10
votes
2 answers

How to get 10.8 SDK and 5.1 compiler in Xcode 6

as from the title, I need to use the 10.8 SDK and the 5.1 (or 5.0) LLVM compiler with Xcode 6, in Mavericks. With the previous Xcode, it was possible to have both the SDKs, but now I see only the 10.9 one. How can I install the previous SDK and …
Shalafi
  • 191
  • 1
  • 8
10
votes
2 answers

How do I pass objects from Javascript to C++ using Emscripten

I want to pass back a Javascript object from JS to C++ class/method. I have the following simple code snippet which is not working: // Access JS objects in C++ like C++ objects #include "emscripten/val.h" //Causing errors ! using namespace…
FacePalm
  • 10,992
  • 5
  • 48
  • 50
10
votes
1 answer

Building autotooled software to LLVM bitcode

I would like to compile software using the autotools build system to LLVM bitcode; that is, I would like the executables obtained at the end to be LLVM bitcode, not actual machine code. (The goal is to be able to run LLVM bitcode analysis tools on…
David Monniaux
  • 1,948
  • 12
  • 23
1 2
3
73 74