-class TypeDesc : public DebugInfoDesc {
-private:
- enum {
- FlagPrivate = 1 << 0,
- FlagProtected = 1 << 1
- };
- DebugInfoDesc *Context; // Context debug descriptor.
- std::string Name; // Type name (may be empty.)
- DebugInfoDesc *File; // Defined compile unit (may be NULL.)
- unsigned Line; // Defined line# (may be zero.)
- uint64_t Size; // Type bit size (may be zero.)
- uint64_t Align; // Type bit alignment (may be zero.)
- uint64_t Offset; // Type bit offset (may be zero.)
- unsigned Flags; // Miscellaneous flags.
-
-public:
- explicit TypeDesc(unsigned T);
-
- // Accessors
- DebugInfoDesc *getContext() const { return Context; }
- const std::string &getName() const { return Name; }
- CompileUnitDesc *getFile() const {
- return static_cast<CompileUnitDesc *>(File);
- }
- unsigned getLine() const { return Line; }
- uint64_t getSize() const { return Size; }
- uint64_t getAlign() const { return Align; }
- uint64_t getOffset() const { return Offset; }
- bool isPrivate() const {
- return (Flags & FlagPrivate) != 0;
- }
- bool isProtected() const {
- return (Flags & FlagProtected) != 0;
- }
- void setContext(DebugInfoDesc *C) { Context = C; }
- void setName(const std::string &N) { Name = N; }
- void setFile(CompileUnitDesc *U) {
- File = static_cast<DebugInfoDesc *>(U);
- }
- void setLine(unsigned L) { Line = L; }
- void setSize(uint64_t S) { Size = S; }
- void setAlign(uint64_t A) { Align = A; }
- void setOffset(uint64_t O) { Offset = O; }
- void setIsPrivate() { Flags |= FlagPrivate; }
- void setIsProtected() { Flags |= FlagProtected; }
-
- /// ApplyToFields - Target the visitor to the fields of the TypeDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// BasicTypeDesc - This class packages debug information associated with a
-/// basic type (eg. int, bool, double.)
-class BasicTypeDesc : public TypeDesc {
-private:
- unsigned Encoding; // Type encoding.
-
-public:
- BasicTypeDesc();
-
- // Accessors
- unsigned getEncoding() const { return Encoding; }
- void setEncoding(unsigned E) { Encoding = E; }
-
- // Implement isa/cast/dyncast.
- static bool classof(const BasicTypeDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the BasicTypeDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-
-//===----------------------------------------------------------------------===//
-/// DerivedTypeDesc - This class packages debug information associated with a
-/// derived types (eg., typedef, pointer, reference.)
-class DerivedTypeDesc : public TypeDesc {
-private:
- DebugInfoDesc *FromType; // Type derived from.
-
-public:
- explicit DerivedTypeDesc(unsigned T);
-
- // Accessors
- TypeDesc *getFromType() const {
- return static_cast<TypeDesc *>(FromType);
- }
- void setFromType(TypeDesc *F) {
- FromType = static_cast<DebugInfoDesc *>(F);
- }
-
- // Implement isa/cast/dyncast.
- static bool classof(const DerivedTypeDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the DerivedTypeDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// CompositeTypeDesc - This class packages debug information associated with a
-/// array/struct types (eg., arrays, struct, union, enums.)
-class CompositeTypeDesc : public DerivedTypeDesc {
-private:
- std::vector<DebugInfoDesc *> Elements;// Information used to compose type.
-
-public:
- explicit CompositeTypeDesc(unsigned T);
-
- // Accessors
- std::vector<DebugInfoDesc *> &getElements() { return Elements; }
-
- // Implement isa/cast/dyncast.
- static bool classof(const CompositeTypeDesc *) { return true; }
- static bool classof(const DebugInfoDesc *D);
-
- /// ApplyToFields - Target the visitor to the fields of the CompositeTypeDesc.
- ///
- virtual void ApplyToFields(DIVisitor *Visitor);
-
- /// getDescString - Return a string used to compose global names and labels.
- ///
- virtual const char *getDescString() const;
-
- /// getTypeString - Return a string used to label this descriptor's type.
- ///
- virtual const char *getTypeString() const;
-
-#ifndef NDEBUG
- virtual void dump();
-#endif
-};
-
-//===----------------------------------------------------------------------===//
-/// SubrangeDesc - This class packages debug information associated with integer
-/// value ranges.
-class SubrangeDesc : public DebugInfoDesc {
-private:
- int64_t Lo; // Low value of range.
- int64_t Hi; // High value of range.