From 94ea5be39fe379cda3ff144a99b6a1a69a9fe2e2 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 10 Dec 2008 00:15:44 +0000 Subject: Fix a couple of Dwarf bugs. - Emit DW_AT_byte_size for struct and union of size zero. - Emit DW_AT_declaration for forward type declaration. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60812 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineModuleInfo.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/llvm/CodeGen/MachineModuleInfo.h') diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index 46bf7904c7..61befb5cfb 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -282,7 +282,8 @@ class TypeDesc : public DebugInfoDesc { private: enum { FlagPrivate = 1 << 0, - FlagProtected = 1 << 1 + FlagProtected = 1 << 1, + FlagFwdDecl = 1 << 2 }; DebugInfoDesc *Context; // Context debug descriptor. std::string Name; // Type name (may be empty.) @@ -291,6 +292,8 @@ private: 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.) + +protected: unsigned Flags; // Miscellaneous flags. public: @@ -312,6 +315,9 @@ public: bool isProtected() const { return (Flags & FlagProtected) != 0; } + bool isForwardDecl() const { + return (Flags & FlagFwdDecl) != 0; + } void setContext(DebugInfoDesc *C) { Context = C; } void setName(const std::string &N) { Name = N; } void setFile(CompileUnitDesc *U) { @@ -323,6 +329,7 @@ public: void setOffset(uint64_t O) { Offset = O; } void setIsPrivate() { Flags |= FlagPrivate; } void setIsProtected() { Flags |= FlagProtected; } + void setIsForwardDecl() { Flags |= FlagFwdDecl; } /// ApplyToFields - Target the visitor to the fields of the TypeDesc. /// -- cgit v1.2.3