mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-02 09:33:59 +00:00
add some comments: MCContext owns the MCSections, but it bump pointer allocates
them, so it doesn't have to explicitly free them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78870 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e309cfa0d8
commit
c9d31524ee
@ -20,7 +20,9 @@ namespace llvm {
|
||||
class MCSymbol;
|
||||
class StringRef;
|
||||
|
||||
/// MCContext - Context object for machine code objects.
|
||||
/// MCContext - Context object for machine code objects. This class owns all
|
||||
/// of the sections that it creates.
|
||||
///
|
||||
class MCContext {
|
||||
MCContext(const MCContext&); // DO NOT IMPLEMENT
|
||||
MCContext &operator=(const MCContext&); // DO NOT IMPLEMENT
|
||||
@ -49,7 +51,6 @@ namespace llvm {
|
||||
/// null if it doesn't exist.
|
||||
MCSection *GetSection(const StringRef &Name) const;
|
||||
|
||||
|
||||
void SetSection(const StringRef &Name, MCSection *S) {
|
||||
MCSection *&Entry = Sections[Name];
|
||||
assert(Entry == 0 && "Multiple sections with the same name created");
|
||||
|
@ -18,6 +18,8 @@ MCContext::MCContext() {
|
||||
}
|
||||
|
||||
MCContext::~MCContext() {
|
||||
// NOTE: The sections are all allocated out of a bump pointer allocator,
|
||||
// we don't need to free them here.
|
||||
}
|
||||
|
||||
MCSection *MCContext::GetSection(const StringRef &Name) const {
|
||||
|
@ -708,8 +708,6 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
" section specifier");
|
||||
}
|
||||
|
||||
|
||||
|
||||
return S;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user