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

Method InsertConstructorExpr

CodeGenerator.cpp:2021–2045  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2019//-----------------------------------------------------------------------------
2020
2021void CodeGenerator::InsertConstructorExpr(const auto* stmt)
2022{
2023 {
2024 CONDITIONAL_LAMBDA_SCOPE_HELPER(Decltype, not isa<DecltypeType>(stmt->getType()))
2025
2026 P0315Visitor dt{*this};
2027 dt.TraverseType(stmt->getType());
2028
2029 if(not mLambdaStack.empty()) {
2030 for(const auto& e : mLambdaStack) {
2031 RETURN_IF((LambdaCallerType::MemberCallExpr == e.callerType()) and isa<DecltypeType>(stmt->getType()));
2032 }
2033 }
2034 }
2035
2036 mOutputFormatHelper.Append(GetName(stmt->getType(), Unqualified::Yes));
2037
2038 const BraceKind braceKind = ValueOr(stmt->isListInitialization(), BraceKind::Curlys, BraceKind::Parens);
2039
2040 WrapInParensOrCurlys(braceKind, [&]() {
2041 if(const auto& arguments = stmt->arguments(); not arguments.empty()) {
2042 ForEachArg(stmt->arguments(), [&](const auto& arg) { InsertArg(arg); });
2043 }
2044 });
2045}
2046//-----------------------------------------------------------------------------
2047
2048void CodeGenerator::InsertArg(const CXXConstructExpr* stmt)

Callers

nothing calls this directly

Calls 5

GetNameFunction · 0.85
ValueOrFunction · 0.85
callerTypeMethod · 0.80
AppendMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected