diff options
Diffstat (limited to 'clang/lib/AST/JSONNodeDumper.cpp')
-rw-r--r-- | clang/lib/AST/JSONNodeDumper.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/AST/JSONNodeDumper.cpp b/clang/lib/AST/JSONNodeDumper.cpp index ae585de..87e4255 100644 --- a/clang/lib/AST/JSONNodeDumper.cpp +++ b/clang/lib/AST/JSONNodeDumper.cpp @@ -1692,3 +1692,18 @@ void JSONNodeDumper::visitVerbatimLineComment( const comments::VerbatimLineComment *C, const comments::FullComment *) { JOS.attribute("text", C->getText()); } + +llvm::json::Object JSONNodeDumper::createFPOptions(FPOptionsOverride FPO) { + llvm::json::Object Ret; +#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \ + if (FPO.has##NAME##Override()) \ + Ret.try_emplace(#NAME, static_cast<unsigned>(FPO.get##NAME##Override())); +#include "clang/Basic/FPOptions.def" + return Ret; +} + +void JSONNodeDumper::VisitCompoundStmt(const CompoundStmt *S) { + VisitStmt(S); + if (S->hasStoredFPFeatures()) + JOS.attribute("fpoptions", createFPOptions(S->getStoredFPFeatures())); +} |