diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-08 20:14:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-08 20:14:13 +0000 |
commit | fbf1d271e6a7157c1b5432e84d5633f63869b5a8 (patch) | |
tree | 4cf9df200e26dc13503b4d8654c6beb95a5a864a /lib/Target/PIC16/PIC16TargetObjectFile.cpp | |
parent | d34ab83c1658b60ce7dd3cdaf955c808dd742b21 (diff) |
sink getOrCreateSection down into all the object file implementations,
now that they create *all* the sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78494 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PIC16/PIC16TargetObjectFile.cpp')
-rw-r--r-- | lib/Target/PIC16/PIC16TargetObjectFile.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/PIC16/PIC16TargetObjectFile.cpp b/lib/Target/PIC16/PIC16TargetObjectFile.cpp index b09ad305c2..308e09c100 100644 --- a/lib/Target/PIC16/PIC16TargetObjectFile.cpp +++ b/lib/Target/PIC16/PIC16TargetObjectFile.cpp @@ -13,12 +13,21 @@ #include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/MC/MCSection.h" +#include "llvm/MC/MCContext.h" using namespace llvm; PIC16TargetObjectFile::PIC16TargetObjectFile() : ExternalVarDecls(0), ExternalVarDefs(0) { } +const MCSection *PIC16TargetObjectFile:: +getOrCreateSection(const char *Name, bool isDirective, SectionKind Kind) const { + if (MCSection *S = getContext().GetSection(Name)) + return S; + return MCSection::Create(Name, isDirective, Kind, getContext()); +} + + void PIC16TargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &tm){ TargetLoweringObjectFile::Initialize(Ctx, tm); TM = &tm; |