summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-05 21:25:31 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-05 21:25:31 +0000
commitcf04b02d1d099ecf6068228043383c61df9f7c84 (patch)
tree293c7583f1662d23a37867ef0ec497719d533c94 /clang/lib/Sema
parent6e085c1efec8e05942b2c7e79b9e708dc8bb5ec2 (diff)
downloadbcm5719-llvm-cf04b02d1d099ecf6068228043383c61df9f7c84.tar.gz
bcm5719-llvm-cf04b02d1d099ecf6068228043383c61df9f7c84.zip
Extend the type printing policy to allow one to turn off the printing
of file locations for anonymous tag types (e.g., "enum <anonymous at t.h:15:6>"), which can get rather long. llvm-svn: 100470
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 317eef8d60f..df14aa7fc5a 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -1338,8 +1338,11 @@ static void AddResultTypeChunk(ASTContext &Context,
if (T.isNull() || Context.hasSameType(T, Context.DependentTy))
return;
+ PrintingPolicy Policy(Context.PrintingPolicy);
+ Policy.AnonymousTagLocations = false;
+
std::string TypeStr;
- T.getAsStringInternal(TypeStr, Context.PrintingPolicy);
+ T.getAsStringInternal(TypeStr, Policy);
Result->AddResultTypeChunk(TypeStr);
}
OpenPOWER on IntegriCloud