Instead of yet another enum indicating the "assembly language flavor",
just use the one that's in the subtarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33255 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPCSubtarget.cpp b/lib/Target/PowerPC/PPCSubtarget.cpp
index eca16c4..235b9d5 100644
--- a/lib/Target/PowerPC/PPCSubtarget.cpp
+++ b/lib/Target/PowerPC/PPCSubtarget.cpp
@@ -112,6 +112,9 @@
// Set up darwin-specific properties.
if (IsDarwin) {
HasLazyResolverStubs = true;
+ AsmFlavor = NewMnemonic;
+ } else {
+ AsmFlavor = OldMnemonic;
}
}
diff --git a/lib/Target/PowerPC/PPCSubtarget.h b/lib/Target/PowerPC/PPCSubtarget.h
index 65d07d8..63efe9e 100644
--- a/lib/Target/PowerPC/PPCSubtarget.h
+++ b/lib/Target/PowerPC/PPCSubtarget.h
@@ -40,6 +40,10 @@
class TargetMachine;
class PPCSubtarget : public TargetSubtarget {
+public:
+ enum AsmWriterFlavorTy {
+ OldMnemonic, NewMnemonic, Unset
+ };
protected:
const TargetMachine &TM;
@@ -53,6 +57,9 @@
/// Which cpu directive was used.
unsigned DarwinDirective;
+ /// AsmFlavor - Which PPC asm dialect to use.
+ AsmWriterFlavorTy AsmFlavor;
+
/// Used by the ISel to turn in optimizations for POWER4-derived architectures
bool IsGigaProcessor;
bool Has64BitSupport;
@@ -120,8 +127,12 @@
bool hasSTFIWX() const { return HasSTFIWX; }
bool hasAltivec() const { return HasAltivec; }
bool isGigaProcessor() const { return IsGigaProcessor; }
-
+
bool isDarwin() const { return IsDarwin; }
+
+ unsigned getAsmFlavor() const {
+ return AsmFlavor != Unset ? unsigned(AsmFlavor) : 0;
+ }
};
} // End llvm namespace
diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
index 7912f70..b9f5849 100644
--- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
+++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
@@ -16,12 +16,6 @@
#include "llvm/Function.h"
using namespace llvm;
-// ASM variant to use.
-enum {
- PPC_OLD_MNEMONICS = 0,
- PPC_NEW_MNEMONICS = 1
-};
-
PPCTargetAsmInfo::PPCTargetAsmInfo(const PPCTargetMachine &TM) {
bool isPPC64 = TM.getSubtargetImpl()->isPPC64();
@@ -32,7 +26,7 @@
LCOMMDirective = "\t.lcomm\t";
InlineAsmStart = "# InlineAsm Start";
InlineAsmEnd = "# InlineAsm End";
- AssemblerDialect = PPC_OLD_MNEMONICS;
+ AssemblerDialect = TM.getSubtargetImpl()->getAsmFlavor();
NeedsSet = true;
AddressSize = isPPC64 ? 8 : 4;
@@ -63,7 +57,6 @@
UsedDirective = "\t.no_dead_strip\t";
WeakRefDirective = "\t.weak_reference\t";
HiddenDirective = "\t.private_extern\t";
- AssemblerDialect = PPC_NEW_MNEMONICS;
}
LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM)