[llvm-commits] [llvm] r78743 - in /llvm/trunk/lib/Target/PowerPC: PPCTargetAsmInfo.cpp PPCTargetAsmInfo.h

Chris Lattner sabre at nondot.org
Tue Aug 11 15:51:34 PDT 2009


Author: lattner
Date: Tue Aug 11 17:51:34 2009
New Revision: 78743

URL: http://llvm.org/viewvc/llvm-project?rev=78743&view=rev
Log:
pass "is64Bit" flag into PPC TAI ctors instead of a whole targetmachine.

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
    llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h

Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=78743&r1=78742&r2=78743&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Tue Aug 11 17:51:34 2009
@@ -12,27 +12,19 @@
 //===----------------------------------------------------------------------===//
 
 #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 @@
   // 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.

Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h?rev=78743&r1=78742&r2=78743&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h Tue Aug 11 17:51:34 2009
@@ -14,19 +14,17 @@
 #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





More information about the llvm-commits mailing list