1 //===-- llvm/SymTabValue.h - Implement SymbolTable Values --------*- C++ -*--=//
3 // This subclass of Value implements a def that has a symbol table for keeping
4 // track of children. This is used by the ValueHolder template class...
6 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_SYMTAB_VALUE_H
9 #define LLVM_SYMTAB_VALUE_H
16 SymbolTable *SymTab, *ParentSymTab;
20 void setParentSymTab(SymbolTable *ST);
22 SymTabValue(Value *Parent);
23 ~SymTabValue(); // Implemented in Value.cpp
25 inline Value *getSTVParent() { return ValueParent; }
26 inline const Value *getSTVParent() const { return ValueParent; }
28 // hasSymbolTable() - Returns true if there is a symbol table allocated to
29 // this object AND if there is at least one name in it!
31 bool hasSymbolTable() const;
33 // CAUTION: The current symbol table may be null if there are no names (ie,
34 // the symbol table is empty)
36 inline SymbolTable *getSymbolTable() { return SymTab; }
37 inline const SymbolTable *getSymbolTable() const { return SymTab; }
39 // getSymbolTableSure is guaranteed to not return a null pointer, because if
40 // the method does not already have a symtab, one is created. Use this if
41 // you intend to put something into the symbol table for the method.
43 SymbolTable *getSymbolTableSure(); // Implemented in Value.cpp