mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-15 20:06:46 +00:00
968ff11967
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77803 91177308-0d34-0410-b5e6-96231b3b80d8
30 lines
943 B
C++
30 lines
943 B
C++
//===- lib/MC/MCSection.cpp - Machine Code Section Representation ---------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/MC/MCSection.h"
|
|
#include "llvm/MC/MCContext.h"
|
|
using namespace llvm;
|
|
|
|
MCSection::~MCSection() {
|
|
}
|
|
|
|
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, bool IsDirective,
|
|
SectionKind K, MCContext &Ctx) {
|
|
return new (Ctx) MCSection(Name, IsDirective, K, Ctx);
|
|
}
|
|
|