diff options
Diffstat (limited to 'llvm/lib/Target/PIC16')
-rw-r--r-- | llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/Target/PIC16/PIC16TargetObjectFile.h | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp b/llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp index b09ad305c28..308e09c100b 100644 --- a/llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp +++ b/llvm/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; diff --git a/llvm/lib/Target/PIC16/PIC16TargetObjectFile.h b/llvm/lib/Target/PIC16/PIC16TargetObjectFile.h index c2611087b50..b71a7050a71 100644 --- a/llvm/lib/Target/PIC16/PIC16TargetObjectFile.h +++ b/llvm/lib/Target/PIC16/PIC16TargetObjectFile.h @@ -45,6 +45,10 @@ namespace llvm { class PIC16TargetObjectFile : public TargetLoweringObjectFile { const TargetMachine *TM; + + const MCSection *getOrCreateSection(const char *Name, + bool isDirective, + SectionKind K) const; public: mutable std::vector<PIC16Section*> BSSSections; mutable std::vector<PIC16Section*> IDATASections; |