[PATCH] D124004: Define __FLT_EVAL_METHOD__ when input source is stdin.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 09:51:21 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/lib/Frontend/FrontendAction.cpp:845-855
+  if (Input.isFile() && Input.getFile() == "-") {
+    Preprocessor &PP = CI.getPreprocessor();
+    std::string PredefineBuffer;
+    PredefineBuffer.reserve(4080);
+    llvm::raw_string_ostream Predefines(PredefineBuffer);
+    Predefines << PP.getPredefines();
+    MacroBuilder Builder(Predefines);
----------------
I'm confused as to why we want to predefine this macro *only* when the input source is stdin? So I'm not certain I understand why this change is desired.

e.g., https://godbolt.org/z/E8Y67381r (note how there's no `__FLT_EVAL_METHOD__` defined there)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124004



More information about the cfe-commits mailing list