================ @@ -29,6 +31,18 @@ class SValExplainer : public FullSValVisitor<SValExplainer, std::string> { ASTContext &ACtx; ProgramStateRef State; + std::string printCFGElementRef(const CFGBlock::ConstCFGElementRef ElemRef) { + std::string Str; + llvm::raw_string_ostream OS(Str); + ElemRef->dumpToStream(OS); + // HACK: `CFGBlock::ConstCFGElementRef::dumpToStream` contains a new line + // character in the end of the string, we don't want it so we remove it here. + while (!Str.empty() && std::isspace(Str.back())) { ---------------- isuckatcs wrote:
`std::isspace` is dependant on the local, so I would advise against using it. Also don't we have a builtin `trim()` function in LLVM, which can be used here? https://github.com/llvm/llvm-project/pull/128251 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits