Fixed a logic error that showed up when compiling with a newer version of clang where:
authorGreg Clayton <gclayton@apple.com>
Mon, 15 Oct 2012 21:16:43 +0000 (21:16 +0000)
committerGreg Clayton <gclayton@apple.com>
Mon, 15 Oct 2012 21:16:43 +0000 (21:16 +0000)
lldb::BasicType
ClangASTContext::GetLLDBBasicTypeEnumeration (clang_type_t clang_type)

would return a bogus value.

llvm-svn: 165979

lldb/source/Symbol/ClangASTContext.cpp

index 57e2ac1..70f4af1 100644 (file)
@@ -3651,11 +3651,10 @@ ClangASTContext::GetLLDBBasicTypeEnumeration (clang_type_t clang_type)
     {
         QualType qual_type(QualType::getFromOpaquePtr(clang_type));
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
-        switch (type_class)
+        if (type_class == clang::Type::Builtin)
         {
-        case clang::Type::Builtin:                  
             switch (cast<clang::BuiltinType>(qual_type)->getKind())
-
+            {
             case clang::BuiltinType::Void:      return eBasicTypeVoid;
             case clang::BuiltinType::Bool:      return eBasicTypeBool;
             case clang::BuiltinType::Char_S:    return eBasicTypeSignedChar;
@@ -3694,6 +3693,7 @@ ClangASTContext::GetLLDBBasicTypeEnumeration (clang_type_t clang_type)
             case clang::BuiltinType::BuiltinFn:
             case clang::BuiltinType::ARCUnbridgedCast:
                 return eBasicTypeOther;
+            }
         }
     }