From 274fc82289223f8b15f9621f4459428ae2812803 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 23 Mar 2010 15:17:13 +0000 Subject: [PATCH] Move ThunkInfo as well. llvm-svn: 99280 --- clang/lib/CodeGen/CGVtable.cpp | 28 ---------------------------- 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 b34e72953373..736fb047c99d 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 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 77687488be4a..93aff61af4bf 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: