llvm

Integrate LLVM Clang 4.x.x / 5.x.x / 6.x.x into Visual Studio 2017

两盒软妹~` 提交于 2019-11-27 05:23:20
问题 The official LLVM 4.0 build for Windows integrates with Visual Studio up to Visual Studio 2015. Unfortunately it still doesn't support Visual Studio 2017. When you try to set the Platform Toolset of a project to LLVM-vs2014 , it pops up an error. Do you know any way to make it work? Update In 2018, LLVM 6.0 officially still doesn't support integration with Visual Studio 2017 (version 15.X.X), only with the Visual Studio 2015 (version 14.X.X) toolset. 回答1: It requires some msbuild targets that

Enable OpenMP support in clang in Mac OS X (sierra & Mojave)

橙三吉。 提交于 2019-11-27 04:52:20
I am using Mac OS X Sierra, and I found that clang (LLVM version 8.1.0 (clang-802.0.38)) does not support OpenMP: when I run clang -fopenmp program_name.c , I got the following error: clang: error: unsupported option '-fopenmp' It seems that clang does not support -fopenmp flag. I could not find any openmp library in homebrew. According to LLVM website, LLVM already supports OpenMP. But I could not find a way to enable it during compiling. Does this mean that the default clang in Mac does not support OpenMP? Could you provide any suggestions? (When I switch to GCC to compile the same program

Passing a gcc flag through makefile

ぐ巨炮叔叔 提交于 2019-11-27 04:30:12
问题 I am trying to build a pass using llvm and I have finished building llvm and its associated components. However, when I run make after following all the steps to build a pass including the makefile, I get the following relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC After tyring to find a fix by googling the error message, I came to know that this is not specific to llvm. A few solutions suggested that I should use "--enable

Building with LLVM and any optimization causes app to crash on startup

删除回忆录丶 提交于 2019-11-27 04:28:55
问题 When I try to build my app with LLVM 2.0 in XCode 4.0.1 and any level or optimization that is not none (anything but -O0), the app crashes after i launch it on the device (simulator is ok). I can't seem to debug the crash as it does not happen when i build in xcode and attach via GDB/LLDB. Also, the crash only happens when i build the app on the command line with xcodebuild; building via the XCode IDE doesn't crash even with the exact same project settings. I can't see any useful information

How to use clang/llvm with Eclipse CDT

ぐ巨炮叔叔 提交于 2019-11-27 01:44:27
问题 Is it possible to use Clang/LLVM with Eclipse CDT and if so, how is it configured to actually make it work? 回答1: I am the main author of the (only) LLVM plug-in for Eclipse CDT. It is still in development so might not be suitable for production environment yet. However feel free to test it to find out if it is suitable for your needs. https://github.com/TuononenP/llvm4eclipsecdt UPDATE The latest version is available via official Eclipse update site: http://download.eclipse.org/releases/mars

Generate LLVM C++ API code as backend

混江龙づ霸主 提交于 2019-11-27 01:38:17
问题 The Online LLVM demo page had an option to generate LLVM C++ API code as backend from a source code. However, that demo page is now disabled. I was wondering how we can do it ourselves using the available LLVM tools. I tried the following clang++ -c -emit-llvm input.cpp -o input.ll llc -march=cpp -o input.ll.cpp input.ll which gives the following error llc: error: invalid target 'cpp'. I am using LLVM/Clang version 3.2. 回答1: The LLVM C++ backend has to be enabled during configuration when

大道至简——RISC-V架构之魂(转载)

[亡魂溺海] 提交于 2019-11-27 01:17:13
1: https://blog.csdn.net/zoomdy/article/details/79580529 2: https://blog.csdn.net/zoomdy/article/details/79580772 3: https://blog.csdn.net/zoomdy/article/details/79580949 4: RISC-V相关的开源项目 https://blog.csdn.net/u013710265/article/details/70332671 和RISC-V相关的有如下一些开源项目: 工具链 1、riscv-tools - 基本上所有RISC-V相关工具链、仿真器、测试的宏项目,包含以下的项目 riscv-gnu-toolchain - GNU工具链 riscv-gcc - GCC 编译器 riscv-binutils-gdb - 二进制工具(链接器,汇编器等)、GDB 调试工具 riscv-glibc - GNU C标准库实现 riscv-isa-sim - Spike周期精确指令集模拟器 riscv-llvm -LLVM编译器框架 riscv-clang - 基于LLVM框架的C编译器 riscv-opcodes - RISC-V操作码信息和转换脚本 riscv-tests - RISC-V指令集测试用例 riscv-fesvr -

What exactly is LLVM?

浪子不回头ぞ 提交于 2019-11-26 23:44:28
问题 I keep hearing about LLVM all the time. It's in Perl, then it's in Haskell, then someone uses it in some other language? What is it? 回答1: LLVM is a library that is used to construct, optimize and produce intermediate and/or binary machine code. LLVM can be used as a compiler framework, where you provide the "front end" (parser and lexer) and the "back end" (code that converts LLVM's representation to actual machine code). LLVM can also act as a JIT compiler - it has support for x86/x86_64 and

How can I force Xcode to use a custom compiler?

本秂侑毒 提交于 2019-11-26 23:18:09
问题 I want to force Xcode to use a custom compiler ('clang-llvm' build from the src) so I can use the clang plugin. My Xcode version is 7.3.1. 回答1: People say it is possible with custom toolchains. I didn't make a research on them because easier solution worked well for me: It is also possible to run frontend plugins directly by setting appropriate "build settings" of Xcode. (Several ways to do this, you can set them on the command line for instance: xcodebuild build FOO=bla.) Here are a few

Where to find the optimization sequence for clang -OX?

落花浮王杯 提交于 2019-11-26 23:15:49
问题 Where can I find the sequence of optimizations used by clang according to -OX? 回答1: clang executes the precisely same sequence of passes as opt -ON. So, you can do something like llvm-as < /dev/null | opt -O3 -disable-output -debug-pass=Arguments to derive the "full" set of passes which are run at O3. 来源: https://stackoverflow.com/questions/7796151/where-to-find-the-optimization-sequence-for-clang-ox