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

Method InsertArgWithParensIfNeeded

CodeGenerator.cpp:4567–4580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4565//-----------------------------------------------------------------------------
4566
4567void CodeGenerator::InsertArgWithParensIfNeeded(const Stmt* stmt)
4568{
4569 const bool needsParens = [&]() {
4570 if(const auto* expr = dyn_cast_or_null<Expr>(stmt)) {
4571 if(const auto* dest = dyn_cast_or_null<UnaryOperator>(expr->IgnoreImplicit())) {
4572 return (dest->getOpcode() == clang::UO_Deref);
4573 }
4574 }
4575
4576 return false;
4577 }();
4578
4579 WrapInParensIfNeeded(needsParens, [&] { InsertArg(stmt); });
4580}
4581//-----------------------------------------------------------------------------
4582
4583void CodeGenerator::InsertSuffix(const QualType& type)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected