Make Triple's isOSBinFormatXXX functions partition triple-space.

Most users would be surprised if "isCOFF" and "isMachO" were simultaneously
true, unless they'd put the compiler in a box with a gun attached to a photon
detector.

This makes sure precisely one of the three formats is true for any triple and
simplifies some target logic based on that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196934 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tim Northover
2013-12-10 16:57:43 +00:00
parent 8b71466c43
commit 7af55ad434
8 changed files with 22 additions and 26 deletions

View File

@@ -51,7 +51,7 @@ using namespace llvm;
bool X86AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
SetupMachineFunction(MF);
if (Subtarget->isTargetCOFF() && !Subtarget->isTargetEnvMacho()) {
if (Subtarget->isTargetCOFF()) {
bool Intrn = MF.getFunction()->hasInternalLinkage();
OutStreamer.BeginCOFFSymbolDef(CurrentFnSym);
OutStreamer.EmitCOFFSymbolStorageClass(Intrn ? COFF::IMAGE_SYM_CLASS_STATIC
@@ -503,7 +503,7 @@ bool X86AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
}
void X86AsmPrinter::EmitStartOfAsmFile(Module &M) {
if (Subtarget->isTargetEnvMacho())
if (Subtarget->isTargetMacho())
OutStreamer.SwitchSection(getObjFileLowering().getTextSection());
if (Subtarget->isTargetCOFF()) {
@@ -530,7 +530,7 @@ void X86AsmPrinter::EmitStartOfAsmFile(Module &M) {
void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
if (Subtarget->isTargetEnvMacho()) {
if (Subtarget->isTargetMacho()) {
// All darwin targets use mach-o.
MachineModuleInfoMachO &MMIMacho =
MMI->getObjFileInfo<MachineModuleInfoMachO>();
@@ -631,7 +631,7 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
OutStreamer.EmitSymbolAttribute(S, MCSA_Global);
}
if (Subtarget->isTargetCOFF() && !Subtarget->isTargetEnvMacho()) {
if (Subtarget->isTargetCOFF()) {
X86COFFMachineModuleInfo &COFFMMI =
MMI->getObjFileInfo<X86COFFMachineModuleInfo>();