summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PIC16
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/PIC16')
-rw-r--r--llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp2
-rw-r--r--llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp13
-rw-r--r--llvm/lib/Target/PIC16/PIC16TargetObjectFile.h4
3 files changed, 12 insertions, 7 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
index 453dd27c925..4a35a1e2879 100644
--- a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
+++ b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
@@ -223,7 +223,7 @@ bool PIC16AsmPrinter::doInitialization(Module &M) {
// Set the section names for all globals.
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I)
- I->setSection(getObjFileLowering().SectionForGlobal(I, TM)->getName());
+ I->setSection(getObjFileLowering().SectionForGlobal(I, Mang,TM)->getName());
DbgInfo.BeginModule(M);
EmitFunctionDecls(M);
diff --git a/llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp b/llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp
index efc03acce93..feec2fd6866 100644
--- a/llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp
+++ b/llvm/lib/Target/PIC16/PIC16TargetObjectFile.cpp
@@ -165,12 +165,13 @@ PIC16TargetObjectFile::getSectionForAuto(const GlobalVariable *GV) const {
const Section*
PIC16TargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV1,
SectionKind Kind,
+ Mangler *Mang,
const TargetMachine &TM) const {
// We select the section based on the initializer here, so it really
// has to be a GlobalVariable.
const GlobalVariable *GV = dyn_cast<GlobalVariable>(GV1);
if (!GV)
- return TargetLoweringObjectFile::SelectSectionForGlobal(GV1, Kind, TM);
+ return TargetLoweringObjectFile::SelectSectionForGlobal(GV1, Kind, Mang,TM);
// Record External Var Decls.
if (GV->isDeclaration()) {
@@ -204,7 +205,7 @@ PIC16TargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV1,
return getROSectionForGlobal(GV);
// Else let the default implementation take care of it.
- return TargetLoweringObjectFile::SelectSectionForGlobal(GV, Kind, TM);
+ return TargetLoweringObjectFile::SelectSectionForGlobal(GV, Kind, Mang,TM);
}
PIC16TargetObjectFile::~PIC16TargetObjectFile() {
@@ -225,6 +226,7 @@ PIC16TargetObjectFile::~PIC16TargetObjectFile() {
/// section assignment of a global.
const Section *
PIC16TargetObjectFile::getSpecialCasedSectionGlobals(const GlobalValue *GV,
+ Mangler *Mang,
SectionKind Kind) const {
// If GV has a sectin name or section address create that section now.
if (GV->hasSection()) {
@@ -235,11 +237,11 @@ PIC16TargetObjectFile::getSpecialCasedSectionGlobals(const GlobalValue *GV,
std::string AddrStr = "Address=";
if (SectName.compare(0, AddrStr.length(), AddrStr) == 0) {
std::string SectAddr = SectName.substr(AddrStr.length());
- return CreateSectionForGlobal(GVar, SectAddr);
+ return CreateSectionForGlobal(GVar, Mang, SectAddr);
}
// Create the section specified with section attribute.
- return CreateSectionForGlobal(GVar);
+ return CreateSectionForGlobal(GVar, Mang);
}
}
@@ -250,6 +252,7 @@ PIC16TargetObjectFile::getSpecialCasedSectionGlobals(const GlobalValue *GV,
// section at that address else create by name.
const Section *
PIC16TargetObjectFile::CreateSectionForGlobal(const GlobalVariable *GV,
+ Mangler *Mang,
const std::string &Addr) const {
// See if this is an uninitialized global.
const Constant *C = GV->getInitializer();
@@ -265,7 +268,7 @@ PIC16TargetObjectFile::CreateSectionForGlobal(const GlobalVariable *GV,
return CreateROSectionForGlobal(GV, Addr);
// Else let the default implementation take care of it.
- return TargetLoweringObjectFile::SectionForGlobal(GV, TM);
+ return TargetLoweringObjectFile::SectionForGlobal(GV, Mang, TM);
}
// Create uninitialized section for a variable.
diff --git a/llvm/lib/Target/PIC16/PIC16TargetObjectFile.h b/llvm/lib/Target/PIC16/PIC16TargetObjectFile.h
index 77aea7804b3..336730d2e62 100644
--- a/llvm/lib/Target/PIC16/PIC16TargetObjectFile.h
+++ b/llvm/lib/Target/PIC16/PIC16TargetObjectFile.h
@@ -59,10 +59,11 @@ namespace llvm {
/// getSpecialCasedSectionGlobals - Allow the target to completely override
/// section assignment of a global.
virtual const Section *
- getSpecialCasedSectionGlobals(const GlobalValue *GV,
+ getSpecialCasedSectionGlobals(const GlobalValue *GV, Mangler *Mang,
SectionKind Kind) const;
virtual const Section *SelectSectionForGlobal(const GlobalValue *GV,
SectionKind Kind,
+ Mangler *Mang,
const TargetMachine&) const;
private:
std::string getSectionNameForSym(const std::string &Sym) const;
@@ -78,6 +79,7 @@ namespace llvm {
const Section *CreateROSectionForGlobal(const GlobalVariable *GV,
std::string Addr = "") const;
const Section *CreateSectionForGlobal(const GlobalVariable *GV,
+ Mangler *Mang,
const std::string &Addr = "") const;
public:
void SetSectionForGVs(Module &M);
OpenPOWER on IntegriCloud