Skip to content

Update GetFunctionArgName API for template functions#224

Merged
vgvassilev merged 2 commits intocompiler-research:mainfrom
aaronj0:update-functionargname
Apr 10, 2024
Merged

Update GetFunctionArgName API for template functions#224
vgvassilev merged 2 commits intocompiler-research:mainfrom
aaronj0:update-functionargname

Conversation

@aaronj0
Copy link
Copy Markdown
Collaborator

@aaronj0 aaronj0 commented Apr 9, 2024

No description provided.

EXPECT_EQ(Cpp::GetFunctionArgName(Decls[1], 2), "l");
EXPECT_EQ(Cpp::GetFunctionArgName(Decls[1], 3), "ch");

// EXPECT_EQ(Cpp::GetFunctionArgName(Decls[2], 0), "");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the commented code or I comment it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these tests pass, have uncommented

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

auto *D = (clang::Decl *)func;
auto *FD = llvm::cast<clang::FunctionDecl>(D);
auto PI = FD->getParamDecl(param_index);
clang::ParmVarDecl* PI;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'PI' is not initialized [cppcoreguidelines-init-variables]

Suggested change
clang::ParmVarDecl* PI;
clang::ParmVarDecl* PI = nullptr;

@vgvassilev vgvassilev merged commit ffeec07 into compiler-research:main Apr 10, 2024
@aaronj0 aaronj0 deleted the update-functionargname branch April 22, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants