[LLVMdev] what are those *Ref used for

Hui Zhang
Fri, 20 Feb 2015 18:09:38 -0000

Hello,

I'm a little confused about the DIScopeRef ,or other names end with
Ref...Why and when shall we use them ?

Like StringRef, it has a function str() to change it to normal std::string,
but DIScopeRef, its full definition is:

typedef DIRef<DIScope>
<http://llvm.org/docs/doxygen/html/classllvm_1_1DIRef.html> DIScopeRef
<http://llvm.org/docs/doxygen/html/namespacellvm.html#ad3fed63164a27d11963083c621293298>

DIRef: Represents reference to a DIDescriptor
<http://llvm.org/docs/doxygen/html/classllvm_1_1DIDescriptor.html>.
abstracts over direct and identifier-based metadata references.


​Therefore, when I get a DIScopeRef dsf, shall I just treat it just like
DIScope ? means I can directly call dsf.func(), where func() represents all
the member functions of DIScope, right ??

Thanks​

--
Best regards


Hui Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20150220/507ed470/attachment.html>