diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-07-24 20:34:41 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-07-24 20:34:41 +0000 |
| commit | bd210e638aca82850ff77832b5be8579d9950c87 (patch) | |
| tree | b4239051c1ffc0142ad6dee0f1a57fe2c0992f99 /clang/lib | |
| parent | 1bbe346cef04e3d98ab4d7bab3dd84e1f4c2acd0 (diff) | |
| download | bcm5719-llvm-bd210e638aca82850ff77832b5be8579d9950c87.tar.gz bcm5719-llvm-bd210e638aca82850ff77832b5be8579d9950c87.zip | |
DI: Make getOrCreateLimitedType() return DICompositeType, NFC
Change `getOrCreateLimitedType()` to return a `DICompositeType` and
remove the casts from its callers. Inside, I've strengthened a `cast`
from `DICompositeTypeBase`, but the casts in the callers already prove
that this is safe. There should be no functionality change here.
llvm-svn: 243155
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 10 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.h | 3 |
2 files changed, 6 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 9d115e3c0c7..d993b112f58 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1509,9 +1509,7 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const RecordType *Ty) { // its members. Finally, we create a descriptor for the complete type (which // may refer to the forward decl if the struct is recursive) and replace all // uses of the forward declaration with the final definition. - - auto *FwdDecl = - cast<llvm::DICompositeType>(getOrCreateLimitedType(Ty, DefUnit)); + llvm::DICompositeType *FwdDecl = getOrCreateLimitedType(Ty, DefUnit); const RecordDecl *D = RD->getDefinition(); if (!D || !D->isCompleteDefinition()) @@ -2175,11 +2173,11 @@ llvm::DIType *CGDebugInfo::CreateTypeNode(QualType Ty, llvm::DIFile *Unit) { llvm_unreachable("type should have been unwrapped!"); } -llvm::DIType *CGDebugInfo::getOrCreateLimitedType(const RecordType *Ty, - llvm::DIFile *Unit) { +llvm::DICompositeType *CGDebugInfo::getOrCreateLimitedType(const RecordType *Ty, + llvm::DIFile *Unit) { QualType QTy(Ty, 0); - auto *T = cast_or_null<llvm::DICompositeTypeBase>(getTypeOrNull(QTy)); + auto *T = cast_or_null<llvm::DICompositeType>(getTypeOrNull(QTy)); // We may have cached a forward decl when we could have created // a non-forward decl. Go ahead and create a non-forward decl diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index 73227bc118c..29254835439 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -390,7 +390,8 @@ private: /// Get the type from the cache or create a new partial type if /// necessary. - llvm::DIType *getOrCreateLimitedType(const RecordType *Ty, llvm::DIFile *F); + llvm::DICompositeType *getOrCreateLimitedType(const RecordType *Ty, + llvm::DIFile *F); /// Create type metadata for a source language type. llvm::DIType *CreateTypeNode(QualType Ty, llvm::DIFile *Fg); |

