llc.cpp (224133) | llc.cpp (226584) |
---|---|
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" | 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/Support/TargetRegistry.h" 36#include "llvm/Support/TargetSelect.h" |
|
35#include "llvm/Target/TargetData.h" 36#include "llvm/Target/TargetMachine.h" | 37#include "llvm/Target/TargetData.h" 38#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 | 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<Reloc::Model> 80RelocModel("relocation-model", 81 cl::desc("Choose relocation model"), 82 cl::init(Reloc::Default), 83 cl::values( 84 clEnumValN(Reloc::Default, "default", 85 "Target default relocation model"), 86 clEnumValN(Reloc::Static, "static", 87 "Non-relocatable code"), 88 clEnumValN(Reloc::PIC_, "pic", 89 "Fully relocatable, position independent code"), 90 clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic", 91 "Relocatable external references, non-relocatable code"), 92 clEnumValEnd)); 93 94static cl::opt<llvm::CodeModel::Model> 95CMModel("code-model", 96 cl::desc("Choose code model"), 97 cl::init(CodeModel::Default), 98 cl::values(clEnumValN(CodeModel::Default, "default", 99 "Target default code model"), 100 clEnumValN(CodeModel::Small, "small", 101 "Small code model"), 102 clEnumValN(CodeModel::Kernel, "kernel", 103 "Kernel code model"), 104 clEnumValN(CodeModel::Medium, "medium", 105 "Medium code model"), 106 clEnumValN(CodeModel::Large, "large", 107 "Large code model"), 108 clEnumValEnd)); 109 |
|
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(); | 110static cl::opt<bool> 111RelaxAll("mc-relax-all", 112 cl::desc("When used with filetype=obj, " 113 "relax all fixups in the emitted object file")); 114 115cl::opt<TargetMachine::CodeGenFileType> 116FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile), 117 cl::desc("Choose a file type (not all types are supported by all targets):"), --- 109 unchanged lines hidden (view full) --- 227 // Enable debug stream buffering. 228 EnableDebugBuffering = true; 229 230 LLVMContext &Context = getGlobalContext(); 231 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. 232 233 // Initialize targets first, so that --version shows registered targets. 234 InitializeAllTargets(); |
204 InitializeAllMCAsmInfos(); 205 InitializeAllMCInstrInfos(); 206 InitializeAllMCSubtargetInfos(); | 235 InitializeAllTargetMCs(); |
207 InitializeAllAsmPrinters(); 208 InitializeAllAsmParsers(); 209 | 236 InitializeAllAsmPrinters(); 237 InitializeAllAsmParsers(); 238 |
239 // Register the target printer for --version. 240 cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion); 241 |
|
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> | 242 cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n"); 243 244 // Load the module to be compiled... 245 SMDiagnostic Err; 246 std::auto_ptr<Module> M; 247 248 M.reset(ParseIRFile(InputFilename, Err, Context)); 249 if (M.get() == 0) { --- 49 unchanged lines hidden (view full) --- 299 if (MAttrs.size()) { 300 SubtargetFeatures Features; 301 for (unsigned i = 0; i != MAttrs.size(); ++i) 302 Features.AddFeature(MAttrs[i]); 303 FeaturesStr = Features.getString(); 304 } 305 306 std::auto_ptr<TargetMachine> |
275 target(TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, 276 FeaturesStr)); | 307 target(TheTarget->createTargetMachine(TheTriple.getTriple(), 308 MCPU, FeaturesStr, 309 RelocModel, CMModel)); |
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 --- | 310 assert(target.get() && "Could not allocate target machine!"); 311 TargetMachine &Target = *target.get(); 312 313 if (DisableDotLoc) 314 Target.setMCUseLoc(false); 315 316 if (DisableCFI) 317 Target.setMCUseCFI(false); --- 64 unchanged lines hidden --- |