Remove attribution from file headers, per discussion on llvmdev.
[oota-llvm.git] / lib / Target / ARM / ARMSubtarget.cpp
1 //===-- ARMSubtarget.cpp - ARM Subtarget Information ------------*- 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 implements the ARM specific subclass of TargetSubtarget.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "ARMSubtarget.h"
15 #include "ARMGenSubtarget.inc"
16 #include "llvm/Module.h"
17 using namespace llvm;
18
19 ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, bool thumb)
20   : ARMArchVersion(V4T)
21   , HasVFP2(false)
22   , IsThumb(thumb)
23   , UseThumbBacktraces(false)
24   , IsR9Reserved(false)
25   , stackAlignment(4)
26   , TargetType(isELF) // Default to ELF unless otherwise specified.
27   , TargetABI(ARM_ABI_APCS) {
28
29   // Determine default and user specified characteristics
30   std::string CPU = "generic";
31
32   // Parse features string.
33   ParseSubtargetFeatures(FS, CPU);
34
35   // Set the boolean corresponding to the current target triple, or the default
36   // if one cannot be determined, to true.
37   const std::string& TT = M.getTargetTriple();
38   if (TT.length() > 5) {
39     if (TT.find("-darwin") != std::string::npos)
40       TargetType = isDarwin;
41   } else if (TT.empty()) {
42 #if defined(__APPLE__)
43     TargetType = isDarwin;
44 #endif
45   }
46
47   if (TT.find("eabi") != std::string::npos)
48     TargetABI = ARM_ABI_AAPCS;
49
50   if (isAAPCS_ABI())
51     stackAlignment = 8;
52
53   if (isTargetDarwin()) {
54     UseThumbBacktraces = true;
55     IsR9Reserved = true;
56   }
57 }