Skip to content

Properly emit typedefs where the name is in the middle of the type. #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions clang/lib/3C/DeclRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ void DeclRewriter::rewriteDecls(ASTContext &Context, ProgramInfo &Info,
if (Var.anyChanges(Env)) {
std::string newTy =
getStorageQualifierString(D) +
Var.mkString(Info.getConstraints().getVariables(), false,
false, false, true) +
" " + TD->getNameAsString();
Var.mkString(Info.getConstraints().getVariables(), true,
false, false, true);
RewriteThese.insert(
new TypedefDeclReplacement(TD, nullptr, newTy));
}
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/3C/ProgramInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ bool ProgramInfo::seenTypedef(PersistentSourceLoc PSL) {

void ProgramInfo::addTypedef(PersistentSourceLoc PSL, bool CanRewriteDef,
TypedefDecl* TD, ASTContext &C) {
auto Name = "typedef__" + TD->getNameAsString();
auto Name = TD->getNameAsString();
auto* PV = new PointerVariableConstraint(TD->getUnderlyingType(), nullptr,
Name, *this, C);
auto *const Rsn =
Expand Down