Temporarily backing out 56585:56589 to unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56607 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
index 717ddd6..6988e78 100644
--- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
+++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
@@ -19,10 +19,21 @@
using namespace llvm;
using namespace llvm::dwarf;
-TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);
+PPCTargetAsmInfo::PPCTargetAsmInfo(const PPCTargetMachine &TM) {
+ bool isPPC64 = TM.getSubtargetImpl()->isPPC64();
+
+ ZeroDirective = "\t.space\t";
+ SetDirective = "\t.set";
+ Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
+ AlignmentIsInBytes = false;
+ LCOMMDirective = "\t.lcomm\t";
+ InlineAsmStart = "# InlineAsm Start";
+ InlineAsmEnd = "# InlineAsm End";
+ AssemblerDialect = TM.getSubtargetImpl()->getAsmFlavor();
+}
PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM):
- PPCTargetAsmInfo<DarwinTargetAsmInfo>(TM) {
+ PPCTargetAsmInfo(TM), DarwinTargetAsmInfo(TM) {
PCSymbol = ".";
CommentString = ";";
GlobalPrefix = "_";
@@ -92,7 +103,7 @@
PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) :
- PPCTargetAsmInfo<ELFTargetAsmInfo>(TM) {
+ PPCTargetAsmInfo(TM), ELFTargetAsmInfo(TM) {
CommentString = "#";
GlobalPrefix = "";
PrivateGlobalPrefix = "";
diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.h b/lib/Target/PowerPC/PPCTargetAsmInfo.h
index a533d5f..c3160e3 100644
--- a/lib/Target/PowerPC/PPCTargetAsmInfo.h
+++ b/lib/Target/PowerPC/PPCTargetAsmInfo.h
@@ -14,43 +14,28 @@
#ifndef PPCTARGETASMINFO_H
#define PPCTARGETASMINFO_H
-#include "PPCTargetMachine.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/DarwinTargetAsmInfo.h"
#include "llvm/Target/ELFTargetAsmInfo.h"
-#include "llvm/Support/Compiler.h"
namespace llvm {
- template <class BaseTAI>
- struct PPCTargetAsmInfo : public BaseTAI {
- explicit PPCTargetAsmInfo(const PPCTargetMachine &TM):
- BaseTAI(TM) {
- const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
- bool isPPC64 = Subtarget->isPPC64();
+ // Forward declaration.
+ class PPCTargetMachine;
- BaseTAI::ZeroDirective = "\t.space\t";
- BaseTAI::SetDirective = "\t.set";
- BaseTAI::Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
- BaseTAI::AlignmentIsInBytes = false;
- BaseTAI::LCOMMDirective = "\t.lcomm\t";
- BaseTAI::InlineAsmStart = "# InlineAsm Start";
- BaseTAI::InlineAsmEnd = "# InlineAsm End";
- BaseTAI::AssemblerDialect = Subtarget->getAsmFlavor();
- }
+ struct PPCTargetAsmInfo : public virtual TargetAsmInfo {
+ explicit PPCTargetAsmInfo(const PPCTargetMachine &TM);
};
- typedef PPCTargetAsmInfo<TargetAsmInfo> PPCGenericTargetAsmInfo;
-
- EXTERN_TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);
-
- struct PPCDarwinTargetAsmInfo : public PPCTargetAsmInfo<DarwinTargetAsmInfo> {
+ struct PPCDarwinTargetAsmInfo : public PPCTargetAsmInfo,
+ public DarwinTargetAsmInfo {
explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM);
virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
bool Global) const;
};
- struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo<ELFTargetAsmInfo> {
+ struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo,
+ public ELFTargetAsmInfo {
explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM);
virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
bool Global) const;