diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-06-27 01:27:56 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-06-27 01:27:56 +0000 |
commit | 914c970899ce3281a8d14d924ec1bfe335624ac6 (patch) | |
tree | 6581617bef8df146df8ce8bfcc9fd8a68d038a8e /include/llvm/CodeGen | |
parent | b827c26e1e49944e44604402d2414b259dba6900 (diff) | |
download | external_llvm-914c970899ce3281a8d14d924ec1bfe335624ac6.tar.gz external_llvm-914c970899ce3281a8d14d924ec1bfe335624ac6.tar.bz2 external_llvm-914c970899ce3281a8d14d924ec1bfe335624ac6.zip |
Reverting broken patch r52803.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52806 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/MachineDebugInfoDesc.h | 46 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineModuleInfo.h | 52 |
2 files changed, 40 insertions, 58 deletions
diff --git a/include/llvm/CodeGen/MachineDebugInfoDesc.h b/include/llvm/CodeGen/MachineDebugInfoDesc.h index 926733f666..a79a12170d 100644 --- a/include/llvm/CodeGen/MachineDebugInfoDesc.h +++ b/include/llvm/CodeGen/MachineDebugInfoDesc.h @@ -407,10 +407,10 @@ public: SubrangeDesc(); // Accessors - int64_t getLo() const { return Lo; } - int64_t getHi() const { return Hi; } - void setLo(int64_t L) { Lo = L; } - void setHi(int64_t H) { Hi = H; } + int64_t getLo() const { return Lo; } + int64_t getHi() const { return Hi; } + void setLo(int64_t L) { Lo = L; } + void setHi(int64_t H) { Hi = H; } /// ApplyToFields - Target the visitor to the fields of the SubrangeDesc. /// @@ -552,34 +552,32 @@ protected: explicit GlobalDesc(unsigned T); public: // Accessors - DebugInfoDesc *getContext() const { return Context; } - const std::string &getName() const { return Name; } - const std::string &getFullName() const { return FullName; } - const std::string &getLinkageName() const { return LinkageName; } + DebugInfoDesc *getContext() const { return Context; } + const std::string &getName() const { return Name; } + const std::string &getFullName() const { return FullName; } + const std::string &getLinkageName() const { return LinkageName; } CompileUnitDesc *getFile() const { return static_cast<CompileUnitDesc *>(File); } - unsigned getLine() const { return Line; } + unsigned getLine() const { return Line; } TypeDesc *getType() const { return static_cast<TypeDesc *>(TyDesc); } - - bool isStatic() const { return IsStatic; } - bool isDefinition() const { return IsDefinition; } - - void setContext(DebugInfoDesc *C) { Context = C; } - void setName(const std::string &N) { Name = N; } - void setFullName(const std::string &N) { FullName = N; } - void setLinkageName(const std::string &N) { LinkageName = N; } + bool isStatic() const { return IsStatic; } + bool isDefinition() const { return IsDefinition; } + void setContext(DebugInfoDesc *C) { Context = C; } + void setName(const std::string &N) { Name = N; } + void setFullName(const std::string &N) { FullName = N; } + void setLinkageName(const std::string &N) { LinkageName = N; } void setFile(CompileUnitDesc *U) { File = static_cast<DebugInfoDesc *>(U); } - void setLine(unsigned L) { Line = L; } + void setLine(unsigned L) { Line = L; } void setType(TypeDesc *T) { TyDesc = static_cast<DebugInfoDesc *>(T); } - void setIsStatic(bool IS) { IsStatic = IS; } - void setIsDefinition(bool ID) { IsDefinition = ID; } + void setIsStatic(bool IS) { IsStatic = IS; } + void setIsDefinition(bool ID) { IsDefinition = ID; } /// ApplyToFields - Target the visitor to the fields of the GlobalDesc. /// @@ -595,8 +593,8 @@ public: GlobalVariableDesc(); // Accessors. - GlobalVariable *getGlobalVariable() const { return Global; } - void setGlobalVariable(GlobalVariable *GV) { Global = GV; } + GlobalVariable *getGlobalVariable() const { return Global; } + void setGlobalVariable(GlobalVariable *GV) { Global = GV; } /// ApplyToFields - Target the visitor to the fields of the /// GlobalVariableDesc. @@ -675,8 +673,8 @@ public: BlockDesc(); // Accessors - DebugInfoDesc *getContext() const { return Context; } - void setContext(DebugInfoDesc *C) { Context = C; } + DebugInfoDesc *getContext() const { return Context; } + void setContext(DebugInfoDesc *C) { Context = C; } /// ApplyToFields - Target the visitor to the fields of the BlockDesc. /// diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index 748dfd68ce..f2a2b7b674 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -33,6 +33,7 @@ #include "llvm/GlobalValue.h" #include "llvm/Pass.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/UniqueVector.h" @@ -85,15 +86,10 @@ public: /// DIDeserializer - This class is responsible for casting GlobalVariables /// into DebugInfoDesc objects. class DIDeserializer { -private: - std::map<GlobalVariable *, DebugInfoDesc *> GlobalDescs; - // Previously defined gloabls. - + // Previously defined gloabls. + DenseMap<GlobalVariable*, DebugInfoDesc*> GlobalDescs; public: - DIDeserializer() {} - ~DIDeserializer() {} - - const std::map<GlobalVariable *, DebugInfoDesc *> &getGlobalDescs() const { + const DenseMap<GlobalVariable *, DebugInfoDesc *> &getGlobalDescs() const { return GlobalDescs; } @@ -107,27 +103,23 @@ public: /// DISerializer - This class is responsible for casting DebugInfoDesc objects /// into GlobalVariables. class DISerializer { -private: Module *M; // Definition space module. PointerType *StrPtrTy; // A "i8*" type. Created lazily. PointerType *EmptyStructPtrTy; // A "{ }*" type. Created lazily. + + // Types per Tag. Created lazily. std::map<unsigned, StructType *> TagTypes; - // Types per Tag. Created lazily. - std::map<DebugInfoDesc *, GlobalVariable *> DescGlobals; - // Previously defined descriptors. - std::map<const std::string, Constant *> StringCache; - // Previously defined strings. - + + // Previously defined descriptors. + DenseMap<DebugInfoDesc *, GlobalVariable *> DescGlobals; + + // Previously defined strings. + DenseMap<const char *, Constant*> StringCache; public: DISerializer() - : M(NULL) - , StrPtrTy(NULL) - , EmptyStructPtrTy(NULL) - , TagTypes() - , DescGlobals() - , StringCache() + : M(NULL), StrPtrTy(NULL), EmptyStructPtrTy(NULL), TagTypes(), + DescGlobals(), StringCache() {} - ~DISerializer() {} // Accessors Module *getModule() const { return M; }; @@ -161,21 +153,17 @@ public: /// DIVerifier - This class is responsible for verifying the given network of /// GlobalVariables are valid as DebugInfoDesc objects. class DIVerifier { -private: enum { Unknown = 0, Invalid, Valid }; - std::map<GlobalVariable *, unsigned> Validity;// Tracks prior results. - std::map<unsigned, unsigned> Counts; // Count of fields per Tag type. - + DenseMap<GlobalVariable *, unsigned> Validity; // Tracks prior results. + std::map<unsigned, unsigned> Counts; // Count of fields per Tag type. public: DIVerifier() - : Validity() - , Counts() + : Validity(), Counts() {} - ~DIVerifier() {} /// Verify - Return true if the GlobalVariable appears to be a valid /// serialization of a DebugInfoDesc. @@ -191,12 +179,10 @@ public: /// SourceLineInfo - This class is used to record source line correspondence. /// class SourceLineInfo { -private: unsigned Line; // Source line number. unsigned Column; // Source column. unsigned SourceID; // Source ID number. unsigned LabelID; // Label in code ID number. - public: SourceLineInfo(unsigned L, unsigned C, unsigned S, unsigned I) : Line(L), Column(C), SourceID(S), LabelID(I) {} @@ -212,10 +198,8 @@ public: /// SourceFileInfo - This class is used to track source information. /// class SourceFileInfo { -private: unsigned DirectoryID; // Directory ID number. std::string Name; // File name (not including directory.) - public: SourceFileInfo(unsigned D, const std::string &N) : DirectoryID(D), Name(N) {} @@ -591,7 +575,7 @@ public: /// getFilterIDFor - Return the id of the filter encoded by TyIds. This is /// function wide. - int getFilterIDFor(SmallVectorImpl<unsigned> &TyIds); + int getFilterIDFor(std::vector<unsigned> &TyIds); /// TidyLandingPads - Remap landing pad labels and remove any deleted landing /// pads. |