diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-08 21:37:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-08 21:37:01 +0000 |
commit | 2cc62b3eb73e1f4921c29414edf1e891509ce8eb (patch) | |
tree | 91421d019470c17b43cf5299132c0b5887649a50 | |
parent | b0e6abe667b9d68a9d7a955d02927380c75dda46 (diff) | |
download | external_llvm-2cc62b3eb73e1f4921c29414edf1e891509ce8eb.zip external_llvm-2cc62b3eb73e1f4921c29414edf1e891509ce8eb.tar.gz external_llvm-2cc62b3eb73e1f4921c29414edf1e891509ce8eb.tar.bz2 |
add new PIC16Section class, this time hopefully not breaking the build :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78505 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PIC16/PIC16Section.h | 37 | ||||
-rw-r--r-- | lib/Target/PIC16/PIC16TargetObjectFile.cpp | 3 | ||||
-rw-r--r-- | lib/Target/PIC16/PIC16TargetObjectFile.h | 2 |
3 files changed, 40 insertions, 2 deletions
diff --git a/lib/Target/PIC16/PIC16Section.h b/lib/Target/PIC16/PIC16Section.h new file mode 100644 index 0000000..0880141 --- /dev/null +++ b/lib/Target/PIC16/PIC16Section.h @@ -0,0 +1,37 @@ +//===- PIC16Section.h - PIC16-specific section representation ---*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file declares the MCSection class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_PIC16SECTION_H +#define LLVM_PIC16SECTION_H + +#include "llvm/MC/MCSection.h" +#include "llvm/MC/MCContext.h" + +namespace llvm { + + class MCSectionPIC16 : public MCSection { + MCSectionPIC16(const StringRef &Name, bool IsDirective, SectionKind K, + MCContext &Ctx) : MCSection(Name, IsDirective, K, Ctx) {} + public: + + static MCSectionPIC16 *Create(const StringRef &Name, bool IsDirective, + SectionKind K, MCContext &Ctx) { + return new (Ctx) MCSectionPIC16(Name, IsDirective, K, Ctx); + } + }; + + + +} // end namespace llvm + +#endif diff --git a/lib/Target/PIC16/PIC16TargetObjectFile.cpp b/lib/Target/PIC16/PIC16TargetObjectFile.cpp index 3900929..a9668f9 100644 --- a/lib/Target/PIC16/PIC16TargetObjectFile.cpp +++ b/lib/Target/PIC16/PIC16TargetObjectFile.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "PIC16TargetObjectFile.h" +#include "PIC16Section.h" #include "PIC16ISelLowering.h" #include "PIC16TargetMachine.h" #include "llvm/DerivedTypes.h" @@ -24,7 +25,7 @@ const MCSection *PIC16TargetObjectFile:: getPIC16Section(const char *Name, bool isDirective, SectionKind Kind) const { if (MCSection *S = getContext().GetSection(Name)) return S; - return MCSection::Create(Name, isDirective, Kind, getContext()); + return MCSectionPIC16::Create(Name, isDirective, Kind, getContext()); } diff --git a/lib/Target/PIC16/PIC16TargetObjectFile.h b/lib/Target/PIC16/PIC16TargetObjectFile.h index d834cde..f8389a6 100644 --- a/lib/Target/PIC16/PIC16TargetObjectFile.h +++ b/lib/Target/PIC16/PIC16TargetObjectFile.h @@ -26,7 +26,7 @@ namespace llvm { /// again and printing only those that match the current section. /// Keeping values inside the sections make printing a section much easier. /// - /// FIXME: Reimplement by inheriting from MCSection. + /// FIXME: MOVE ALL THIS STUFF TO MCSectionPIC16. /// struct PIC16Section { const MCSection *S_; // Connection to actual Section. |