pass "is64Bit" flag into PPC TAI ctors instead of a whole targetmachine.
authorChris Lattner <sabre@nondot.org>
Tue, 11 Aug 2009 22:51:34 +0000 (22:51 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 11 Aug 2009 22:51:34 +0000 (22:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78743 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCTargetAsmInfo.cpp
lib/Target/PowerPC/PPCTargetAsmInfo.h

index 925e590786082f613353b0b145c9709f1c70f306..e32f34c31287722807e812557d6e72c39121801e 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #include "PPCTargetAsmInfo.h"
-#include "PPCTargetMachine.h"
-#include "llvm/Function.h"
-#include "llvm/Support/Dwarf.h"
-
 using namespace llvm;
-using namespace llvm::dwarf;
 
-PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) {
+PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(bool is64Bit) {
   PCSymbol = ".";
   CommentString = ";";
   ExceptionsType = ExceptionHandling::Dwarf;
 
-  const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
-  bool isPPC64 = Subtarget->isPPC64();
-  
-  if (!isPPC64)
+  if (!is64Bit)
     Data64bitsDirective = 0;      // We can't emit a 64-bit unit in PPC32 mode.
   AssemblerDialect = 0;           // Old-Style mnemonics.
 }
 
-PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) {
+PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(bool is64Bit) {
   CommentString = "#";
   GlobalPrefix = "";
   PrivateGlobalPrefix = ".L";
@@ -48,17 +40,14 @@ PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) {
   // Set up DWARF directives
   HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
 
-  const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
-  bool isPPC64 = Subtarget->isPPC64();
-
   // Exceptions handling
-  if (!isPPC64)
+  if (!is64Bit)
     ExceptionsType = ExceptionHandling::Dwarf;
   AbsoluteEHSectionOffsets = false;
     
   ZeroDirective = "\t.space\t";
   SetDirective = "\t.set";
-  Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
+  Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
   AlignmentIsInBytes = false;
   LCOMMDirective = "\t.lcomm\t";
   AssemblerDialect = 1;   // New-Style mnemonics.
index 0d9285a80fb90b889caaf314bbd807b36698c855..c7f8862e7ff4a8a0df20756d287fb9cc757ecea1 100644 (file)
 #ifndef PPCTARGETASMINFO_H
 #define PPCTARGETASMINFO_H
 
-#include "PPCTargetMachine.h"
 #include "llvm/Target/TargetAsmInfo.h"
 #include "llvm/Target/DarwinTargetAsmInfo.h"
-#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
   struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
-    explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM);
+    explicit PPCDarwinTargetAsmInfo(bool is64Bit);
   };
 
   struct PPCLinuxTargetAsmInfo : public TargetAsmInfo {
-    explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM);
+    explicit PPCLinuxTargetAsmInfo(bool is64Bit);
   };
 
 } // namespace llvm