summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-11-19 18:01:14 +0000
committerdim <dim@FreeBSD.org>2011-11-19 18:01:14 +0000
commitfa09afd40854d77a65ec9873200b7baa27629790 (patch)
treeb00e59f52ffd11cd97c8a6b6494b94bc69eb8915 /contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp
parent91c9f9c59de212075e0866994bd4d631eade390f (diff)
downloadFreeBSD-src-fa09afd40854d77a65ec9873200b7baa27629790.zip
FreeBSD-src-fa09afd40854d77a65ec9873200b7baa27629790.tar.gz
Pull in r144505 from upstream clang trunk:
Fix the signature of the getcontext builtin, eliminating incorrect warnings about its prototype. This also adds a -W(no-)builtin-requires-header option, which can be used to enable or disable warnings of this kind. MFC after: 1 week
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp')
-rw-r--r--contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp b/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp
index fe1cc30..de19d85 100644
--- a/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp
+++ b/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp
@@ -2659,6 +2659,24 @@ void ASTReader::InitializeContext() {
if (Context.ObjCSelRedefinitionType.isNull())
Context.ObjCSelRedefinitionType = GetType(ObjCSelRedef);
}
+
+ if (unsigned Ucontext_t = SpecialTypes[SPECIAL_TYPE_UCONTEXT_T]) {
+ QualType Ucontext_tType = GetType(Ucontext_t);
+ if (Ucontext_tType.isNull()) {
+ Error("ucontext_t type is NULL");
+ return;
+ }
+
+ if (!Context.ucontext_tDecl) {
+ if (const TypedefType *Typedef = Ucontext_tType->getAs<TypedefType>())
+ Context.setucontext_tDecl(Typedef->getDecl());
+ else {
+ const TagType *Tag = Ucontext_tType->getAs<TagType>();
+ assert(Tag && "Invalid ucontext_t type in AST file");
+ Context.setucontext_tDecl(Tag->getDecl());
+ }
+ }
+ }
}
ReadPragmaDiagnosticMappings(Context.getDiagnostics());
OpenPOWER on IntegriCloud