forked from OSchip/llvm-project
Only provide a source location for an anonymous tag if the location is valid
llvm-svn: 105010
This commit is contained in:
parent
0fa67e479a
commit
7e5aeac10a
|
@ -452,11 +452,13 @@ void TypePrinter::PrintTag(TagDecl *D, std::string &InnerString) {
|
|||
if (!HasKindDecoration)
|
||||
OS << " " << D->getKindName();
|
||||
|
||||
PresumedLoc PLoc = D->getASTContext().getSourceManager().getPresumedLoc(
|
||||
D->getLocation());
|
||||
OS << " at " << PLoc.getFilename()
|
||||
<< ':' << PLoc.getLine()
|
||||
<< ':' << PLoc.getColumn();
|
||||
if (D->getLocation().isValid()) {
|
||||
PresumedLoc PLoc = D->getASTContext().getSourceManager().getPresumedLoc(
|
||||
D->getLocation());
|
||||
OS << " at " << PLoc.getFilename()
|
||||
<< ':' << PLoc.getLine()
|
||||
<< ':' << PLoc.getColumn();
|
||||
}
|
||||
}
|
||||
|
||||
OS << '>';
|
||||
|
|
Loading…
Reference in New Issue