[PATCH] D110278: Adding doWithCleanup abstraction

2021-09-30 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/Frontend/FrontendAction.cpp:553-565 + bool HasBegunSourceFile = false; + std::function Operation = [&]() { +return BeginSourceFileImpl(CI, RealInput, HasBegunSourceFile); + }; + std::function Cleanup = [&]() { +if

[PATCH] D110278: Adding doWithCleanup abstraction

2021-09-22 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added reviewers: lhames, dblaikie. Herald added subscribers: dexonsmith, mgorny. beanz requested review of this revision. Herald added projects: clang, LLVM. This patch adds a new `doWithCleanup` abstraction to LLVM that works with `llvm::Error`, `int`, `bool`, a