diff options
| author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-08-13 21:08:56 +0000 |
|---|---|---|
| committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-08-13 21:08:56 +0000 |
| commit | df743ae60322bc4c75d5df6213565bc4c9c8b8af (patch) | |
| tree | 7017cd6b21ab30da25806670a5baabbe08285895 | |
| parent | e6e417149f27aee3369fd35b9feee0ff1147c8ec (diff) | |
| download | bcm5719-llvm-df743ae60322bc4c75d5df6213565bc4c9c8b8af.tar.gz bcm5719-llvm-df743ae60322bc4c75d5df6213565bc4c9c8b8af.zip | |
Add a method to return if the ELF section contains only common symbols!
llvm-svn: 78937
| -rw-r--r-- | llvm/include/llvm/MC/MCSectionELF.h | 3 | ||||
| -rw-r--r-- | llvm/lib/MC/MCSectionELF.cpp | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/llvm/include/llvm/MC/MCSectionELF.h b/llvm/include/llvm/MC/MCSectionELF.h index 00369f7d2f6..31e1e6684f6 100644 --- a/llvm/include/llvm/MC/MCSectionELF.h +++ b/llvm/include/llvm/MC/MCSectionELF.h @@ -55,6 +55,9 @@ public: /// ShouldPrintSectionType - Only prints the section type if supported bool ShouldPrintSectionType(unsigned Ty) const; + + /// IsCommon - True if this section contains only common symbols + bool IsCommon() const; /// These are the section type and flags fields. An ELF section can have /// only one Type, but can have more than one of the flags specified. diff --git a/llvm/lib/MC/MCSectionELF.cpp b/llvm/lib/MC/MCSectionELF.cpp index d172a9c9230..56f803496ac 100644 --- a/llvm/lib/MC/MCSectionELF.cpp +++ b/llvm/lib/MC/MCSectionELF.cpp @@ -121,3 +121,13 @@ void MCSectionELF::PrintSwitchToSection(const TargetAsmInfo &TAI, OS << '\n'; } +// IsCommon - True if this section contains only common symbols +bool MCSectionELF::IsCommon() const { + + if (strncmp(SectionName.c_str(), ".gnu.linkonce.", 14) == 0) + return true; + + return false; +} + + |

