[TranslationUnitPatcher] Throws exception when unexpected dumper results
@@ -19,7 +19,6 @@ import pt.up.fe.specs.util.utilities.LineStream;
public class ErrorWorker implements LineStreamWorker<TUErrorsData> {
-
@Override
public String getId() {
return "<Clang Error>";
@@ -43,13 +42,24 @@ public class ErrorWorker implements LineStreamWorker<TUErrorsData> {
String argKind = "", argValue = "";
argKind = lineStream.nextLine();
argValue = lineStream.nextLine();
+
+ // System.out.println("ARG KIND 1: " + argKind);
+ // System.out.println("ARG VALUE 1: " + argValue);
+
while (!(argKind.equals("<Clang Error End>"))) {
error.get(TUErrorData.MAP).put(argKind, argValue);
argKind = lineStream.nextLine();
argValue = lineStream.nextLine();
+
+ // System.out.println("ARG KIND: " + argKind);
+ // System.out.println("ARG VALUE: " + argValue);
+
if (argValue == null || argValue.equals("<Clang Error End>")) {
- System.out.println("Warning: There is something wrong with the messages in llvm::errs()");
- break;
+ throw new RuntimeException(
+ "There is something wrong with the messages in llvm::errs(). Arg value: " + argValue);
+ // System.out.println(
+ // "Warning: There is something wrong with the messages in llvm::errs(). Arg value: " + argValue);
+ // break;
}
}
}
