llvm

“Failed to run llvm optimizations” using clang++ for webassmebly

南笙酒味 提交于 2021-01-29 17:31:25
问题 I've installed emscripten-1.38.27 1 and fastcomp-clang-e1.38.27-64bit via the official emsdk tool. After running qmake and gettting no errors nor warnings,I ran make for my Qt project and that resulted in this(with EMCC_DEBUG=1 ): shared:DEBUG: executed emsdk-master/fastcomp-clang/e1.38.27_64bit/clang++ -target asmjs- unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=38 -D__EMSCRIPTEN_tiny__=27 -D_LIBCPP_ABI_VERSION=2 -Werror=implicit-function-declaration -nostdinc -Xclang

LLVM build on Windows: Visual Studio cl.exe skipped

独自空忆成欢 提交于 2021-01-29 14:01:18
问题 I try to build and install the LLVM source on Windows (specifically LLVM-8, but the issue exists on the latest version as well), using Visual Studio 2019 and CMake 3.18.2, following the guide from http://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm. The output however looks the same as discussed in Building LLVM using Visual Studio, but the solution did not change anything for me. I ran the following commands: git clone --config core.autocrlf=false https:/

Generating IR from clang using classes

时间秒杀一切 提交于 2021-01-29 10:00:39
问题 I am trying to generate LLVM IR using clang classes I am pretty new at this and so far I've used this code as a reference which is in turn copied from Method to create LLVM IR The above link is pretty old and I did change my code here and there according to the new signatures #include <clang/CodeGen/CodeGenAction.h> #include <clang/Frontend/CompilerInstance.h> #include <clang/Frontend/CompilerInvocation.h> #include <clang/Basic/DiagnosticOptions.h> #include <clang/Frontend

Ubuntu下安装clang和libc++

最后都变了- 提交于 2021-01-29 09:14:46
最近在跑别人代码(Makoto Miwa - Relation Extraction)的时候需要用到clang++,所以需要在Ubuntu上安装一下clang++。转载自: 算法时空 选择版本 之前推荐的是当前版本 trunk ,但是有时它在不断更新,所以最好还是选择特定版本,这里我们选择clang 5.0最终版,那么 官网指南 中可将 trunk 改成 tags/RELEASE_500/final 。 例如: http://llvm.org/svn/llvm-project/llvm/trunk 可以改成: http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_500/final 步骤 安装必要的包: 1 sudo apt install subversion 2 sudo apt install cmake 建立目录(这里取名为 CL ): 1 cd ~ 2 sudo mkdir CL 3 cd CL 下载 llvm : 1 svn co http: // llvm.org/svn/llvm-project/llvm/tags/RELEASE_500/final llvm 下载 clang : 1 cd llvm/ tools 2 svn co http: // llvm.org/svn/llvm-project/cfe/tags

Cmake when building LLVM

╄→гoц情女王★ 提交于 2021-01-28 07:09:35
问题 Trying to build llvm project LLVM Project with CMake, it gives me an error that I can't solve by my own. For doing this, I am using an Ubuntu Virtual Machine (version 18.04) and I am trying to build the project with "ninja". I have tried to build this with the following commands (which the LLVM Builder Guide says to use, https://llvm.org/docs/GettingStarted.html) git clone https://github.com/llvm/llvm-project.git cd llvm-project/ mkdir build && cd build cmake -DLLVM_ENABLE_PROJECTS='all'

Emscripten 1.34.1 Issue

家住魔仙堡 提交于 2021-01-28 02:51:37
问题 Things were working fine in an Emscripten build 1.29.0 but after upgrading to 1.34.1, I get the following error: 1> Traceback (most recent call last): 1> File "C:\Program Files\Emscripten\emscripten\1.34.1\\emcc", line 1260, in <module> 1> shared.Building.llvm_opt(final, link_opts) 1> File "C:\Program Files\Emscripten\emscripten\1.34.1\tools\shared.py", line 1429, in llvm_opt 1> assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output 1> AssertionError: Failed to run llvm

Print FPU registers in lldb

旧城冷巷雨未停 提交于 2021-01-28 02:06:38
问题 How do you print FPU registers using lldb? In gdb, you would do something like p $st0 , however doing the same in lldb results in the error: error: use of undeclared identifier '$st0' . register read st0 doesn't work either and gives the error error: Invalid register name 'st0'. . 回答1: By using register read --all as suggested by paulsm4 , I found that the name of the registers are actually stmm0 to stmm7 and not st0 to st7 . So doing register read stmm0 --format b will get you the binary

Build size for LLVM 6.0.0 is huge (42G)

你。 提交于 2021-01-28 00:30:08
问题 I built llvm-6.0.0 from source and everything works fine. I'm just wondering how come its size is so huge ( 42G ). Can I easily erase some object files or other to make the build directory smaller? $ du -hs ~/GIT/llvm-6.0.0/build/ 42G /home/oren/GIT/llvm-6.0.0/build/ 回答1: You're building without shared libraries, which means that a number of very large libraries are linked statically into a large number of (otherwise small) tools. I'm guessing that you may also be building for all targets (32

CMakeList file to generate LLVM bitcode file from C source file

喜欢而已 提交于 2021-01-27 16:55:03
问题 I am trying to generate LLVM bytecode file from a C source file (hello.c) using CMake. And below is my CMakeLists file. ###### CMakelists.txt ############ cmake_minimum_required(VERSION 2.8.9) set(CMAKE_C_COMPILER "clang") set(CMAKE_C_FLAGS "-emit-llvm") project (hello) add_executable(hello hello.c) I am new to CMake and not sure if this is the right way. I could not find any rules to make *.bc in the generated MakeFile . Please correct me here. I also tried "-save-temps" Considering this for

CMakeList file to generate LLVM bitcode file from C source file

谁说我不能喝 提交于 2021-01-27 16:47:13
问题 I am trying to generate LLVM bytecode file from a C source file (hello.c) using CMake. And below is my CMakeLists file. ###### CMakelists.txt ############ cmake_minimum_required(VERSION 2.8.9) set(CMAKE_C_COMPILER "clang") set(CMAKE_C_FLAGS "-emit-llvm") project (hello) add_executable(hello hello.c) I am new to CMake and not sure if this is the right way. I could not find any rules to make *.bc in the generated MakeFile . Please correct me here. I also tried "-save-temps" Considering this for