MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / ScopeHandler

Method ScopeHandler

InsightsHelpers.cpp:22–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20namespace clang::insights {
21
22ScopeHandler::ScopeHandler(const Decl* d)
23: mStack{mGlobalStack}
24, mHelper{mScope.length()}
25{
26 mStack.push(mHelper);
27
28 if(const auto* recordDecl = dyn_cast_or_null<CXXRecordDecl>(d)) {
29 mScope.append(GetName(*recordDecl));
30
31 if(const auto* classTmplSpec = dyn_cast_or_null<ClassTemplateSpecializationDecl>(recordDecl)) {
32 OutputFormatHelper ofm{};
33 CodeGenerator codeGenerator{ofm};
34 codeGenerator.InsertTemplateArgs(*classTmplSpec);
35
36 mScope.append(ofm);
37 }
38
39 } else if(const auto* namespaceDecl = dyn_cast_or_null<NamespaceDecl>(d)) {
40 mScope.append(namespaceDecl->getName());
41 }
42
43 if(not mScope.empty()) {
44 mScope.append("::");
45 }
46}
47//-----------------------------------------------------------------------------
48
49ScopeHandler::~ScopeHandler()

Callers

nothing calls this directly

Calls 5

GetNameFunction · 0.85
pushMethod · 0.80
getNameMethod · 0.80
InsertTemplateArgsMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected