[cfe-commits] r105010 - /cfe/trunk/lib/AST/TypePrinter.cpp
Douglas Gregor
dgregor at apple.com
Fri May 28 14:47:04 PDT 2010
Author: dgregor
Date: Fri May 28 16:47:04 2010
New Revision: 105010
URL: http://llvm.org/viewvc/llvm-project?rev=105010&view=rev
Log:
Only provide a source location for an anonymous tag if the location is valid
Modified:
cfe/trunk/lib/AST/TypePrinter.cpp
Modified: cfe/trunk/lib/AST/TypePrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypePrinter.cpp?rev=105010&r1=105009&r2=105010&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypePrinter.cpp (original)
+++ cfe/trunk/lib/AST/TypePrinter.cpp Fri May 28 16:47:04 2010
@@ -452,11 +452,13 @@
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 << '>';
More information about the cfe-commits
mailing list