NodeLocationAccessors GetLocations(clang::Stmt const *Object);
NodeLocationAccessors GetLocations(clang::Decl const *Object);
NodeLocationAccessors GetLocations(clang::CXXCtorInitializer const *Object);
-NodeLocationAccessors GetLocations(clang::NestedNameSpecifierLoc const *);
-NodeLocationAccessors GetLocations(clang::TemplateArgumentLoc const *);
+NodeLocationAccessors GetLocations(clang::NestedNameSpecifierLoc const &);
+NodeLocationAccessors GetLocations(clang::TemplateArgumentLoc const &);
NodeLocationAccessors GetLocations(clang::CXXBaseSpecifier const *);
NodeLocationAccessors GetLocations(clang::TypeLoc const &);
NodeLocationAccessors GetLocations(clang::DynTypedNode const &Node);
return {};
}
NodeLocationAccessors NodeIntrospection::GetLocations(
- clang::NestedNameSpecifierLoc const*) {
+ clang::NestedNameSpecifierLoc const&) {
return {};
}
NodeLocationAccessors NodeIntrospection::GetLocations(
- clang::TemplateArgumentLoc const*) {
+ clang::TemplateArgumentLoc const&) {
return {};
}
NodeLocationAccessors NodeIntrospection::GetLocations(
implementationContent = ''
+ RefClades = {"NestedNameSpecifierLoc", "TemplateArgumentLoc", "TypeLoc"}
+
def __init__(self, templateClasses):
self.templateClasses = templateClasses
def GenerateBaseGetLocationsDeclaration(self, CladeName):
InstanceDecoration = "*"
- if CladeName == "TypeLoc":
+ if CladeName in self.RefClades:
InstanceDecoration = "&"
self.implementationContent += \
MethodReturnType = 'NodeLocationAccessors'
InstanceDecoration = "*"
- if CladeName == "TypeLoc":
+ if CladeName in self.RefClades:
InstanceDecoration = "&"
Signature = \
RecursionGuardParam = ', TypeLocRecursionGuard'
ArgPrefix = '*'
- if CladeName == "TypeLoc":
+ if CladeName in self.RefClades:
ArgPrefix = ''
self.implementationContent += \
'GetLocations{0}(Prefix, {1}Object, Locs, Rngs {2});'.format(
if (const auto *N = Node.get<{0}>())
""".format(CladeName)
ArgPrefix = ""
- if CladeName == "TypeLoc":
+ if CladeName in self.RefClades:
ArgPrefix = "*"
self.implementationContent += \
"""
return {};
}
NodeLocationAccessors NodeIntrospection::GetLocations(
- clang::NestedNameSpecifierLoc const*) {
+ clang::NestedNameSpecifierLoc const&) {
return {};
}
NodeLocationAccessors NodeIntrospection::GetLocations(
- clang::TemplateArgumentLoc const*) {
+ clang::TemplateArgumentLoc const&) {
return {};
}
NodeLocationAccessors NodeIntrospection::GetLocations(
const auto *NNS = BoundNodes[0].getNodeAs<NestedNameSpecifierLoc>("nns");
- auto Result = NodeIntrospection::GetLocations(NNS);
+ auto Result = NodeIntrospection::GetLocations(*NNS);
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);
const auto *TA = BoundNodes[0].getNodeAs<TemplateArgumentLoc>("ta");
- auto Result = NodeIntrospection::GetLocations(TA);
+ auto Result = NodeIntrospection::GetLocations(*TA);
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);
const auto *TA = BoundNodes[0].getNodeAs<TemplateArgumentLoc>("ta");
- auto Result = NodeIntrospection::GetLocations(TA);
+ auto Result = NodeIntrospection::GetLocations(*TA);
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);
const auto *TA = BoundNodes[0].getNodeAs<TemplateArgumentLoc>("ta");
- auto Result = NodeIntrospection::GetLocations(TA);
+ auto Result = NodeIntrospection::GetLocations(*TA);
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);
const auto *TA = BoundNodes[0].getNodeAs<TemplateArgumentLoc>("ta");
- auto Result = NodeIntrospection::GetLocations(TA);
+ auto Result = NodeIntrospection::GetLocations(*TA);
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);
const auto *TA = BoundNodes[0].getNodeAs<TemplateArgumentLoc>("ta");
- auto Result = NodeIntrospection::GetLocations(TA);
+ auto Result = NodeIntrospection::GetLocations(*TA);
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);
const auto *TA = BoundNodes[0].getNodeAs<TemplateArgumentLoc>("ta");
- auto Result = NodeIntrospection::GetLocations(TA);
+ auto Result = NodeIntrospection::GetLocations(*TA);
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);
const auto *TA = BoundNodes[0].getNodeAs<TemplateArgumentLoc>("ta");
- auto Result = NodeIntrospection::GetLocations(TA);
+ auto Result = NodeIntrospection::GetLocations(*TA);
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);
const auto *TA = BoundNodes[0].getNodeAs<TemplateArgumentLoc>("ta");
- auto Result = NodeIntrospection::GetLocations(TA);
+ auto Result = NodeIntrospection::GetLocations(*TA);
auto ExpectedLocations =
FormatExpected<SourceLocation>(Result.LocationAccessors);