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

Method MacroDefined

Insights.cpp:147–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145 }
146
147 void MacroDefined(const Token& macroNameTok, const MacroDirective* md) override
148 {
149 const auto loc = md->getLocation();
150 if(not mSm.isWrittenInMainFile(loc)) {
151 return;
152 }
153
154 auto name = mPP.getSpelling(macroNameTok);
155
156 if(not name.starts_with("INSIGHTS_"sv)) {
157 return;
158 }
159
160 mIncludes.emplace_back(loc, StrCat("#define "sv, name, "\n"sv));
161 }
162};
163
164class CppInsightASTConsumer final : public ASTConsumer

Callers

nothing calls this directly

Calls 1

StrCatFunction · 0.85

Tested by

no test coverage detected