[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

Melanie Blower via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 11:55:37 PST 2020


mibintc marked an inline comment as done.
mibintc added inline comments.


================
Comment at: clang/lib/Parse/ParsePragma.cpp:2537
+    if (!Actions.CurContext->isTranslationUnit()) {
+//FIXME this seems to be the wrong way to check file-scope
+//since the token immediately following a function definition
----------------
sepavloff wrote:
> Probably using `Actions.getCurScope()` can help to recognize file scope.
Thanks for the suggestion, I (Actions.getCurScope()==0) to test for file scope, but that didn't work either. I put a workaround into the test case CodeGen/fp-floatcontrol-pragma.cpp, the forward class declaration ResetTUScope. If the reset is there, then the pragma is recognized to be at file scope. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72841





More information about the llvm-commits mailing list