r174292 - CodeGen: Remove unnecessary const_casts. No functionality change.
Benjamin Kramer
benny.kra at googlemail.com
Sun Feb 3 10:55:35 PST 2013
Author: d0k
Date: Sun Feb 3 12:55:34 2013
New Revision: 174292
URL: http://llvm.org/viewvc/llvm-project?rev=174292&view=rev
Log:
CodeGen: Remove unnecessary const_casts. No functionality change.
Modified:
cfe/trunk/lib/AST/VTableBuilder.cpp
Modified: cfe/trunk/lib/AST/VTableBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/VTableBuilder.cpp?rev=174292&r1=174291&r2=174292&view=diff
==============================================================================
--- cfe/trunk/lib/AST/VTableBuilder.cpp (original)
+++ cfe/trunk/lib/AST/VTableBuilder.cpp Sun Feb 3 12:55:34 2013
@@ -257,11 +257,9 @@ static BaseOffset ComputeBaseOffset(ASTC
const CXXRecordDecl *DerivedRD) {
CXXBasePaths Paths(/*FindAmbiguities=*/false,
/*RecordPaths=*/true, /*DetectVirtual=*/false);
-
- if (!const_cast<CXXRecordDecl *>(DerivedRD)->
- isDerivedFrom(const_cast<CXXRecordDecl *>(BaseRD), Paths)) {
+
+ if (!DerivedRD->isDerivedFrom(BaseRD, Paths))
llvm_unreachable("Class must be derived from the passed in base class!");
- }
return ComputeBaseOffset(Context, DerivedRD, Paths.front());
}
@@ -1202,10 +1200,8 @@ VTableBuilder::ComputeThisAdjustmentBase
CXXBasePaths Paths(/*FindAmbiguities=*/true,
/*RecordPaths=*/true, /*DetectVirtual=*/true);
- if (!const_cast<CXXRecordDecl *>(DerivedRD)->
- isDerivedFrom(const_cast<CXXRecordDecl *>(BaseRD), Paths)) {
+ if (!DerivedRD->isDerivedFrom(BaseRD, Paths))
llvm_unreachable("Class must be derived from the passed in base class!");
- }
// We have to go through all the paths, and see which one leads us to the
// right base subobject.
More information about the cfe-commits
mailing list