[cfe-commits] r92278 - /cfe/trunk/lib/CodeGen/CGRTTI.cpp

Chris Lattner clattner at apple.com
Tue Dec 29 14:43:13 PST 2009


On Dec 29, 2009, at 2:30 PM, Anders Carlsson wrote:

> Author: andersca
> Date: Tue Dec 29 16:30:11 2009
> New Revision: 92278
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=92278&view=rev
> Log:
> Match gcc and treat vector types as fundamental types.

Actually, the GCC folks just changed their mangling of vectors:
http://gcc.gnu.org/ml/gcc-patches/2009-12/msg01030.html

Among other things, it was changed because you couldn't define overload on vectors with the same element type but different width.  I think we should follow the 'new' gcc model.

-Chris

> 
> Modified:
>    cfe/trunk/lib/CodeGen/CGRTTI.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CGRTTI.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRTTI.cpp?rev=92278&r1=92277&r2=92278&view=diff
> 
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGRTTI.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGRTTI.cpp Tue Dec 29 16:30:11 2009
> @@ -371,11 +371,9 @@
>     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 @@
>     return llvm::GlobalValue::ExternalLinkage;
>   }
> 
> +  case Type::Vector:
> +  case Type::ExtVector:
>   case Type::Builtin:
>     return llvm::GlobalValue::WeakODRLinkage;
> 
> @@ -691,6 +691,13 @@
>   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 @@
>     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: {
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list