Couple of fixes to mention bunzip2 and make instructions more clear.
[llvm-complete.git] / lib / Target / ARM / ARMSubtarget.cpp
blob6db36dff29ca5b2d1bf6a276a73e3bb405a5da81
1 //===-- ARMSubtarget.cpp - ARM Subtarget Information ------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file was developed by Evan Cheng and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the ARM specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #include "ARMSubtarget.h"
15 #include "ARMGenSubtarget.inc"
16 #include "llvm/Module.h"
17 using namespace llvm;
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) {
29 // Determine default and user specified characteristics
30 std::string CPU = "generic";
32 // Parse features string.
33 ParseSubtargetFeatures(FS, CPU);
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
47 if (TT.find("eabi") != std::string::npos)
48 TargetABI = ARM_ABI_AAPCS;
50 if (isAAPCS_ABI())
51 stackAlignment = 8;
53 if (isTargetDarwin()) {
54 UseThumbBacktraces = true;
55 IsR9Reserved = true;