summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PIC16
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-24 18:42:53 +0000
committerChris Lattner <sabre@nondot.org>2009-07-24 18:42:53 +0000
commit73f665143992e7bfbbce08cb30fd12e3916567f7 (patch)
treec175c16a22067b0837c72319f86008b3d96c3536 /llvm/lib/Target/PIC16
parentbf9ac228f7f90c776434db4ca8be457632fd225d (diff)
downloadbcm5719-llvm-73f665143992e7bfbbce08cb30fd12e3916567f7.tar.gz
bcm5719-llvm-73f665143992e7bfbbce08cb30fd12e3916567f7.zip
we already know the sectionkind when invoking SelectSectionForGlobal,
pass it in instead of recomputing it. llvm-svn: 76990
Diffstat (limited to 'llvm/lib/Target/PIC16')
-rw-r--r--llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp9
-rw-r--r--llvm/lib/Target/PIC16/PIC16TargetAsmInfo.h3
2 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp b/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
index fedb0b82ca3..6f4b0c5c8d8 100644
--- a/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
+++ b/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
@@ -186,14 +186,15 @@ PIC16TargetAsmInfo::getSectionForAuto(const GlobalVariable *GV) const {
// Override default implementation to put the true globals into
// multiple data sections if required.
const Section*
-PIC16TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV1) const {
+PIC16TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV1,
+ SectionKind::Kind Kind) 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 TargetAsmInfo::SelectSectionForGlobal(GV1);
+ return TargetAsmInfo::SelectSectionForGlobal(GV1, Kind);
- // Record Exteranl Var Decls.
+ // Record External Var Decls.
if (GV->isDeclaration()) {
ExternalVarDecls->Items.push_back(GV);
return ExternalVarDecls->S_;
@@ -225,7 +226,7 @@ PIC16TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV1) const {
return getROSectionForGlobal(GV);
// Else let the default implementation take care of it.
- return TargetAsmInfo::SelectSectionForGlobal(GV);
+ return TargetAsmInfo::SelectSectionForGlobal(GV, Kind);
}
PIC16TargetAsmInfo::~PIC16TargetAsmInfo() {
diff --git a/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.h b/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.h
index 9b934b039d9..d9259aa6d45 100644
--- a/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.h
+++ b/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.h
@@ -74,7 +74,8 @@ namespace llvm {
const Section *getROSectionForGlobal(const GlobalVariable *GV) const;
const Section *CreateROSectionForGlobal(const GlobalVariable *GV,
std::string Addr = "") const;
- virtual const Section *SelectSectionForGlobal(const GlobalValue *GV) const;
+ virtual const Section *SelectSectionForGlobal(const GlobalValue *GV,
+ SectionKind::Kind Kind) const;
const Section *CreateSectionForGlobal(const GlobalVariable *GV,
const std::string &Addr = "") const;
public:
OpenPOWER on IntegriCloud