From 1fca5ff62bb2ecb5bfc8974f4dbfc56e9d3ca721 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 27 Oct 2004 16:14:51 +0000 Subject: [PATCH] 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 --- include/llvm/AbstractTypeUser.h | 2 +- include/llvm/Analysis/AliasSetTracker.h | 4 ++-- include/llvm/Analysis/DataStructure/DSNode.h | 2 +- include/llvm/Analysis/Dominators.h | 6 ++--- include/llvm/Analysis/LoopInfo.h | 2 +- include/llvm/BasicBlock.h | 3 ++- include/llvm/CodeGen/MachineBasicBlock.h | 5 ++-- include/llvm/CodeGen/MachineCodeEmitter.h | 3 ++- include/llvm/CodeGen/MachineFunction.h | 2 +- include/llvm/CodeGen/MachineInstr.h | 6 ++--- include/llvm/Instructions.h | 8 ++++--- include/llvm/Pass.h | 14 ++++++----- include/llvm/Support/Annotation.h | 4 ++-- include/llvm/Support/CommandLine.h | 32 ++++++++++++++----------- include/llvm/Support/DOTGraphTraits.h | 2 +- include/llvm/System/MappedFile.h | 2 +- include/llvm/Target/TargetData.h | 3 ++- include/llvm/Target/TargetFrameInfo.h | 3 ++- include/llvm/Target/TargetInstrInfo.h | 3 ++- include/llvm/Target/TargetSchedInfo.h | 3 ++- include/llvm/Transforms/Utils/FunctionUtils.h | 2 +- include/llvm/Transforms/Utils/PromoteMemToReg.h | 4 ++-- include/llvm/Use.h | 2 +- include/llvm/Value.h | 2 +- lib/Analysis/InstCount.cpp | 2 +- lib/Transforms/Scalar/IndVarSimplify.cpp | 2 +- lib/Transforms/Scalar/SCCP.cpp | 2 +- lib/Transforms/TransformInternals.h | 3 ++- lib/VMCore/ConstantFold.h | 2 +- lib/VMCore/ConstantFolding.h | 2 +- lib/VMCore/PassManagerT.h | 9 ++++--- utils/TableGen/CodeGenTarget.h | 2 +- utils/TableGen/InstrInfoEmitter.h | 2 +- utils/TableGen/InstrSelectorEmitter.h | 2 +- utils/TableGen/Record.h | 20 ++++++++++------ 35 files changed, 96 insertions(+), 71 deletions(-) diff --git a/include/llvm/AbstractTypeUser.h b/include/llvm/AbstractTypeUser.h index 26620eb85f5..71a532ef97b 100644 --- a/include/llvm/AbstractTypeUser.h +++ b/include/llvm/AbstractTypeUser.h @@ -39,7 +39,7 @@ namespace llvm { -struct Type; +class Type; class DerivedType; class AbstractTypeUser { diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h index fe3e60c62bb..91c822b5031 100644 --- a/include/llvm/Analysis/AliasSetTracker.h +++ b/include/llvm/Analysis/AliasSetTracker.h @@ -34,7 +34,7 @@ class AliasSet; class AliasSet { friend class AliasSetTracker; - struct PointerRec; + class PointerRec; typedef std::pair HashNodePair; class PointerRec { @@ -116,7 +116,7 @@ class AliasSet { // Volatile - True if this alias set contains volatile loads or stores. bool Volatile : 1; - friend class ilist_traits; + friend struct ilist_traits; AliasSet *getPrev() const { return Prev; } AliasSet *getNext() const { return Next; } void setPrev(AliasSet *P) { Prev = P; } diff --git a/include/llvm/Analysis/DataStructure/DSNode.h b/include/llvm/Analysis/DataStructure/DSNode.h index 27ae67ee1dd..3cdc0a6420e 100644 --- a/include/llvm/Analysis/DataStructure/DSNode.h +++ b/include/llvm/Analysis/DataStructure/DSNode.h @@ -47,7 +47,7 @@ class DSNode { /// doubly-linked ilist in the DSGraph. /// DSNode *Next, *Prev; - friend class ilist_traits; + friend struct ilist_traits; /// Size - The current size of the node. This should be equal to the size of /// the current type record. diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 11d4b98cdd8..c1cdae50f23 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -287,9 +287,9 @@ protected: Node *RootNode; public: class Node { - friend class DominatorTree; - friend class PostDominatorTree; - friend class DominatorTreeBase; + friend struct DominatorTree; + friend struct PostDominatorTree; + friend struct DominatorTreeBase; BasicBlock *TheBB; Node *IDom; std::vector Children; diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index c5eec834287..32351ea55ce 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -35,7 +35,7 @@ namespace llvm { -class DominatorSet; +struct DominatorSet; class LoopInfo; class PHINode; class Instruction; diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h index 2a18ba837ed..0ede5f3072a 100644 --- a/include/llvm/BasicBlock.h +++ b/include/llvm/BasicBlock.h @@ -45,7 +45,8 @@ template<> struct ilist_traits static iplist &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 InstListType; private : InstListType InstList; diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index 62a6e802088..a7d031bad4b 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -24,7 +24,8 @@ namespace llvm { // ilist_traits template <> -class ilist_traits { +struct ilist_traits { +protected: // this is only set by the MachineBasicBlock owning the ilist friend class MachineBasicBlock; MachineBasicBlock* parent; @@ -179,7 +180,7 @@ public: int getNumber() const { return Number; } private: // Methods used to maintain doubly linked list of blocks... - friend class ilist_traits; + friend struct ilist_traits; MachineBasicBlock *getPrev() const { return Prev; } MachineBasicBlock *getNext() const { return Next; } diff --git a/include/llvm/CodeGen/MachineCodeEmitter.h b/include/llvm/CodeGen/MachineCodeEmitter.h index 0daab91faf7..dc7aa5e09cb 100644 --- a/include/llvm/CodeGen/MachineCodeEmitter.h +++ b/include/llvm/CodeGen/MachineCodeEmitter.h @@ -29,7 +29,8 @@ class Value; class GlobalValue; class Function; -struct MachineCodeEmitter { +class MachineCodeEmitter { +public: virtual ~MachineCodeEmitter() {} /// startFunction - This callback is invoked when the specified function is diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index 72feda4eb18..e6d9eb1bf81 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -31,7 +31,7 @@ class MachineConstantPool; // ilist_traits template <> -class ilist_traits { +struct ilist_traits { // this is only set by the MachineFunction owning the ilist friend class MachineFunction; MachineFunction* Parent; diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index d9a865e0a69..6227490706d 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -29,8 +29,8 @@ class MachineBasicBlock; class TargetMachine; class GlobalValue; -template class ilist_traits; -template class ilist; +template struct ilist_traits; +template struct ilist; typedef short MachineOpCode; @@ -417,7 +417,7 @@ class MachineInstr { // Intrusive list support // - friend class ilist_traits; + friend struct ilist_traits; public: MachineInstr(short Opcode, unsigned numOperands); diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 96772edd769..5ba361b6465 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -21,7 +21,7 @@ namespace llvm { -struct BasicBlock; +class BasicBlock; class PointerType; //===----------------------------------------------------------------------===// @@ -1159,7 +1159,8 @@ public: /// UnwindInst - Immediately exit the current function, unwinding the stack /// until an invoke instruction is found. /// -struct UnwindInst : public TerminatorInst { +class UnwindInst : public TerminatorInst { +public: UnwindInst(Instruction *InsertBefore = 0) : TerminatorInst(Instruction::Unwind, InsertBefore) { } @@ -1196,7 +1197,8 @@ struct UnwindInst : public TerminatorInst { /// presence of this instruction indicates some higher level knowledge that the /// end of the block cannot be reached. /// -struct UnreachableInst : public TerminatorInst { +class UnreachableInst : public TerminatorInst { +public: UnreachableInst(Instruction *InsertBefore = 0) : TerminatorInst(Instruction::Unreachable, InsertBefore) { } diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index 77f630c3164..ff710d37664 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -38,7 +38,7 @@ namespace llvm { class Value; -struct BasicBlock; +class BasicBlock; class Function; class Module; class AnalysisUsage; @@ -56,7 +56,7 @@ typedef const PassInfo* AnalysisID; /// constrained passes described below. /// class Pass { - friend class AnalysisResolver; + friend struct AnalysisResolver; AnalysisResolver *Resolver; // AnalysisResolver this pass is owned by... 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 /// they want to the program. /// -struct ModulePass : public Pass { - +class ModulePass : public Pass { +public: /// runOnModule - Virtual method overriden by subclasses to process the module /// being operated on. 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 /// "basic" versions of AnalysisGroups. /// -struct ImmutablePass : public ModulePass { +class ImmutablePass : public ModulePass { +public: /// initializePass - This method may be overriden by immutable passes to allow /// them to perform various initialization actions they require. This is /// 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 /// functions in the module /// -struct FunctionPass : public ModulePass { +class FunctionPass : public ModulePass { +public: /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// diff --git a/include/llvm/Support/Annotation.h b/include/llvm/Support/Annotation.h index 4325836c290..2331ca5a239 100644 --- a/include/llvm/Support/Annotation.h +++ b/include/llvm/Support/Annotation.h @@ -30,7 +30,7 @@ namespace llvm { class AnnotationID; class Annotation; class Annotable; -class AnnotationManager; +struct AnnotationManager; //===----------------------------------------------------------------------===// // @@ -39,7 +39,7 @@ class AnnotationManager; // freely around and passed byvalue with little or no overhead. // class AnnotationID { - friend class AnnotationManager; + friend struct AnnotationManager; unsigned ID; AnnotationID(); // Default ctor is disabled diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h index 2c38e0aac06..4bb1c1f4ee8 100644 --- a/include/llvm/Support/CommandLine.h +++ b/include/llvm/Support/CommandLine.h @@ -513,8 +513,8 @@ struct basic_parser : public basic_parser_impl { // parser // template<> -struct parser : public basic_parser { - +class parser : public basic_parser { +public: // parse - Return true on error. bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val); @@ -531,8 +531,8 @@ struct parser : public basic_parser { // parser // template<> -struct parser : public basic_parser { - +class parser : public basic_parser { +public: // parse - Return true on error. bool parse(Option &O, const char *ArgName, const std::string &Arg, int &Val); @@ -545,8 +545,8 @@ struct parser : public basic_parser { // parser // template<> -struct parser : public basic_parser { - +class parser : public basic_parser { +public: // parse - Return true on error. bool parse(Option &O, const char *AN, const std::string &Arg, unsigned &Val); @@ -559,7 +559,8 @@ struct parser : public basic_parser { // parser // template<> -struct parser : public basic_parser { +class parser : public basic_parser { +public: // parse - Return true on error. bool parse(Option &O, const char *AN, const std::string &Arg, double &Val); @@ -572,7 +573,8 @@ struct parser : public basic_parser { // parser // template<> -struct parser : public basic_parser { +class parser : public basic_parser { +public: // parse - Return true on error. bool parse(Option &O, const char *AN, const std::string &Arg, float &Val); @@ -585,7 +587,8 @@ struct parser : public basic_parser { // parser // template<> -struct parser : public basic_parser { +class parser : public basic_parser { +public: // parse - Return true on error. bool parse(Option &O, const char *AN, const std::string &Arg, std::string &Value) { @@ -687,8 +690,8 @@ public: // object in all cases that it is used. // template -struct opt_storage : public DataType { - +class opt_storage : public DataType { +public: template void setValue(const T &V) { DataType::operator=(V); } @@ -701,7 +704,8 @@ struct opt_storage : public DataType { // to get at the value. // template -struct opt_storage { +class opt_storage { +public: DataType Value; // 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. // template -struct list_storage : public std::vector { - +class list_storage : public std::vector { +public: template void addValue(const T &V) { push_back(V); } }; diff --git a/include/llvm/Support/DOTGraphTraits.h b/include/llvm/Support/DOTGraphTraits.h index b83b759f407..7196e51f8cb 100644 --- a/include/llvm/Support/DOTGraphTraits.h +++ b/include/llvm/Support/DOTGraphTraits.h @@ -95,7 +95,7 @@ struct DefaultDOTGraphTraits { /// from DefaultDOTGraphTraits if you don't need to override everything. /// template -class DOTGraphTraits : public DefaultDOTGraphTraits {}; +struct DOTGraphTraits : public DefaultDOTGraphTraits {}; } // End llvm namespace diff --git a/include/llvm/System/MappedFile.h b/include/llvm/System/MappedFile.h index f6b656c7bab..0a3f21b67fb 100644 --- a/include/llvm/System/MappedFile.h +++ b/include/llvm/System/MappedFile.h @@ -21,7 +21,7 @@ namespace sys { /// Forward declare a class used for holding platform specific information /// that needs to be - class MappedFileInfo; + struct MappedFileInfo; /// This class provides an abstraction for a memory mapped file in the /// operating system's filesystem. It provides platform independent operations diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h index 9de9d7044a8..3879b74c7e5 100644 --- a/include/llvm/Target/TargetData.h +++ b/include/llvm/Target/TargetData.h @@ -114,7 +114,8 @@ public: // This object is used to lazily calculate structure layout information for a // target machine, based on the TargetData structure. // -struct StructLayout { +class StructLayout { +public: std::vector MemberOffsets; uint64_t StructSize; unsigned StructAlignment; diff --git a/include/llvm/Target/TargetFrameInfo.h b/include/llvm/Target/TargetFrameInfo.h index dfdca8dab77..bbaeafdcdfc 100644 --- a/include/llvm/Target/TargetFrameInfo.h +++ b/include/llvm/Target/TargetFrameInfo.h @@ -27,7 +27,8 @@ class MachineFunction; /// 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, /// spill locations) can be stored. -struct TargetFrameInfo { +class TargetFrameInfo { +public: enum StackDirection { StackGrowsUp, // Adding to the stack increases the stack address StackGrowsDown // Adding to the stack decreases the stack address diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index 603bf67a4d1..7fddde5a1dd 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -61,7 +61,8 @@ const unsigned M_2_ADDR_FLAG = 1 << 15; // before control flow occurs. const unsigned M_TERMINATOR_FLAG = 1 << 16; -struct TargetInstrDescriptor { +class TargetInstrDescriptor { +public: const char * Name; // Assembly language mnemonic for the opcode. int numOperands; // Number of args; -1 if variable #args int resultPos; // Position of the result; -1 if no result diff --git a/include/llvm/Target/TargetSchedInfo.h b/include/llvm/Target/TargetSchedInfo.h index 8a904d99bcc..9a4497f9c29 100644 --- a/include/llvm/Target/TargetSchedInfo.h +++ b/include/llvm/Target/TargetSchedInfo.h @@ -152,7 +152,8 @@ private: /// TargetSchedInfo - Common interface to machine information for /// instruction scheduling /// -struct TargetSchedInfo { +class TargetSchedInfo { +public: const TargetMachine& target; unsigned maxNumIssueTotal; diff --git a/include/llvm/Transforms/Utils/FunctionUtils.h b/include/llvm/Transforms/Utils/FunctionUtils.h index 9c2f2098c15..d0e9cbc63e8 100644 --- a/include/llvm/Transforms/Utils/FunctionUtils.h +++ b/include/llvm/Transforms/Utils/FunctionUtils.h @@ -18,7 +18,7 @@ namespace llvm { class BasicBlock; - class DominatorSet; + struct DominatorSet; class Function; class Loop; diff --git a/include/llvm/Transforms/Utils/PromoteMemToReg.h b/include/llvm/Transforms/Utils/PromoteMemToReg.h index f6c3a8fce0c..12e7fb12579 100644 --- a/include/llvm/Transforms/Utils/PromoteMemToReg.h +++ b/include/llvm/Transforms/Utils/PromoteMemToReg.h @@ -20,8 +20,8 @@ namespace llvm { class AllocaInst; -class DominatorTree; -class DominanceFrontier; +struct DominatorTree; +struct DominanceFrontier; class TargetData; class AliasSetTracker; diff --git a/include/llvm/Use.h b/include/llvm/Use.h index 03afc24580f..88b723bfc3a 100644 --- a/include/llvm/Use.h +++ b/include/llvm/Use.h @@ -35,7 +35,7 @@ class Use { Value *Val; User *U; Use *Prev, *Next; - friend class ilist_traits; + friend struct ilist_traits; public: inline Use(Value *v, User *user); inline Use(const Use &u); diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 884b265dc16..ab1707884f0 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -27,7 +27,7 @@ namespace llvm { class Constant; class Argument; class Instruction; -struct BasicBlock; +class BasicBlock; class GlobalValue; class Function; class GlobalVariable; diff --git a/lib/Analysis/InstCount.cpp b/lib/Analysis/InstCount.cpp index 12d16b081e7..96c255ba311 100644 --- a/lib/Analysis/InstCount.cpp +++ b/lib/Analysis/InstCount.cpp @@ -29,7 +29,7 @@ namespace { #include "llvm/Instruction.def" class InstCount : public FunctionPass, public InstVisitor { - friend class InstVisitor; + friend struct InstVisitor; void visitFunction (Function &F) { ++TotalFuncs; } void visitBasicBlock(BasicBlock &BB) { ++TotalBlocks; } diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 00249807cac..7ad8ef403c8 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -66,7 +66,7 @@ namespace { Instruction *InsertPt; - friend class SCEVVisitor; + friend struct SCEVVisitor; public: SCEVExpander(ScalarEvolution &se, LoopInfo &li) : SE(se), LI(li) {} diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index aa57159b6e3..82d00b472ad 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -135,7 +135,7 @@ public: // The implementation of this class // private: - friend class InstVisitor; // Allow callbacks from visitor + friend struct InstVisitor; // Allow callbacks from visitor // 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 diff --git a/lib/Transforms/TransformInternals.h b/lib/Transforms/TransformInternals.h index 3b80146a278..b5747c91303 100644 --- a/lib/Transforms/TransformInternals.h +++ b/lib/Transforms/TransformInternals.h @@ -90,7 +90,8 @@ public: typedef std::map ValueTypeCache; -struct ValueMapCache { +class ValueMapCache { +public: // Operands mapped - Contains an entry if the first value (the user) has had // the second value (the operand) mapped already. // diff --git a/lib/VMCore/ConstantFold.h b/lib/VMCore/ConstantFold.h index 676b4b8cd83..84e358c5dff 100644 --- a/lib/VMCore/ConstantFold.h +++ b/lib/VMCore/ConstantFold.h @@ -24,7 +24,7 @@ namespace llvm { class Value; class Constant; - struct Type; + class Type; // Constant fold various types of instruction... Constant *ConstantFoldCastInstruction(const Constant *V, const Type *DestTy); diff --git a/lib/VMCore/ConstantFolding.h b/lib/VMCore/ConstantFolding.h index 676b4b8cd83..84e358c5dff 100644 --- a/lib/VMCore/ConstantFolding.h +++ b/lib/VMCore/ConstantFolding.h @@ -24,7 +24,7 @@ namespace llvm { class Value; class Constant; - struct Type; + class Type; // Constant fold various types of instruction... Constant *ConstantFoldCastInstruction(const Constant *V, const Type *DestTy); diff --git a/lib/VMCore/PassManagerT.h b/lib/VMCore/PassManagerT.h index 1d8267fe4e7..8de22d43cc5 100644 --- a/lib/VMCore/PassManagerT.h +++ b/lib/VMCore/PassManagerT.h @@ -630,7 +630,8 @@ public: // This pass manager is used to group together all of the BasicBlockPass's // into a single unit. // -template<> struct PassManagerTraits : public BasicBlockPass { +template<> class PassManagerTraits : public BasicBlockPass { +public: // PassClass - The type of passes tracked by this PassManager typedef BasicBlockPass PassClass; @@ -683,7 +684,8 @@ template<> struct PassManagerTraits : public BasicBlockPass { // This pass manager is used to group together all of the FunctionPass's // into a single unit. // -template<> struct PassManagerTraits : public FunctionPass { +template<> class PassManagerTraits : public FunctionPass { +public: // PassClass - The type of passes tracked by this PassManager typedef FunctionPass PassClass; @@ -726,7 +728,8 @@ template<> struct PassManagerTraits : public FunctionPass { // // This is the top level PassManager implementation that holds generic passes. // -template<> struct PassManagerTraits : public ModulePass { +template<> class PassManagerTraits : public ModulePass { +public: // PassClass - The type of passes tracked by this PassManager typedef ModulePass PassClass; diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h index d74e8872a3e..ac5306e4efb 100644 --- a/utils/TableGen/CodeGenTarget.h +++ b/utils/TableGen/CodeGenTarget.h @@ -26,7 +26,7 @@ namespace llvm { class Record; class RecordKeeper; -class CodeGenRegister; +struct CodeGenRegister; /// getValueType - Return the MVT::ValueType that the specified TableGen record /// corresponds to. diff --git a/utils/TableGen/InstrInfoEmitter.h b/utils/TableGen/InstrInfoEmitter.h index 87a140b43aa..bf7da347ed2 100644 --- a/utils/TableGen/InstrInfoEmitter.h +++ b/utils/TableGen/InstrInfoEmitter.h @@ -22,7 +22,7 @@ namespace llvm { class StringInit; class IntInit; class ListInit; -class CodeGenInstruction; +struct CodeGenInstruction; class InstrInfoEmitter : public TableGenBackend { RecordKeeper &Records; diff --git a/utils/TableGen/InstrSelectorEmitter.h b/utils/TableGen/InstrSelectorEmitter.h index 156e7222b76..302a98adc3c 100644 --- a/utils/TableGen/InstrSelectorEmitter.h +++ b/utils/TableGen/InstrSelectorEmitter.h @@ -24,7 +24,7 @@ namespace llvm { class DagInit; -class Init; +struct Init; class InstrSelectorEmitter; /// NodeType - Represents Information parsed from the DagNode entries. diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h index e88497f3120..9bd8708e431 100644 --- a/utils/TableGen/Record.h +++ b/utils/TableGen/Record.h @@ -34,7 +34,7 @@ class DagRecTy; class RecordRecTy; // Init subclasses... -class Init; +struct Init; class UnsetInit; class BitInit; class BitsInit; @@ -107,7 +107,8 @@ inline std::ostream &operator<<(std::ostream &OS, const RecTy &Ty) { /// BitRecTy - 'bit' - Represent a single bit /// -struct BitRecTy : public RecTy { +class BitRecTy : public RecTy { +public: Init *convertValue(UnsetInit *UI) { return (Init*)UI; } Init *convertValue(BitInit *BI) { return (Init*)BI; } Init *convertValue(BitsInit *BI); @@ -157,7 +158,8 @@ public: /// 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(IntInit *II) { return (Init*)II; } Init *convertValue(BitInit *BI); @@ -177,7 +179,8 @@ struct IntRecTy : public RecTy { /// StringRecTy - 'string' - Represent an string value /// -struct StringRecTy : public RecTy { +class StringRecTy : public RecTy { +public: Init *convertValue(UnsetInit *UI) { return (Init*)UI; } Init *convertValue(StringInit *SI) { return (Init*)SI; } Init *convertValue(TypedInit *TI); @@ -219,7 +222,8 @@ public: /// 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( CodeInit *CI) { return (Init*)CI; } Init *convertValue(TypedInit *TI); @@ -234,7 +238,8 @@ struct CodeRecTy : public RecTy { /// DagRecTy - 'dag' - Represent a dag fragment /// -struct DagRecTy : public RecTy { +class DagRecTy : public RecTy { +public: Init *convertValue(UnsetInit *UI) { return (Init*)UI; } Init *convertValue( DagInit *CI) { return (Init*)CI; } Init *convertValue(TypedInit *TI); @@ -343,7 +348,8 @@ inline std::ostream &operator<<(std::ostream &OS, const Init &I) { /// UnsetInit - ? - Represents an uninitialized value /// -struct UnsetInit : public Init { +class UnsetInit : public Init { +public: virtual Init *convertInitializerTo(RecTy *Ty) { return Ty->convertValue(this); } -- 2.11.0