llvm

Where is __dso_handle defined?

梦想的初衷 提交于 2019-12-03 16:25:01
问题 I have an unresolved symbol error when trying to compile my program which complains that it cannot find __dso_handle . Which library is this function usually defined in? Does the following result from nm on libstdc++.so.6 mean it contains that? I tried to link against it but the error still occurs. nm libstdc++.so.6 | grep dso 00000000002fc480 d __dso_handle 回答1: __dso_handle is a "guard" that is used to identify dynamic shared objects during global destruction. Realistically, you should stop

“too many errors emitted stopping now” - How to increase or remove the limit?

瘦欲@ 提交于 2019-12-03 16:21:23
问题 So I'm doing some refactoring and it's really annoying that I don't get all the errors up front. How can I either increase the limit or remove the limit, so that the compiler will output all the errors it can find? 回答1: So I found how to do it. You add this compiler flag: -ferror-limit=0 0 means that it will not stop because of too many errors. This seems to be a question and answer that explains how to add a compiler flag in Xcode 4: Xcode Project-Wide compiler flag 回答2: Maybe this:

Possible to auto-generate llvm c++ api code from LLVM-IR?

只愿长相守 提交于 2019-12-03 16:13:36
The clang 3.0 online demo page http://llvm.org/demo/index.cgi provides an option to output LLVM C++ API code" representing the LLVM-IR for the input program. Is "produce LLVM C++ API code" output a clang option (and if so, what is it)? Or is it an llvm tool option (which one)? Is it possible to do the same thing but from LLVM-IR input? Basically I'd like to see the proper llvm c++ api calls needed to produce a particular given llvm-ir sequence. I'd like to learn backwards by example rather than forwards from the documentation. Manual pages and --help and --help-hidden for clang, llvm-as and

Build 32-bit with 64-bit llvm-gcc

强颜欢笑 提交于 2019-12-03 16:10:45
问题 I have a 64-bit version of llvm-gcc, but I want to be able to build both 32-bit and 64-bit binaries. Is there a flag for this? I tried passing -m32 (which works on the regular gcc), but I get an error message like this: [jay@andesite]$ llvm-gcc -m32 test.c -o test Warning: Generation of 64-bit code for a 32-bit processor requested. Warning: 64-bit processors all have at least SSE2. /tmp/cchzYo9t.s: Assembler messages: /tmp/cchzYo9t.s:8: Error: bad register name `%rbp' /tmp/cchzYo9t.s:9: Error

Understanding branches in gcov files

喜夏-厌秋 提交于 2019-12-03 14:37:36
I'm trying to understand the output of the gcov tool. Running it with no options makes sense, but I'm wanting to try and understand the branch coverage options. Unfortunately it's hard to make sense of what the branches do and why they aren't taken. Below is the output for a method (compile using the latest LLVM/Clang build). function -[TestCoverageAppDelegate loopThroughArray:] called 5 returned 100% blocks executed 88% 5: 30:- (NSInteger)loopThroughArray:(NSArray *)array { 5: 31: NSInteger i = 0; 22: 32: for (NSString *string in array) { branch 0 taken 0 branch 1 taken 7 -: 33: 22: 34: }

七天LLVM零基础入门(Linux版本)------第四天

两盒软妹~` 提交于 2019-12-03 14:15:38
作者: snsn1984 第一步:复习 第三天的时候,我们学习了LLVM的编程指引。在开始第四天的学习之前,需要复习之前学习过的两篇文档: LLVM IR的文档( http://llvm.org/docs/LangRef.html ) 编程指引文档 ( http://llvm.org/docs/ProgrammersManual.html ) 这两篇文档是LLVM的重中之重,希望学习的时候认真一点,能掌握这些文档的核心。 第二步:阅读文档 Write an LLVM pass http://llvm.org/docs/WritingAnLLVMPass.html 在阅读的过程中,文档中提到的例子要自己认真运行一下,并且对提到的实际代码,要认真的阅读。 对Pass的简要介绍,可参加我之前的一个博文: http://blog.csdn.net/snsn1984/article/details/8160696 同时,还有一个对Pass例子的分析: http://blog.csdn.net/snsn1984/article/details/8568828 第三步:自己根据HelloWorld的例子,写一个输出一个函数中所有的BasicBlock的name的Pass. 这个Pass是FunctionPass的子类,通过自己实现runOnFunction

performance comparison - gcc and llvm-gcc

谁都会走 提交于 2019-12-03 14:00:39
问题 I compared gcc and llvm-gcc with -O3 option on hmmer and mcf in spec cpu2006 benchmark. Surprisingly, I found gcc beat llvm-gcc for both cases. Is it because the -O3 has different meanings? How should I establish the experiments to get a fair comparison? BTW, I did the experiment by ONLY changing cc in the makefile. Thanks, Bo 回答1: You seem surprised that gcc beat llvm on your benchmark. Phoronix hosts a bunch of interesting benchmarks in this area. For instance, have a look at: Benchmarking

Is there a way to show where LLVM is auto vectorising?

為{幸葍}努か 提交于 2019-12-03 13:58:18
Context: I have several loops in an Objective-C library I am writing which deal with processing large text arrays. I can see that right now it is running in a single threaded manner. I understand that LLVM is now capable of auto-vectorising loops, as described at Apple's session at WWDC. It is however very cautious in the way it does it, one reason being the possibility of variables being modified due to CPU pipelining. My question: how can I see where LLVM has vectorised my code, and, more usefully, how can I receive debug messages that explain why it can't vectorise my code? I'm sure if it

What is the sanctioned way to build libc++ for clang on Linux?

假如想象 提交于 2019-12-03 12:36:27
Edit/Update/Note: Just let clang use libstdc++. Has been working really well for me so far. =============================== In the past I have been able to succeed by doing something with cmake , but just now I discovered a buildit script inside the lib directory of the http://llvm.org/svn/llvm-project/libcxx/trunk project tree. This buildit script appears to not make use of libsupc++ which is what the cmake approach that I took earlier used. For instance, this guide shows one cmake incantation to produce a makefile for libc++ , which will be able to take care of compiling and installation. My

GCC toolchain for LLVM

瘦欲@ 提交于 2019-12-03 12:28:16
I am running on an RHEL 6.x box, which of course has GCC 4.4 installed. I wish to have LLVM running on this machine. In order to do so, I must compile it from source. In order to do that , I need a more modern version of GCC. So, following the instructions , I have built GCC 4.8.2: [snip] % $PWD/../gcc-4.8.2/configure --prefix=$HOME/toolchains --enable-languages=c,c++ % make -j$(nproc) % make install I'm logged in as root, so $HOME/toolchains resolves to /root/toolchains . After satisfying prerequisites for LLVM, I'm ready to configure and build LLVM. root@dev06 /root/llvm-build # ~/llvm