diff options
author | Anders Carlsson <andersca@mac.com> | 2010-04-24 21:27:51 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-04-24 21:27:51 +0000 |
commit | e04d45e05277ee04997fe59b1d194503f484c846 (patch) | |
tree | 41b741d9440d9413379d952b0449fabe64c12e5e /lib/CodeGen/CGClass.cpp | |
parent | a04efdf635d35d88e65041fad007225d8c8d64a5 (diff) |
Get rid of the old GetNonVirtualBaseClassOffset and change all call sites to use the new version.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102274 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGClass.cpp')
-rw-r--r-- | lib/CodeGen/CGClass.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index 6dea9f77ae..45390c7bdc 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -88,31 +88,6 @@ CodeGenModule::GetNonVirtualBaseClassOffset(const CXXRecordDecl *ClassDecl, Types.ConvertType(getContext().getPointerDiffType()); return llvm::ConstantInt::get(PtrDiffTy, Offset); -} - -llvm::Constant * -CodeGenModule::GetNonVirtualBaseClassOffset(const CXXRecordDecl *Class, - const CXXRecordDecl *BaseClass) { - if (Class == BaseClass) - return 0; - - CXXBasePaths Paths(/*FindAmbiguities=*/false, - /*RecordPaths=*/true, /*DetectVirtual=*/false); - if (!const_cast<CXXRecordDecl *>(Class)-> - isDerivedFrom(const_cast<CXXRecordDecl *>(BaseClass), Paths)) { - assert(false && "Class must be derived from the passed in base class!"); - return 0; - } - - uint64_t Offset = ComputeNonVirtualBaseClassOffset(getContext(), - Paths.front(), 0); - if (!Offset) - return 0; - - const llvm::Type *PtrDiffTy = - Types.ConvertType(getContext().getPointerDiffType()); - - return llvm::ConstantInt::get(PtrDiffTy, Offset); } /// Gets the address of a virtual base class within a complete object. |