diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2018-03-31 18:26:25 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2018-03-31 18:26:25 +0000 |
| commit | e7c7d70278d1fc7e1badf243d5e02ecd2011c881 (patch) | |
| tree | 26231a15be891271d44d01aee76ca6973fae9125 /clang/lib/CodeGen | |
| parent | 6124cae8f7656c9c75941dc2f480404dde491200 (diff) | |
| download | bcm5719-llvm-e7c7d70278d1fc7e1badf243d5e02ecd2011c881.tar.gz bcm5719-llvm-e7c7d70278d1fc7e1badf243d5e02ecd2011c881.zip | |
Revert r328845, it caused crbug.com/827810.
llvm-svn: 328922
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/CodeGen/MicrosoftCXXABI.cpp | 24 |
2 files changed, 14 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 0f7ac725d58..42c0210e1df 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1416,7 +1416,7 @@ llvm::DISubprogram *CGDebugInfo::CreateCXXMemberFunction( // deleting dtor. const auto *DD = dyn_cast<CXXDestructorDecl>(Method); GlobalDecl GD = DD ? GlobalDecl(DD, Dtor_Deleting) : GlobalDecl(Method); - const MethodVFTableLocation &ML = + MicrosoftVTableContext::MethodVFTableLocation ML = CGM.getMicrosoftVTableContext().getMethodVFTableLocation(GD); VIndex = ML.Index; diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp index e80c3b33d2a..542e1bf5fa3 100644 --- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp @@ -230,7 +230,7 @@ public: getThisArgumentTypeForMethod(const CXXMethodDecl *MD) override { MD = MD->getCanonicalDecl(); if (MD->isVirtual() && !isa<CXXDestructorDecl>(MD)) { - const MethodVFTableLocation &ML = + MicrosoftVTableContext::MethodVFTableLocation ML = CGM.getMicrosoftVTableContext().getMethodVFTableLocation(MD); // The vbases might be ordered differently in the final overrider object // and the complete object, so the "this" argument may sometimes point to @@ -616,8 +616,9 @@ private: const VBTableGlobals &enumerateVBTables(const CXXRecordDecl *RD); /// \brief Generate a thunk for calling a virtual member function MD. - llvm::Function *EmitVirtualMemPtrThunk(const CXXMethodDecl *MD, - const MethodVFTableLocation &ML); + llvm::Function *EmitVirtualMemPtrThunk( + const CXXMethodDecl *MD, + const MicrosoftVTableContext::MethodVFTableLocation &ML); public: llvm::Type *ConvertMemberPointerType(const MemberPointerType *MPT) override; @@ -1335,7 +1336,7 @@ MicrosoftCXXABI::getVirtualFunctionPrologueThisAdjustment(GlobalDecl GD) { LookupGD = GlobalDecl(DD, Dtor_Deleting); } - const MethodVFTableLocation &ML = + MicrosoftVTableContext::MethodVFTableLocation ML = CGM.getMicrosoftVTableContext().getMethodVFTableLocation(LookupGD); CharUnits Adjustment = ML.VFPtrOffset; @@ -1384,7 +1385,7 @@ Address MicrosoftCXXABI::adjustThisArgumentForVirtualFunctionCall( // with the base one, so look up the deleting one instead. LookupGD = GlobalDecl(DD, Dtor_Deleting); } - const MethodVFTableLocation &ML = + MicrosoftVTableContext::MethodVFTableLocation ML = CGM.getMicrosoftVTableContext().getMethodVFTableLocation(LookupGD); CharUnits StaticOffset = ML.VFPtrOffset; @@ -1850,7 +1851,8 @@ CGCallee MicrosoftCXXABI::getVirtualFunctionPointer(CodeGenFunction &CGF, llvm::Value *VTable = CGF.GetVTablePtr(VPtr, Ty, MethodDecl->getParent()); MicrosoftVTableContext &VFTContext = CGM.getMicrosoftVTableContext(); - const MethodVFTableLocation &ML = VFTContext.getMethodVFTableLocation(GD); + MicrosoftVTableContext::MethodVFTableLocation ML = + VFTContext.getMethodVFTableLocation(GD); // Compute the identity of the most derived class whose virtual table is // located at the MethodVFTableLocation ML. @@ -1935,16 +1937,16 @@ MicrosoftCXXABI::enumerateVBTables(const CXXRecordDecl *RD) { return VBGlobals; } -llvm::Function * -MicrosoftCXXABI::EmitVirtualMemPtrThunk(const CXXMethodDecl *MD, - const MethodVFTableLocation &ML) { +llvm::Function *MicrosoftCXXABI::EmitVirtualMemPtrThunk( + const CXXMethodDecl *MD, + const MicrosoftVTableContext::MethodVFTableLocation &ML) { assert(!isa<CXXConstructorDecl>(MD) && !isa<CXXDestructorDecl>(MD) && "can't form pointers to ctors or virtual dtors"); // Calculate the mangled name. SmallString<256> ThunkName; llvm::raw_svector_ostream Out(ThunkName); - getMangleContext().mangleVirtualMemPtrThunk(MD, ML, Out); + getMangleContext().mangleVirtualMemPtrThunk(MD, Out); // If the thunk has been generated previously, just return it. if (llvm::GlobalValue *GV = CGM.getModule().getNamedValue(ThunkName)) @@ -2758,7 +2760,7 @@ MicrosoftCXXABI::EmitMemberFunctionPointer(const CXXMethodDecl *MD) { FirstField = CGM.GetAddrOfFunction(MD, Ty); } else { auto &VTableContext = CGM.getMicrosoftVTableContext(); - const MethodVFTableLocation &ML = + MicrosoftVTableContext::MethodVFTableLocation ML = VTableContext.getMethodVFTableLocation(MD); FirstField = EmitVirtualMemPtrThunk(MD, ML); // Include the vfptr adjustment if the method is in a non-primary vftable. |

