Home | History | Annotate | Download | only in Support
      1 /*
      2  * Copyright 2012, The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *     http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef BCC_SUPPORT_TARGET_LINKER_CONFIGS_H
     18 #define BCC_SUPPORT_TARGET_LINKER_CONFIGS_H
     19 
     20 #include <string>
     21 
     22 #include "bcc/Config/Config.h"
     23 #include "bcc/Support/LinkerConfig.h"
     24 
     25 namespace bcc {
     26 
     27 //===----------------------------------------------------------------------===//
     28 // ARM
     29 //===----------------------------------------------------------------------===//
     30 #if defined(PROVIDE_ARM_CODEGEN)
     31 class ARMLinkerConfig : public LinkerConfig {
     32 public:
     33   ARMLinkerConfig();
     34 };
     35 #endif // defined(PROVIDE_ARM_CODEGEN)
     36 
     37 //===----------------------------------------------------------------------===//
     38 // MIPS
     39 //===----------------------------------------------------------------------===//
     40 #if defined(PROVIDE_MIPS_CODEGEN)
     41 class MipsLinkerConfig : public LinkerConfig {
     42 public:
     43   MipsLinkerConfig();
     44 };
     45 #endif // defined(PROVIDE_MIPS_CODEGEN)
     46 
     47 //===----------------------------------------------------------------------===//
     48 // X86 and X86_64
     49 //===----------------------------------------------------------------------===//
     50 #if defined(PROVIDE_X86_CODEGEN)
     51 class X86FamilyLinkerConfigBase : public LinkerConfig {
     52 public:
     53   X86FamilyLinkerConfigBase(const std::string& pTriple);
     54 };
     55 
     56 class X86_32LinkerConfig : public X86FamilyLinkerConfigBase {
     57 public:
     58   X86_32LinkerConfig();
     59 };
     60 
     61 class X86_64LinkerConfig : public X86FamilyLinkerConfigBase {
     62 public:
     63   X86_64LinkerConfig();
     64 };
     65 #endif // defined(PROVIDE_X86_CODEGEN)
     66 
     67 //===----------------------------------------------------------------------===//
     68 // Default target
     69 //===----------------------------------------------------------------------===//
     70 class DefaultLinkerConfig : public
     71 #if defined (DEFAULT_ARM_CODEGEN)
     72   ARMLinkerConfig
     73 #elif defined (DEFAULT_MIPS_CODEGEN)
     74   MipsLinkerConfig
     75 #elif defined (DEFAULT_X86_CODEGEN)
     76   X86_32LinkerConfig
     77 #elif defined (DEFAULT_X86_64_CODEGEN)
     78   X86_64LinkerConfig
     79 #else
     80 #  error "Unsupported Default Target!"
     81 #endif
     82 { };
     83 
     84 #if !defined(TARGET_BUILD)
     85 //===----------------------------------------------------------------------===//
     86 // General target
     87 //===----------------------------------------------------------------------===//
     88 class GeneralLinkerConfig : public LinkerConfig {
     89 public:
     90   GeneralLinkerConfig(const std::string& pTriple);
     91 };
     92 #endif // !defined(TARGET_BUILD)
     93 
     94 } // end namespace bcc
     95 
     96 #endif // BCC_SUPPORT_LINKER_CONFIG_H
     97