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

Method InsertArg

CodeGenerator.cpp:215–224  ·  view source on GitHub ↗

Replace every \c VarDecl with the given variable name. This cover init captures which introduce a new name. However, it means that _all_ VarDecl's will be changed. TODO: Check if it is really good to replace all VarDecl's

Source from the content-addressed store, hash-verified

213 /// However, it means that _all_ VarDecl's will be changed.
214 /// TODO: Check if it is really good to replace all VarDecl's
215 void InsertArg(const DeclRefExpr* stmt) override
216 {
217 if(isa<VarDecl>(stmt->getDecl())) {
218 mOutputFormatHelper.Append("_"sv, mVarName);
219
220 } else {
221
222 CodeGenerator::InsertArg(stmt);
223 }
224 }
225
226private:
227 std::string_view mVarName; ///< The name of the variable that needs to be prefixed with _.

Callers

nothing calls this directly

Calls 1

AppendMethod · 0.80

Tested by

no test coverage detected