mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
make SectionForGlobal non-virtual, add a hook for pic16 to do its "address=" hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76989 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -263,10 +263,18 @@ TargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {
|
||||
|
||||
|
||||
const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const {
|
||||
// Select section name
|
||||
SectionKind::Kind Kind = SectionKindForGlobal(GV);
|
||||
|
||||
// Select section name.
|
||||
if (GV->hasSection()) {
|
||||
|
||||
// If the target has special section hacks for specifically named globals,
|
||||
// return them now.
|
||||
if (const Section *TS = getSpecialCasedSectionGlobals(GV, Kind))
|
||||
return TS;
|
||||
|
||||
// Honour section already set, if any.
|
||||
unsigned Flags = SectionFlagsForGlobal(GV, SectionKindForGlobal(GV));
|
||||
unsigned Flags = SectionFlagsForGlobal(GV, Kind);
|
||||
|
||||
// This is an explicitly named section.
|
||||
Flags |= SectionFlags::Named;
|
||||
@@ -282,9 +290,8 @@ const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const {
|
||||
// If this global is linkonce/weak and the target handles this by emitting it
|
||||
// into a 'uniqued' section name, create and return the section now.
|
||||
if (GV->isWeakForLinker()) {
|
||||
if (const char *Prefix =
|
||||
getSectionPrefixForUniqueGlobal(SectionKindForGlobal(GV))) {
|
||||
unsigned Flags = SectionFlagsForGlobal(GV, SectionKindForGlobal(GV));
|
||||
if (const char *Prefix = getSectionPrefixForUniqueGlobal(Kind)) {
|
||||
unsigned Flags = SectionFlagsForGlobal(GV, Kind);
|
||||
|
||||
// FIXME: Use mangler interface (PR4584).
|
||||
std::string Name = Prefix+GV->getNameStr();
|
||||
|
Reference in New Issue
Block a user