LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AArch64Subtarget.h
Go to the documentation of this file.
1 //==-- AArch64Subtarget.h - Define Subtarget for the AArch64 ---*- 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 declares the AArch64 specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TARGET_AARCH64_SUBTARGET_H
15 #define LLVM_TARGET_AARCH64_SUBTARGET_H
16 
17 #include "llvm/ADT/Triple.h"
19 
20 #define GET_SUBTARGETINFO_HEADER
21 #include "AArch64GenSubtargetInfo.inc"
22 
23 #include <string>
24 
25 namespace llvm {
26 class StringRef;
27 class GlobalValue;
28 
30  virtual void anchor();
31 protected:
32  bool HasFPARMv8;
33  bool HasNEON;
34  bool HasCrypto;
35 
36  /// TargetTriple - What processor and OS we're targeting.
38 
39  /// CPUString - String name of used CPU.
40  std::string CPUString;
41 
42 private:
43  void initializeSubtargetFeatures(StringRef CPU, StringRef FS);
44 
45 public:
46  /// This constructor initializes the data members to match that
47  /// of the specified triple.
48  ///
50 
51  virtual bool enableMachineScheduler() const {
52  return true;
53  }
54 
55  /// ParseSubtargetFeatures - Parses features string setting specified
56  /// subtarget options. Definition of function is auto generated by tblgen.
58 
59  bool GVIsIndirectSymbol(const GlobalValue *GV, Reloc::Model RelocM) const;
60 
61  bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
62  bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
63 
64  bool hasFPARMv8() const { return HasFPARMv8; }
65  bool hasNEON() const { return HasNEON; }
66  bool hasCrypto() const { return HasCrypto; }
67 
68  const std::string & getCPUString() const { return CPUString; }
69 };
70 } // End llvm namespace
71 
72 #endif // LLVM_TARGET_AARCH64_SUBTARGET_H
bool isTargetLinux() const
virtual bool enableMachineScheduler() const
bool GVIsIndirectSymbol(const GlobalValue *GV, Reloc::Model RelocM) const
const std::string & getCPUString() const
bool isOSLinux() const
Tests whether the OS is Linux.
Definition: Triple.h:338
AArch64Subtarget(StringRef TT, StringRef CPU, StringRef FS)
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
std::string CPUString
CPUString - String name of used CPU.
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition: Triple.h:343
Triple TargetTriple
TargetTriple - What processor and OS we're targeting.