summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCSection.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-01 21:11:14 +0000
committerChris Lattner <sabre@nondot.org>2009-08-01 21:11:14 +0000
commitc9c277ba0fa0b30949f2bb49eb1e2894b87a08ba (patch)
treebaca8808c217e3674dcf9b9b558a2e32088d4fac /llvm/lib/MC/MCSection.cpp
parente480ce3d2916c2282cc3409b7e3534d265676927 (diff)
downloadbcm5719-llvm-c9c277ba0fa0b30949f2bb49eb1e2894b87a08ba.tar.gz
bcm5719-llvm-c9c277ba0fa0b30949f2bb49eb1e2894b87a08ba.zip
Change SectionKind to be a property that is true of a *section*, it
should have no state that is specific to particular globals in the section. In this case, it means the removal of the "isWeak" and "ExplicitSection" bits. MCSection uses the new form of SectionKind. To handle isWeak, I introduced a new SectionInfo class, which is SectionKind + isWeak, and it is used by the part of the code generator that does classification of a specific global. The ExplicitSection disappears. It is moved onto MCSection as a new "IsDirective" bit. Since the Name of a section is either a section or directive, it makes sense to keep this bit in MCSection. Ultimately the creator of MCSection should canonicalize (e.g.) .text to whatever the actual section is. llvm-svn: 77803
Diffstat (limited to 'llvm/lib/MC/MCSection.cpp')
-rw-r--r--llvm/lib/MC/MCSection.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCSection.cpp b/llvm/lib/MC/MCSection.cpp
index 006546febb1..84487b24be2 100644
--- a/llvm/lib/MC/MCSection.cpp
+++ b/llvm/lib/MC/MCSection.cpp
@@ -14,15 +14,16 @@ using namespace llvm;
MCSection::~MCSection() {
}
-MCSection::MCSection(const StringRef &N, SectionKind K, MCContext &Ctx)
- : Name(N), Kind(K) {
+MCSection::MCSection(const StringRef &N, bool isDirective, SectionKind K,
+ MCContext &Ctx)
+ : Name(N), IsDirective(isDirective), Kind(K) {
MCSection *&Entry = Ctx.Sections[Name];
assert(Entry == 0 && "Multiple sections with the same name created");
Entry = this;
}
-MCSection *MCSection::Create(const StringRef &Name, SectionKind K,
- MCContext &Ctx) {
- return new (Ctx) MCSection(Name, K, Ctx);
+MCSection *MCSection::Create(const StringRef &Name, bool IsDirective,
+ SectionKind K, MCContext &Ctx) {
+ return new (Ctx) MCSection(Name, IsDirective, K, Ctx);
}
OpenPOWER on IntegriCloud