From: Anders Carlsson Date: Tue, 23 Mar 2010 15:17:13 +0000 (+0000) Subject: Move ThunkInfo as well. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4e4c96b9e717ae747f8a22b432695d833b4c0d6;p=clang Move ThunkInfo as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99280 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index b34e729533..736fb047c9 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -1164,34 +1164,6 @@ private: /// currently building. MethodInfoMapTy MethodInfoMap; - /// ThunkInfo - The 'this' pointer adjustment as well as an optional return - /// adjustment for a thunk. - struct ThunkInfo { - /// This - The 'this' pointer adjustment. - ThisAdjustment This; - - /// Return - The return adjustment. - ReturnAdjustment Return; - - ThunkInfo() { } - - ThunkInfo(const ThisAdjustment &This, const ReturnAdjustment &Return) - : This(This), Return(Return) { } - - friend bool operator==(const ThunkInfo &LHS, const ThunkInfo &RHS) { - return LHS.This == RHS.This && LHS.Return == RHS.Return; - } - - friend bool operator<(const ThunkInfo &LHS, const ThunkInfo &RHS) { - if (LHS.This < RHS.This) - return true; - - return LHS.This == RHS.This && LHS.Return < RHS.Return; - } - - bool isEmpty() const { return This.isEmpty() && Return.isEmpty(); } - }; - typedef llvm::DenseMap VtableThunksMapTy; /// VTableThunks - The thunks by vtable index in the vtable currently being diff --git a/lib/CodeGen/CGVtable.h b/lib/CodeGen/CGVtable.h index 77687488be..93aff61af4 100644 --- a/lib/CodeGen/CGVtable.h +++ b/lib/CodeGen/CGVtable.h @@ -83,9 +83,36 @@ struct ThisAdjustment { return LHS.NonVirtual == RHS.NonVirtual && LHS.VCallOffsetOffset < RHS.VCallOffsetOffset; } - }; +/// ThunkInfo - The 'this' pointer adjustment as well as an optional return +/// adjustment for a thunk. +struct ThunkInfo { + /// This - The 'this' pointer adjustment. + ThisAdjustment This; + + /// Return - The return adjustment. + ReturnAdjustment Return; + + ThunkInfo() { } + + ThunkInfo(const ThisAdjustment &This, const ReturnAdjustment &Return) + : This(This), Return(Return) { } + + friend bool operator==(const ThunkInfo &LHS, const ThunkInfo &RHS) { + return LHS.This == RHS.This && LHS.Return == RHS.Return; + } + + friend bool operator<(const ThunkInfo &LHS, const ThunkInfo &RHS) { + if (LHS.This < RHS.This) + return true; + + return LHS.This == RHS.This && LHS.Return < RHS.Return; + } + + bool isEmpty() const { return This.isEmpty() && Return.isEmpty(); } +}; + /// ThunkAdjustment - Virtual and non-virtual adjustment for thunks. class ThunkAdjustment { public: