This is an archive of the discontinued LLVM Phabricator instance.

[clangd][QueryDriver] Use language from underlying database if possible
ClosedPublic

Authored by kadircet on Jul 10 2019, 7:02 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

kadircet created this revision.Jul 10 2019, 7:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2019, 7:02 AM
sammccall accepted this revision.Jul 11 2019, 5:43 AM
sammccall added inline comments.
clang-tools-extra/clangd/QueryDriverDatabase.cpp
121 ↗(On Diff #208949)

does gcc accept the same set of -x flags?

This revision is now accepted and ready to land.Jul 11 2019, 5:43 AM
kadircet marked an inline comment as done.Jul 11 2019, 5:57 AM
kadircet added inline comments.
clang-tools-extra/clangd/QueryDriverDatabase.cpp
121 ↗(On Diff #208949)

It seems to be the case. Relevant section of manpage for gcc:

You can specify the input language explicitly with the -x option:

-x language
    Specify explicitly the language for the following input files
    (rather than letting the compiler choose a default based on the
    file name suffix).  This option applies to all following input
    files until the next -x option.  Possible values for language
    are:

            c  c-header  cpp-output
            c++  c++-header  c++-cpp-output
            objective-c  objective-c-header  objective-c-cpp-output
            objective-c++ objective-c++-header objective-c++-cpp-output
            assembler  assembler-with-cpp
            ada
            d
            f77  f77-cpp-input f95  f95-cpp-input
            go
            brig
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2019, 6:49 AM