]> granicus.if.org Git - clang/commitdiff
Bad cast...need to use dyn_cast_or_null. Also changed Sema::InitBuiltinVaListType...
authorSteve Naroff <snaroff@apple.com>
Tue, 16 Oct 2007 00:00:18 +0000 (00:00 +0000)
committerSteve Naroff <snaroff@apple.com>
Tue, 16 Oct 2007 00:00:18 +0000 (00:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43023 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaDecl.cpp
Sema/SemaExpr.cpp
clang.xcodeproj/project.pbxproj

index 62f3fabe7d263f4d61e9f3de86e00c5df1e1fbe0..232c5ba2e2e965bd78e37d4b80d139d49e670d2e 100644 (file)
@@ -154,7 +154,7 @@ void Sema::InitBuiltinVaListType()
   IdentifierInfo *VaIdent = &Context.Idents.get("__builtin_va_list");
   ScopedDecl *VaDecl = LookupScopedDecl(VaIdent, Decl::IDNS_Ordinary, 
                                           SourceLocation(), TUScope);
-  TypedefDecl *VaTypedef = cast<TypedefDecl>(VaDecl);
+  TypedefDecl *VaTypedef = dyn_cast_or_null<TypedefDecl>(VaDecl);
   Context.setBuiltinVaListType(Context.getTypedefType(VaTypedef));
 }
 
index 29a3b667be8caec084b927a05e56ec3b7ab8a82c..8ee0913f99382281d45f95bbddeb38dca570f2e5 100644 (file)
@@ -1896,9 +1896,9 @@ Sema::ExprResult Sema::ParseObjCStringLiteral(ExprTy *string) {
     IdentifierInfo *NSIdent = &Context.Idents.get("NSConstantString");
     ScopedDecl *IFace = LookupScopedDecl(NSIdent, Decl::IDNS_Ordinary, 
                                          SourceLocation(), TUScope);
-    ObjcInterfaceDecl *stringInterface = cast<ObjcInterfaceDecl>(IFace);
-    assert(stringInterface && "missing '@interface NSConstantString'");
-    Context.setObjcConstantStringInterface(stringInterface);
+    ObjcInterfaceDecl *strIFace = dyn_cast_or_null<ObjcInterfaceDecl>(IFace);
+    assert(strIFace && "missing '@interface NSConstantString'");
+    Context.setObjcConstantStringInterface(strIFace);
   }
   QualType t = Context.getObjcConstantStringInterface();
   t = Context.getPointerType(t);
index 75d938806b0068e9faf478a9935977559b88f772..b88c381faa0b21298a15082c3f3667bb0e3dacc7 100644 (file)
                08FB7793FE84155DC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
                        projectDirPath = "";