llvm

How to get the macro and its expansion with clang libtooling?

喜你入骨 提交于 2020-03-05 04:07:09
问题 I am working on clang libtooling. So far I am managed to get the macro where it is getting referred in the source file through visitDeclRefExpr(DeclRefExpr *DR) But can I get a list of macros with its name and its expansion as string. exampleprogram.c #define abc ab #define sum 0 int main() { int ab; abc = abc + 0; return 0; } can I get the output like the following abc -- ab sum -- 0 How can I achieve this output with clang libtooling. How can I implement with the clang libtooling? Please

How to get the macro and its expansion with clang libtooling?

故事扮演 提交于 2020-03-05 04:07:06
问题 I am working on clang libtooling. So far I am managed to get the macro where it is getting referred in the source file through visitDeclRefExpr(DeclRefExpr *DR) But can I get a list of macros with its name and its expansion as string. exampleprogram.c #define abc ab #define sum 0 int main() { int ab; abc = abc + 0; return 0; } can I get the output like the following abc -- ab sum -- 0 How can I achieve this output with clang libtooling. How can I implement with the clang libtooling? Please

Error during cmake build, missing header file that I know the path to (mac)

℡╲_俬逩灬. 提交于 2020-03-04 15:34:35
问题 This post is bumping a 3 year old unresolved issue from here I am following instructions from here. As the title suggests, I'm running mac os mojave. I can successfully build with cmake, but I cannot make successfully and receive the following error: $ cmake --build . -v -- include_dir=/usr/include/ ... ... ... [ 32%] Building C object projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.eprintf.dir/eprintf.c.o cd /Users/anthonymcknight/Documents/cubing/bfs/lab4/cilk/llvm/build/projects

Rust 共同创始人 Brian Anderson 讲故事:Rust 编译模型之殇

守給你的承諾、 提交于 2020-03-04 11:27:15
出处 : PingCAP 微信公众号 翻译 : Rust中文社区翻译小组 原文 : The Rust Compilation Model Calamity 原作者 : Brian Anderson 是 Rust 编程语言及其姊妹项目 Servo Web 浏览器的共同创始人之一。他目前在 PingCAP 担任高级数据库工程师。 Rust 编译缓慢的根由在于语言的设计 我的意思并非是此乃 Rust 语言的设计目标。正如语言设计者们相互争论时经常说的那样,编程语言的设计总是充满了各种权衡。其中最主要的权衡就是:运行时性能和编译时性能。而 Rust 团队几乎总是选择运行时而非编译时。 因此,Rust 编译时间很慢。这有点让人恼火,因为 Rust 在其他方面的表现都非常好,唯独 Rust 编译时间却表现如此糟糕。 Rust 与 TiKV 的编译时冒险:第 1 集 在 PingCAP,我们基于 Rust 开发了分布式存储系统 TiKV 。然而它的编译速度慢到足以让公司里的许多人不愿使用 Rust。我最近花了一些时间,与 TiKV 团队及其社区中的其他几人一起调研了 TiKV 编译时间缓慢的问题。 通过这一系列博文,我将会讨论在这个过程中的收获: 为什么 Rust 编译那么慢,或者说让人感觉那么慢; Rust 的发展如何造就了编译时间的缓慢; 编译时用例; 我们测量过的

What version of LLVM does the latest emscripten use?

时光怂恿深爱的人放手 提交于 2020-03-02 09:30:11
问题 What version of LLVM does the latest emscripten use? I googled for this quite a while but could not find any info. The background is that I've got some C++ code that requires clang-5.0 - what are the chances that it would compile with emscripten? Or at least code that needs clang-4.0? 回答1: The latest version of emscripten uses clang version 4: $ emcc -v emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.37.21 clang version 4.0.0 (https://github.com/kripken/emscripten

What version of LLVM does the latest emscripten use?

自作多情 提交于 2020-03-02 09:30:09
问题 What version of LLVM does the latest emscripten use? I googled for this quite a while but could not find any info. The background is that I've got some C++ code that requires clang-5.0 - what are the chances that it would compile with emscripten? Or at least code that needs clang-4.0? 回答1: The latest version of emscripten uses clang version 4: $ emcc -v emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.37.21 clang version 4.0.0 (https://github.com/kripken/emscripten

Windows 10: Clang, “stdio.h” not found [duplicate]

◇◆丶佛笑我妖孽 提交于 2020-03-01 03:08:41
问题 This question already has answers here : clang/clang++ doesn't find C/C++ headers in windows? (3 answers) Closed 3 years ago . I have installed LLVM and Clang-3.9.0 on Win10. I have MinGW installed as well. I have put my C code in 'D:' drive. I can use gcc and g++ to compile my code. But when I use clang I get: clang -cc1 version 3.9.0 based upon LLVM 3.9.0 default target x86_64-pc-windows-msvc ignoring duplicate directory "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A" ignoring

Windows 10: Clang, “stdio.h” not found [duplicate]

爱⌒轻易说出口 提交于 2020-03-01 03:07:36
问题 This question already has answers here : clang/clang++ doesn't find C/C++ headers in windows? (3 answers) Closed 3 years ago . I have installed LLVM and Clang-3.9.0 on Win10. I have MinGW installed as well. I have put my C code in 'D:' drive. I can use gcc and g++ to compile my code. But when I use clang I get: clang -cc1 version 3.9.0 based upon LLVM 3.9.0 default target x86_64-pc-windows-msvc ignoring duplicate directory "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A" ignoring

在Linux CentOS 6.6上安装Python 2.7.9

纵然是瞬间 提交于 2020-03-01 02:02:26
编译CoreCLR需要Clang 3.5,而CentOS上安装的是Clang 3.4.2(yum repos中最新版也是这个),只能自己手工编译LLVM的源代码进行安装。 (注:CentOS的版本是6.6) 一、安装libstdc++4.7 (注:如果是CentOS 7.0,不需要这步) wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++ ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/ 如果不安装,在configure配置编译选项时会出现下面的错误提示: We detected a missing feature in the standard C++ library that was known to be missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous C++11 problems with 4.6's library, and

学习 LLVM(11) iplist 和 ilist

梦想与她 提交于 2020-02-29 13:51:15
位于 llvm/include/llvm/[[ADT]]/[[ilist.h]] 参见: * http://llvm.org/docs/ProgrammersManual.html#dss_ilist * [[ilist.h]], [[ilist]] * intrusive -- 侵入的、贯入的、打扰的、闯入的。 == 简介 == ilist/iplist 被称为是侵入式的(intrusive),原因在于它要求其模板参数类 T 里面提供有 next/prev 指针,并且实现 getNext(), setNext(), getPrev(), setPrev() 的函数。 ilist_iterator 模板类用于实现 ilist/iplist 的遍历。 其实现可看做是一个典型的 std list 容器类。参见 std。 <B>缺点</B>:需要 T 提供缺省构造,用于产生哨兵(sentinel)节点,及提供 getNext(), getPrev() 等函数用于访问 prev/next 节点。 iplist - list 容器的子集。可用于多态类,也即有一个公共基类 其保存 next/prev 指针。ilist 自身只是保存了一个链表 list 的头指针。 == 类概要 == <syntaxhighlight lang="cpp"> template<typename NodeTy,