Deleted Added
sdiff udiff text old ( 224133 ) new ( 226584 )
full compact
1//===-- llc.cpp - Implement the LLVM Native Code Generator ----------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 18 unchanged lines hidden (view full) ---

27#include "llvm/Support/Debug.h"
28#include "llvm/Support/FormattedStream.h"
29#include "llvm/Support/ManagedStatic.h"
30#include "llvm/Support/PluginLoader.h"
31#include "llvm/Support/PrettyStackTrace.h"
32#include "llvm/Support/ToolOutputFile.h"
33#include "llvm/Support/Host.h"
34#include "llvm/Support/Signals.h"
35#include "llvm/Target/TargetData.h"
36#include "llvm/Target/TargetMachine.h"
37#include "llvm/Target/TargetRegistry.h"
38#include "llvm/Target/TargetSelect.h"
39#include <memory>
40using namespace llvm;
41
42// General options for llc. Other pass-specific options are specified
43// within the corresponding llc passes, and target-specific options
44// and back-end code generation options are specified with the target machine.
45//
46static cl::opt<std::string>

--- 24 unchanged lines hidden (view full) ---

71 cl::init(""));
72
73static cl::list<std::string>
74MAttrs("mattr",
75 cl::CommaSeparated,
76 cl::desc("Target specific attributes (-mattr=help for details)"),
77 cl::value_desc("a1,+a2,-a3,..."));
78
79static cl::opt<bool>
80RelaxAll("mc-relax-all",
81 cl::desc("When used with filetype=obj, "
82 "relax all fixups in the emitted object file"));
83
84cl::opt<TargetMachine::CodeGenFileType>
85FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile),
86 cl::desc("Choose a file type (not all types are supported by all targets):"),

--- 109 unchanged lines hidden (view full) ---

196 // Enable debug stream buffering.
197 EnableDebugBuffering = true;
198
199 LLVMContext &Context = getGlobalContext();
200 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
201
202 // Initialize targets first, so that --version shows registered targets.
203 InitializeAllTargets();
204 InitializeAllMCAsmInfos();
205 InitializeAllMCInstrInfos();
206 InitializeAllMCSubtargetInfos();
207 InitializeAllAsmPrinters();
208 InitializeAllAsmParsers();
209
210 cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
211
212 // Load the module to be compiled...
213 SMDiagnostic Err;
214 std::auto_ptr<Module> M;
215
216 M.reset(ParseIRFile(InputFilename, Err, Context));
217 if (M.get() == 0) {

--- 49 unchanged lines hidden (view full) ---

267 if (MAttrs.size()) {
268 SubtargetFeatures Features;
269 for (unsigned i = 0; i != MAttrs.size(); ++i)
270 Features.AddFeature(MAttrs[i]);
271 FeaturesStr = Features.getString();
272 }
273
274 std::auto_ptr<TargetMachine>
275 target(TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU,
276 FeaturesStr));
277 assert(target.get() && "Could not allocate target machine!");
278 TargetMachine &Target = *target.get();
279
280 if (DisableDotLoc)
281 Target.setMCUseLoc(false);
282
283 if (DisableCFI)
284 Target.setMCUseCFI(false);

--- 64 unchanged lines hidden ---