]> granicus.if.org Git - clang/commitdiff
Match gcc and treat vector types as fundamental types.
authorAnders Carlsson <andersca@mac.com>
Tue, 29 Dec 2009 22:30:11 +0000 (22:30 +0000)
committerAnders Carlsson <andersca@mac.com>
Tue, 29 Dec 2009 22:30:11 +0000 (22:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92278 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGRTTI.cpp

index 0e3db3a09553dd8ddaedfc3be8e91f64935b5731..ff7e27336bb0872cf1ed9a7a2b4376db0dc7718f 100644 (file)
@@ -371,11 +371,9 @@ public:
     case Type::IncompleteArray:
     case Type::VariableArray:
     case Type::Enum:
-      return BuildTypeInfo(Ty);
-
     case Type::Vector:
     case Type::ExtVector:
-      return BuildSimpleType(Ty, "_ZTVN10__cxxabiv117__array_type_infoE");
+      return BuildTypeInfo(Ty);
     }
   }
   
@@ -649,6 +647,8 @@ static llvm::GlobalVariable::LinkageTypes getTypeInfoLinkage(QualType Ty) {
     return llvm::GlobalValue::ExternalLinkage;
   }
 
+  case Type::Vector:
+  case Type::ExtVector:
   case Type::Builtin:
     return llvm::GlobalValue::WeakODRLinkage;
 
@@ -691,6 +691,13 @@ void RTTIBuilder::BuildVtablePointer(const Type *Ty) {
   switch (Ty->getTypeClass()) {
   default: assert(0 && "Unhandled type!");
 
+  // GCC treats vector types as fundamental types.
+  case Type::Vector:
+  case Type::ExtVector:
+    // abi::__fundamental_type_info
+    VtableName = "_ZTVN10__cxxabiv123__fundamental_type_infoE";
+    break;
+
   case Type::ConstantArray:
   case Type::IncompleteArray:
     // abi::__array_type_info
@@ -774,21 +781,28 @@ llvm::Constant *RTTIBuilder::BuildTypeInfo(QualType Ty) {
     assert(false && "Builtin type info must be in the standard library!");
     break;
 
+  // GCC treats vector types as fundamental types.
+  case Type::Vector:
+  case Type::ExtVector:
+    // Itanium C++ ABI 2.9.5p4:
+    // abi::__fundamental_type_info adds no data members to std::type_info.
+    break;
+      
   case Type::ConstantArray:
   case Type::IncompleteArray:
-    // Itanium C++ ABI 2.9.5p4:
-    // abi::__array_type_info adds no data members to std::type_info;
+    // Itanium C++ ABI 2.9.5p5:
+    // abi::__array_type_info adds no data members to std::type_info.
     break;
 
   case Type::FunctionNoProto:
   case Type::FunctionProto:
-    // Itanium C++ ABI 2.9.5p4:
-    // abi::__function_type_info adds no data members to std::type_info;
+    // Itanium C++ ABI 2.9.5p5:
+    // abi::__function_type_info adds no data members to std::type_info.
     break;
 
   case Type::Enum:
-    // Itanium C++ ABI 2.9.5p4:
-    // abi::__enum_type_info adds no data members to std::type_info;
+    // Itanium C++ ABI 2.9.5p5:
+    // abi::__enum_type_info adds no data members to std::type_info.
     break;
 
   case Type::Record: {