D8634: Custom defines/includes: Improve handling of parser arguments

Aaron Puchert noreply at phabricator.kde.org
Fri Nov 3 02:05:56 UTC 2017


aaronpuchert created this revision.
aaronpuchert added a reviewer: KDevelop.

REVISION SUMMARY
  This fixes numerous bugs:
  
  - Parser arguments for OpenCL and Cuda were not persisted.
  - OpenCL standards are defined via -cl-std=, not -std=. That broke some assumptions.
  - Custom arguments were detected (regardless of the actual language) by replacing the standard with c++11 and comparing against the default arguments for C++. This accidentally worked, but will fail if someone changes the default arguments.
  
  Most of the hacks were left in place to keep the changes small, though
  I'd argue that a proper solution needs to be found for most if the
  issues.
  
  To make the handling of parser arguments easier, I tried to use the
  existing Utils::LanguageType enumeration as often as possible. Instead
  of initializing the ParserArguments with an aggregate, I assigned the
  arguments for each language separately to ensure there are no mix-ups in
  the order.
  
  I'm not very fond of the ParserArguments class/struct-hybrid, but I'm
  not quite sure in which direction to go there.
  
  Although KDevelop itself runs fine with these changes, there are some
  problems in the TestDefinesAndIncludes, where the parser arguments,
  includes or defines on an inode/directory are queried. But what are
  these supposed to be? Directories can't be compiled.

REPOSITORY
  R32 KDevelop

BRANCH
  parser-arguments

REVISION DETAIL
  https://phabricator.kde.org/D8634

AFFECTED FILES
  plugins/custom-definesandincludes/compilerprovider/compilerprovider.cpp
  plugins/custom-definesandincludes/compilerprovider/settingsmanager.cpp
  plugins/custom-definesandincludes/compilerprovider/settingsmanager.h
  plugins/custom-definesandincludes/definesandincludesmanager.cpp
  plugins/custom-definesandincludes/kcm_widget/parserwidget.cpp
  plugins/custom-definesandincludes/kcm_widget/projectpathsmodel.cpp

To: aaronpuchert, #kdevelop
Cc: kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20171103/07e4b679/attachment.html>


More information about the KDevelop-devel mailing list