2009-06-07 07:08:01 +00:00
|
|
|
//===--- Main.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open
|
|
|
|
// Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2009-07-07 16:39:33 +00:00
|
|
|
// Usually this file just includes CompilerDriver/Main.inc, but here we apply
|
2009-07-09 19:37:58 +00:00
|
|
|
// some trickery to make the built-in '-save-temps' option hidden and enable
|
|
|
|
// '--temp-dir' by default.
|
2009-06-07 07:08:01 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-07-07 16:39:33 +00:00
|
|
|
#include "llvm/CompilerDriver/BuiltinOptions.h"
|
|
|
|
#include "llvm/CompilerDriver/ForceLinkage.h"
|
2009-07-11 17:35:46 +00:00
|
|
|
#include "llvm/System/Path.h"
|
2009-07-07 16:39:33 +00:00
|
|
|
|
|
|
|
namespace llvmc {
|
|
|
|
int Main(int argc, char** argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
|
|
|
|
// HACK
|
|
|
|
SaveTemps.setHiddenFlag(llvm::cl::Hidden);
|
2009-07-09 18:09:26 +00:00
|
|
|
TempDirname = "tmp-objs";
|
2009-07-07 16:39:33 +00:00
|
|
|
|
2009-07-11 17:35:46 +00:00
|
|
|
// Remove the temp dir if already exists.
|
|
|
|
llvm::sys::Path tempDir;
|
|
|
|
tempDir = TempDirname;
|
|
|
|
tempDir.eraseFromDisk(true);
|
|
|
|
|
2009-07-07 16:39:33 +00:00
|
|
|
llvmc::ForceLinkage();
|
|
|
|
return llvmc::Main(argc, argv);
|
|
|
|
}
|