Review Request 121777: Make it possible to change language standard for the parser

Milian Wolff mail at milianw.de
Thu Jan 15 21:58:23 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121777/#review74104
-----------------------------------------------------------


All of this makes me wonder whether we are overdesigning this feature. Wouldn't it be enough to add a simple line edit to let the user add/customize the command line passed to the compiler? Then he could chose whatever he wants there and we don't need most of this code, nor need to add fancy auto detection or anything like it?


languages/plugins/custom-definesandincludes/compilerprovider/compilerfactories.cpp
<https://git.reviewboard.kde.org/r/121777/#comment51467>

    Here, we _know_ that this is true, no? We just created the compiler after all... these conditionals should not be required.
    
    Rather, I expect this to be something like
    
        auto cpp11 = createCompiler(QStringLiteral("Clang c++11"), QStringLiteral("clang"), false);
        cpp11->setLanguageStandard(QStringLiteral("c++11"));
        provider->registerCompiler(cpp11);
    
        auto c99 = createCompiler(...);
        c99->setLanguageStandard(...);
        provider->registerCompiler(c99);
    
    similar below for the other compilers.
    
    Or, if you really want to auto-detect the supported standards from the compiler, make/add a static ClangCompiler::supportedStandards.
    
    I really dislike how you create a compiler to return the static list of standards.



languages/plugins/custom-definesandincludes/compilerprovider/gcclikecompiler.cpp
<https://git.reviewboard.kde.org/r/121777/#comment51468>

    please use
    
        return languageStandards().key(standard, CompilerStandard::DEFAULT);
    
    the warning is not so helpful, or is it?



languages/plugins/custom-definesandincludes/compilerprovider/gcclikecompiler.cpp
<https://git.reviewboard.kde.org/r/121777/#comment51469>

    here and below: QStringLiteral


- Milian Wolff


On Jan. 9, 2015, 10:53 a.m., Sergey Kalinichev wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121777/
> -----------------------------------------------------------
> 
> (Updated Jan. 9, 2015, 10:53 a.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdevelop
> 
> 
> Description
> -------
> 
> Now we can choose different language standards for computing standard include directories/defined macros. 
> Also this feature is very useful for the kdev-clang plugin (Now it's possible to parse plain C projects).
> 
> 
> Diffs
> -----
> 
>   languages/plugins/custom-definesandincludes/compilerprovider/compilerfactories.h 00042fb 
>   languages/plugins/custom-definesandincludes/compilerprovider/compilerfactories.cpp 8d47690 
>   languages/plugins/custom-definesandincludes/compilerprovider/compilerprovider.cpp 3643e78 
>   languages/plugins/custom-definesandincludes/compilerprovider/gcclikecompiler.h 079b78d 
>   languages/plugins/custom-definesandincludes/compilerprovider/gcclikecompiler.cpp bc99d8d 
>   languages/plugins/custom-definesandincludes/compilerprovider/icompiler.h 3627ebd 
>   languages/plugins/custom-definesandincludes/compilerprovider/icompiler.cpp 0bf6a44 
>   languages/plugins/custom-definesandincludes/compilerprovider/icompilerfactory.h 3849bcb 
>   languages/plugins/custom-definesandincludes/compilerprovider/msvccompiler.h a59a6b7 
>   languages/plugins/custom-definesandincludes/compilerprovider/msvccompiler.cpp fcd9db7 
>   languages/plugins/custom-definesandincludes/compilerprovider/settingsmanager.cpp 229f456 
>   languages/plugins/custom-definesandincludes/kcm_widget/compilerswidget.cpp aebbf5a 
>   languages/plugins/custom-definesandincludes/kcm_widget/compilerswidget.ui 0c90cee 
>   languages/plugins/custom-definesandincludes/kcm_widget/projectpathswidget.ui 3e413b3 
> 
> Diff: https://git.reviewboard.kde.org/r/121777/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sergey Kalinichev
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20150115/66784a96/attachment-0001.html>


More information about the KDevelop-devel mailing list