diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-04 21:44:19 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-04 21:44:19 +0000 |
commit | 006113841bdae1edb77aef75ba1ffdf2e55a3094 (patch) | |
tree | 58cbf9843a8b787b3067625bd20eea5f543b3f6f /lib | |
parent | 691d77f20763915fc7c9b34e29939d225fd0b4d2 (diff) |
Don't try to install the __[u]int128_t identifier if it is already installed by PCHReader.
Currently, adding it to visible decls of a PCH'ed translation unit has no effect because
adding visible decls before deserialization has no effect (the decls won't be visible).
This will be fixed in a future commit; then it will force deserialization of visible decls, so avoid pointlessly installing it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/ASTContext.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 3 | ||||
-rw-r--r-- | lib/Frontend/PCHWriter.cpp | 1 | ||||
-rw-r--r-- | lib/Sema/Sema.cpp | 4 |
4 files changed, 9 insertions, 3 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index f8f568cbb4..24ddb127bd 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -141,8 +141,8 @@ ASTContext::ASTContext(const LangOptions& LOpts, SourceManager &SM, bool FreeMem, unsigned size_reserve) : TemplateSpecializationTypes(this_()), DependentTemplateSpecializationTypes(this_()), - GlobalNestedNameSpecifier(0), CFConstantStringTypeDecl(0), - NSConstantStringTypeDecl(0), + GlobalNestedNameSpecifier(0), IsInt128Installed(false), + CFConstantStringTypeDecl(0), NSConstantStringTypeDecl(0), ObjCFastEnumerationStateTypeDecl(0), FILEDecl(0), jmp_bufDecl(0), sigjmp_bufDecl(0), BlockDescriptorType(0), BlockDescriptorExtendedType(0), NullTypeSourceInfo(QualType()), diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 198fd434c8..27ca86f2f1 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -1769,6 +1769,9 @@ void PCHReader::InitializeContext(ASTContext &Ctx) { Context->ObjCSelRedefinitionType = GetType(ObjCSelRedef); if (unsigned String = SpecialTypes[pch::SPECIAL_TYPE_NS_CONSTANT_STRING]) Context->setNSConstantStringType(GetType(String)); + + if (SpecialTypes[pch::SPECIAL_TYPE_INT128_INSTALLED]) + Context->setInt128Installed(); } /// \brief Retrieve the name of the original source file name diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index 52db0ee1e7..1177b9452b 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -2159,6 +2159,7 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls, AddTypeRef(Context.getRawBlockdescriptorExtendedType(), Record); AddTypeRef(Context.ObjCSelRedefinitionType, Record); AddTypeRef(Context.getRawNSConstantStringType(), Record); + Record.push_back(Context.isInt128Installed()); Stream.EmitRecord(pch::SPECIAL_TYPES, Record); // Keep writing types and declarations until all types and diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 3e23ad3030..6194c293d2 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -46,7 +46,8 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) { VAListTagName = PP.getIdentifierInfo("__va_list_tag"); - if (PP.getTargetInfo().getPointerWidth(0) >= 64) { + if (!Context.isInt128Installed() && // May be set by PCHReader. + PP.getTargetInfo().getPointerWidth(0) >= 64) { TypeSourceInfo *TInfo; // Install [u]int128_t for 64-bit targets. @@ -61,6 +62,7 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) { SourceLocation(), &Context.Idents.get("__uint128_t"), TInfo), TUScope); + Context.setInt128Installed(); } |