[llvm-commits] [llvm] r169728 - in /llvm/trunk: include/llvm/Analysis/PtrUseVisitor.h lib/Analysis/CMakeLists.txt lib/Analysis/PtrUseVisitor.cpp lib/Transforms/Scalar/SROA.cpp

Duncan Sands baldrick at free.fr
Mon Dec 10 01:45:10 PST 2012


Hi Chandler,

>         +    /// \brief Mark the visit as aborted. Intended for use in a void
>         return.
>
>
>     Intended for use in a void return?  What does this mean?  What happens if I is
>     used for an instruction that is not a void return?
>
>
> The 'set' methods are intended to work cleanly with code like:
>
> void visitMyInstruction(MyInstruction &I) {
>    // .. some code ..
>
>    if (detectErrorCondition())
>      return PI.setAborted(&I);
>
>    // .. rest of my code ..
> }
>
> Thus, they are designed to be called within a void-type return statement by the
> implementor of the visitor. Does that clarify? It has nothing to do with the
> return of the LLVM IR under analysis.

are you saying that the user should not continue to use the visitor after having
called setAborted, and should bail out at once?

Ciao, Duncan.



More information about the llvm-commits mailing list