llvm

MacOS clang via Homebrew broken under Mojave `wchar.h`

时光毁灭记忆、已成空白 提交于 2019-12-01 18:10:20
Unsurprisingly the new update of OSX Mojave broke my llvm installation in Homebrew, these are the steps I tried: xcode-select --install # Complained, so I installed commandLineTools from here https://developer.apple.com/download/more/ xcode-select -p /Library/Developer/CommandLineTools xcode-select --install # Now says installed sudo xcodebuild -license # Fails, as it says I only have CommandLineTools installed in /Library/Developer/CommandLineTools not xcode # Try something else (all versions) brew uninstall --force llvm brew install llvm # yay v7 how exciting # Only it still don't work clang

MacOS clang via Homebrew broken under Mojave `wchar.h`

会有一股神秘感。 提交于 2019-12-01 18:08:43
问题 Unsurprisingly the new update of OSX Mojave broke my llvm installation in Homebrew, these are the steps I tried: xcode-select --install # Complained, so I installed commandLineTools from here https://developer.apple.com/download/more/ xcode-select -p /Library/Developer/CommandLineTools xcode-select --install # Now says installed sudo xcodebuild -license # Fails, as it says I only have CommandLineTools installed in /Library/Developer/CommandLineTools not xcode # Try something else (all

Make Xcode ignore LLVM build warnings in 3rd party project

懵懂的女人 提交于 2019-12-01 17:27:54
I have a third party project in my Xcode workspace (it's a dependency for my main project) and I want Xcode to ignore all build warnings from that third party project. Preferably I'd like to ignore all build warnings for the Vendor/* group in my project since that's where I put all my third party code. Possible? Yes, it's possible, but only if you compile the third-party files in a separate target. This way, you can set different compiler flags. Let's say your main target is an application. You defined your build settings, as well as the compiler warning flags. Now you want to use some third

What is my version of LLVM & clang (OSX)?

假装没事ソ 提交于 2019-12-01 16:53:28
问题 On Mac OS, if I run clang --version , I get: Apple LLVM version 6.0 (clang-600.0.34.4) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix Since LLVM official page suggests that the current LLVM version is 3.5, it seems that Apple clang versioning is distinct from the open-source LLVM. The output (based on LLVM 3.5svn) suggests that probably it is 3.5 on my machine as well. Now I got here since I wanted to compile a C++14 file, using g++ -std=c++14 main.cc . This page

Make Xcode ignore LLVM build warnings in 3rd party project

六月ゝ 毕业季﹏ 提交于 2019-12-01 16:52:19
问题 I have a third party project in my Xcode workspace (it's a dependency for my main project) and I want Xcode to ignore all build warnings from that third party project. Preferably I'd like to ignore all build warnings for the Vendor/* group in my project since that's where I put all my third party code. Possible? 回答1: Yes, it's possible, but only if you compile the third-party files in a separate target. This way, you can set different compiler flags. Let's say your main target is an

What is my version of LLVM & clang (OSX)?

血红的双手。 提交于 2019-12-01 16:41:50
On Mac OS, if I run clang --version , I get: Apple LLVM version 6.0 (clang-600.0.34.4) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix Since LLVM official page suggests that the current LLVM version is 3.5, it seems that Apple clang versioning is distinct from the open-source LLVM. The output (based on LLVM 3.5svn) suggests that probably it is 3.5 on my machine as well. Now I got here since I wanted to compile a C++14 file, using g++ -std=c++14 main.cc . This page suggests that this option should work on clang 3.5. However, it works only with -std=c++1y , which

How to detect -stdlib=libc++ in the preprocessor?

白昼怎懂夜的黑 提交于 2019-12-01 15:22:20
I think this is part of the problem at No type named 'unique_ptr' in namespace 'std' when compiling under LLVM/Clang . According to Marshall Clow , I can detect -stdlib=libc++ via _LIBCPP_VERSION : If you're writing cross-platform code, sometimes you need to know what standard library you are using. In theory, they should all offer equivalent functionality, but that's just theory. Sometimes you just need to know. The best way to check for libc++ is to look for the preprocessor symbol _LIBCPP_VERSION. If that's defined, then you're using libc++. #ifdef _LIBCPP_VERSION // libc++ specific code

How to detect -stdlib=libc++ in the preprocessor?

断了今生、忘了曾经 提交于 2019-12-01 14:15:15
问题 I think this is part of the problem at No type named 'unique_ptr' in namespace 'std' when compiling under LLVM/Clang. According to Marshall Clow, I can detect -stdlib=libc++ via _LIBCPP_VERSION : If you're writing cross-platform code, sometimes you need to know what standard library you are using. In theory, they should all offer equivalent functionality, but that's just theory. Sometimes you just need to know. The best way to check for libc++ is to look for the preprocessor symbol _LIBCPP

LLVM unable to unroll loops [Can't unroll; loop not terminated by a conditional branch]

吃可爱长大的小学妹 提交于 2019-12-01 13:23:16
I am getting an error Can't unroll; loop not terminated by a conditional branch for the following code: for(i=0 ; j<10 && i<5 ; i++) j= j+2; I am using the following command for unrolling loops in a file a.bc : opt -loops -loop-rotate -loop-simplify -loop-unroll -unroll-count=3 -unroll-allow-partial -debug a.bc -o a.loop.bc Is there a way to unroll loops avoiding this error? use this command and it should work (I have tested it on LLVM 3.6 and 3.7) opt -mem2reg -simplifycfg -loops -lcssa -loop-simplify -loop-rotate -loop-unroll -unroll-count=3 -unroll-allow-partial -debug a.bc -o a.loop.bc you

LLVM unable to unroll loops [Can't unroll; loop not terminated by a conditional branch]

拟墨画扇 提交于 2019-12-01 12:39:17
问题 I am getting an error Can't unroll; loop not terminated by a conditional branch for the following code: for(i=0 ; j<10 && i<5 ; i++) j= j+2; I am using the following command for unrolling loops in a file a.bc : opt -loops -loop-rotate -loop-simplify -loop-unroll -unroll-count=3 -unroll-allow-partial -debug a.bc -o a.loop.bc Is there a way to unroll loops avoiding this error? 回答1: use this command and it should work (I have tested it on LLVM 3.6 and 3.7) opt -mem2reg -simplifycfg -loops -lcssa