projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow forward declarations to take a context. This helps the debugger
[oota-llvm.git]
/
include
/
llvm
/
SymbolTableListTraits.h
diff --git
a/include/llvm/SymbolTableListTraits.h
b/include/llvm/SymbolTableListTraits.h
index b5ec20de600a703f6f475a58154355e345e57d57..91a4eb99ff0d368c489c7b0d9ff50829b93bf08a 100644
(file)
--- a/
include/llvm/SymbolTableListTraits.h
+++ b/
include/llvm/SymbolTableListTraits.h
@@
-28,7
+28,8
@@
#include "llvm/ADT/ilist.h"
namespace llvm {
#include "llvm/ADT/ilist.h"
namespace llvm {
-
+class ValueSymbolTable;
+
template<typename NodeTy> class ilist_iterator;
template<typename NodeTy, typename Traits> class iplist;
template<typename Ty> struct ilist_traits;
template<typename NodeTy> class ilist_iterator;
template<typename NodeTy, typename Traits> class iplist;
template<typename Ty> struct ilist_traits;
@@
-46,14
+47,21
@@
public:
/// of instructions, it returns the BasicBlock that owns them.
ItemParentClass *getListOwner() {
typedef iplist<ValueSubClass> ItemParentClass::*Sublist;
/// of instructions, it returns the BasicBlock that owns them.
ItemParentClass *getListOwner() {
typedef iplist<ValueSubClass> ItemParentClass::*Sublist;
- Sublist Sub(ItemParentClass::
- getSublistAccess(static_cast<ValueSubClass*>(0)));
- size_t Offset(size_t(&((ItemParentClass*)0->*Sub)));
+ size_t Offset(size_t(&((ItemParentClass*)0->*ItemParentClass::
+ getSublistAccess(static_cast<ValueSubClass*>(0)))));
iplist<ValueSubClass>* Anchor(static_cast<iplist<ValueSubClass>*>(this));
return reinterpret_cast<ItemParentClass*>(reinterpret_cast<char*>(Anchor)-
Offset);
}
iplist<ValueSubClass>* Anchor(static_cast<iplist<ValueSubClass>*>(this));
return reinterpret_cast<ItemParentClass*>(reinterpret_cast<char*>(Anchor)-
Offset);
}
+ static iplist<ValueSubClass> &getList(ItemParentClass *Par) {
+ return Par->*(Par->getSublistAccess((ValueSubClass*)0));
+ }
+
+ static ValueSymbolTable *getSymTab(ItemParentClass *Par) {
+ return Par ? toPtr(Par->getValueSymbolTable()) : 0;
+ }
+
void addNodeToList(ValueSubClass *V);
void removeNodeFromList(ValueSubClass *V);
void transferNodesFromList(ilist_traits<ValueSubClass> &L2,
void addNodeToList(ValueSubClass *V);
void removeNodeFromList(ValueSubClass *V);
void transferNodesFromList(ilist_traits<ValueSubClass> &L2,
@@
-62,6
+70,8
@@
public:
//private:
template<typename TPtr>
void setSymTabObject(TPtr *, TPtr);
//private:
template<typename TPtr>
void setSymTabObject(TPtr *, TPtr);
+ static ValueSymbolTable *toPtr(ValueSymbolTable *P) { return P; }
+ static ValueSymbolTable *toPtr(ValueSymbolTable &R) { return &R; }
};
} // End llvm namespace
};
} // End llvm namespace