//
//===----------------------------------------------------------------------===//
+#include "llvm/CompilerDriver/AutoGenerated.h"
#include "llvm/CompilerDriver/BuiltinOptions.h"
#include "llvm/CompilerDriver/CompilationGraph.h"
#include "llvm/CompilerDriver/Error.h"
-#include "llvm/CompilerDriver/Plugin.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/System/Path.h"
+#include "llvm/Support/Path.h"
#include <sstream>
#include <string>
return 0;
}
else if (SaveTemps == SaveTempsEnum::Obj && !OutputFilename.empty()) {
- tempDir = OutputFilename;
- tempDir = tempDir.getDirname();
+ tempDir = sys::path::parent_path(OutputFilename);
}
else {
// SaveTemps == Cwd --> use current dir (leave tempDir empty).
return 0;
}
- if (!tempDir.exists()) {
+ bool Exists;
+ if (llvm::sys::fs::exists(tempDir.str(), Exists) || !Exists) {
std::string ErrMsg;
if (tempDir.createDirectoryOnDisk(true, &ErrMsg)) {
PrintError(ErrMsg);
return 0;
}
- /// BuildTargets - A small wrapper for CompilationGraph::Build. Returns non-zero value
+ /// BuildTargets - A small wrapper for CompilationGraph::Build. Returns
+ /// non-zero value in case of error.
int BuildTargets(CompilationGraph& graph, const LanguageMap& langMap) {
int ret;
sys::Path tempDir;
*GlobalTimeLog << "# " << cmd << ' ' << time << '\n';
}
-// Sometimes plugins want to condition on the value in argv[0].
+// Sometimes user code wants to access the argv[0] value.
const char* ProgramName;
int Main(int argc, char** argv) {
ProgramName = argv[0];
cl::ParseCommandLineOptions
- (argc, argv, "LLVM Compiler Driver (Work In Progress)",
+ (argc, argv,
+ /* Overview = */ "LLVM Compiler Driver (Work In Progress)",
/* ReadResponseFiles = */ false);
- PluginLoader Plugins;
- if (int ret = Plugins.RunInitialization(langMap, graph))
+ if (int ret = autogenerated::RunInitialization(langMap, graph))
return ret;
if (CheckGraph) {