[PATCH] D54547: PTH-- Remove feature entirely-

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 14 14:37:52 PST 2018


erichkeane created this revision.
erichkeane added reviewers: aaron.ballman, jyknight, rsmith, chandlerc, bkramer.
Herald added a subscriber: mgorny.

When debugging a boost build with a modified
version of Clang, I discovered that the PTH implementation
stores TokenKind in 8 bits. However, we currently have 368
TokenKinds.

The result is that the value gets truncated and the wrong token
gets picked up when including PTH files.  It seems that this will
go wrong every time someone uses a token that uses the 9th bit.

Upon asking on IRC, it was brought up that this was a highly 
experimental features that was considered a failure.  I discovered
via googling that BoostBuild (mostly Boost.Math) is the only user of this
feature, using the CC1 flag directly.  I believe that this can be
transferred over to normal PCH with minimal effort:
https://github.com/boostorg/build/issues/367

Based on advice on IRC and research showing that this is a nearly
completely unused feature, this patch removes it entirely.

Note: I considered leaving the build-flags in place and making them
emit an error/warning, however since I've basically identified and 
warned the only user, it seemed better to just remove them.


Repository:
  rC Clang

https://reviews.llvm.org/D54547

Files:
  NOTES.txt
  docs/InternalsManual.rst
  docs/PTHInternals.rst
  include/clang/Basic/DiagnosticFrontendKinds.td
  include/clang/Basic/DiagnosticLexKinds.td
  include/clang/Driver/CC1Options.td
  include/clang/Driver/Driver.h
  include/clang/Driver/Options.td
  include/clang/Frontend/FrontendActions.h
  include/clang/Frontend/FrontendOptions.h
  include/clang/Frontend/Utils.h
  include/clang/Lex/PTHLexer.h
  include/clang/Lex/PTHManager.h
  include/clang/Lex/Preprocessor.h
  include/clang/Lex/PreprocessorOptions.h
  lib/ARCMigrate/ARCMT.cpp
  lib/Driver/Driver.cpp
  lib/Driver/ToolChains/Clang.cpp
  lib/Frontend/CMakeLists.txt
  lib/Frontend/CacheTokens.cpp
  lib/Frontend/ChainedIncludesSource.cpp
  lib/Frontend/CompilerInstance.cpp
  lib/Frontend/CompilerInvocation.cpp
  lib/Frontend/FrontendActions.cpp
  lib/Frontend/InitPreprocessor.cpp
  lib/FrontendTool/ExecuteCompilerInvocation.cpp
  lib/Lex/CMakeLists.txt
  lib/Lex/PPDirectives.cpp
  lib/Lex/PPLexerChange.cpp
  lib/Lex/PPMacroExpansion.cpp
  lib/Lex/PTHLexer.cpp
  lib/Lex/Pragma.cpp
  lib/Lex/Preprocessor.cpp
  lib/Serialization/ASTReader.cpp
  lib/Serialization/ASTWriter.cpp
  test/Driver/pth.c
  test/PCH/emit-pth.c
  test/PCH/pth.c
  test/Preprocessor/include-pth.c
  unittests/Tooling/DiagnosticsYamlTest.cpp
  unittests/Tooling/RefactoringActionRulesTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54547.174103.patch
Type: text/x-patch
Size: 112295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181114/a9746fea/attachment-0001.bin>


More information about the cfe-commits mailing list