class Type;
struct ELFTargetAsmInfo: public TargetAsmInfo {
- explicit ELFTargetAsmInfo(const TargetMachine &TM);
+ ELFTargetAsmInfo(const TargetMachine &TM);
/// getSectionForMergeableConstant - Given a mergeable constant with the
/// specified size and relocation information, return a section that it
explicit Section(unsigned F = SectionFlags::Invalid) : Flags(F) { }
public:
-
unsigned getEntitySize() const { return (Flags >> 24) & 0xFF; }
const std::string &getName() const { return Name; }
virtual ~TargetAsmInfo();
const Section* getNamedSection(const char *Name,
- unsigned Flags = SectionFlags::None,
- bool Override = false) const;
+ unsigned Flags = SectionFlags::None) const;
const Section* getUnnamedSection(const char *Directive,
- unsigned Flags = SectionFlags::None,
- bool Override = false) const;
+ unsigned Flags = SectionFlags::None) const;
/// Measure the specified inline asm to determine an approximation of its
/// length.
ARMTargetAsmInfo<ELFTargetAsmInfo>(TM) {
Subtarget = &TM.getSubtarget<ARMSubtarget>();
+ BSSSection_ = getUnnamedSection("\t.bss",
+ SectionFlags::Writable | SectionFlags::BSS);
+
NeedsSet = false;
HasLEB128 = true;
AbsoluteDebugSectionOffsets = true;
// BSS section needs to be emitted as ".section"
BSSSection = "\t.section\t.bss";
BSSSection_ = getUnnamedSection("\t.section\t.bss",
- SectionFlags::Writable | SectionFlags::BSS,
- true);
+ SectionFlags::Writable | SectionFlags::BSS);
SupportsDebugInformation = true;
NeedsSet = true;
#include "llvm/Target/ELFTargetAsmInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetData.h"
-
using namespace llvm;
ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM)
: TargetAsmInfo(TM) {
- BSSSection_ = getUnnamedSection("\t.bss",
- SectionFlags::Writable | SectionFlags::BSS);
+ BSSSection_ = getUnnamedSection("\t.bss",
+ SectionFlags::Writable | SectionFlags::BSS);
ReadOnlySection = getNamedSection("\t.rodata", SectionFlags::None);
TLSDataSection = getNamedSection("\t.tdata",
SectionFlags::Writable | SectionFlags::TLS);
//===----------------------------------------------------------------------===//
#include "MSP430TargetAsmInfo.h"
-#include "MSP430TargetMachine.h"
-
using namespace llvm;
-MSP430TargetAsmInfo::MSP430TargetAsmInfo(const MSP430TargetMachine &TM)
+MSP430TargetAsmInfo::MSP430TargetAsmInfo(const TargetMachine &TM)
: ELFTargetAsmInfo(TM) {
AlignmentIsInBytes = false;
+
+ BSSSection_ = getUnnamedSection("\t.bss",
+ SectionFlags::Writable | SectionFlags::BSS);
}
#ifndef MSP430TARGETASMINFO_H
#define MSP430TARGETASMINFO_H
-#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/ELFTargetAsmInfo.h"
namespace llvm {
-
- // Forward declaration.
- class MSP430TargetMachine;
-
struct MSP430TargetAsmInfo : public ELFTargetAsmInfo {
- explicit MSP430TargetAsmInfo(const MSP430TargetMachine &TM);
+ explicit MSP430TargetAsmInfo(const TargetMachine &TM);
};
} // namespace llvm
#include "MipsTargetAsmInfo.h"
#include "MipsTargetMachine.h"
-#include "llvm/GlobalVariable.h"
-
using namespace llvm;
MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM)
BSSSection = "\t.section\t.bss";
CStringSection = ".rodata.str";
+ BSSSection_ = getUnnamedSection("\t.bss",
+ SectionFlags::Writable | SectionFlags::BSS);
+
if (!TM.getSubtarget<MipsSubtarget>().hasABICall())
JumpTableDirective = "\t.word\t";
else
#ifndef MIPSTARGETASMINFO_H
#define MIPSTARGETASMINFO_H
-#include "MipsSubtarget.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Target/TargetAsmInfo.h"
-#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/ELFTargetAsmInfo.h"
namespace llvm {
-
// Forward declaration.
- class GlobalValue;
class MipsTargetMachine;
struct MipsTargetAsmInfo : public ELFTargetAsmInfo {
explicit MipsTargetAsmInfo(const MipsTargetMachine &TM);
-
- private:
- const MipsSubtarget *Subtarget;
};
} // namespace llvm
}
const char *
-PPCDarwinTargetAsmInfo::getEHGlobalPrefix() const
-{
+PPCDarwinTargetAsmInfo::getEHGlobalPrefix() const {
const PPCSubtarget* Subtarget = &TM.getSubtarget<PPCSubtarget>();
if (Subtarget->getDarwinVers() > 9)
return PrivateGlobalPrefix;
- else
- return "";
+ return "";
}
PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) :
BSSSection = "\t.section\t\".sbss\",\"aw\",@nobits";
// PPC/Linux normally uses named section for BSS.
- BSSSection_ = getNamedSection("\t.bss",
- SectionFlags::Writable | SectionFlags::BSS,
- /* Override */ true);
+ BSSSection_ = getNamedSection("\t.bss",
+ SectionFlags::Writable | SectionFlags::BSS);
// Debug Information
AbsoluteDebugSectionOffsets = true;
#include "llvm/ADT/SmallVector.h"
using namespace llvm;
-SparcELFTargetAsmInfo::SparcELFTargetAsmInfo(const TargetMachine &TM):
- ELFTargetAsmInfo(TM) {
+SparcELFTargetAsmInfo::SparcELFTargetAsmInfo(const TargetMachine &TM)
+ : ELFTargetAsmInfo(TM) {
Data16bitsDirective = "\t.half\t";
Data32bitsDirective = "\t.word\t";
Data64bitsDirective = 0; // .xword is only supported by V9.
CStringSection=".rodata.str";
// Sparc normally uses named section for BSS.
- BSSSection_ = getNamedSection("\t.bss",
- SectionFlags::Writable | SectionFlags::BSS,
- /* Override */ true);
+ BSSSection_ = getNamedSection("\t.bss",
+ SectionFlags::Writable | SectionFlags::BSS);
}
#ifndef SPARCTARGETASMINFO_H
#define SPARCTARGETASMINFO_H
-#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/ELFTargetAsmInfo.h"
namespace llvm {
PCSymbol = ".";
NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits";
+
+ BSSSection_ = getUnnamedSection("\t.bss",
+ SectionFlags::Writable | SectionFlags::BSS);
}
#ifndef SystemZTARGETASMINFO_H
#define SystemZTARGETASMINFO_H
-#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/ELFTargetAsmInfo.h"
namespace llvm {
}
-const Section *TargetAsmInfo::getNamedSection(const char *Name, unsigned Flags,
- bool Override) const {
+const Section *TargetAsmInfo::getNamedSection(const char *Name,
+ unsigned Flags) const {
Section &S = Sections[Name];
// This is newly-created section, set it up properly.
- if (S.Flags == SectionFlags::Invalid || Override) {
+ if (S.Name.empty()) {
S.Flags = Flags | SectionFlags::Named;
S.Name = Name;
}
}
const Section*
-TargetAsmInfo::getUnnamedSection(const char *Directive, unsigned Flags,
- bool Override) const {
+TargetAsmInfo::getUnnamedSection(const char *Directive, unsigned Flags) const {
Section& S = Sections[Directive];
// This is newly-created section, set it up properly.
- if (S.Flags == SectionFlags::Invalid || Override) {
+ if (S.Name.empty()) {
S.Flags = Flags & ~SectionFlags::Named;
S.Name = Directive;
}
// Set up DWARF directives
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
+ BSSSection_ = getUnnamedSection("\t.bss",
+ SectionFlags::Writable | SectionFlags::BSS);
+
// Debug Information
AbsoluteDebugSectionOffsets = true;
SupportsDebugInformation = true;