#define LLVM_TARGET_PIC16_TARGETOBJECTFILE_H
#include "llvm/Target/TargetLoweringObjectFile.h"
+#include "llvm/ADT/StringMap.h"
#include <vector>
+#include <string>
namespace llvm {
class GlobalVariable;
class Module;
class PIC16TargetMachine;
+ class MCSectionPIC16;
enum { DataBankSize = 80 };
/// 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.
+ const MCSectionPIC16 *S_; // Connection to actual Section.
unsigned Size; // Total size of the objects contained.
bool SectionPrinted;
std::vector<const GlobalVariable*> Items;
- PIC16Section(const MCSection *s) {
+ PIC16Section(const MCSectionPIC16 *s) {
S_ = s;
Size = 0;
SectionPrinted = false;
};
class PIC16TargetObjectFile : public TargetLoweringObjectFile {
+ /// SectionsByName - Bindings of names to allocated sections.
+ mutable StringMap<MCSectionPIC16*> SectionsByName;
+
const TargetMachine *TM;
+
+ const MCSectionPIC16 *getPIC16Section(const char *Name,
+ SectionKind K,
+ int Address = -1,
+ int Color = -1) const;
public:
mutable std::vector<PIC16Section*> BSSSections;
mutable std::vector<PIC16Section*> IDATASections;