llvm

Apple LLVM Compiler Error 4.1

我与影子孤独终老i 提交于 2019-11-30 17:53:11
问题 So, I happened to move some folders, and all of sudden my project figured it would be cool to just like, not work. Can someone please tell me how to fix this error? (Error while compiling for irl iphone.) Short error: clang: error: no such file or directory: '/Users/OscarApeland/Downloads/LNG Converter 2/LNG Converter/LNG Converter/LNG Converter-Prefix.pch' clang: error: no input files Command/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed

Why sometimes 'self' isn't available while debugging with lldb?

只愿长相守 提交于 2019-11-30 17:33:48
A lot of time (when it's not every time) I got the following error when I try to print objects on lldb. Is there some build/debug configuration to change or is this an error inside lldb? (lldb) po userLevel error: warning: Stopped in an Objective-C method, but 'self' isn't available; pretending we are in a generic context error: use of undeclared identifier 'userLevel' error: 1 errors parsing expression I build with llvm and do not strip debug symbols. Edit: Here is the backtrace: (lldb) bt * thread #1: tid = 0x1c03, 0x001169c5 FanCake-Beta`-[KWUserLevelController addPoints:](, _cmd=0x0029187b

can I count on my compiler to optimize strlen on const char *?

自古美人都是妖i 提交于 2019-11-30 17:26:38
In my SAX xml parsing callback (XCode 4, LLVM), I am doing a lot of calls to this type of code: static const char* kFoo = "Bar"; void SaxCallBack(char* sax_string,.....) { if ( strcmp(sax_string, kFoo, strlen(kFoo) ) == 0) { } } Is it safe to assume that strlen(kFoo) is optimized by the compiler? (The Apple sample code had pre-calculated strlen(kFoo), but I think this is error prone for large numbers of constant strings.) Edit: Motivation for optimizing: parsing my SVG map on iPod touch 2G takes 5 seconds (!) using NSXMLParser. So, I want to switch to lib2xml, and optimize the string

How to force clang to use some library by default?

和自甴很熟 提交于 2019-11-30 17:25:17
I build clang by clang against libc++ , libc++abi , compiler-rt in the following steps: To download (and update) llvm and sub-projects I use the following script: svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm cd llvm/tools svn co http://llvm.org/svn/llvm-project/cfe/trunk clang svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk clang/tools/extra svn co http://llvm.org/svn/llvm-project/lldb/trunk lldb svn co http://llvm.org/svn/llvm-project/lld/trunk lld svn co http://llvm.org/svn/llvm-project/polly/trunk polly cd ../projects/ svn co http://llvm.org/svn/llvm-project

Error when using imshow on OS X

≡放荡痞女 提交于 2019-11-30 17:03:43
I have setup OpenCV2 in XCode but unfortunately imshow does not work: Undefined symbols for architecture x86_64: "cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)", referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) I am running OS X 10.8.4 with latest XCode. I have attached a few images below to show the setup in XCode and the libraries. So far it seems that other functions work fine with OpenCV, except

Why am I getting “undefined reference to `dladdr'” even with -ldl for this simple program?

独自空忆成欢 提交于 2019-11-30 14:28:41
问题 I'm working through an LLVM Tutorial, but I'm having trouble compiling. I've written a minimal example that reproduces the issue: #include "llvm/Module.h" #include "llvm/LLVMContext.h" int main(int argc, char **argv) { llvm::Module *module = new llvm::Module("test", llvm::getGlobalContext()); return 0; } When I try to compile, I get a bunch of 'undefined reference' erros: clang++ `llvm-config --cxxflags` -c -o test.o test.cpp clang++ test.o `llvm-config --ldflags --libs core` -o test /usr/lib

Why does Clang coerce struct parameters to ints

我的梦境 提交于 2019-11-30 13:27:03
问题 When using struct parameters in a function, clang will change the function signature. Instead of using a struct type, the signature will be a coerced int of equal size. In my compiler project, I use the llvm struct type for the method signature (which seems more logical). This wouldn't be a problem, except for the fact that resulting assembly produced by LLVM when using the struct or coerced types are different and not call compatible . This results in my compiler not being ABI compatible

What is the LLVM version bundled with Xcode?

只谈情不闲聊 提交于 2019-11-30 12:36:48
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 (clang-700.0.72) See https://gist.github.com/yamaya/2924292 in which an interesting comment says: Looking at the sources (src/CMakeLists.txt), it appears AppleClang is based on (approximately) the following LLVM branches: clang-700.0.72 => LLVM 3.7.0 clang-700.1.76 => LLVM 3.7.0 clang-700.1.81 => LLVM 3.7.0 clang-703.0.29 => LLVM 3.8.0 clang-703.0.31 => LLVM

Cmake and clang tooling linking error (outside of source tree)

怎甘沉沦 提交于 2019-11-30 11:40:42
问题 I am trying to compile the RecursiveASTVisitor example of Clang using a CMake file. Building the project goes well, however linking C++ executable fails with multiple undefined reference to LLVM and Clang libraries. I am building the example outside of the LLVM/Clang source file tree. Here is my CMakeLists.txt (I am using FindClang.cmake and FindLLVM.cmake from this project): cmake_minimum_required(VERSION 2.8.4) project(ifcount) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules

developing an llvm pass with cmake out of llvm source directory

不想你离开。 提交于 2019-11-30 10:22:02
I am trying to develop an llvm pass under my project directory. For that, I follow the info in http://llvm.org/docs/CMake.html#developing-llvm-pass-out-of-source . I create my CMakeFiles appropriately as in this link and my final project directory is like; |-- src | |-- CMakeLists.txt | |-- bigForPass | | |-- CMakeLists.txt | | |-- bigForPass.cpp | | |-- merged.bc | |-- build I also linked my source files with llvm root directory without any problem. Finally I make the build under the 'build' folder and my shared library is created successfully with no problems (under build/bin folder) with