[PATCH] D53866: [Preamble] Fix preamble for circular #includes

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 4 00:53:37 PST 2018


ilya-biryukov added inline comments.


================
Comment at: include/clang/Lex/Preprocessor.h:391
   } PreambleConditionalStack;
+  bool PreambleGenerationFailed = false;
 
----------------
There's a mechanism to handle preamble with errors, see `PreprocessorOpts::AllowPCHWithCompilerErrors`.
Maybe rely on it and avoid adding a different one?


================
Comment at: lib/Lex/PPDirectives.cpp:1945
+    // Generate a fatal error to skip further processing.
+    Diag(FilenameTok.getLocation(), diag::err_pp_error_opening_file) << ""
+                                                                     << "";
----------------
Maybe add a new error or find a more appropriate existing one to reuse?
"Error opening file", especially without any arguments does not provide enough context to figure out what went wrong.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D53866/new/

https://reviews.llvm.org/D53866





More information about the cfe-commits mailing list