diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -116,6 +116,7 @@ - Improve __builtin_dump_struct: - Support bitfields in struct and union. - Improve the dump format, dump both bitwidth(if its a bitfield) and field value. + - Remove anonymous tag locations. New Compiler Flags ------------------ diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -2050,8 +2050,10 @@ RecordDecl *RD = RType->castAs()->getDecl()->getDefinition(); std::string Pad = std::string(Lvl * 4, ' '); + PrintingPolicy Policy(Context.getLangOpts()); + Policy.AnonymousTagLocations = false; Value *GString = - CGF.Builder.CreateGlobalStringPtr(RType.getAsString() + " {\n"); + CGF.Builder.CreateGlobalStringPtr(RType.getAsString(Policy) + " {\n"); Value *Res = CGF.Builder.CreateCall(Func, {GString}); static llvm::DenseMap Types;