1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/include/llvm/SymTabValue.h
Chris Lattner 8131335c27 Made the following changes:
* ValueHolder became a 3 argument template.  This allows for BasicBlock to
  use the value holder arg as a typesafe parent pointer.
* SymTabValue no longer inherits from Value
* Method does not inherit from only SymTabValue.  Now it inherits from both
  STV & Value.
* Module does not inherit from only SymTabValue.  Now it inherits from both
  STV & Value.
* Updated the SymTabValue.h file to reference SymTabValue instead of STDef
  in several places
* Added isArraySelector & isStructSelector to GetElementPtr instruction

llvm-svn: 177
2001-07-14 06:07:58 +00:00

56 lines
1.8 KiB
C++

//===-- llvm/SymTabValue.h - Implement SymbolTable Values --------*- C++ -*--=//
//
// This subclass of Value implements a def that has a symbol table for keeping
// track of children. This is used by the ValueHolder template class...
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_SYMTAB_VALUE_H
#define LLVM_SYMTAB_VALUE_H
#include "llvm/ConstantPool.h"
class SymbolTable;
class ConstPoolVal;
class Value;
class SymTabValue {
public:
typedef ConstantPool ConstantPoolType;
private:
SymbolTable *SymTab, *ParentSymTab;
ConstantPool ConstPool; // The constant pool
Value *ValueParent;
protected:
void setParentSymTab(SymbolTable *ST);
public:
SymTabValue(Value *Parent);
~SymTabValue(); // Implemented in Value.cpp
inline Value *getSTVParent() { return ValueParent; }
inline const Value *getSTVParent() const { return ValueParent; }
// hasSymbolTable() - Returns true if there is a symbol table allocated to
// this object AND if there is at least one name in it!
//
bool hasSymbolTable() const;
// CAUTION: The current symbol table may be null if there are no names (ie,
// the symbol table is empty)
//
inline SymbolTable *getSymbolTable() { return SymTab; }
inline const SymbolTable *getSymbolTable() const { return SymTab; }
inline const ConstantPool &getConstantPool() const{ return ConstPool; }
inline ConstantPool &getConstantPool() { return ConstPool; }
// getSymbolTableSure is guaranteed to not return a null pointer, because if
// the method does not already have a symtab, one is created. Use this if
// you intend to put something into the symbol table for the method.
//
SymbolTable *getSymbolTableSure(); // Implemented in Value.cpp
};
#endif