Return the operand rather than a null SDValue when the given SELECT_CC
[oota-llvm.git] / lib / Target / PowerPC / PPCTargetAsmInfo.h
1 //=====-- PPCTargetAsmInfo.h - PPC asm properties -------------*- C++ -*--====//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declaration of the DarwinTargetAsmInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef PPCTARGETASMINFO_H
15 #define PPCTARGETASMINFO_H
16
17 #include "PPCTargetMachine.h"
18 #include "llvm/Target/TargetAsmInfo.h"
19 #include "llvm/Target/DarwinTargetAsmInfo.h"
20 #include "llvm/Target/ELFTargetAsmInfo.h"
21 #include "llvm/Support/Compiler.h"
22
23 namespace llvm {
24
25   template <class BaseTAI>
26   struct PPCTargetAsmInfo : public BaseTAI {
27     explicit PPCTargetAsmInfo(const PPCTargetMachine &TM):
28       BaseTAI(TM) {
29       const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
30       bool isPPC64 = Subtarget->isPPC64();
31
32       BaseTAI::ZeroDirective = "\t.space\t";
33       BaseTAI::SetDirective = "\t.set";
34       BaseTAI::Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
35       BaseTAI::AlignmentIsInBytes = false;
36       BaseTAI::LCOMMDirective = "\t.lcomm\t";
37       BaseTAI::InlineAsmStart = "# InlineAsm Start";
38       BaseTAI::InlineAsmEnd = "# InlineAsm End";
39       BaseTAI::AssemblerDialect = Subtarget->getAsmFlavor();
40     }
41   };
42
43   typedef PPCTargetAsmInfo<TargetAsmInfo> PPCGenericTargetAsmInfo;
44
45   EXTERN_TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);
46
47   struct PPCDarwinTargetAsmInfo : public PPCTargetAsmInfo<DarwinTargetAsmInfo> {
48     explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM);
49     virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
50                                            bool Global) const;
51     virtual const char *getEHGlobalPrefix() const;
52   };
53
54   struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo<ELFTargetAsmInfo> {
55     explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM);
56     virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
57                                            bool Global) const;
58   };
59
60 } // namespace llvm
61
62 #endif