summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-11-13 21:51:09 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-11-13 21:51:09 +0000
commit6cfa82bc5f0dae53f6cc39a0cbdba960119852cc (patch)
treeb4ebc7e299075b23f4a46d4c8754ec9287fe5ee4 /clang/lib/Serialization/ASTReader.cpp
parent8e1d906734d72a94afa1c2ca35465265ff0df50d (diff)
downloadbcm5719-llvm-6cfa82bc5f0dae53f6cc39a0cbdba960119852cc.tar.gz
bcm5719-llvm-6cfa82bc5f0dae53f6cc39a0cbdba960119852cc.zip
Fix the signature of the getcontext builtin. Patch by Dimitry Andric.
llvm-svn: 144505
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 3e2dc7c6faf..80b582e246d 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -2660,6 +2660,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