aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp13
-rw-r--r--lib/Analysis/NaCl/PNaClABIVerifyModule.cpp11
2 files changed, 17 insertions, 7 deletions
diff --git a/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp b/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp
index a2e5f1b2a5..abc66b0add 100644
--- a/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp
+++ b/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp
@@ -17,7 +17,7 @@
#include "llvm/Instruction.h"
#include "llvm/Pass.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/Transforms/NaCl.h"
+#include "llvm/Analysis/NaCl.h"
using namespace llvm;
namespace {
@@ -28,6 +28,11 @@ struct PNaClABIVerifyFunctions : public FunctionPass {
static char ID;
PNaClABIVerifyFunctions() : FunctionPass(ID) {}
bool runOnFunction(Function &F);
+ // For now, this print method exists to allow us to run the pass with
+ // opt -analyze to avoid dumping the result to stdout, to make testing
+ // simpler. In the future we will probably want to make it do something
+ // useful.
+ virtual void print(llvm::raw_ostream &O, const Module *M) const {};
};
} // and anonymous namespace
@@ -47,8 +52,8 @@ bool PNaClABIVerifyFunctions::runOnFunction(Function &F) {
// invoke and call are handled separately.
break;
default:
- errs() << Twine("Function ") + FI->getName() +
- " has Disallowed instruction: " +
+ errs() << Twine("Function ") + F.getName() +
+ " has disallowed instruction: " +
BBI->getOpcodeName() + "\n";
}
}
@@ -58,7 +63,7 @@ bool PNaClABIVerifyFunctions::runOnFunction(Function &F) {
char PNaClABIVerifyFunctions::ID = 0;
-static RegisterPass<PNaClABIVerifyFunctions> X("pnaclabi-functions",
+static RegisterPass<PNaClABIVerifyFunctions> X("verify-pnaclabi-functions",
"Verify functions for PNaCl", false, false);
FunctionPass *llvm::createPNaClABIVerifyFunctionsPass() {
diff --git a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp
index f39b83881e..5062f710f6 100644
--- a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp
+++ b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp
@@ -17,7 +17,7 @@
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/Transforms/NaCl.h"
+#include "llvm/Analysis/NaCl.h"
using namespace llvm;
namespace {
@@ -27,6 +27,11 @@ struct PNaClABIVerifyModule : public ModulePass {
static char ID;
PNaClABIVerifyModule() : ModulePass(ID) {}
bool runOnModule(Module &M);
+ // For now, this print method exists to allow us to run the pass with
+ // opt -analyze to avoid dumping the result to stdout, to make testing
+ // simpler. In the future we will probably want to make it do something
+ // useful.
+ virtual void print(llvm::raw_ostream &O, const Module *M) const {};
};
static const char* LinkageName(GlobalValue::LinkageTypes LT) {
@@ -69,7 +74,7 @@ bool PNaClABIVerifyModule::runOnModule(Module &M) {
break;
default:
errs() << (Twine("Variable ") + MI->getName() +
- " has Disallowed linkage type: " +
+ " has disallowed linkage type: " +
LinkageName(MI->getLinkage()) + "\n");
}
}
@@ -78,7 +83,7 @@ bool PNaClABIVerifyModule::runOnModule(Module &M) {
char PNaClABIVerifyModule::ID = 0;
-static RegisterPass<PNaClABIVerifyModule> X("pnaclabi-module",
+static RegisterPass<PNaClABIVerifyModule> X("verify-pnaclabi-module",
"Verify module for PNaCl", false, false);
ModulePass *llvm::createPNaClABIVerifyModulePass() {