#include "llvm/CodeGen/LinkAllAsmWriterComponents.h"
#include "llvm/CodeGen/LinkAllCodegenComponents.h"
#include "llvm/Config/config.h"
-#include "llvm/LinkAllVMCore.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/PluginLoader.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/System/Host.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Target/TargetSelect.h"
-#include "llvm/Transforms/Scalar.h"
#include <memory>
using namespace llvm;
static cl::opt<std::string>
OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"));
-static cl::opt<bool>
-Force("f", cl::desc("Enable binary output on terminals"));
-
// Determine optimization level.
static cl::opt<char>
OptLevel("O",
return outputFilename;
}
-static formatted_raw_ostream *GetOutputStream(const char *TargetName,
+static formatted_raw_ostream *GetOutputStream(const char *TargetName,
+ Triple::OSType OS,
const char *ProgName) {
if (OutputFilename != "") {
if (OutputFilename == "-")
OutputFilename += ".s";
break;
case TargetMachine::CGFT_ObjectFile:
- OutputFilename += ".o";
+ if (OS == Triple::Win32)
+ OutputFilename += ".obj";
+ else
+ OutputFilename += ".o";
Binary = true;
break;
case TargetMachine::CGFT_Null:
// Initialize targets first, so that --version shows registered targets.
InitializeAllTargets();
InitializeAllAsmPrinters();
+ InitializeAllAsmParsers();
cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
TargetMachine &Target = *target.get();
// Figure out where we are going to send the output...
- formatted_raw_ostream *Out = GetOutputStream(TheTarget->getName(), argv[0]);
+ formatted_raw_ostream *Out = GetOutputStream(TheTarget->getName(),
+ TheTriple.getOS(), argv[0]);
if (Out == 0) return 1;
CodeGenOpt::Level OLvl = CodeGenOpt::Default;