Skip to content

Commit

Permalink
Update for LLVM 5.0
Browse files Browse the repository at this point in the history
The debug method is not compiled in the Release builds anymore, so
expand to use llvm::errs() directly.
  • Loading branch information
davidchisnall committed Oct 3, 2017
1 parent 6077e6f commit ba5248a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SimplePass.cc
@@ -1,4 +1,5 @@
#include "llvm/Pass.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/LLVMContext.h"
Expand Down Expand Up @@ -69,7 +70,7 @@ struct SimplePass : FunctionPass, InstVisitor<SimplePass>
/// instructions.
void visitAllocaInst(AllocaInst &AI) {
// Log the alloca to the standard error
AI.dump();
llvm::errs() << AI << '\n';
visitedAllocas.push_back(&AI);
}

Expand All @@ -85,7 +86,7 @@ struct SimplePass : FunctionPass, InstVisitor<SimplePass>
for (auto &I : BB) {
if (AllocaInst *AI = dyn_cast<AllocaInst>(&I)) {
// Log the alloca to the standard error
AI->dump();
llvm::errs() << *AI << '\n';
foundAllocas.push_back(AI);
}
}
Expand Down

0 comments on commit ba5248a

Please sign in to comment.