[llvm] r241889 - Address Reid's review feedback.
David Majnemer
david.majnemer at gmail.com
Fri Jul 10 00:00:58 PDT 2015
Author: majnemer
Date: Fri Jul 10 02:00:58 2015
New Revision: 241889
URL: http://llvm.org/viewvc/llvm-project?rev=241889&view=rev
Log:
Address Reid's review feedback.
Modified:
llvm/trunk/docs/LangRef.rst
llvm/trunk/lib/IR/Verifier.cpp
llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Modified: llvm/trunk/docs/LangRef.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=241889&r1=241888&r2=241889&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.rst (original)
+++ llvm/trunk/docs/LangRef.rst Fri Jul 10 02:00:58 2015
@@ -5183,15 +5183,15 @@ none of the ``catchblock`` instructions
in-flight exception.
If a ``nextaction`` label is not present, the instruction unwinds out of
-the function it is located in. The
-:ref:`personality function <personalityfn>` will look for an appropriate
-catch block in the caller.
+its parent function. The
+:ref:`personality function <personalityfn>` will continue processing
+exception handling actions in the caller.
Arguments:
""""""""""
The instruction optionally takes a label, ``nextaction``, indicating
-where control should transfer to if none of the constituent
+where control should transfer to if none of the preceding
``catchblock`` instructions are suitable for the in-flight exception.
Semantics:
@@ -5212,6 +5212,7 @@ The ``catchendblock`` instruction has se
catch block.
- A basic block that is not a catch-end block may not include a
'``catchendblock``' instruction.
+- Exactly one catch block may unwind to a ``catchendblock``.
Example:
""""""""
@@ -5251,7 +5252,7 @@ Semantics:
The '``catchret``' instruction ends the existing (in-flight) exception
whose unwinding was interrupted with a
-:ref:`catchblock <i_catchblock>` instruction and transfer control to
+:ref:`catchblock <i_catchblock>` instruction and transfers control to
``normal``.
Example:
@@ -5301,6 +5302,7 @@ Example:
.. code-block:: llvm
+ cleanupret void unwind to caller
cleanupret { i8*, i32 } %exn unwind label %continue
.. _i_terminateblock:
@@ -5314,21 +5316,20 @@ Syntax:
::
terminateblock [<args>*] unwind label <exception label>
+ terminateblock [<args>*] unwind to caller
Overview:
"""""""""
The '``terminateblock``' instruction is used by `LLVM's exception handling
system <ExceptionHandling.html#overview>`_ to specify that a basic block
-is a terminate block --- one where a personality routine attempts to transfer
-control to terminate the program.
+is a terminate block --- one where a personality routine may decide to
+terminate the program.
The ``args`` correspond to whatever information the personality
routine requires to know if this is an appropriate place to terminate the
program. Control is tranfered to the ``exception`` label if the
-``terminateblock`` is an appropriate handler for the in-flight exception.
-If the ``terminateblock`` is not an appropriate handler, execution of
-the program is terminated via
-:ref:`personality function <personalityfn>` specific means.
+personality routine decides not to terminate the program for the
+in-flight exception.
Arguments:
""""""""""
@@ -5336,7 +5337,7 @@ Arguments:
The instruction takes a list of arbitrary values which are interpreted
by the :ref:`personality function <personalityfn>`.
-The ``terminateblock`` must be provided an ``exception`` label to
+The ``terminateblock`` may be given an ``exception`` label to
transfer control to if the in-flight exception matches the ``args``.
Semantics:
Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=241889&r1=241888&r2=241889&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Fri Jul 10 02:00:58 2015
@@ -2408,8 +2408,8 @@ void Verifier::visitCallInst(CallInst &C
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!",
Modified: llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp?rev=241889&r1=241888&r2=241889&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp Fri Jul 10 02:00:58 2015
@@ -2654,23 +2654,27 @@ struct MemorySanitizerVisitor : public I
}
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) {
More information about the llvm-commits
mailing list