diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index e893f5b4627c..69806fa4407d 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -116,6 +116,7 @@ Non-comprehensive list of changes in this release - 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 index b0df0b147fc5..2159dd713910 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -2050,8 +2050,10 @@ static llvm::Value *dumpRecord(CodeGenFunction &CGF, QualType RType, 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;