Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: tools/llc/llc.cpp

Issue 14329025: Check for metadata in PNaCl ABI checker. (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===-- llc.cpp - Implement the LLVM Native Code Generator ----------------===// 1 //===-- llc.cpp - Implement the LLVM Native Code Generator ----------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This is the llc code generator driver. It provides a convenient 10 // This is the llc code generator driver. It provides a convenient
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 cl::init(false)); 119 cl::init(false));
120 120
121 static cl::opt<bool> 121 static cl::opt<bool>
122 PNaClABIVerify("pnaclabi-verify", 122 PNaClABIVerify("pnaclabi-verify",
123 cl::desc("Verify PNaCl bitcode ABI before translating"), 123 cl::desc("Verify PNaCl bitcode ABI before translating"),
124 cl::init(false)); 124 cl::init(false));
125 static cl::opt<bool> 125 static cl::opt<bool>
126 PNaClABIVerifyFatalErrors("pnaclabi-verify-fatal-errors", 126 PNaClABIVerifyFatalErrors("pnaclabi-verify-fatal-errors",
127 cl::desc("PNaCl ABI verification errors are fatal"), 127 cl::desc("PNaCl ABI verification errors are fatal"),
128 cl::init(false)); 128 cl::init(false));
129 // @LOCALMOD-END 129 static cl::opt<bool>
130 AllowDebugMetadata("pnaclabi-verify-allow-debug",
131 cl::desc("Allow debug metadata during PNaCl ABI verification."),
132 cl::init(false));
133 //// @LOCALMOD-END
130 134
131 // Determine optimization level. 135 // Determine optimization level.
132 static cl::opt<char> 136 static cl::opt<char>
133 OptLevel("O", 137 OptLevel("O",
134 cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] " 138 cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
135 "(default = '-O2')"), 139 "(default = '-O2')"),
136 cl::Prefix, 140 cl::Prefix,
137 cl::ZeroOrMore, 141 cl::ZeroOrMore,
138 cl::init(' ')); 142 cl::init(' '));
139 143
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 385
382 mod = M.get(); 386 mod = M.get();
383 if (mod == 0) { 387 if (mod == 0) {
384 Err.print(argv[0], errs()); 388 Err.print(argv[0], errs());
385 return 1; 389 return 1;
386 } 390 }
387 391
388 // @LOCALMOD-BEGIN 392 // @LOCALMOD-BEGIN
389 if (PNaClABIVerify) { 393 if (PNaClABIVerify) {
390 // Verify the module (but not the functions yet) 394 // Verify the module (but not the functions yet)
391 ModulePass *VerifyPass = createPNaClABIVerifyModulePass(&ABIErrorReporter) ; 395 ModulePass *VerifyPass = createPNaClABIVerifyModulePass(
396 &ABIErrorReporter, AllowDebugMetadata);
392 VerifyPass->runOnModule(*mod); 397 VerifyPass->runOnModule(*mod);
393 CheckABIVerifyErrors(ABIErrorReporter, "Module"); 398 CheckABIVerifyErrors(ABIErrorReporter, "Module");
394 } 399 }
395 #if defined(__native_client__) && defined(NACL_SRPC) 400 #if defined(__native_client__) && defined(NACL_SRPC)
396 RecordMetadataForSrpc(*mod); 401 RecordMetadataForSrpc(*mod);
397 402
398 // To determine if we should compile PIC or not, we needed to load at 403 // To determine if we should compile PIC or not, we needed to load at
399 // least the metadata. Since we've already constructed the commandline, 404 // least the metadata. Since we've already constructed the commandline,
400 // we have to hack this in after commandline processing. 405 // we have to hack this in after commandline processing.
401 if (mod->getOutputFormat() == Module::SharedOutputFormat) { 406 if (mod->getOutputFormat() == Module::SharedOutputFormat) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 // @LOCALMOD-BEGIN 520 // @LOCALMOD-BEGIN
516 OwningPtr<PassManagerBase> PM; 521 OwningPtr<PassManagerBase> PM;
517 if (LazyBitcode || ReduceMemoryFootprint) 522 if (LazyBitcode || ReduceMemoryFootprint)
518 PM.reset(new FunctionPassManager(mod)); 523 PM.reset(new FunctionPassManager(mod));
519 else 524 else
520 PM.reset(new PassManager()); 525 PM.reset(new PassManager());
521 526
522 // Add the ABI verifier pass before the analysis and code emission passes. 527 // Add the ABI verifier pass before the analysis and code emission passes.
523 FunctionPass *FunctionVerifyPass = NULL; 528 FunctionPass *FunctionVerifyPass = NULL;
524 if (PNaClABIVerify) { 529 if (PNaClABIVerify) {
525 FunctionVerifyPass = createPNaClABIVerifyFunctionsPass(&ABIErrorReporter); 530 FunctionVerifyPass = createPNaClABIVerifyFunctionsPass(
531 &ABIErrorReporter, AllowDebugMetadata);
526 PM->add(FunctionVerifyPass); 532 PM->add(FunctionVerifyPass);
527 } 533 }
528 // @LOCALMOD-END 534 // @LOCALMOD-END
529 535
530 // Add an appropriate TargetLibraryInfo pass for the module's triple. 536 // Add an appropriate TargetLibraryInfo pass for the module's triple.
531 TargetLibraryInfo *TLI = new TargetLibraryInfo(TheTriple); 537 TargetLibraryInfo *TLI = new TargetLibraryInfo(TheTriple);
532 if (DisableSimplifyLibCalls) 538 if (DisableSimplifyLibCalls)
533 TLI->disableAllFunctions(); 539 TLI->disableAllFunctions();
534 PM->add(TLI); 540 PM->add(TLI);
535 541
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 } 667 }
662 668
663 #if !defined(NACL_SRPC) 669 #if !defined(NACL_SRPC)
664 int 670 int
665 main (int argc, char **argv) { 671 main (int argc, char **argv) {
666 return llc_main(argc, argv); 672 return llc_main(argc, argv);
667 } 673 }
668 #else 674 #else
669 // main() is in nacl_file.cpp. 675 // main() is in nacl_file.cpp.
670 #endif 676 #endif
OLDNEW
« no previous file with comments | « test/NaCl/PNaClABI/types-function.ll ('k') | tools/opt/opt.cpp » ('j') | tools/opt/opt.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698