diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-07-09 13:22:17 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-07-09 13:22:17 +0000 |
| commit | 94ff6f02ef01562cda33cdac8a8dd0f66de4ea64 (patch) | |
| tree | f572954db0b4c9942f374b4fc34b687127622207 /llvm | |
| parent | 4e4f3168dd985bb44149eab4c494ceeb9ffb16b0 (diff) | |
| download | bcm5719-llvm-94ff6f02ef01562cda33cdac8a8dd0f66de4ea64.tar.gz bcm5719-llvm-94ff6f02ef01562cda33cdac8a8dd0f66de4ea64.zip | |
Print entity size for mergeable sections
llvm-svn: 53303
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Target/TargetAsmInfo.h | 26 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetAsmInfo.cpp | 3 |
2 files changed, 20 insertions, 9 deletions
diff --git a/llvm/include/llvm/Target/TargetAsmInfo.h b/llvm/include/llvm/Target/TargetAsmInfo.h index 0cd7f8d7a5e..4e7d23d5001 100644 --- a/llvm/include/llvm/Target/TargetAsmInfo.h +++ b/llvm/include/llvm/Target/TargetAsmInfo.h @@ -45,15 +45,25 @@ namespace llvm { namespace SectionFlags { enum Flags { None = 0, - Code = 1 << 0, ///< Section contains code - Writeable = 1 << 1, ///< Section is writeable - BSS = 1 << 2, ///< Section contains only zeroes - Mergeable = 1 << 3, ///< Section contains mergeable data - Strings = 1 << 4, ///< Section contains null-terminated strings - TLS = 1 << 5, ///< Section contains thread-local data - Debug = 1 << 6, ///< Section contains debug data - Linkonce = 1 << 7 ///< Section is linkonce + Code = 1 << 0, ///< Section contains code + Writeable = 1 << 1, ///< Section is writeable + BSS = 1 << 2, ///< Section contains only zeroes + Mergeable = 1 << 3, ///< Section contains mergeable data + Strings = 1 << 4, ///< Section contains null-terminated strings + TLS = 1 << 5, ///< Section contains thread-local data + Debug = 1 << 6, ///< Section contains debug data + Linkonce = 1 << 7, ///< Section is linkonce + // Some gap for future flags + EntitySize = 0xFF << 24 ///< Entity size for mergeable sections }; + + static inline unsigned getEntitySize(unsigned flags) { + return (flags >> 24) & 0xFF; + } + + static inline unsigned setEntitySize(unsigned flags, unsigned size) { + return ((flags & ~EntitySize) | ((size & 0xFF) << 24)); + } } class TargetMachine; diff --git a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp index c900ac9e77c..b0c6f1cb533 100644 --- a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp @@ -337,7 +337,8 @@ std::string X86ELFTargetAsmInfo::PrintSectionFlags(unsigned flags) const { else Flags += ",@progbits"; - // FIXME: entity size for mergeable sections + if (unsigned entitySize = SectionFlags::getEntitySize(flags)) + Flags += "," + utostr(entitySize); return Flags; } |

