Convert 'struct' to 'class' in various places to adhere to the coding standards

and work better with VC++.  Patch contributed by Morten Ofstad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17281 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2004-10-27 16:14:51 +00:00
parent 3acd9181df
commit 1fca5ff62b
35 changed files with 96 additions and 71 deletions

View File

@@ -39,7 +39,7 @@
namespace llvm { namespace llvm {
struct Type; class Type;
class DerivedType; class DerivedType;
class AbstractTypeUser { class AbstractTypeUser {

View File

@@ -34,7 +34,7 @@ class AliasSet;
class AliasSet { class AliasSet {
friend class AliasSetTracker; friend class AliasSetTracker;
struct PointerRec; class PointerRec;
typedef std::pair<Value* const, PointerRec> HashNodePair; typedef std::pair<Value* const, PointerRec> HashNodePair;
class PointerRec { class PointerRec {
@@ -116,7 +116,7 @@ class AliasSet {
// Volatile - True if this alias set contains volatile loads or stores. // Volatile - True if this alias set contains volatile loads or stores.
bool Volatile : 1; bool Volatile : 1;
friend class ilist_traits<AliasSet>; friend struct ilist_traits<AliasSet>;
AliasSet *getPrev() const { return Prev; } AliasSet *getPrev() const { return Prev; }
AliasSet *getNext() const { return Next; } AliasSet *getNext() const { return Next; }
void setPrev(AliasSet *P) { Prev = P; } void setPrev(AliasSet *P) { Prev = P; }

View File

@@ -47,7 +47,7 @@ class DSNode {
/// doubly-linked ilist in the DSGraph. /// doubly-linked ilist in the DSGraph.
/// ///
DSNode *Next, *Prev; DSNode *Next, *Prev;
friend class ilist_traits<DSNode>; friend struct ilist_traits<DSNode>;
/// Size - The current size of the node. This should be equal to the size of /// Size - The current size of the node. This should be equal to the size of
/// the current type record. /// the current type record.

View File

@@ -287,9 +287,9 @@ protected:
Node *RootNode; Node *RootNode;
public: public:
class Node { class Node {
friend class DominatorTree; friend struct DominatorTree;
friend class PostDominatorTree; friend struct PostDominatorTree;
friend class DominatorTreeBase; friend struct DominatorTreeBase;
BasicBlock *TheBB; BasicBlock *TheBB;
Node *IDom; Node *IDom;
std::vector<Node*> Children; std::vector<Node*> Children;

View File

@@ -35,7 +35,7 @@
namespace llvm { namespace llvm {
class DominatorSet; struct DominatorSet;
class LoopInfo; class LoopInfo;
class PHINode; class PHINode;
class Instruction; class Instruction;

View File

@@ -45,7 +45,8 @@ template<> struct ilist_traits<Instruction>
static iplist<Instruction> &getList(BasicBlock *BB); static iplist<Instruction> &getList(BasicBlock *BB);
}; };
struct BasicBlock : public Value { // Basic blocks are data objects also class BasicBlock : public Value { // Basic blocks are data objects also
public:
typedef iplist<Instruction> InstListType; typedef iplist<Instruction> InstListType;
private : private :
InstListType InstList; InstListType InstList;

View File

@@ -24,7 +24,8 @@ namespace llvm {
// ilist_traits // ilist_traits
template <> template <>
class ilist_traits<MachineInstr> { struct ilist_traits<MachineInstr> {
protected:
// this is only set by the MachineBasicBlock owning the ilist // this is only set by the MachineBasicBlock owning the ilist
friend class MachineBasicBlock; friend class MachineBasicBlock;
MachineBasicBlock* parent; MachineBasicBlock* parent;
@@ -179,7 +180,7 @@ public:
int getNumber() const { return Number; } int getNumber() const { return Number; }
private: // Methods used to maintain doubly linked list of blocks... private: // Methods used to maintain doubly linked list of blocks...
friend class ilist_traits<MachineBasicBlock>; friend struct ilist_traits<MachineBasicBlock>;
MachineBasicBlock *getPrev() const { return Prev; } MachineBasicBlock *getPrev() const { return Prev; }
MachineBasicBlock *getNext() const { return Next; } MachineBasicBlock *getNext() const { return Next; }

View File

@@ -29,7 +29,8 @@ class Value;
class GlobalValue; class GlobalValue;
class Function; class Function;
struct MachineCodeEmitter { class MachineCodeEmitter {
public:
virtual ~MachineCodeEmitter() {} virtual ~MachineCodeEmitter() {}
/// startFunction - This callback is invoked when the specified function is /// startFunction - This callback is invoked when the specified function is

View File

@@ -31,7 +31,7 @@ class MachineConstantPool;
// ilist_traits // ilist_traits
template <> template <>
class ilist_traits<MachineBasicBlock> { struct ilist_traits<MachineBasicBlock> {
// this is only set by the MachineFunction owning the ilist // this is only set by the MachineFunction owning the ilist
friend class MachineFunction; friend class MachineFunction;
MachineFunction* Parent; MachineFunction* Parent;

View File

@@ -29,8 +29,8 @@ class MachineBasicBlock;
class TargetMachine; class TargetMachine;
class GlobalValue; class GlobalValue;
template <typename T> class ilist_traits; template <typename T> struct ilist_traits;
template <typename T> class ilist; template <typename T> struct ilist;
typedef short MachineOpCode; typedef short MachineOpCode;
@@ -417,7 +417,7 @@ class MachineInstr {
// Intrusive list support // Intrusive list support
// //
friend class ilist_traits<MachineInstr>; friend struct ilist_traits<MachineInstr>;
public: public:
MachineInstr(short Opcode, unsigned numOperands); MachineInstr(short Opcode, unsigned numOperands);

View File

@@ -21,7 +21,7 @@
namespace llvm { namespace llvm {
struct BasicBlock; class BasicBlock;
class PointerType; class PointerType;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@@ -1159,7 +1159,8 @@ public:
/// UnwindInst - Immediately exit the current function, unwinding the stack /// UnwindInst - Immediately exit the current function, unwinding the stack
/// until an invoke instruction is found. /// until an invoke instruction is found.
/// ///
struct UnwindInst : public TerminatorInst { class UnwindInst : public TerminatorInst {
public:
UnwindInst(Instruction *InsertBefore = 0) UnwindInst(Instruction *InsertBefore = 0)
: TerminatorInst(Instruction::Unwind, InsertBefore) { : TerminatorInst(Instruction::Unwind, InsertBefore) {
} }
@@ -1196,7 +1197,8 @@ struct UnwindInst : public TerminatorInst {
/// presence of this instruction indicates some higher level knowledge that the /// presence of this instruction indicates some higher level knowledge that the
/// end of the block cannot be reached. /// end of the block cannot be reached.
/// ///
struct UnreachableInst : public TerminatorInst { class UnreachableInst : public TerminatorInst {
public:
UnreachableInst(Instruction *InsertBefore = 0) UnreachableInst(Instruction *InsertBefore = 0)
: TerminatorInst(Instruction::Unreachable, InsertBefore) { : TerminatorInst(Instruction::Unreachable, InsertBefore) {
} }

View File

@@ -38,7 +38,7 @@
namespace llvm { namespace llvm {
class Value; class Value;
struct BasicBlock; class BasicBlock;
class Function; class Function;
class Module; class Module;
class AnalysisUsage; class AnalysisUsage;
@@ -56,7 +56,7 @@ typedef const PassInfo* AnalysisID;
/// constrained passes described below. /// constrained passes described below.
/// ///
class Pass { class Pass {
friend class AnalysisResolver; friend struct AnalysisResolver;
AnalysisResolver *Resolver; // AnalysisResolver this pass is owned by... AnalysisResolver *Resolver; // AnalysisResolver this pass is owned by...
const PassInfo *PassInfoCache; const PassInfo *PassInfoCache;
@@ -211,8 +211,8 @@ inline std::ostream &operator<<(std::ostream &OS, const Pass &P) {
/// interprocedural optimizations and analyses. ModulePass's may do anything /// interprocedural optimizations and analyses. ModulePass's may do anything
/// they want to the program. /// they want to the program.
/// ///
struct ModulePass : public Pass { class ModulePass : public Pass {
public:
/// runOnModule - Virtual method overriden by subclasses to process the module /// runOnModule - Virtual method overriden by subclasses to process the module
/// being operated on. /// being operated on.
virtual bool runOnModule(Module &M) = 0; virtual bool runOnModule(Module &M) = 0;
@@ -228,7 +228,8 @@ struct ModulePass : public Pass {
/// not need to be run. This is useful for things like target information and /// not need to be run. This is useful for things like target information and
/// "basic" versions of AnalysisGroups. /// "basic" versions of AnalysisGroups.
/// ///
struct ImmutablePass : public ModulePass { class ImmutablePass : public ModulePass {
public:
/// initializePass - This method may be overriden by immutable passes to allow /// initializePass - This method may be overriden by immutable passes to allow
/// them to perform various initialization actions they require. This is /// them to perform various initialization actions they require. This is
/// primarily because an ImmutablePass can "require" another ImmutablePass, /// primarily because an ImmutablePass can "require" another ImmutablePass,
@@ -255,7 +256,8 @@ private:
/// 2. Optimizing a function does not cause the addition or removal of any /// 2. Optimizing a function does not cause the addition or removal of any
/// functions in the module /// functions in the module
/// ///
struct FunctionPass : public ModulePass { class FunctionPass : public ModulePass {
public:
/// doInitialization - Virtual method overridden by subclasses to do /// doInitialization - Virtual method overridden by subclasses to do
/// any necessary per-module initialization. /// any necessary per-module initialization.
/// ///

View File

@@ -30,7 +30,7 @@ namespace llvm {
class AnnotationID; class AnnotationID;
class Annotation; class Annotation;
class Annotable; class Annotable;
class AnnotationManager; struct AnnotationManager;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
@@ -39,7 +39,7 @@ class AnnotationManager;
// freely around and passed byvalue with little or no overhead. // freely around and passed byvalue with little or no overhead.
// //
class AnnotationID { class AnnotationID {
friend class AnnotationManager; friend struct AnnotationManager;
unsigned ID; unsigned ID;
AnnotationID(); // Default ctor is disabled AnnotationID(); // Default ctor is disabled

View File

@@ -513,8 +513,8 @@ struct basic_parser : public basic_parser_impl {
// parser<bool> // parser<bool>
// //
template<> template<>
struct parser<bool> : public basic_parser<bool> { class parser<bool> : public basic_parser<bool> {
public:
// parse - Return true on error. // parse - Return true on error.
bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val); bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val);
@@ -531,8 +531,8 @@ struct parser<bool> : public basic_parser<bool> {
// parser<int> // parser<int>
// //
template<> template<>
struct parser<int> : public basic_parser<int> { class parser<int> : public basic_parser<int> {
public:
// parse - Return true on error. // parse - Return true on error.
bool parse(Option &O, const char *ArgName, const std::string &Arg, int &Val); bool parse(Option &O, const char *ArgName, const std::string &Arg, int &Val);
@@ -545,8 +545,8 @@ struct parser<int> : public basic_parser<int> {
// parser<unsigned> // parser<unsigned>
// //
template<> template<>
struct parser<unsigned> : public basic_parser<unsigned> { class parser<unsigned> : public basic_parser<unsigned> {
public:
// parse - Return true on error. // parse - Return true on error.
bool parse(Option &O, const char *AN, const std::string &Arg, unsigned &Val); bool parse(Option &O, const char *AN, const std::string &Arg, unsigned &Val);
@@ -559,7 +559,8 @@ struct parser<unsigned> : public basic_parser<unsigned> {
// parser<double> // parser<double>
// //
template<> template<>
struct parser<double> : public basic_parser<double> { class parser<double> : public basic_parser<double> {
public:
// parse - Return true on error. // parse - Return true on error.
bool parse(Option &O, const char *AN, const std::string &Arg, double &Val); bool parse(Option &O, const char *AN, const std::string &Arg, double &Val);
@@ -572,7 +573,8 @@ struct parser<double> : public basic_parser<double> {
// parser<float> // parser<float>
// //
template<> template<>
struct parser<float> : public basic_parser<float> { class parser<float> : public basic_parser<float> {
public:
// parse - Return true on error. // parse - Return true on error.
bool parse(Option &O, const char *AN, const std::string &Arg, float &Val); bool parse(Option &O, const char *AN, const std::string &Arg, float &Val);
@@ -585,7 +587,8 @@ struct parser<float> : public basic_parser<float> {
// parser<std::string> // parser<std::string>
// //
template<> template<>
struct parser<std::string> : public basic_parser<std::string> { class parser<std::string> : public basic_parser<std::string> {
public:
// parse - Return true on error. // parse - Return true on error.
bool parse(Option &O, const char *AN, const std::string &Arg, bool parse(Option &O, const char *AN, const std::string &Arg,
std::string &Value) { std::string &Value) {
@@ -687,8 +690,8 @@ public:
// object in all cases that it is used. // object in all cases that it is used.
// //
template<class DataType> template<class DataType>
struct opt_storage<DataType,false,true> : public DataType { class opt_storage<DataType,false,true> : public DataType {
public:
template<class T> template<class T>
void setValue(const T &V) { DataType::operator=(V); } void setValue(const T &V) { DataType::operator=(V); }
@@ -701,7 +704,8 @@ struct opt_storage<DataType,false,true> : public DataType {
// to get at the value. // to get at the value.
// //
template<class DataType> template<class DataType>
struct opt_storage<DataType, false, false> { class opt_storage<DataType, false, false> {
public:
DataType Value; DataType Value;
// Make sure we initialize the value with the default constructor for the // Make sure we initialize the value with the default constructor for the
@@ -864,8 +868,8 @@ public:
// object in all cases that it is used. // object in all cases that it is used.
// //
template<class DataType> template<class DataType>
struct list_storage<DataType, bool> : public std::vector<DataType> { class list_storage<DataType, bool> : public std::vector<DataType> {
public:
template<class T> template<class T>
void addValue(const T &V) { push_back(V); } void addValue(const T &V) { push_back(V); }
}; };

View File

@@ -95,7 +95,7 @@ struct DefaultDOTGraphTraits {
/// from DefaultDOTGraphTraits if you don't need to override everything. /// from DefaultDOTGraphTraits if you don't need to override everything.
/// ///
template <typename Ty> template <typename Ty>
class DOTGraphTraits : public DefaultDOTGraphTraits {}; struct DOTGraphTraits : public DefaultDOTGraphTraits {};
} // End llvm namespace } // End llvm namespace

View File

@@ -21,7 +21,7 @@ namespace sys {
/// Forward declare a class used for holding platform specific information /// Forward declare a class used for holding platform specific information
/// that needs to be /// that needs to be
class MappedFileInfo; struct MappedFileInfo;
/// This class provides an abstraction for a memory mapped file in the /// This class provides an abstraction for a memory mapped file in the
/// operating system's filesystem. It provides platform independent operations /// operating system's filesystem. It provides platform independent operations

View File

@@ -114,7 +114,8 @@ public:
// This object is used to lazily calculate structure layout information for a // This object is used to lazily calculate structure layout information for a
// target machine, based on the TargetData structure. // target machine, based on the TargetData structure.
// //
struct StructLayout { class StructLayout {
public:
std::vector<uint64_t> MemberOffsets; std::vector<uint64_t> MemberOffsets;
uint64_t StructSize; uint64_t StructSize;
unsigned StructAlignment; unsigned StructAlignment;

View File

@@ -27,7 +27,8 @@ class MachineFunction;
/// The offset to the local area is the offset from the stack pointer on /// The offset to the local area is the offset from the stack pointer on
/// function entry to the first location where function data (local variables, /// function entry to the first location where function data (local variables,
/// spill locations) can be stored. /// spill locations) can be stored.
struct TargetFrameInfo { class TargetFrameInfo {
public:
enum StackDirection { enum StackDirection {
StackGrowsUp, // Adding to the stack increases the stack address StackGrowsUp, // Adding to the stack increases the stack address
StackGrowsDown // Adding to the stack decreases the stack address StackGrowsDown // Adding to the stack decreases the stack address

View File

@@ -61,7 +61,8 @@ const unsigned M_2_ADDR_FLAG = 1 << 15;
// before control flow occurs. // before control flow occurs.
const unsigned M_TERMINATOR_FLAG = 1 << 16; const unsigned M_TERMINATOR_FLAG = 1 << 16;
struct TargetInstrDescriptor { class TargetInstrDescriptor {
public:
const char * Name; // Assembly language mnemonic for the opcode. const char * Name; // Assembly language mnemonic for the opcode.
int numOperands; // Number of args; -1 if variable #args int numOperands; // Number of args; -1 if variable #args
int resultPos; // Position of the result; -1 if no result int resultPos; // Position of the result; -1 if no result

View File

@@ -152,7 +152,8 @@ private:
/// TargetSchedInfo - Common interface to machine information for /// TargetSchedInfo - Common interface to machine information for
/// instruction scheduling /// instruction scheduling
/// ///
struct TargetSchedInfo { class TargetSchedInfo {
public:
const TargetMachine& target; const TargetMachine& target;
unsigned maxNumIssueTotal; unsigned maxNumIssueTotal;

View File

@@ -18,7 +18,7 @@
namespace llvm { namespace llvm {
class BasicBlock; class BasicBlock;
class DominatorSet; struct DominatorSet;
class Function; class Function;
class Loop; class Loop;

View File

@@ -20,8 +20,8 @@
namespace llvm { namespace llvm {
class AllocaInst; class AllocaInst;
class DominatorTree; struct DominatorTree;
class DominanceFrontier; struct DominanceFrontier;
class TargetData; class TargetData;
class AliasSetTracker; class AliasSetTracker;

View File

@@ -35,7 +35,7 @@ class Use {
Value *Val; Value *Val;
User *U; User *U;
Use *Prev, *Next; Use *Prev, *Next;
friend class ilist_traits<Use>; friend struct ilist_traits<Use>;
public: public:
inline Use(Value *v, User *user); inline Use(Value *v, User *user);
inline Use(const Use &u); inline Use(const Use &u);

View File

@@ -27,7 +27,7 @@ namespace llvm {
class Constant; class Constant;
class Argument; class Argument;
class Instruction; class Instruction;
struct BasicBlock; class BasicBlock;
class GlobalValue; class GlobalValue;
class Function; class Function;
class GlobalVariable; class GlobalVariable;

View File

@@ -29,7 +29,7 @@ namespace {
#include "llvm/Instruction.def" #include "llvm/Instruction.def"
class InstCount : public FunctionPass, public InstVisitor<InstCount> { class InstCount : public FunctionPass, public InstVisitor<InstCount> {
friend class InstVisitor<InstCount>; friend struct InstVisitor<InstCount>;
void visitFunction (Function &F) { ++TotalFuncs; } void visitFunction (Function &F) { ++TotalFuncs; }
void visitBasicBlock(BasicBlock &BB) { ++TotalBlocks; } void visitBasicBlock(BasicBlock &BB) { ++TotalBlocks; }

View File

@@ -66,7 +66,7 @@ namespace {
Instruction *InsertPt; Instruction *InsertPt;
friend class SCEVVisitor<SCEVExpander, Value*>; friend struct SCEVVisitor<SCEVExpander, Value*>;
public: public:
SCEVExpander(ScalarEvolution &se, LoopInfo &li) : SE(se), LI(li) {} SCEVExpander(ScalarEvolution &se, LoopInfo &li) : SE(se), LI(li) {}

View File

@@ -135,7 +135,7 @@ public:
// The implementation of this class // The implementation of this class
// //
private: private:
friend class InstVisitor<SCCP>; // Allow callbacks from visitor friend struct InstVisitor<SCCP>; // Allow callbacks from visitor
// markConstant - Make a value be marked as "constant". If the value // markConstant - Make a value be marked as "constant". If the value
// is not already a constant, add it to the instruction work list so that // is not already a constant, add it to the instruction work list so that

View File

@@ -90,7 +90,8 @@ public:
typedef std::map<const Value*, const Type*> ValueTypeCache; typedef std::map<const Value*, const Type*> ValueTypeCache;
struct ValueMapCache { class ValueMapCache {
public:
// Operands mapped - Contains an entry if the first value (the user) has had // Operands mapped - Contains an entry if the first value (the user) has had
// the second value (the operand) mapped already. // the second value (the operand) mapped already.
// //

View File

@@ -24,7 +24,7 @@
namespace llvm { namespace llvm {
class Value; class Value;
class Constant; class Constant;
struct Type; class Type;
// Constant fold various types of instruction... // Constant fold various types of instruction...
Constant *ConstantFoldCastInstruction(const Constant *V, const Type *DestTy); Constant *ConstantFoldCastInstruction(const Constant *V, const Type *DestTy);

View File

@@ -24,7 +24,7 @@
namespace llvm { namespace llvm {
class Value; class Value;
class Constant; class Constant;
struct Type; class Type;
// Constant fold various types of instruction... // Constant fold various types of instruction...
Constant *ConstantFoldCastInstruction(const Constant *V, const Type *DestTy); Constant *ConstantFoldCastInstruction(const Constant *V, const Type *DestTy);

View File

@@ -630,7 +630,8 @@ public:
// This pass manager is used to group together all of the BasicBlockPass's // This pass manager is used to group together all of the BasicBlockPass's
// into a single unit. // into a single unit.
// //
template<> struct PassManagerTraits<BasicBlock> : public BasicBlockPass { template<> class PassManagerTraits<BasicBlock> : public BasicBlockPass {
public:
// PassClass - The type of passes tracked by this PassManager // PassClass - The type of passes tracked by this PassManager
typedef BasicBlockPass PassClass; typedef BasicBlockPass PassClass;
@@ -683,7 +684,8 @@ template<> struct PassManagerTraits<BasicBlock> : public BasicBlockPass {
// This pass manager is used to group together all of the FunctionPass's // This pass manager is used to group together all of the FunctionPass's
// into a single unit. // into a single unit.
// //
template<> struct PassManagerTraits<Function> : public FunctionPass { template<> class PassManagerTraits<Function> : public FunctionPass {
public:
// PassClass - The type of passes tracked by this PassManager // PassClass - The type of passes tracked by this PassManager
typedef FunctionPass PassClass; typedef FunctionPass PassClass;
@@ -726,7 +728,8 @@ template<> struct PassManagerTraits<Function> : public FunctionPass {
// //
// This is the top level PassManager implementation that holds generic passes. // This is the top level PassManager implementation that holds generic passes.
// //
template<> struct PassManagerTraits<Module> : public ModulePass { template<> class PassManagerTraits<Module> : public ModulePass {
public:
// PassClass - The type of passes tracked by this PassManager // PassClass - The type of passes tracked by this PassManager
typedef ModulePass PassClass; typedef ModulePass PassClass;

View File

@@ -26,7 +26,7 @@ namespace llvm {
class Record; class Record;
class RecordKeeper; class RecordKeeper;
class CodeGenRegister; struct CodeGenRegister;
/// getValueType - Return the MVT::ValueType that the specified TableGen record /// getValueType - Return the MVT::ValueType that the specified TableGen record
/// corresponds to. /// corresponds to.

View File

@@ -22,7 +22,7 @@ namespace llvm {
class StringInit; class StringInit;
class IntInit; class IntInit;
class ListInit; class ListInit;
class CodeGenInstruction; struct CodeGenInstruction;
class InstrInfoEmitter : public TableGenBackend { class InstrInfoEmitter : public TableGenBackend {
RecordKeeper &Records; RecordKeeper &Records;

View File

@@ -24,7 +24,7 @@
namespace llvm { namespace llvm {
class DagInit; class DagInit;
class Init; struct Init;
class InstrSelectorEmitter; class InstrSelectorEmitter;
/// NodeType - Represents Information parsed from the DagNode entries. /// NodeType - Represents Information parsed from the DagNode entries.

View File

@@ -34,7 +34,7 @@ class DagRecTy;
class RecordRecTy; class RecordRecTy;
// Init subclasses... // Init subclasses...
class Init; struct Init;
class UnsetInit; class UnsetInit;
class BitInit; class BitInit;
class BitsInit; class BitsInit;
@@ -107,7 +107,8 @@ inline std::ostream &operator<<(std::ostream &OS, const RecTy &Ty) {
/// BitRecTy - 'bit' - Represent a single bit /// BitRecTy - 'bit' - Represent a single bit
/// ///
struct BitRecTy : public RecTy { class BitRecTy : public RecTy {
public:
Init *convertValue(UnsetInit *UI) { return (Init*)UI; } Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(BitInit *BI) { return (Init*)BI; } Init *convertValue(BitInit *BI) { return (Init*)BI; }
Init *convertValue(BitsInit *BI); Init *convertValue(BitsInit *BI);
@@ -157,7 +158,8 @@ public:
/// IntRecTy - 'int' - Represent an integer value of no particular size /// IntRecTy - 'int' - Represent an integer value of no particular size
/// ///
struct IntRecTy : public RecTy { class IntRecTy : public RecTy {
public:
Init *convertValue(UnsetInit *UI) { return (Init*)UI; } Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(IntInit *II) { return (Init*)II; } Init *convertValue(IntInit *II) { return (Init*)II; }
Init *convertValue(BitInit *BI); Init *convertValue(BitInit *BI);
@@ -177,7 +179,8 @@ struct IntRecTy : public RecTy {
/// StringRecTy - 'string' - Represent an string value /// StringRecTy - 'string' - Represent an string value
/// ///
struct StringRecTy : public RecTy { class StringRecTy : public RecTy {
public:
Init *convertValue(UnsetInit *UI) { return (Init*)UI; } Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(StringInit *SI) { return (Init*)SI; } Init *convertValue(StringInit *SI) { return (Init*)SI; }
Init *convertValue(TypedInit *TI); Init *convertValue(TypedInit *TI);
@@ -219,7 +222,8 @@ public:
/// CodeRecTy - 'code' - Represent an code fragment, function or method. /// CodeRecTy - 'code' - Represent an code fragment, function or method.
/// ///
struct CodeRecTy : public RecTy { class CodeRecTy : public RecTy {
public:
Init *convertValue(UnsetInit *UI) { return (Init*)UI; } Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue( CodeInit *CI) { return (Init*)CI; } Init *convertValue( CodeInit *CI) { return (Init*)CI; }
Init *convertValue(TypedInit *TI); Init *convertValue(TypedInit *TI);
@@ -234,7 +238,8 @@ struct CodeRecTy : public RecTy {
/// DagRecTy - 'dag' - Represent a dag fragment /// DagRecTy - 'dag' - Represent a dag fragment
/// ///
struct DagRecTy : public RecTy { class DagRecTy : public RecTy {
public:
Init *convertValue(UnsetInit *UI) { return (Init*)UI; } Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue( DagInit *CI) { return (Init*)CI; } Init *convertValue( DagInit *CI) { return (Init*)CI; }
Init *convertValue(TypedInit *TI); Init *convertValue(TypedInit *TI);
@@ -343,7 +348,8 @@ inline std::ostream &operator<<(std::ostream &OS, const Init &I) {
/// UnsetInit - ? - Represents an uninitialized value /// UnsetInit - ? - Represents an uninitialized value
/// ///
struct UnsetInit : public Init { class UnsetInit : public Init {
public:
virtual Init *convertInitializerTo(RecTy *Ty) { virtual Init *convertInitializerTo(RecTy *Ty) {
return Ty->convertValue(this); return Ty->convertValue(this);
} }