llvm

How to install Clang and LLVM 3.9 on CentOS 7

╄→尐↘猪︶ㄣ 提交于 2019-12-04 07:59:35
问题 I have taken rpm packages from https://copr-be.cloud.fedoraproject.org/results/alonid/llvm-3.9.0/epel-7-x86_64/00505197-clang-3.9.0/ for Clang 3.9. I am installing the rpm packages by the command rpm -ivh clang-3.9.0-3.9.0-3.1.el7.centos.alonid.src.rpm But when I do rpm -ivh clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64.rpm I get the following error : error: Failed dependencies: clang-3.9.0-libs(x86-64) = 3.9.0-3.1.el7.centos.alonid is needed by clang-3.9.0-3.9.0-3.1.el7.centos.alonid.x86_64

Linking against clang-llvm

落花浮王杯 提交于 2019-12-04 07:52:33
I've been working on a small tool with clang/llvm but I haven't been able to successfully get g++ and gnu's linker to properly link my code against clang. my linker is generating the following errors: undefined reference to `clang::FileManager::~FileManager()' undefined reference to `clang::FileManager::FileManager()' undefined reference to `llvm::sys::getHostTriple()' undefined reference to `clang::Diagnostic::Diagnostic(clang::DiagnosticClient*)' undefined reference to `llvm::outs()' undefined reference to `clang::TargetInfo::CreateTargetInfo(clang::Diagnostic&, clang::TargetOptions&)'

Collecting LLVM Edge Profiling with llvm-prof

谁说胖子不能爱 提交于 2019-12-04 07:46:51
I'm using these commands to compile the code below in order to collect edge/blocks profiling in trunk-llvm: clang -emit-llvm -c sort.c -o sort.bc opt -insert-edge-profiling sort.bc -o sort_prof.bc clang sort_prof.bc -lprofile_rt -L/llvms/lib -o sort_prof then I run the program and display the profiling information using llvm-prof sort_prof.bc, and the result is: ===-------------------------------------------------------------------------=== Function execution frequencies: ## Frequency 1. 4.3e+05/708539 main 2. 2.8e+05/708539 quickSort NOTE: 2 functions were never executed! ..... My question is

lldb is not starting an application

◇◆丶佛笑我妖孽 提交于 2019-12-04 07:34:53
this is my first experience in commandline mode of lldb. unsuccessful. installed minimal kit with clang, lld, lldb v5 (ubuntu 16.04) sample application built with clang. trying to start: lldb applcation >run error: process launch failed: unable to locate lldb-server-5.0.0 so now the questions: why lldb tries to run a server? this is not a remote debugging. why lldb refers to 5.0.0 (and where to change this setting)? actually there was added symbolic links automiticaly with xxx-5.0 suffix to all llvm utilities, but not with xxx-5.0.0. would be reasonable if this refers to lldb-server itself,

How do I get debug information from a function?

自闭症网瘾萝莉.ら 提交于 2019-12-04 07:26:01
I've used Clang to compile a function with debug information enabled. For Instruction s there's the handy getDebugLoc() , but there's no such thing for Function s. Given a Function instance, how can I get the debug information (I'm guessing in DISubProgram form) for it? I've seen the guide entry explaining how that debug information is represented , and the metadata does contain a link back to the function, but there's apparently no link back. Am I supposed to iterate over all the metadata in the module? I don't think there's currently an easier way. There used to be a global metadata node

meaning of llvm[n] when compiling llvm, where n is an integer

▼魔方 西西 提交于 2019-12-04 07:01:02
问题 I'm compiling LLVM as well as clang. I noticed that the output of compilation has llvm[1]: or llvm[2]: or llvm[3] : prefixed to each line. What do those integers in brackets mean? 回答1: It's the number of the compilation job ( make -j ). Helpful to trace compilation errors. 回答2: Apparently, it's not connected to the number of the compilation job (can be easily checked via make -j 1). The autoconf-based build system indicates the "level" of the makefile inside the source tree). To be prices, it

Can I compile a function with gcc and then use it with clang?

微笑、不失礼 提交于 2019-12-04 04:49:08
I am trying to use SSE4.2 intrinsics with clang/llvm but its not compiling, as I get cannot select intrinsic error from LLVM. On the other hand, the same code compiles flawlessly in gcc. So I thought, maybe I can compile that function with gcc, so as to have an object or library file, and then call that library function in my code, which is compiled by clang/llvm. Would that work? Z boson It's possible to compile an object file with GCC in Linux and convert it to work in Visual Studio. I did this recently running Linux in Virtual Box on Windows converting-c-object-file-from-linux-o-to-windows

Xcode 4.2 Code Coverage

廉价感情. 提交于 2019-12-04 04:25:47
I started to use Xcode 4.2 and i have problems with generating code coverage. Xcode 4.2 does not include the GCC 4.2 compiler, but it was replaced with the LLVM GCC 4.2 compiler. The first one was needed to generate code coverage in the previous version of Xcode. I followed the 'tutorial' on CoverStory website , but this results in the following: a) when i do all steps, no coverage files. b) when i link the libprofile_rt.dylib to my project, the test which should fail, do not fail anymore. Did anyone encounter this issue? And how did you solve it? Thanks Here is a way to enable compiling with

Linking LLVM causes gcov to fail

十年热恋 提交于 2019-12-04 04:00:52
问题 Passing --coverage to gcc while also linking LLVM causes an undefined reference to `__gcov_exit' error from the linker. I've set up a fresh project to try to isolate this problem. You can view the source on github and inspect the compiler output on Travis-CI. This is the difference between a coverage and a non-coverage build -DCMAKE_CXX_FLAGS="--coverage" This is the difference between an LLVM and a non-LLVM build target_link_libraries(Test PUBLIC LLVMCore ) The LLVM job succeeds. The

Linking libc++ to CMake project on Linux

荒凉一梦 提交于 2019-12-04 03:00:16
I want to use libc++ together with clang on Arch Linux in CMake project. I installed libc++ and added following lines to CMakeLists.txt as said on LLVM site in Linux section of "Using libc++ in your programs": set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") set(CMAKE_EXE_LINKER_FLAGS "-lc++abi") I have tried just "++abi" in linker's flags, but it didn't help. I need some help in figuring out what i should write in my CMakeLists.txt. emw Don't forget to set the compiler to clang++: set(CMAKE_CXX_COMPILER "clang++") Also, purge the cmake generated files (delete the folder