aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mutator-lvl0.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/mutator-lvl0.cpp b/mutator-lvl0.cpp
index 2f16974..37ecde0 100644
--- a/mutator-lvl0.cpp
+++ b/mutator-lvl0.cpp
@@ -60,6 +60,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*
#include "clang/Rewrite/Core/Rewriter.h"
/*LLVM headers*/
#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/APInt.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/IR/Function.h"
@@ -8433,8 +8434,25 @@ int main(int argc, const char **argv)
IsThereJunkPreInclusion ITJPIInstance;
ITJPIInstance.Check(SourcePathList);
+
+ int RunResult = 0;
- int RunResult = Tool.run(newFrontendActionFactory<MyFrontendAction>().get());
+ try
+ {
+ RunResult = Tool.run(newFrontendActionFactory<MyFrontendAction>().get());
+ }
+ catch (MutExHeaderNotFound &E1)
+ {
+ std::cerr << E1.what() << "\n";
+ }
+ catch (std::domain_error &E2)
+ {
+ std::cerr << E2.what() << "\n";
+ }
+ catch(...)
+ {
+ std::cerr << "Unexpected exception!\n";
+ }
CheckForNullStatements CheckForNull;
@@ -8446,16 +8464,6 @@ int main(int argc, const char **argv)
JSONDocOUT.CloseReport();
- try {}
- catch (MutExHeaderNotFound &E1)
- {
- std::cerr << E1.what() << "\n";
- }
- catch (std::domain_error &E2)
- {
- std::cerr << E2.what() << "\n";
- }
-
return RunResult;
}
/*last line intentionally left blank.*/