#include "llvm/Assembly/Parser.h"
#include "llvm/Bytecode/Writer.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <fstream>
#include <string>
#include <memory>
}
Out = new std::ofstream(OutputFilename.c_str());
+ // Make sure that the Out file gets unlink'd from the disk if we get a
+ // SIGINT
+ RemoveFileOnSignal(OutputFilename);
}
}
#include "Support/DepthFirstIterator.h"
#include "Support/PostOrderIterator.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <fstream>
#include <iostream>
using std::cerr;
<< "': File exists! Sending to standard output.\n";
} else {
Out = new std::ofstream(OutputFilename.c_str());
+
+ // Make sure that the Out file gets unlink'd from the disk if we get a
+ // SIGINT
+ RemoveFileOnSignal(OutputFilename);
}
}
}
#include "llvm/Transforms/Scalar/PromoteMemoryToRegister.h"
#include "llvm/Bytecode/WriteBytecodePass.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <memory>
#include <fstream>
#include <string>
return 1;
}
+ // Make sure that the Out file gets unlink'd from the disk if we get a SIGINT
+ RemoveFileOnSignal(OutputFilename);
+
// In addition to just parsing the input from GCC, we also want to spiff it up
// a little bit. Do this now.
//
#include "llvm/Transforms/ConstantMerge.h"
#include "llvm/Transforms/IPO/GlobalDCE.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <fstream>
#include <memory>
#include <algorithm>
}
Passes.add(new WriteBytecodePass(&Out)); // Write bytecode to file...
+ // Make sure that the Out file gets unlink'd from the disk if we get a SIGINT
+ RemoveFileOnSignal(OutputFilename+".bc");
+
// Run our queue of passes all at once now, efficiently.
Passes.run(Composite.get());
Out.close();
#include "llvm/Bytecode/Writer.h"
#include "llvm/Module.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <fstream>
#include <memory>
#include <sys/types.h> // For FileExists
cerr << "Error opening '" << OutputFilename << "'!\n";
return 1;
}
+
+ // Make sure that the Out file gets unlink'd from the disk if we get a
+ // SIGINT
+ RemoveFileOnSignal(OutputFilename);
}
if (Verbose) cerr << "Writing bytecode...\n";
#include "llvm/Function.h"
#include "llvm/PassManager.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <memory>
#include <string>
#include <fstream>
return 1;
}
Out = new std::ofstream(OutputFilename.c_str());
+
+ // Make sure that the Out file gets unlink'd from the disk if we get a
+ // SIGINT
+ RemoveFileOnSignal(OutputFilename);
} else {
if (InputFilename == "-") {
OutputFilename = "-";
delete Out;
return 1;
}
+ // Make sure that the Out file gets unlink'd from the disk if we get a
+ // SIGINT
+ RemoveFileOnSignal(OutputFilename);
}
}
#include "llvm/Assembly/Parser.h"
#include "llvm/Bytecode/Writer.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <fstream>
#include <string>
#include <memory>
}
Out = new std::ofstream(OutputFilename.c_str());
+ // Make sure that the Out file gets unlink'd from the disk if we get a
+ // SIGINT
+ RemoveFileOnSignal(OutputFilename);
}
}
#include "llvm/Assembly/Parser.h"
#include "llvm/Bytecode/Writer.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <fstream>
#include <string>
#include <memory>
}
Out = new std::ofstream(OutputFilename.c_str());
+ // Make sure that the Out file gets unlink'd from the disk if we get a
+ // SIGINT
+ RemoveFileOnSignal(OutputFilename);
}
}
#include "Support/DepthFirstIterator.h"
#include "Support/PostOrderIterator.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <fstream>
#include <iostream>
using std::cerr;
<< "': File exists! Sending to standard output.\n";
} else {
Out = new std::ofstream(OutputFilename.c_str());
+
+ // Make sure that the Out file gets unlink'd from the disk if we get a
+ // SIGINT
+ RemoveFileOnSignal(OutputFilename);
}
}
}
#include "Support/DepthFirstIterator.h"
#include "Support/PostOrderIterator.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <fstream>
#include <iostream>
using std::cerr;
<< "': File exists! Sending to standard output.\n";
} else {
Out = new std::ofstream(OutputFilename.c_str());
+
+ // Make sure that the Out file gets unlink'd from the disk if we get a
+ // SIGINT
+ RemoveFileOnSignal(OutputFilename);
}
}
}
#include "llvm/Bytecode/Writer.h"
#include "llvm/Module.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <fstream>
#include <memory>
#include <sys/types.h> // For FileExists
cerr << "Error opening '" << OutputFilename << "'!\n";
return 1;
}
+
+ // Make sure that the Out file gets unlink'd from the disk if we get a
+ // SIGINT
+ RemoveFileOnSignal(OutputFilename);
}
if (Verbose) cerr << "Writing bytecode...\n";
#include "llvm/Transforms/Instrumentation/TraceValues.h"
#include "llvm/Transforms/Instrumentation/ProfilePaths.h"
#include "Support/CommandLine.h"
+#include "Support/Signals.h"
#include <fstream>
#include <memory>
cerr << "Error opening " << OutputFilename << "!\n";
return 1;
}
+
+ // Make sure that the Output file gets unlink'd from the disk if we get a
+ // SIGINT
+ RemoveFileOnSignal(OutputFilename);
}
// Create a PassManager to hold and optimize the collection of passes we are