diff options
author | John McCall <rjmccall@apple.com> | 2011-01-19 06:33:43 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-01-19 06:33:43 +0000 |
commit | 424cec97bdff219cd976dce85a405140069c57f9 (patch) | |
tree | 2398a9d0ab79460797b9e343d9e163f6b2b15a13 /clang/lib/CodeGen | |
parent | 0c49533039cba8214ada637dd313f54c6a5a8364 (diff) | |
download | bcm5719-llvm-424cec97bdff219cd976dce85a405140069c57f9.tar.gz bcm5719-llvm-424cec97bdff219cd976dce85a405140069c57f9.zip |
Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.
llvm-svn: 123814
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 6 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 3 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenTBAA.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenTypes.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenTypes.h | 2 |
6 files changed, 7 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index daa9052fdac..3cf128b8c65 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -821,7 +821,7 @@ CodeGenFunction::GenerateBlockFunction(GlobalDecl GD, const BlockExpr *BExpr, SC_Static, SC_None, false, HasPrototype); - if (FunctionProtoType *FT = dyn_cast<FunctionProtoType>(FnType)) { + if (const FunctionProtoType *FT = dyn_cast<FunctionProtoType>(FnType)) { const FunctionDecl *CFD = dyn_cast<FunctionDecl>(CurCodeDecl); FunctionDecl *FD = const_cast<FunctionDecl *>(CFD); llvm::SmallVector<ParmVarDecl*, 16> Params; diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index ba0c8ca8e21..fb851dd2861 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1307,11 +1307,9 @@ static QualType UnwrapTypeForDebugInfo(QualType T) { case Type::TemplateSpecialization: T = cast<TemplateSpecializationType>(T)->desugar(); break; - case Type::TypeOfExpr: { - TypeOfExprType *Ty = cast<TypeOfExprType>(T); - T = Ty->getUnderlyingExpr()->getType(); + case Type::TypeOfExpr: + T = cast<TypeOfExprType>(T)->getUnderlyingExpr()->getType(); break; - } case Type::TypeOf: T = cast<TypeOfType>(T)->getUnderlyingType(); break; diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 0a192457a4f..a648b9c6b3b 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -2065,8 +2065,7 @@ Value *ScalarExprEmitter::EmitCompare(const BinaryOperator *E,unsigned UICmpOpc, *SecondVecArg = RHS; QualType ElTy = LHSTy->getAs<VectorType>()->getElementType(); - Type *Ty = CGF.getContext().getCanonicalType(ElTy).getTypePtr(); - const BuiltinType *BTy = dyn_cast<BuiltinType>(Ty); + const BuiltinType *BTy = ElTy->getAs<BuiltinType>(); BuiltinType::Kind ElementKind = BTy->getKind(); switch(E->getOpcode()) { diff --git a/clang/lib/CodeGen/CodeGenTBAA.cpp b/clang/lib/CodeGen/CodeGenTBAA.cpp index 71b43010e63..b231e9e140b 100644 --- a/clang/lib/CodeGen/CodeGenTBAA.cpp +++ b/clang/lib/CodeGen/CodeGenTBAA.cpp @@ -100,7 +100,7 @@ CodeGenTBAA::getTBAAInfo(QualType QTy) { if (TypeHasMayAlias(QTy)) return getChar(); - Type *Ty = Context.getCanonicalType(QTy).getTypePtr(); + const Type *Ty = Context.getCanonicalType(QTy).getTypePtr(); if (llvm::MDNode *N = MetadataCache[Ty]) return N; diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index 6658179d7f9..0a1f76d297a 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/lib/CodeGen/CodeGenTypes.cpp @@ -85,7 +85,7 @@ const llvm::Type *CodeGenTypes::ConvertTypeRecursive(QualType T) { T = Context.getCanonicalType(T); // See if type is already cached. - llvm::DenseMap<Type *, llvm::PATypeHolder>::iterator + llvm::DenseMap<const Type *, llvm::PATypeHolder>::iterator I = TypeCache.find(T.getTypePtr()); // If type is found in map and this is not a definition for a opaque // place holder type then use it. Otherwise, convert type T. diff --git a/clang/lib/CodeGen/CodeGenTypes.h b/clang/lib/CodeGen/CodeGenTypes.h index c2b0b75878f..41513daf17c 100644 --- a/clang/lib/CodeGen/CodeGenTypes.h +++ b/clang/lib/CodeGen/CodeGenTypes.h @@ -88,7 +88,7 @@ private: /// and maps llvm::Types to corresponding clang::Type. llvm::PATypeHolder is /// used instead of llvm::Type because it allows us to bypass potential /// dangling type pointers due to type refinement on llvm side. - llvm::DenseMap<Type *, llvm::PATypeHolder> TypeCache; + llvm::DenseMap<const Type *, llvm::PATypeHolder> TypeCache; /// ConvertNewType - Convert type T into a llvm::Type. Do not use this /// method directly because it does not do any type caching. This method |