llvm

LLVM compilation errors on VS 2012

寵の児 提交于 2019-12-20 03:13:54
问题 I have built the LLVM using CMake using VS 2012 in keeping with documentation. I am trying to build a toy compiler with flex, bison and LLVM. The final stage of my compiler my main class looks like this: #include <iostream> #include "codegen.h" #include "node.h" #include "llvm/Target/Targetmachine.h" using namespace std; extern int yyparse(); extern NBlock* programBlock; void createCoreFunctions(CodeGenContext& context); int main(int argc, char **argv) { yyparse(); std::cout << programBlock <

微信团队分享:极致优化,iOS版微信编译速度3倍提升的实践总结

你说的曾经没有我的故事 提交于 2019-12-20 00:57:35
1、引言 岁月真是个养猪场,这几年,人胖了,微信代码也翻了。 记得 14 年转岗来微信时,用自己笔记本编译微信工程才十来分钟。如今用公司配的 17 年款 27-inch iMac 编译要接近半小时;偶然间更新完代码,又莫名其妙需要全新编译。在这么低的编译效率下,开发心情受到严重影响。 于是年初我向上头请示,优化微信编译效率,上头也同意了。 学习交流: - 即时通讯/推送技术开发交流5群: 215477170 [推荐] - 移动端IM开发入门文章:《 新手入门一篇就够:从零开发移动端IM 》 (本文同步发布于: http://www.52im.net/thread-2873-1-1.html ) 2、相关文章 《 微信团队分享:微信移动端的全文检索多音字问题解决方案 》 《 微信团队分享:iOS版微信的高性能通用key-value组件技术实践 》 《 微信团队分享:iOS版微信是如何防止特殊字符导致的炸群、APP崩溃的? 》 《 微信团队原创分享:iOS版微信的内存监控系统技术实践 》 《 iOS后台唤醒实战:微信收款到账语音提醒技术总结 》 《 微信团队分享:微信Android版小视频编码填过的那些坑 》 《 微信手机端的本地数据全文检索优化之路 》 《 微信团队披露:微信界面卡死超级bug“15。。。。”的来龙去脉 》 《 微信客户端团队负责人技术访谈

微信团队分享:极致优化,iOS版微信编译速度3倍提升的实践总结

╄→尐↘猪︶ㄣ 提交于 2019-12-20 00:41:09
1、引言 岁月真是个养猪场,这几年,人胖了,微信代码也翻了。 记得 14 年转岗来微信时,用自己笔记本编译微信工程才十来分钟。如今用公司配的 17 年款 27-inch iMac 编译要接近半小时;偶然间更新完代码,又莫名其妙需要全新编译。在这么低的编译效率下,开发心情受到严重影响。 于是年初我向上头请示,优化微信编译效率,上头也同意了。 学习交流: - 即时通讯/推送技术开发交流5群: 215477170 [推荐] - 移动端IM开发入门文章:《 新手入门一篇就够:从零开发移动端IM 》 (本文同步发布于: http://www.52im.net/thread-2873-1-1.html ) 2、相关文章 《 微信团队分享:微信移动端的全文检索多音字问题解决方案 》 《 微信团队分享:iOS版微信的高性能通用key-value组件技术实践 》 《 微信团队分享:iOS版微信是如何防止特殊字符导致的炸群、APP崩溃的? 》 《 微信团队原创分享:iOS版微信的内存监控系统技术实践 》 《 iOS后台唤醒实战:微信收款到账语音提醒技术总结 》 《 微信团队分享:微信Android版小视频编码填过的那些坑 》 《 微信手机端的本地数据全文检索优化之路 》 《 微信团队披露:微信界面卡死超级bug“15。。。。”的来龙去脉 》 《 微信客户端团队负责人技术访谈

微信团队分享:极致优化,iOS版微信编译速度3倍提升的实践总结

时光怂恿深爱的人放手 提交于 2019-12-19 21:13:23
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1、引言 岁月真是个养猪场,这几年,人胖了,微信代码也翻了。 记得 14 年转岗来微信时,用自己笔记本编译微信工程才十来分钟。如今用公司配的 17 年款 27-inch iMac 编译要接近半小时;偶然间更新完代码,又莫名其妙需要全新编译。在这么低的编译效率下,开发心情受到严重影响。 于是年初我向上头请示,优化微信编译效率,上头也同意了。 2、现有方案 在动手之前,先搜索目前已有方案,大概情况如下。 2.1 优化工程配置 1)将 Debug Information Format 改为 DWARF: Debug 时是不需要生成符号表,可以检查一下子工程(尤其开源库)有没有设置正确。 2)将 Build Active Architecture Only 改为 Yes: Debug 时是不需要生成全架构,可以检查一下子工程(尤其开源库)有没有设置正确。 3)优化头文件搜索路径: 避免工程 Header Search Paths 设置了路径递归引用: Xcode 编译源文件时,会根据 Header Search Paths 自动添加 -I 参数,如果递归引用的路径下子目录越多,-I 参数也越多,编译器预处理头文件效率就越低,所以不能简单的设置路径递归引用。同样 Framework Search Paths 也类似处理。

Why is Clang automatically adding attributes to my functions?

。_饼干妹妹 提交于 2019-12-19 09:49:43
问题 I have a piece of code that I'm trying to turn into LLVM bitcode: int main() { volatile double n = 0.45; for (int j = 0; j < 32; j++) { n *= j; } return 0; } I run the following command on it: clang -O0 -S -emit-llvm TrainingCode/trainingCode.cpp -o TrainingCode/trainingCode.ll to generate the following LLVM bitcode (take note of the 6th line, the one with "Function Attrs"): ; ModuleID = 'TrainingCode/trainingCode.cpp' source_filename = "TrainingCode/trainingCode.cpp" target datalayout = "e-m

Xcode 7 command failed due to signal: illegal instruction 4

旧时模样 提交于 2019-12-19 06:44:28
问题 I just used Xcode 7's migration tool to migrate a project from Swift 1.2 to 2. After fixing up errors missed and such, all is well except for an error which prevents me from even building: Command failed due to signal: illegal instruction 4. I have tried the help in these articles (Xcode 7 and Swift 2.0 : Command failed due to signal: Abort trap: 6, and Command failed due to signal: Abort trap: 6) which are not identical issues to mine, but nevertheless they were not able to fix the issue. I

Why isn't __clang__ defined when using LLVM+Clang in Visual Studio?

余生长醉 提交于 2019-12-19 06:37:18
问题 I installed LLVM for Windows, which includes Clang and a few other tools. It integrates with Visual Studio, and even lets me choose a "Platform Toolset" in the project properties. However, when I choose any of the toolsets that came with LLVM, __clang__ isn't defined, and _MSC_VER is defined instead. How do I make __clang__ defined when using LLVM and Clang in Visual Studio? My Visual Studio version is the 2015 Preview (however I have also tested on 2013 with no success either), and my LLVM

Difference in stringstream behavior for void* type using libc++ and libstdc++

隐身守侯 提交于 2019-12-19 06:19:43
问题 The following test program returns different results depending on whether I'm using libc++ or libstdc++. #include <sstream> #include <iostream> int main() { int a = 0; void* optr = &a; void* iptr; std::stringstream ss; ss << optr; std::cout << ss.str() << '\n'; ss >> iptr; std::cout << iptr << '\n'; return 0; } I'm using the following version of clang from Xcode 5 on OSX 10.9.2 $ xcrun clang++ --version Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple

LLVM insert pthread function calls into IR

↘锁芯ラ 提交于 2019-12-19 04:12:25
问题 I'm writing a LLVM pass (it's a LoopPass ) that needs to insert pthread functions calls like pthread_create() and pthread_join() into the IR. I know how to create and insert a function call into IR, but I am having trouble to get the pthread representation of Function* in LLVM. Here's what I have: Function *pthread_create_func = currentModule->getFunction("pthread_create"); but it returns NULL. As a comparison Function *printf_func = currentModule->getFunction("printf"); will return the

how to compile CUDA to llvm IR?

百般思念 提交于 2019-12-19 04:09:10
问题 I've been trying for three days to compile a CUDA kernel into llvm IR and I couldn't do it. I've changed langoptions.cpp and added CUDA=1; in the constructor , but still the clang give me Error messages for cuda syntax (like _synchthreads() call). I've done the following: downloaded llvm (including clang) modified langoptions.cpp (CUDA=1; in the constructor), and installed it. installed CUDA toolkit 4.1 and CUDA SDK. compiled a CUDA example using clang using: clang -I${CUDA_HOME}/include -I$