Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove object format #81

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions llvm/include/llvm/ADT/Triple.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ class Triple {
enum ObjectFormatType {
UnknownObjectFormat,

ELF,
MachO,
ELF
};

private:
Expand Down Expand Up @@ -523,11 +522,6 @@ class Triple {
return getObjectFormat() == Triple::ELF;
}

/// Tests whether the environment is MachO.
bool isOSBinFormatMachO() const {
return getObjectFormat() == Triple::MachO;
}

/// Tests whether the target is the PS4 CPU
bool isPS4CPU() const {
return getArch() == Triple::x86_64 &&
Expand Down
21 changes: 0 additions & 21 deletions llvm/include/llvm/MC/MCAsmInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,6 @@ class MCAsmInfo {
/// True if target stack grow up. Default is false.
bool StackGrowsUp;

/// True if this target has the MachO .subsections_via_symbols directive.
/// Default is false.
bool HasSubsectionsViaSymbols;

/// True if this is a MachO target that supports the macho-specific .zerofill
/// directive for emitting BSS Symbols. Default is false.
bool HasMachoZeroFillDirective;

/// True if this is a MachO target that supports the macho-specific .tbss
/// directive for emitting thread local BSS Symbols. Default is false.
bool HasMachoTBSSDirective;

/// True if the compiler should emit a ".reference .constructors_used" or
/// ".reference .destructors_used" directive after the static ctor/dtor
/// list. This directive is only emitted in Static relocation model. Default
Expand Down Expand Up @@ -276,10 +264,6 @@ class MCAsmInfo {
/// Defaults to false.
bool HasIdentDirective;

/// True if this target supports the MachO .no_dead_strip directive. Defaults
/// to false.
bool HasNoDeadStrip;

/// Used to declare a global as being a weak symbol. Defaults to ".weak".
const char *WeakDirective;

Expand Down Expand Up @@ -378,8 +362,6 @@ class MCAsmInfo {
/// True if target stack grow up.
bool isStackGrowthDirectionUp() const { return StackGrowsUp; }

bool hasSubsectionsViaSymbols() const { return HasSubsectionsViaSymbols; }

// Data directive accessors.

const char *getData8bitsDirective() const { return Data8bitsDirective; }
Expand Down Expand Up @@ -437,8 +419,6 @@ class MCAsmInfo {

// Accessors.

bool hasMachoZeroFillDirective() const { return HasMachoZeroFillDirective; }
bool hasMachoTBSSDirective() const { return HasMachoTBSSDirective; }
bool hasStaticCtorDtorReferenceInStaticMode() const {
return HasStaticCtorDtorReferenceInStaticMode;
}
Expand Down Expand Up @@ -499,7 +479,6 @@ class MCAsmInfo {
bool hasDotTypeDotSizeDirective() const { return HasDotTypeDotSizeDirective; }
bool hasSingleParameterDotFile() const { return HasSingleParameterDotFile; }
bool hasIdentDirective() const { return HasIdentDirective; }
bool hasNoDeadStrip() const { return HasNoDeadStrip; }
const char *getWeakDirective() const { return WeakDirective; }
const char *getWeakRefDirective() const { return WeakRefDirective; }
bool hasWeakDefDirective() const { return HasWeakDefDirective; }
Expand Down
29 changes: 0 additions & 29 deletions llvm/include/llvm/MC/MCAsmInfoDarwin.h

This file was deleted.

17 changes: 0 additions & 17 deletions llvm/include/llvm/MC/MCContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ namespace llvm {
class MCRegisterInfo;
class MCLineSection;
class SMLoc;
class MCSectionMachO;
class MCSectionELF;

/// Context object for machine code objects. This class owns all of the
Expand Down Expand Up @@ -73,7 +72,6 @@ namespace llvm {
BumpPtrAllocator Allocator;

SpecificBumpPtrAllocator<MCSectionELF> ELFAllocator;
SpecificBumpPtrAllocator<MCSectionMachO> MachOAllocator;

/// Bindings of names to symbols.
SymbolTable Symbols;
Expand Down Expand Up @@ -189,7 +187,6 @@ namespace llvm {
}
};

StringMap<MCSectionMachO *> MachOUniquingMap;
std::map<ELFSectionKey, MCSectionELF *> ELFUniquingMap;
StringMap<bool> ELFRelSecNames;

Expand Down Expand Up @@ -293,20 +290,6 @@ namespace llvm {
/// \name Section Management
/// @{

/// Return the MCSection for the specified mach-o section. This requires
/// the operands to be valid.
MCSectionMachO *getMachOSection(StringRef Segment, StringRef Section,
unsigned TypeAndAttributes,
unsigned Reserved2, SectionKind K,
const char *BeginSymName = nullptr);

MCSectionMachO *getMachOSection(StringRef Segment, StringRef Section,
unsigned TypeAndAttributes, SectionKind K,
const char *BeginSymName = nullptr) {
return getMachOSection(Segment, Section, TypeAndAttributes, 0, K,
BeginSymName);
}

MCSectionELF *getELFSection(StringRef Section, unsigned Type,
unsigned Flags) {
return getELFSection(Section, Type, Flags, nullptr);
Expand Down
5 changes: 0 additions & 5 deletions llvm/include/llvm/MC/MCExpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,6 @@ class MCSymbolRefExpr : public MCExpr {
/// Specifies how the variant kind should be printed.
const unsigned UseParensForSymbolVariant : 1;

// FIXME: Remove this bit.
const unsigned HasSubsectionsViaSymbols : 1;

/// The symbol being referenced.
const MCSymbol *Symbol;

Expand Down Expand Up @@ -334,8 +331,6 @@ class MCSymbolRefExpr : public MCExpr {

void printVariantKind(raw_ostream &OS) const;

bool hasSubsectionsViaSymbols() const { return HasSubsectionsViaSymbols; }

/// @}
/// \name Static Utility Functions
/// @{
Expand Down
7 changes: 3 additions & 4 deletions llvm/include/llvm/MC/MCObjectFileInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ class MCObjectFileInfo {
/// it'll go here.
MCSection *TLSExtraDataSection;

/// Section directive for Thread Local data. ELF and MachO.
/// Section directive for Thread Local data. ELF.
MCSection *TLSDataSection; // Defaults to ".tdata".

/// Section directive for Thread Local uninitialized data.
///
/// Null if this target doesn't support a BSS section. ELF and MachO only.
/// Null if this target doesn't support a BSS section. ELF only.
MCSection *TLSBSSSection; // Defaults to ".tbss".

/// StackMap section.
Expand Down Expand Up @@ -312,15 +312,14 @@ class MCObjectFileInfo {
return EHFrameSection;
}

enum Environment { IsMachO, IsELF };
enum Environment { IsELF };
Environment getObjectFileType() const { return Env; }

private:
Environment Env;
MCContext *Ctx;
Triple TT;

void initMachOMCObjectFileInfo(Triple T);
void initELFMCObjectFileInfo(Triple T);

public:
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/MC/MCSection.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct ilist_node_traits<MCFragment> {
/// current translation unit. The MCContext class uniques and creates these.
class MCSection {
public:
enum SectionVariant { SV_ELF = 0, SV_MachO };
enum SectionVariant { SV_ELF = 0 };

/// \brief Express the state of bundle locked groups while emitting code.
enum BundleLockStateType {
Expand Down
91 changes: 0 additions & 91 deletions llvm/include/llvm/MC/MCSectionMachO.h

This file was deleted.

3 changes: 0 additions & 3 deletions llvm/include/llvm/MC/MCSymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class MCSymbol {
enum SymbolKind {
SymbolKindUnset,
SymbolKindELF,
SymbolKindMachO,
};

/// A symbol can contain an Offset, or Value, or be Common, but never more
Expand Down Expand Up @@ -276,8 +275,6 @@ class MCSymbol {

bool isELF() const { return Kind == SymbolKindELF; }

bool isMachO() const { return Kind == SymbolKindMachO; }

/// @}
/// \name Variable Symbols
/// @{
Expand Down
Loading