Don't try to guess the language from given arguments
ClosedPublic

Authored by aaronpuchert on Oct 15 2017, 8:31 PM.

Details

Summary

Before this change, the compiler provider looked up the arguments for a
given language, and passed those to the compiler, where the language was
guessed from the arguments.

Instead we now pass the language together with the arguments into the
function, and no more guessing is needed. Besides being cleaner, it may
not always be possible to guess the language from the given arguments
anyway.

Diff Detail

Repository
R32 KDevelop
Branch
dont-guess-language
Lint
No Linters Available
Unit
No Unit Test Coverage
aaronpuchert created this revision.Oct 15 2017, 8:31 PM

Added language flag for Objective C.

apol added a subscriber: apol.Oct 15 2017, 10:31 PM

Makes sense I guess, but I'm not sure what we get...

plugins/custom-definesandincludes/compilerprovider/icompiler.h
42

Make Other the first, this way you don't have to add this random = 100 there if you want.

plugins/custom-definesandincludes/compilerprovider/tests/test_compilerprovider.cpp
127

why did you remove 1 of de dashes?

mwolff accepted this revision.Oct 16 2017, 8:21 AM
mwolff added a subscriber: mwolff.

lgtm

plugins/custom-definesandincludes/compilerprovider/tests/test_compilerprovider.cpp
127

both man clang and man gcc use this form, and above we also use this form. So I think this change is fine, but should go to a separate patch (commit it directly)

This revision is now accepted and ready to land.Oct 16 2017, 8:21 AM

I don't have commit access yet, so could you commit this for me?

plugins/custom-definesandincludes/compilerprovider/icompiler.h
42

Not a bad idea, but I wanted to leave the enumeration the same for now.

what is your email address, that we can use to associate this commit with you?

If you run arc patch D8317 locally, you should get the commit with all necessary information, including my email address.

This revision was automatically updated to reflect the committed changes.
kfunk added a subscriber: kfunk.Nov 4 2017, 5:12 PM

@aaronpuchert Apparently this Diff here is causing problems in the QML/JS plugin: https://bugs.kde.org/show_bug.cgi?id=386388 -- please check.

Somehow I can't find you (or your email address in Bugzilla)

I know that there is a problem, see the discussion on change D8634. The problem is that I'm not sure how to proceed: when do we encounter Utils::Other, and what do we do about it? The Clang Parser can probably not parse a file of type Utils::Other anyway.

I didn't have an account on Bugzilla, that is fixed.

plugins/custom-definesandincludes/compilerprovider/gcclikecompiler.cpp
54 ↗(On Diff #20820)

Clang can't really parse Utils::Other files, so there is nothing reasonable we can do here.

Of course we can fix that particular bug by returning an empty string instead.