llc.cpp (218885) | llc.cpp (221337) |
---|---|
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//===----------------------------------------------------------------------===// --- 85 unchanged lines hidden (view full) --- 94 clEnumValEnd)); 95 96cl::opt<bool> NoVerify("disable-verify", cl::Hidden, 97 cl::desc("Do not verify input module")); 98 99cl::opt<bool> DisableDotLoc("disable-dot-loc", cl::Hidden, 100 cl::desc("Do not use .loc entries")); 101 | 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//===----------------------------------------------------------------------===// --- 85 unchanged lines hidden (view full) --- 94 clEnumValEnd)); 95 96cl::opt<bool> NoVerify("disable-verify", cl::Hidden, 97 cl::desc("Do not verify input module")); 98 99cl::opt<bool> DisableDotLoc("disable-dot-loc", cl::Hidden, 100 cl::desc("Do not use .loc entries")); 101 |
102cl::opt<bool> DisableCFI("disable-cfi", cl::Hidden, 103 cl::desc("Do not use .cfi_* directives")); 104 |
|
102static cl::opt<bool> 103DisableRedZone("disable-red-zone", 104 cl::desc("Do not emit code that uses the red zone."), 105 cl::init(false)); 106 107static cl::opt<bool> 108NoImplicitFloats("no-implicit-float", 109 cl::desc("Don't generate implicit floating point instructions (x86-only)"), --- 92 unchanged lines hidden (view full) --- 202 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. 203 204 // Initialize targets first, so that --version shows registered targets. 205 InitializeAllTargets(); 206 InitializeAllAsmPrinters(); 207 InitializeAllAsmParsers(); 208 209 cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n"); | 105static cl::opt<bool> 106DisableRedZone("disable-red-zone", 107 cl::desc("Do not emit code that uses the red zone."), 108 cl::init(false)); 109 110static cl::opt<bool> 111NoImplicitFloats("no-implicit-float", 112 cl::desc("Don't generate implicit floating point instructions (x86-only)"), --- 92 unchanged lines hidden (view full) --- 205 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. 206 207 // Initialize targets first, so that --version shows registered targets. 208 InitializeAllTargets(); 209 InitializeAllAsmPrinters(); 210 InitializeAllAsmParsers(); 211 212 cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n"); |
210 | 213 |
211 // Load the module to be compiled... 212 SMDiagnostic Err; 213 std::auto_ptr<Module> M; 214 215 M.reset(ParseIRFile(InputFilename, Err, Context)); 216 if (M.get() == 0) { 217 Err.Print(argv[0], errs()); 218 return 1; --- 47 unchanged lines hidden (view full) --- 266 if (MCPU.size() || MAttrs.size()) { 267 SubtargetFeatures Features; 268 Features.setCPU(MCPU); 269 for (unsigned i = 0; i != MAttrs.size(); ++i) 270 Features.AddFeature(MAttrs[i]); 271 FeaturesStr = Features.getString(); 272 } 273 | 214 // Load the module to be compiled... 215 SMDiagnostic Err; 216 std::auto_ptr<Module> M; 217 218 M.reset(ParseIRFile(InputFilename, Err, Context)); 219 if (M.get() == 0) { 220 Err.Print(argv[0], errs()); 221 return 1; --- 47 unchanged lines hidden (view full) --- 269 if (MCPU.size() || MAttrs.size()) { 270 SubtargetFeatures Features; 271 Features.setCPU(MCPU); 272 for (unsigned i = 0; i != MAttrs.size(); ++i) 273 Features.AddFeature(MAttrs[i]); 274 FeaturesStr = Features.getString(); 275 } 276 |
274 std::auto_ptr<TargetMachine> | 277 std::auto_ptr |
275 target(TheTarget->createTargetMachine(TheTriple.getTriple(), FeaturesStr)); 276 assert(target.get() && "Could not allocate target machine!"); 277 TargetMachine &Target = *target.get(); 278 279 if (DisableDotLoc) 280 Target.setMCUseLoc(false); | 278 target(TheTarget->createTargetMachine(TheTriple.getTriple(), FeaturesStr)); 279 assert(target.get() && "Could not allocate target machine!"); 280 TargetMachine &Target = *target.get(); 281 282 if (DisableDotLoc) 283 Target.setMCUseLoc(false); |
281 if (TheTriple.getOS() == Triple::Darwin) { 282 switch (TheTriple.getDarwinMajorNumber()) { 283 case 7: 284 case 8: 285 case 9: 286 // disable .loc support for older darwin OS. 287 Target.setMCUseLoc(false); 288 break; 289 default: 290 break; 291 } 292 } | |
293 | 284 |
285 if (DisableCFI) 286 Target.setMCUseCFI(false); 287 288 // Disable .loc support for older OS X versions. 289 if (TheTriple.isMacOSX() && 290 TheTriple.isMacOSXVersionLT(10, 6)) 291 Target.setMCUseLoc(false); 292 |
|
294 // Figure out where we are going to send the output... 295 OwningPtr<tool_output_file> Out 296 (GetOutputStream(TheTarget->getName(), TheTriple.getOS(), argv[0])); 297 if (!Out) return 1; 298 299 CodeGenOpt::Level OLvl = CodeGenOpt::Default; 300 switch (OptLevel) { 301 default: --- 31 unchanged lines hidden (view full) --- 333 334 // Ask the target to add backend passes as necessary. 335 if (Target.addPassesToEmitFile(PM, FOS, FileType, OLvl, NoVerify)) { 336 errs() << argv[0] << ": target does not support generation of this" 337 << " file type!\n"; 338 return 1; 339 } 340 | 293 // Figure out where we are going to send the output... 294 OwningPtr<tool_output_file> Out 295 (GetOutputStream(TheTarget->getName(), TheTriple.getOS(), argv[0])); 296 if (!Out) return 1; 297 298 CodeGenOpt::Level OLvl = CodeGenOpt::Default; 299 switch (OptLevel) { 300 default: --- 31 unchanged lines hidden (view full) --- 332 333 // Ask the target to add backend passes as necessary. 334 if (Target.addPassesToEmitFile(PM, FOS, FileType, OLvl, NoVerify)) { 335 errs() << argv[0] << ": target does not support generation of this" 336 << " file type!\n"; 337 return 1; 338 } 339 |
340 // Before executing passes, print the final values of the LLVM options. 341 cl::PrintOptionValues(); 342 |
|
341 PM.run(mod); 342 } 343 344 // Declare success. 345 Out->keep(); 346 347 return 0; 348} | 343 PM.run(mod); 344 } 345 346 // Declare success. 347 Out->keep(); 348 349 return 0; 350} |