diff options
author | Mike Stump <mrs@apple.com> | 2009-07-28 02:25:19 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-07-28 02:25:19 +0000 |
commit | 782fa308a765aeac2acb39c4e697c937ec21185b (patch) | |
tree | 3bd6c43f32e0d1c70fb66aed8a15c0332c86b1d1 /lib/Frontend | |
parent | 0cfeb63f532973777f6fe75d3468c3acad4adfe3 (diff) |
Make longjmp a real builtin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 22 | ||||
-rw-r--r-- | lib/Frontend/PCHWriter.cpp | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index f21fc62522..8665705f68 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -1540,6 +1540,28 @@ void PCHReader::InitializeContext(ASTContext &Ctx) { Context->setFILEDecl(Tag->getDecl()); } } + if (unsigned Jmp_buf = SpecialTypes[pch::SPECIAL_TYPE_jmp_buf]) { + QualType Jmp_bufType = GetType(Jmp_buf); + assert(!Jmp_bufType.isNull() && "jmp_bug type is NULL"); + if (const TypedefType *Typedef = Jmp_bufType->getAsTypedefType()) + Context->setjmp_bufDecl(Typedef->getDecl()); + else { + const TagType *Tag = Jmp_bufType->getAsTagType(); + assert(Tag && "Invalid jmp_bug type in PCH file"); + Context->setjmp_bufDecl(Tag->getDecl()); + } + } + if (unsigned Sigjmp_buf = SpecialTypes[pch::SPECIAL_TYPE_sigjmp_buf]) { + QualType Sigjmp_bufType = GetType(Sigjmp_buf); + assert(!Sigjmp_bufType.isNull() && "sigjmp_buf type is NULL"); + if (const TypedefType *Typedef = Sigjmp_bufType->getAsTypedefType()) + Context->setsigjmp_bufDecl(Typedef->getDecl()); + else { + const TagType *Tag = Sigjmp_bufType->getAsTagType(); + assert(Tag && "Invalid sigjmp_buf type in PCH file"); + Context->setsigjmp_bufDecl(Tag->getDecl()); + } + } } /// \brief Retrieve the name of the original source file name diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index 13f564d012..69247d3e85 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -1840,6 +1840,8 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls, AddTypeRef(Context.getRawCFConstantStringType(), Record); AddTypeRef(Context.getRawObjCFastEnumerationStateType(), Record); AddTypeRef(Context.getFILEType(), Record); + AddTypeRef(Context.getjmp_bufType(), Record); + AddTypeRef(Context.getsigjmp_bufType(), Record); Stream.EmitRecord(pch::SPECIAL_TYPES, Record); // Keep writing types and declarations until all types and |