summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/Verifier.cpp4
-rw-r--r--llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp20
2 files changed, 14 insertions, 10 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index b6df70869b5..cc7d662d759 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -2408,8 +2408,8 @@ void Verifier::visitCallInst(CallInst &CI) {
void Verifier::visitInvokeInst(InvokeInst &II) {
VerifyCallSite(&II);
- // Verify that there is an exception block instruction is the first non-PHI
- // instruction of the 'unwind' destination.
+ // Verify that the first non-PHI instruction of the unwind destination is an
+ // exception handling instruction.
Assert(
II.getUnwindDest()->isEHBlock(),
"The unwind destination does not have an exception handling instruction!",
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index bcc39ef9fba..ee77882e7ca 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -2654,23 +2654,27 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
}
void visitCleanupBlockInst(CleanupBlockInst &I) {
- setShadow(&I, getCleanShadow(&I));
- setOrigin(&I, getCleanOrigin());
+ if (!I.getType()->isVoidTy()) {
+ setShadow(&I, getCleanShadow(&I));
+ setOrigin(&I, getCleanOrigin());
+ }
}
void visitCatchBlock(CatchBlockInst &I) {
- setShadow(&I, getCleanShadow(&I));
- setOrigin(&I, getCleanOrigin());
+ if (!I.getType()->isVoidTy()) {
+ setShadow(&I, getCleanShadow(&I));
+ setOrigin(&I, getCleanOrigin());
+ }
}
void visitTerminateBlock(TerminateBlockInst &I) {
- setShadow(&I, getCleanShadow(&I));
- setOrigin(&I, getCleanOrigin());
+ DEBUG(dbgs() << "TerminateBlock: " << I << "\n");
+ // Nothing to do here.
}
void visitCatchEndBlockInst(CatchEndBlockInst &I) {
- setShadow(&I, getCleanShadow(&I));
- setOrigin(&I, getCleanOrigin());
+ DEBUG(dbgs() << "CatchEndBlock: " << I << "\n");
+ // Nothing to do here.
}
void visitGetElementPtrInst(GetElementPtrInst &I) {
OpenPOWER on IntegriCloud