summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-01-05 02:47:05 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-01-05 02:47:05 +0000
commitd174ce4ad17b1965cefba7a7e5b97fe7235d7337 (patch)
tree7a6d6b16f4bc15a26b83b14e53d8d05dd4b8ee5f /llvm/lib/IR/Verifier.cpp
parent9c31db4f94e78027bece17ee18a154a48436e574 (diff)
downloadbcm5719-llvm-d174ce4ad17b1965cefba7a7e5b97fe7235d7337.tar.gz
bcm5719-llvm-d174ce4ad17b1965cefba7a7e5b97fe7235d7337.zip
[PM] Switch the new pass manager to use a reference-based API for IR
units. This was debated back and forth a bunch, but using references is now clearly cleaner. Of all the code written using pointers thus far, in only one place did it really make more sense to have a pointer. In most cases, this just removes immediate dereferencing from the code. I think it is much better to get errors on null IR units earlier, potentially at compile time, than to delay it. Most notably, the legacy pass manager uses references for its routines and so as more and more code works with both, the use of pointers was likely to become really annoying. I noticed this when I ported the domtree analysis over and wrote the entire thing with references only to have it fail to compile. =/ It seemed better to switch now than to delay. We can, of course, revisit this is we learn that references are really problematic in the API. llvm-svn: 225145
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 0bc9d5e1bc8..bc721145d2a 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -2902,15 +2902,15 @@ ModulePass *llvm::createDebugInfoVerifierPass(bool FatalErrors) {
return new DebugInfoVerifierLegacyPass(FatalErrors);
}
-PreservedAnalyses VerifierPass::run(Module *M) {
- if (verifyModule(*M, &dbgs()) && FatalErrors)
+PreservedAnalyses VerifierPass::run(Module &M) {
+ if (verifyModule(M, &dbgs()) && FatalErrors)
report_fatal_error("Broken module found, compilation aborted!");
return PreservedAnalyses::all();
}
-PreservedAnalyses VerifierPass::run(Function *F) {
- if (verifyFunction(*F, &dbgs()) && FatalErrors)
+PreservedAnalyses VerifierPass::run(Function &F) {
+ if (verifyFunction(F, &dbgs()) && FatalErrors)
report_fatal_error("Broken function found, compilation aborted!");
return PreservedAnalyses::all();
OpenPOWER on IntegriCloud