[PATCH] D107304: [clangd][query-driver] Extract GCC version from the driver output

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 2 12:53:43 PDT 2021


ArcsinX created this revision.
ArcsinX added reviewers: sammccall, kadircet.
Herald added subscribers: usaxena95, arphaman.
ArcsinX requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

Clang uses 4.2.1 as a default GCC version.
For projects that rely on the GCC version, this can be a problem, e.g.

  #if __GNUC__ < 5
  #error "Incompatible compiler"
  #endif

This patch extracts the GCC version from the driver output and adds -fgnuc-version=<extracted version> compile option to unsure that the values of GCC macros are correct.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107304

Files:
  clang-tools-extra/clangd/QueryDriverDatabase.cpp
  clang-tools-extra/clangd/test/system-include-extractor.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107304.363551.patch
Type: text/x-patch
Size: 4629 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210802/0c187d17/attachment.bin>


More information about the cfe-commits mailing list