summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-27 22:38:19 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-27 22:38:19 +0000
commitc0b07286cf9d303958d2d21c0548403086c87e36 (patch)
treef7620d339f3b00c699e65fd82972cfde71c93b13 /clang/lib/AST/ASTContext.cpp
parentac8dbf0fc70ca56fa6c7bda4e9b76323102ba65a (diff)
downloadbcm5719-llvm-c0b07286cf9d303958d2d21c0548403086c87e36.tar.gz
bcm5719-llvm-c0b07286cf9d303958d2d21c0548403086c87e36.zip
When 'bool' is not a built-in type but is defined as a macro, print
'bool' rather than '_Bool' within types, to make things a bit more readable. Fixes <rdar://problem/10063263>. llvm-svn: 140650
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index fa0ebc8a863..9a9c95aa2db 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -231,11 +231,11 @@ ASTContext::ASTContext(LangOptions& LOpts, SourceManager &SM,
BlockDescriptorExtendedType(0), cudaConfigureCallDecl(0),
NullTypeSourceInfo(QualType()),
SourceMgr(SM), LangOpts(LOpts),
- AddrSpaceMap(0), Target(t),
+ AddrSpaceMap(0), Target(t), PrintingPolicy(LOpts),
Idents(idents), Selectors(sels),
BuiltinInfo(builtins),
DeclarationNames(*this),
- ExternalSource(0), Listener(0), PrintingPolicy(LOpts),
+ ExternalSource(0), Listener(0),
LastSDM(0, 0),
UniqueBlockByRefTypeID(0)
{
@@ -4385,7 +4385,7 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
= TemplateSpecializationType::PrintTemplateArgumentList(
TemplateArgs.data(),
TemplateArgs.size(),
- (*this).PrintingPolicy);
+ (*this).getPrintingPolicy());
S += TemplateArgsStr;
}
@@ -6475,6 +6475,12 @@ MangleContext *ASTContext::createMangleContext() {
CXXABI::~CXXABI() {}
+PrintingPolicy ASTContext::getPrintingPolicy() const {
+ PrintingPolicy.Bool
+ = LangOpts.Bool || Idents.get("bool").hasMacroDefinition();
+ return PrintingPolicy;
+}
+
size_t ASTContext::getSideTableAllocatedMemory() const {
return ASTRecordLayouts.getMemorySize()
+ llvm::capacity_in_bytes(ObjCLayouts)
OpenPOWER on IntegriCloud