move dwarf debug info section selection stuff from TAI to
[oota-llvm.git] / lib / Target / CellSPU / SPUTargetAsmInfo.cpp
index 2bc0ffdb7ef610e2943141d0d68ccefee17d952c..2dcb1135c5708b12001955d6744d68098429a131 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #include "SPUTargetAsmInfo.h"
-#include "SPUTargetMachine.h"
-#include "llvm/Function.h"
-#include "llvm/Support/Compiler.h"
-
 using namespace llvm;
 
-SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo(const SPUTargetMachine &TM) :
-    SPUTargetAsmInfo<ELFTargetAsmInfo>(TM) {
+SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo() {
+  ZeroDirective = "\t.space\t";
+  SetDirective = "\t.set";
+  Data64bitsDirective = "\t.quad\t";
+  AlignmentIsInBytes = false;
+  LCOMMDirective = "\t.lcomm\t";
+  InlineAsmStart = "# InlineAsm Start";
+  InlineAsmEnd = "# InlineAsm End";
+      
   PCSymbol = ".";
   CommentString = "#";
   GlobalPrefix = "";
   PrivateGlobalPrefix = ".L";
-  // This corresponds to what the gcc SPU compiler emits, for consistency.
-  CStringSection = ".rodata.str";
-}
 
-/// PreferredEHDataFormat - This hook allows the target to select data
-/// format used for encoding pointers in exception handling data. Reason is
-/// 0 for data, 1 for code labels, 2 for function pointers. Global is true
-/// if the symbol can be relocated.
-unsigned
-SPULinuxTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason,
-                                             bool Global) const {
-  // We really need to write something here.
-  return TargetAsmInfo::PreferredEHDataFormat(Reason, Global);
+  // Has leb128, .loc and .file
+  HasLEB128 = true;
+  HasDotLocAndDotFile = true;
+
+  SupportsDebugInformation = true;
+  NeedsSet = true;
+
+  // Exception handling is not supported on CellSPU (think about it: you only
+  // have 256K for code+data. Would you support exception handling?)
+  SupportsExceptionHandling = false;
 }
 
-// Instantiate default implementation.
-TEMPLATE_INSTANTIATION(class SPUTargetAsmInfo<TargetAsmInfo>);