[llvm] r205358 - Add a comment about the DIDescriptor class hierarchy.
Robinson, Paul
Paul_Robinson at playstation.sony.com
Tue Apr 1 18:21:57 PDT 2014
> -----Original Message-----
> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
> bounces at cs.uiuc.edu] On Behalf Of Adrian Prantl
> Sent: Tuesday, April 01, 2014 2:04 PM
> To: llvm-commits at cs.uiuc.edu
> Subject: [llvm] r205358 - Add a comment about the DIDescriptor class
> hierarchy.
>
> Author: adrian
> Date: Tue Apr 1 16:04:24 2014
> New Revision: 205358
>
> URL: http://llvm.org/viewvc/llvm-project?rev=205358&view=rev
> Log:
> Add a comment about the DIDescriptor class hierarchy.
>
> Modified:
> llvm/trunk/include/llvm/IR/DebugInfo.h
> llvm/trunk/lib/IR/DebugInfo.cpp
>
> Modified: llvm/trunk/include/llvm/IR/DebugInfo.h
> URL: http://llvm.org/viewvc/llvm-
> project/llvm/trunk/include/llvm/IR/DebugInfo.h?rev=205358&r1=205357&r2=2
> 05358&view=diff
> ========================================================================
> ======
> --- llvm/trunk/include/llvm/IR/DebugInfo.h (original)
> +++ llvm/trunk/include/llvm/IR/DebugInfo.h Tue Apr 1 16:04:24 2014
> @@ -197,6 +197,13 @@ typedef DIRef<DIScope> DIScopeRef;
> typedef DIRef<DIType> DITypeRef;
>
> /// DIScope - A base class for various scopes.
> +///
> +/// Although, implementation-wise, DIScope is the parent class of most
> +/// other DIxxx classes, including DIType and its descendants, most of
> +/// DIScopeâs descendants are not a substitutable subtype of
Funny character there, that wants to be a simple apostrophe.
--paulr
> +/// DIScope. The DIDescriptor::isScope() method only is true for
> +/// DIScopes that are scopes in the strict lexical scope sense
> +/// (DICompileUnit, DISubprogram, etc.), but not for, e.g., a DIType.
> class DIScope : public DIDescriptor {
> protected:
> friend class DIDescriptor;
>
> Modified: llvm/trunk/lib/IR/DebugInfo.cpp
> URL: http://llvm.org/viewvc/llvm-
> project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=205358&r1=205357&r2=205358&v
> iew=diff
> ========================================================================
> ======
> --- llvm/trunk/lib/IR/DebugInfo.cpp (original)
> +++ llvm/trunk/lib/IR/DebugInfo.cpp Tue Apr 1 16:04:24 2014
> @@ -429,8 +429,10 @@ static bool fieldIsTypeRef(const MDNode
> /// Check if a value can be a ScopeRef.
> static bool isScopeRef(const Value *Val) {
> return !Val ||
> - (isa<MDString>(Val) && !cast<MDString>(Val)-
> >getString().empty()) ||
> - isa<MDNode>(Val);
> + (isa<MDString>(Val) && !cast<MDString>(Val)->getString().empty())
> ||
> + // Not checking for Val->isScope() here, because it would work
> + // only for lexical scopes and not all subclasses of DIScope.
> + isa<MDNode>(Val);
> }
>
> /// Check if a field at position Elt of a MDNode can be a ScopeRef.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list