clang

compiling libc++ with clang++ in Ubuntu

我们两清 提交于 2019-12-24 09:49:39
问题 My OS is Ubuntu-11.04 i compiled llvm with clang as per the user manual successfully. then i tried to compile libcxx with clang++, i made modifications to the $LIBCXX_DIR/lib/buildit.sh by reading the following http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013228.html The modified file $LIBCXX_DIR/lib/buildit is pasted after the error message. with the modified buildit.sh i get following errors. It seems clang++ is unable to compile the header file 'string' successfully. Here is

How to check for Objective 2.0 support by GCC under linux?

北慕城南 提交于 2019-12-24 09:43:26
问题 I'm under linux and I have both clang 3.5 , from the svn trunk, and gcc 4.8.1 . It surprises me that I can't compile objective-c 2.0 code with gcc but I can do that with clang . I know that gcc was the default compiler on MAC OS X for a long time before the coming of clang . So why gcc doesn't support obj-c 2.0 under linux? clang even works fine with GNUstep, where gcc really can't keep up in terms of implemented features from the version 2.0 of the language. For example, the autoreleasepool

How to improve the completion speed of clang_complete?

泪湿孤枕 提交于 2019-12-24 09:00:23
问题 I'm using the plugin clang_complete in Vim. The plugin could complete C++ STL accurately. But its completion speed is unacceptable. Is there any way to improve the clang_complete's completion speed? update:Yesterday I found this,and now the omnicppcomplete could basically meet my need ,so I decided to continue to use omnicppcomplete.vim. Thak you for your answers!! 回答1: Well i heard, that using libclang.so instead of clang executable is much faster. However for reliable completion, you need

How to get source location of #includes using clang libtooling?

元气小坏坏 提交于 2019-12-24 06:29:47
问题 Is there any way to get clang::SourceLocation for every #include in file by its clang::FileID or clang::FileEntry or something? 回答1: What about using source manager's GetIncludedLoc function which takes fileid as parameter. SourceManager.GetIncludedLoc(fileid) 回答2: Thank's @Hemant for your answer, you're right I Already found that by myself (in clang 3.8 it is called getIncludeLoc ) but forgot to write here. I used this to find the location after all #includes where i can put my own. Here's

How to get HEADER_SEARCH_PATHS to produce -isystem includes in XCode 5

孤街醉人 提交于 2019-12-24 04:58:07
问题 I want to suppress warnings in the headers we include from third party libraries. According to what I've read here and elsewhere (e.g., Set system search path in Xcode 4), by putting the appropriate path in the HEADER_SEARCH_PATHS variable of the .pbxproj file, it should result in clang using a -isystem command line option instead of -I, thus suppressing warnings. However, it's not working. As you can see from the snippet of the .pbx file below, we're setting the include paths using that

clang++ warning: “warning: unknown warning option '-Wno-maybe-uninitialized'”

南楼画角 提交于 2019-12-24 04:15:35
问题 Having installed LLVM on Ubuntu 16.04 using the command: sudo apt-get install clang llvm I get the following error when compiling: nlykkei@nlykkei-VirtualBox:~$ clang++ -g toy.cpp `llvm-config --cxxflags --ldflags --system-libs --libs` -o toy warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option] 1 warning generated. To be specific, I follow the tutorial: http://llvm.org/docs/tutorial/LangImpl03.html on the LLVM website. The

Link errors while trying to compile statically an executable with clang on windows

安稳与你 提交于 2019-12-24 04:15:10
问题 I've been trying to shift my C++ work in windows on clang lately, and everything so far seems to work right except one thing: Making full static excecutables (without any external dll dependencies like libgcc libstdc++ etc...). Let me give you an example. We have the following simple program: #include <string> int main() { std::string s1 = "Happy"; std::string s2 = " Cow"; std::string s3 = s1 + s2; return 0; } If we try to compile it using the following line: clang++ -static -O0 -std=c++11

Undefined symbols SystemRuntimeMacOSX::Initialize and SystemRuntimeMacOSX::Terminate

孤者浪人 提交于 2019-12-24 03:54:15
问题 I'm trying to build LLDB as part of Clang/LLVM. LLVM, Clang, Compiler-RT and Extras build OK. However, LLVM has an issue when building with the other components. The directory structure is set up according to LLVM/Clang/LLDB instructions. The docs on LLDB are located at Building LLDB. Below was run from the build directory, which lies next to the llvm directory ( llvm is where all sources were unpacked): $ cd build $ ../llvm/configure --enable-optimized --enable-cxx11 --enable-libcpp --prefix

Clang warns me when I aggregate initialize an array while gcc doesn't

主宰稳场 提交于 2019-12-24 03:48:13
问题 When I compile the following piece of code with CLANG: #include <iostream> #include <array> #include <algorithm> #include <functional> int main() { std::array<int, 2> a = {1, 2}; std::array<int, 2> b = {2, 1}; std::array<int, 2> c; std::transform(a.begin(), a.end(), b.begin(), c.begin(), std::multiplies<int>()); for(auto &&i : c) std::cout << i << " "; std::cout << std::endl; } by issuing the command: clang++ -std=c++14 -O2 -Wall -pedantic -pthread main.cpp It issues the warning: warning:

How to get `mov rdx, symbol` to move symbol value and not value at symbol's address in clang intel-syntax?

◇◆丶佛笑我妖孽 提交于 2019-12-24 03:45:10
问题 I have the following code which I'm using with clang on macOS: .intel_syntax noprefix .data hello: .ascii "Hello world\n" hello_len = . - hello .text .globl _main _main: mov rax, 0x2000004 mov rdi, 1 lea rsi, [rip + hello] mov rdx, hello_len # <------- syscall mov rax, 0x2000001 syscall While it looks like it should print "Hello World" and exit, it actually segfaults. It turns out it's because mov rdx, hello_len actually tries to move the value that is at address hello_len , not the value of