[llvm] r340664 - Add documentation comment to ForwardTemplateReference.

Richard Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 15:33:53 PDT 2018


Author: rsmith
Date: Fri Aug 24 15:33:53 2018
New Revision: 340664

URL: http://llvm.org/viewvc/llvm-project?rev=340664&view=rev
Log:
Add documentation comment to ForwardTemplateReference.

This node doesn't directly correspond to a mangled name fragment, so
it's useful to explicitly describe when it's created and what it's for.

Modified:
    llvm/trunk/include/llvm/Demangle/ItaniumDemangle.h

Modified: llvm/trunk/include/llvm/Demangle/ItaniumDemangle.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Demangle/ItaniumDemangle.h?rev=340664&r1=340663&r2=340664&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Demangle/ItaniumDemangle.h (original)
+++ llvm/trunk/include/llvm/Demangle/ItaniumDemangle.h Fri Aug 24 15:33:53 2018
@@ -1118,6 +1118,24 @@ public:
   }
 };
 
+/// A forward-reference to a template argument that was not known at the point
+/// where the template parameter name was parsed in a mangling.
+///
+/// This is created when demangling the name of a specialization of a
+/// conversion function template:
+///
+/// \code
+/// struct A {
+///   template<typename T> operator T*();
+/// };
+/// \endcode
+///
+/// When demangling a specialization of the conversion function template, we
+/// encounter the name of the template (including the \c T) before we reach
+/// the template argument list, so we cannot substitute the parameter name
+/// for the corresponding argument while parsing. Instead, we create a
+/// \c ForwardTemplateReference node that is resolved after we parse the
+/// template arguments.
 struct ForwardTemplateReference : Node {
   size_t Index;
   Node *Ref = nullptr;




More information about the llvm-commits mailing list