llvm-clang

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,

iOS mixed dynamic framework - bridge objc headers with private module

﹥>﹥吖頭↗ 提交于 2019-12-04 05:45:41
In regards to a "dynamic framework" target, I need to bridge internal (private) objective-c headers to my swift counterparts. From my understanding I need to use a private module. Some of these swift counterparts are bridged back to objective-c using the @objc class TheClass syntax. I've gone ahead and created a module.modulemap and a module.private.modulemap file in a directory under $SRCROOT and added the "necessary" flags to the build settings. SWIFT_INCLUDE_PATHS =>$(SRCROOT)/... I've also tried adding a "Private module map file" to the build settings My module map file is: module

What's required to implement root class of Objective-C?

99封情书 提交于 2019-12-03 15:24:50
I tried this code: // main.m #import <stdio.h> @interface Test + (void)test; @end @implementation Test + (void)test { printf("test"); } @end int main() { [Test test]; return 0; } with LLVM/Clang without any framework, it doesn't compiled with this error: Undefined symbols: "_objc_msgSend", referenced from: _main in main.o ld: symbol(s) not found clang: error: linker command failed with exit code 1 (use -v to see invocation) So I added libobjc.dylib . Code compiled, but threw this runtime exception: objc[13896]: Test: Does not recognize selector forward:: Program received signal: “EXC_BAD

Integrating LLVM passes

瘦欲@ 提交于 2019-12-03 09:23:27
This maybe a rookie question but is there a way to integrate my LLVM modulepass to be called by default during the transformation phase? Right now I am using this syntax to load my pass and register it ~/llvm/llvm/build/Debug+Asserts/bin/clang -Xclang -load -Xclang ~/llvm/llvm/build/Debug+Asserts/lib/SOMEPASSLIB.so (The problem is when I want to build some package with this pass, the compiler accepts it when I say, pass the loading part as CFLAGS env variable, but some makefiles use CFLAGS for linking too, and the linker has no idea what it can do with this information and fails the build :\ )

C++ program not compiling with Clang and visual Studio 2010 Express

假装没事ソ 提交于 2019-12-03 03:30:00
I'm trying to compile the source code as described in this tutorial with visual c++ 2010 express. http://kevinaboos.wordpress.com/2013/07/23/clang-tutorial-part-ii-libtooling-example/ The full source code is over here. https://github.com/kevinaboos/LibToolingExample I have used the executable provided in this link to install LLVM. I can't post the complete error message due to formatting issues. But I will try to give as much information as I can. When I'm trying to build the solution , I get the following errors :- argument unused during compilation warnings. C:\Program Files (x86)\LLVM

What do you need to install to use Clang on windows to build c++14 for 64 bit?

旧巷老猫 提交于 2019-12-03 01:37:50
问题 UPDATE: I've written a detailed tutorial that incorporates the top two answers on this question: http://blog.johannesmp.com/2015/09/01/installing-clang-on-windows-pt1/ TL;DR On Windows, Given the following program: #include <iostream> int main() { int arr[] = {1, 2, 3, 4, 5}; for(auto el : arr) { std::cout << el << std::endl; } return 0; } I want to be able to do the following: clang++ hello.cpp -o hello.exe -std=c++14 And get a 64 bit executable that just works . I don't want to have to

Private module map for a framework

限于喜欢 提交于 2019-12-02 17:39:26
I'm using this answer to create a module map to create a module for CommonCrypto so I can use it in a framework. Doing this however means that any projects that I use this framework in have access to CommonCrypto with import CommonCrypto - and even worse, declaring CommonCrypto in another framework and importing this into the project results in Redefinition of module 'CommonCrypto' errors. I.e. the following setup: MainProject |--> import FrameworkA - module map for CommonCrypto |--> import FrameworkB - module map for CommonCrypto Is there a way to create a module map but have it private to

Conversion from ___attribute___((shared)) to addrspace(3) in Clang compiler when compiling CUDA files

半世苍凉 提交于 2019-12-02 10:52:54
问题 The clang compiler includes CUDA header file host_defines.h in which the __shared__ is defined as __attribute__((shared)) . When CUDA source files are compiled to internal representation (IR) using clang, the __shared__ gets converted to addrspace(3) . These address spaces can be observed in the clang file llvm/tools/clang/lib/Basic/Targets.cpp line number 1601 as an array static const unsigned NVPTXAddrSpaceMap[] = { 1, // opencl_global 3, // opencl_local 4, // opencl_constant // FIXME:

OpenMP support on OSX 10.11, gcc errors with “file omp.h not found”

别说谁变了你拦得住时间么 提交于 2019-12-01 09:47:16
问题 I have been using gcc version 5.3.0. It says that it comes with openmp support. But every time when I compile a program using either gcc [by terminal] or via xCode 7, I get same error, "file omp.h not found". I have searched too much on this issue and tried almost everything I found. First I tried to locate omp.h on my mac. I found some files; then in header file, I used that specific location of omp.h but no help [it gave me linker error]. I installed gcc version 6.0 (pre-release) but no

What is proper LLVM header guard style?

扶醉桌前 提交于 2019-12-01 06:12:11
In clang tidy, the check [llvm-header-guard] looks for LLVM style header guards, but I can't find any examples of proper LLVM header guard style, specifically the structure of the name given to the define, the coding standards pages does not mention anything. Looking at the unit tests: https://github.com/llvm-mirror/clang-tools-extra/blob/master/unittests/clang-tidy/LLVMModuleTest.cpp it seems to accept a few variations on the commonly used patterns. For a file named include/llvm/ADT/foo.h the convention seems to be: #ifndef LLVM_ADT_FOO_H #define LLVM_ADT_FOO_H //... #endif // LLVM_ADT_FOO_H