llvm.org GIT mirror llvm / 1fca5ff
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 Chris Lattner 16 years ago
35 changed file(s) with 96 addition(s) and 71 deletion(s). Raw diff Collapse all Expand all
3838
3939 namespace llvm {
4040
41 struct Type;
41 class Type;
4242 class DerivedType;
4343
4444 class AbstractTypeUser {
3333 class AliasSet {
3434 friend class AliasSetTracker;
3535
36 struct PointerRec;
36 class PointerRec;
3737 typedef std::pair HashNodePair;
3838
3939 class PointerRec {
115115 // Volatile - True if this alias set contains volatile loads or stores.
116116 bool Volatile : 1;
117117
118 friend class ilist_traits;
118 friend struct ilist_traits;
119119 AliasSet *getPrev() const { return Prev; }
120120 AliasSet *getNext() const { return Next; }
121121 void setPrev(AliasSet *P) { Prev = P; }
4646 /// doubly-linked ilist in the DSGraph.
4747 ///
4848 DSNode *Next, *Prev;
49 friend class ilist_traits;
49 friend struct ilist_traits;
5050
5151 /// Size - The current size of the node. This should be equal to the size of
5252 /// the current type record.
286286 Node *RootNode;
287287 public:
288288 class Node {
289 friend class DominatorTree;
290 friend class PostDominatorTree;
291 friend class DominatorTreeBase;
289 friend struct DominatorTree;
290 friend struct PostDominatorTree;
291 friend struct DominatorTreeBase;
292292 BasicBlock *TheBB;
293293 Node *IDom;
294294 std::vector Children;
3434
3535 namespace llvm {
3636
37 class DominatorSet;
37 struct DominatorSet;
3838 class LoopInfo;
3939 class PHINode;
4040 class Instruction;
4444 static iplist &getList(BasicBlock *BB);
4545 };
4646
47 struct BasicBlock : public Value { // Basic blocks are data objects also
47 class BasicBlock : public Value { // Basic blocks are data objects also
48 public:
4849 typedef iplist InstListType;
4950 private :
5051 InstListType InstList;
2323
2424 // ilist_traits
2525 template <>
26 class ilist_traits {
26 struct ilist_traits {
27 protected:
2728 // this is only set by the MachineBasicBlock owning the ilist
2829 friend class MachineBasicBlock;
2930 MachineBasicBlock* parent;
178179 int getNumber() const { return Number; }
179180
180181 private: // Methods used to maintain doubly linked list of blocks...
181 friend class ilist_traits;
182 friend struct ilist_traits;
182183
183184 MachineBasicBlock *getPrev() const { return Prev; }
184185 MachineBasicBlock *getNext() const { return Next; }
2828 class GlobalValue;
2929 class Function;
3030
31 struct MachineCodeEmitter {
31 class MachineCodeEmitter {
32 public:
3233 virtual ~MachineCodeEmitter() {}
3334
3435 /// startFunction - This callback is invoked when the specified function is
3030
3131 // ilist_traits
3232 template <>
33 class ilist_traits {
33 struct ilist_traits {
3434 // this is only set by the MachineFunction owning the ilist
3535 friend class MachineFunction;
3636 MachineFunction* Parent;
2828 class TargetMachine;
2929 class GlobalValue;
3030
31 template class ilist_traits;
32 template class ilist;
31 template struct ilist_traits;
32 template struct ilist;
3333
3434 typedef short MachineOpCode;
3535
416416
417417 // Intrusive list support
418418 //
419 friend class ilist_traits;
419 friend struct ilist_traits;
420420
421421 public:
422422 MachineInstr(short Opcode, unsigned numOperands);
2020
2121 namespace llvm {
2222
23 struct BasicBlock;
23 class BasicBlock;
2424 class PointerType;
2525
2626 //===----------------------------------------------------------------------===//
11581158 /// UnwindInst - Immediately exit the current function, unwinding the stack
11591159 /// until an invoke instruction is found.
11601160 ///
1161 struct UnwindInst : public TerminatorInst {
1161 class UnwindInst : public TerminatorInst {
1162 public:
11621163 UnwindInst(Instruction *InsertBefore = 0)
11631164 : TerminatorInst(Instruction::Unwind, InsertBefore) {
11641165 }
11951196 /// presence of this instruction indicates some higher level knowledge that the
11961197 /// end of the block cannot be reached.
11971198 ///
1198 struct UnreachableInst : public TerminatorInst {
1199 class UnreachableInst : public TerminatorInst {
1200 public:
11991201 UnreachableInst(Instruction *InsertBefore = 0)
12001202 : TerminatorInst(Instruction::Unreachable, InsertBefore) {
12011203 }
3737 namespace llvm {
3838
3939 class Value;
40 struct BasicBlock;
40 class BasicBlock;
4141 class Function;
4242 class Module;
4343 class AnalysisUsage;
5555 /// constrained passes described below.
5656 ///
5757 class Pass {
58 friend class AnalysisResolver;
58 friend struct AnalysisResolver;
5959 AnalysisResolver *Resolver; // AnalysisResolver this pass is owned by...
6060 const PassInfo *PassInfoCache;
6161
210210 /// interprocedural optimizations and analyses. ModulePass's may do anything
211211 /// they want to the program.
212212 ///
213 struct ModulePass : public Pass {
214
213 class ModulePass : public Pass {
214 public:
215215 /// runOnModule - Virtual method overriden by subclasses to process the module
216216 /// being operated on.
217217 virtual bool runOnModule(Module &M) = 0;
227227 /// not need to be run. This is useful for things like target information and
228228 /// "basic" versions of AnalysisGroups.
229229 ///
230 struct ImmutablePass : public ModulePass {
230 class ImmutablePass : public ModulePass {
231 public:
231232 /// initializePass - This method may be overriden by immutable passes to allow
232233 /// them to perform various initialization actions they require. This is
233234 /// primarily because an ImmutablePass can "require" another ImmutablePass,
254255 /// 2. Optimizing a function does not cause the addition or removal of any
255256 /// functions in the module
256257 ///
257 struct FunctionPass : public ModulePass {
258 class FunctionPass : public ModulePass {
259 public:
258260 /// doInitialization - Virtual method overridden by subclasses to do
259261 /// any necessary per-module initialization.
260262 ///
2929 class AnnotationID;
3030 class Annotation;
3131 class Annotable;
32 class AnnotationManager;
32 struct AnnotationManager;
3333
3434 //===----------------------------------------------------------------------===//
3535 //
3838 // freely around and passed byvalue with little or no overhead.
3939 //
4040 class AnnotationID {
41 friend class AnnotationManager;
41 friend struct AnnotationManager;
4242 unsigned ID;
4343
4444 AnnotationID(); // Default ctor is disabled
512512 // parser
513513 //
514514 template<>
515 struct parser : public basic_parser {
516
515 class parser : public basic_parser {
516 public:
517517 // parse - Return true on error.
518518 bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val);
519519
530530 // parser
531531 //
532532 template<>
533 struct parser : public basic_parser {
534
533 class parser : public basic_parser {
534 public:
535535 // parse - Return true on error.
536536 bool parse(Option &O, const char *ArgName, const std::string &Arg, int &Val);
537537
544544 // parser
545545 //
546546 template<>
547 struct parser : public basic_parser {
548
547 class parser : public basic_parser {
548 public:
549549 // parse - Return true on error.
550550 bool parse(Option &O, const char *AN, const std::string &Arg, unsigned &Val);
551551
558558 // parser
559559 //
560560 template<>
561 struct parser : public basic_parser {
561 class parser : public basic_parser {
562 public:
562563 // parse - Return true on error.
563564 bool parse(Option &O, const char *AN, const std::string &Arg, double &Val);
564565
571572 // parser
572573 //
573574 template<>
574 struct parser : public basic_parser {
575 class parser : public basic_parser {
576 public:
575577 // parse - Return true on error.
576578 bool parse(Option &O, const char *AN, const std::string &Arg, float &Val);
577579
584586 // parser
585587 //
586588 template<>
587 struct parser : public basic_parser {
589 class parser : public basic_parser {
590 public:
588591 // parse - Return true on error.
589592 bool parse(Option &O, const char *AN, const std::string &Arg,
590593 std::string &Value) {
686689 // object in all cases that it is used.
687690 //
688691 template
689 struct opt_storage : public DataType {
690
692 class opt_storage : public DataType {
693 public:
691694 template
692695 void setValue(const T &V) { DataType::operator=(V); }
693696
700703 // to get at the value.
701704 //
702705 template
703 struct opt_storage {
706 class opt_storage {
707 public:
704708 DataType Value;
705709
706710 // Make sure we initialize the value with the default constructor for the
863867 // object in all cases that it is used.
864868 //
865869 template
866 struct list_storage : public std::vector {
867
870 class list_storage : public std::vector {
871 public:
868872 template
869873 void addValue(const T &V) { push_back(V); }
870874 };
9494 /// from DefaultDOTGraphTraits if you don't need to override everything.
9595 ///
9696 template
97 class DOTGraphTraits : public DefaultDOTGraphTraits {};
97 struct DOTGraphTraits : public DefaultDOTGraphTraits {};
9898
9999 } // End llvm namespace
100100
2020
2121 /// Forward declare a class used for holding platform specific information
2222 /// that needs to be
23 class MappedFileInfo;
23 struct MappedFileInfo;
2424
2525 /// This class provides an abstraction for a memory mapped file in the
2626 /// operating system's filesystem. It provides platform independent operations
113113 // This object is used to lazily calculate structure layout information for a
114114 // target machine, based on the TargetData structure.
115115 //
116 struct StructLayout {
116 class StructLayout {
117 public:
117118 std::vector MemberOffsets;
118119 uint64_t StructSize;
119120 unsigned StructAlignment;
2626 /// The offset to the local area is the offset from the stack pointer on
2727 /// function entry to the first location where function data (local variables,
2828 /// spill locations) can be stored.
29 struct TargetFrameInfo {
29 class TargetFrameInfo {
30 public:
3031 enum StackDirection {
3132 StackGrowsUp, // Adding to the stack increases the stack address
3233 StackGrowsDown // Adding to the stack decreases the stack address
6060 // before control flow occurs.
6161 const unsigned M_TERMINATOR_FLAG = 1 << 16;
6262
63 struct TargetInstrDescriptor {
63 class TargetInstrDescriptor {
64 public:
6465 const char * Name; // Assembly language mnemonic for the opcode.
6566 int numOperands; // Number of args; -1 if variable #args
6667 int resultPos; // Position of the result; -1 if no result
151151 /// TargetSchedInfo - Common interface to machine information for
152152 /// instruction scheduling
153153 ///
154 struct TargetSchedInfo {
154 class TargetSchedInfo {
155 public:
155156 const TargetMachine& target;
156157
157158 unsigned maxNumIssueTotal;
1717
1818 namespace llvm {
1919 class BasicBlock;
20 class DominatorSet;
20 struct DominatorSet;
2121 class Function;
2222 class Loop;
2323
1919 namespace llvm {
2020
2121 class AllocaInst;
22 class DominatorTree;
23 class DominanceFrontier;
22 struct DominatorTree;
23 struct DominanceFrontier;
2424 class TargetData;
2525 class AliasSetTracker;
2626
3434 Value *Val;
3535 User *U;
3636 Use *Prev, *Next;
37 friend class ilist_traits;
37 friend struct ilist_traits;
3838 public:
3939 inline Use(Value *v, User *user);
4040 inline Use(const Use &u);
2626 class Constant;
2727 class Argument;
2828 class Instruction;
29 struct BasicBlock;
29 class BasicBlock;
3030 class GlobalValue;
3131 class Function;
3232 class GlobalVariable;
2828 #include "llvm/Instruction.def"
2929
3030 class InstCount : public FunctionPass, public InstVisitor {
31 friend class InstVisitor;
31 friend struct InstVisitor;
3232
3333 void visitFunction (Function &F) { ++TotalFuncs; }
3434 void visitBasicBlock(BasicBlock &BB) { ++TotalBlocks; }
6565
6666 Instruction *InsertPt;
6767
68 friend class SCEVVisitor;
68 friend struct SCEVVisitor;
6969 public:
7070 SCEVExpander(ScalarEvolution &se, LoopInfo &li) : SE(se), LI(li) {}
7171
134134 // The implementation of this class
135135 //
136136 private:
137 friend class InstVisitor; // Allow callbacks from visitor
137 friend struct InstVisitor; // Allow callbacks from visitor
138138
139139 // markConstant - Make a value be marked as "constant". If the value
140140 // is not already a constant, add it to the instruction work list so that
8989
9090 typedef std::map ValueTypeCache;
9191
92 struct ValueMapCache {
92 class ValueMapCache {
93 public:
9394 // Operands mapped - Contains an entry if the first value (the user) has had
9495 // the second value (the operand) mapped already.
9596 //
2323 namespace llvm {
2424 class Value;
2525 class Constant;
26 struct Type;
26 class Type;
2727
2828 // Constant fold various types of instruction...
2929 Constant *ConstantFoldCastInstruction(const Constant *V, const Type *DestTy);
2323 namespace llvm {
2424 class Value;
2525 class Constant;
26 struct Type;
26 class Type;
2727
2828 // Constant fold various types of instruction...
2929 Constant *ConstantFoldCastInstruction(const Constant *V, const Type *DestTy);
629629 // This pass manager is used to group together all of the BasicBlockPass's
630630 // into a single unit.
631631 //
632 template<> struct PassManagerTraits : public BasicBlockPass {
632 template<> class PassManagerTraits : public BasicBlockPass {
633 public:
633634 // PassClass - The type of passes tracked by this PassManager
634635 typedef BasicBlockPass PassClass;
635636
682683 // This pass manager is used to group together all of the FunctionPass's
683684 // into a single unit.
684685 //
685 template<> struct PassManagerTraits : public FunctionPass {
686 template<> class PassManagerTraits : public FunctionPass {
687 public:
686688 // PassClass - The type of passes tracked by this PassManager
687689 typedef FunctionPass PassClass;
688690
725727 //
726728 // This is the top level PassManager implementation that holds generic passes.
727729 //
728 template<> struct PassManagerTraits : public ModulePass {
730 template<> class PassManagerTraits : public ModulePass {
731 public:
729732 // PassClass - The type of passes tracked by this PassManager
730733 typedef ModulePass PassClass;
731734
2525
2626 class Record;
2727 class RecordKeeper;
28 class CodeGenRegister;
28 struct CodeGenRegister;
2929
3030 /// getValueType - Return the MVT::ValueType that the specified TableGen record
3131 /// corresponds to.
2121 class StringInit;
2222 class IntInit;
2323 class ListInit;
24 class CodeGenInstruction;
24 struct CodeGenInstruction;
2525
2626 class InstrInfoEmitter : public TableGenBackend {
2727 RecordKeeper &Records;
2323 namespace llvm {
2424
2525 class DagInit;
26 class Init;
26 struct Init;
2727 class InstrSelectorEmitter;
2828
2929 /// NodeType - Represents Information parsed from the DagNode entries.
3333 class RecordRecTy;
3434
3535 // Init subclasses...
36 class Init;
36 struct Init;
3737 class UnsetInit;
3838 class BitInit;
3939 class BitsInit;
106106
107107 /// BitRecTy - 'bit' - Represent a single bit
108108 ///
109 struct BitRecTy : public RecTy {
109 class BitRecTy : public RecTy {
110 public:
110111 Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
111112 Init *convertValue(BitInit *BI) { return (Init*)BI; }
112113 Init *convertValue(BitsInit *BI);
156157
157158 /// IntRecTy - 'int' - Represent an integer value of no particular size
158159 ///
159 struct IntRecTy : public RecTy {
160 class IntRecTy : public RecTy {
161 public:
160162 Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
161163 Init *convertValue(IntInit *II) { return (Init*)II; }
162164 Init *convertValue(BitInit *BI);
176178
177179 /// StringRecTy - 'string' - Represent an string value
178180 ///
179 struct StringRecTy : public RecTy {
181 class StringRecTy : public RecTy {
182 public:
180183 Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
181184 Init *convertValue(StringInit *SI) { return (Init*)SI; }
182185 Init *convertValue(TypedInit *TI);
218221
219222 /// CodeRecTy - 'code' - Represent an code fragment, function or method.
220223 ///
221 struct CodeRecTy : public RecTy {
224 class CodeRecTy : public RecTy {
225 public:
222226 Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
223227 Init *convertValue( CodeInit *CI) { return (Init*)CI; }
224228 Init *convertValue(TypedInit *TI);
233237
234238 /// DagRecTy - 'dag' - Represent a dag fragment
235239 ///
236 struct DagRecTy : public RecTy {
240 class DagRecTy : public RecTy {
241 public:
237242 Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
238243 Init *convertValue( DagInit *CI) { return (Init*)CI; }
239244 Init *convertValue(TypedInit *TI);
342347
343348 /// UnsetInit - ? - Represents an uninitialized value
344349 ///
345 struct UnsetInit : public Init {
350 class UnsetInit : public Init {
351 public:
346352 virtual Init *convertInitializerTo(RecTy *Ty) {
347353 return Ty->convertValue(this);
348354 }