diff options
author | Anders Carlsson <andersca@mac.com> | 2010-03-23 15:17:13 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-03-23 15:17:13 +0000 |
commit | 274fc82289223f8b15f9621f4459428ae2812803 (patch) | |
tree | 37fc3388fa6b98529eb046529c5d2307afe7d943 /clang/lib | |
parent | 67fd3a50dc6c4f6aed7478f09e4de68c73084b61 (diff) | |
download | bcm5719-llvm-274fc82289223f8b15f9621f4459428ae2812803.tar.gz bcm5719-llvm-274fc82289223f8b15f9621f4459428ae2812803.zip |
Move ThunkInfo as well.
llvm-svn: 99280
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGVtable.cpp | 28 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGVtable.h | 29 |
2 files changed, 28 insertions, 29 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp index b34e7295337..736fb047c99 100644 --- a/clang/lib/CodeGen/CGVtable.cpp +++ b/clang/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<uint64_t, ThunkInfo> VtableThunksMapTy; /// VTableThunks - The thunks by vtable index in the vtable currently being diff --git a/clang/lib/CodeGen/CGVtable.h b/clang/lib/CodeGen/CGVtable.h index 77687488be4..93aff61af4b 100644 --- a/clang/lib/CodeGen/CGVtable.h +++ b/clang/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: |