gccsense vs.clang_complete [英] gccsense vs. clang_complete

查看:247
本文介绍了gccsense vs.clang_complete的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用omniCppComplete + ctags一段时间,想要进一步改进代码完成。

I've been using omniCppComplete + ctags for a while, and want to make a further improvement on the code completion.

根据这里的建议[ a href =http://vim.wikia.com/wiki/C++_code_completion> 1 ],gccsense和clang_complete似乎是替代品。但是,我不知道哪一个更好。

谢谢!

According to the suggestion in here [1], gccsense and clang_complete seems to be alternatives. However, I am not sure which one is better. Any idea on their performance?
Thanks!

更新:我尝试clang_complete后,发现完成速度极其不可接受。
然后我尝试使用libclang.dylib,这加快了很多,但仍然使一个感觉滞后。
现在我应该坚持使用ctags。

Update: After I tried clang_complete, I found the completion speed extremely unacceptable. I then tried it using libclang.dylib, which speeds up a lot but still make one feels lagging. I think I should stick to ctags for now.

推荐答案

你应该使用clang_complete,而不是gccsense。

You should probably use clang_complete, not gccsense.

这里的要点是两者的架构。这两个解决方案背后的想法是非常相似的:你不能获得正常的C ++完成没有访问内部编译器(gcc)信息(抽象语法树),而gcc不提供给你足够的接口。访问这个信息的实现部分是非常不同的在这里:gccsense是一种黑客 - 这是一个gcc的自定义构建能够存储的必要信息为提供它插件,而clang_complete另一种方式使用替代编译器:clang,其创建的主要目标之一正是使外部工具易于访问AST。

The main point here is the architecture of the two. The idea behind both solutions is very similar: you can't get normal C++ completion without access to internal compiler (gcc) information (Abstract Syntax Tree) while gcc doesn't provide you with sufficient interfaces for that. The implementation part of accessing this info though is quite different here: gccsense is a kind of "hack" - it's a custom build of gcc capable for storing the neccessary info for futher providing it to plugin, while clang_complete goes the other way by using alternative compiler: clang, one of the main goals of creation of which was exactly making AST easily accessible by external tools.

因此,在使用gccsense的情况下,你需要编译你的代码与一种自定义的gcc编译器,这已经有点过时了(gccsense使用gcc 4.4)现在和将不断需要开发人员的支持功能。相反,clang_complete不依赖于clang编译器,它使用它作为外部工具。

So, in case of using gccsense you'll need to compile your code with a kind of custom gcc compiler, which is already a little bit outdated (gccsense is using gcc 4.4) now and will constantly need developer's support in feature. On the contrary, clang_complete doesn't depend so much on clang compiler, it uses it as external tool.

至于性能:clang设计得比gcc更快。 Clang_complete在Windows上可能比MacOS / Linux稍慢,但gccsense甚至不能在Windows时编译。

As for performance: again clang was designed to be faster than gcc and it is. Clang_complete can be slightly slower on Windows than on MacOS/Linux, however gccsense can't even be compiled for Windows at the time.

这篇关于gccsense vs.clang_complete的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆