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

Zahira Ammarguellat via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 10:14:13 PDT 2022


zahiraam added a subscriber: glandium.
zahiraam 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);
----------------
aaron.ballman wrote:
> 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)
I was offering a solution  to the issue raised by @glandium in https://reviews.llvm.org/D109239. I thought that the issue was only when the source is stdin, but obviously not.  The default setting should happen under no condition. 


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