aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index fa0ebc8a86..9a9c95aa2d 100644
--- a/lib/AST/ASTContext.cpp
+++ b/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)