Home | History | Annotate | Download | only in Support
      1 //===- TargetLinkerConfig.h -----------------------------------------------===//
      2 //
      3 //                     The MCLinker Project
      4 //
      5 // This file is distributed under the University of Illinois Open Source
      6 // License. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 #ifndef ALONE_SUPPORT_TARGET_LINKER_CONFIGS_H
     11 #define ALONE_SUPPORT_TARGET_LINKER_CONFIGS_H
     12 
     13 #include <string>
     14 
     15 #include "alone/Config/Config.h"
     16 #include "alone/Support/LinkerConfig.h"
     17 
     18 namespace alone {
     19 
     20 //===----------------------------------------------------------------------===//
     21 // ARM
     22 //===----------------------------------------------------------------------===//
     23 #if defined(PROVIDE_ARM_CODEGEN)
     24 class ARMLinkerConfig : public LinkerConfig {
     25 public:
     26   ARMLinkerConfig();
     27 };
     28 #endif // defined(PROVIDE_ARM_CODEGEN)
     29 
     30 //===----------------------------------------------------------------------===//
     31 // MIPS
     32 //===----------------------------------------------------------------------===//
     33 #if defined(PROVIDE_MIPS_CODEGEN)
     34 class MipsLinkerConfig : public LinkerConfig {
     35 public:
     36   MipsLinkerConfig();
     37 };
     38 #endif // defined(PROVIDE_MIPS_CODEGEN)
     39 
     40 //===----------------------------------------------------------------------===//
     41 // X86 and X86_64
     42 //===----------------------------------------------------------------------===//
     43 #if defined(PROVIDE_X86_CODEGEN)
     44 class X86FamilyLinkerConfigBase : public LinkerConfig {
     45 public:
     46   X86FamilyLinkerConfigBase(const std::string& pTriple);
     47 };
     48 
     49 class X86_32LinkerConfig : public X86FamilyLinkerConfigBase {
     50 public:
     51   X86_32LinkerConfig();
     52 };
     53 
     54 class X86_64LinkerConfig : public X86FamilyLinkerConfigBase {
     55 public:
     56   X86_64LinkerConfig();
     57 };
     58 #endif // defined(PROVIDE_X86_CODEGEN)
     59 
     60 //===----------------------------------------------------------------------===//
     61 // Default target
     62 //===----------------------------------------------------------------------===//
     63 class DefaultLinkerConfig : public
     64 #if defined (DEFAULT_ARM_CODEGEN)
     65   ARMLinkerConfig
     66 #elif defined (DEFAULT_MIPS_CODEGEN)
     67   MipsLinkerConfig
     68 #elif defined (DEFAULT_X86_CODEGEN)
     69   X86_32LinkerConfig
     70 #elif defined (DEFAULT_X86_64_CODEGEN)
     71   X86_64LinkerConfig
     72 #else
     73 #  error "Unsupported Default Target!"
     74 #endif
     75 { };
     76 
     77 #if !defined(TARGET_BUILD)
     78 //===----------------------------------------------------------------------===//
     79 // General target
     80 //===----------------------------------------------------------------------===//
     81 class GeneralLinkerConfig : public LinkerConfig {
     82 public:
     83   GeneralLinkerConfig(const std::string& pTriple);
     84 };
     85 #endif // !defined(TARGET_BUILD)
     86 
     87 } // end namespace alone
     88 
     89 #endif // ALONE_SUPPORT_LINKER_CONFIG_H
     90