LLVM API Documentation

PPCTargetAsmInfo.h

Go to the documentation of this file.
00001 //=====-- PPCTargetAsmInfo.h - PPC asm properties -------------*- C++ -*--====//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains the declaration of the DarwinTargetAsmInfo class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef PPCTARGETASMINFO_H
00015 #define PPCTARGETASMINFO_H
00016 
00017 #include "PPCTargetMachine.h"
00018 #include "llvm/Target/TargetAsmInfo.h"
00019 #include "llvm/Target/DarwinTargetAsmInfo.h"
00020 #include "llvm/Target/ELFTargetAsmInfo.h"
00021 #include "llvm/Support/Compiler.h"
00022 
00023 namespace llvm {
00024 
00025   template <class BaseTAI>
00026   struct PPCTargetAsmInfo : public BaseTAI {
00027     explicit PPCTargetAsmInfo(const PPCTargetMachine &TM):
00028       BaseTAI(TM) {
00029       const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
00030       bool isPPC64 = Subtarget->isPPC64();
00031 
00032       BaseTAI::ZeroDirective = "\t.space\t";
00033       BaseTAI::SetDirective = "\t.set";
00034       BaseTAI::Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
00035       BaseTAI::AlignmentIsInBytes = false;
00036       BaseTAI::LCOMMDirective = "\t.lcomm\t";
00037       BaseTAI::InlineAsmStart = "# InlineAsm Start";
00038       BaseTAI::InlineAsmEnd = "# InlineAsm End";
00039       BaseTAI::AssemblerDialect = Subtarget->getAsmFlavor();
00040     }
00041   };
00042 
00043   typedef PPCTargetAsmInfo<TargetAsmInfo> PPCGenericTargetAsmInfo;
00044 
00045   EXTERN_TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);
00046 
00047   struct PPCDarwinTargetAsmInfo : public PPCTargetAsmInfo<DarwinTargetAsmInfo> {
00048     explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM);
00049     virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
00050                                            bool Global) const;
00051     virtual const char *getEHGlobalPrefix() const;
00052   };
00053 
00054   struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo<ELFTargetAsmInfo> {
00055     explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM);
00056     virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
00057                                            bool Global) const;
00058   };
00059 
00060 } // namespace llvm
00061 
00062 #endif