LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AArch64Subtarget.cpp
Go to the documentation of this file.
1 //===-- AArch64Subtarget.cpp - AArch64 Subtarget Information --------------===//
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 AArch64 specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "AArch64Subtarget.h"
15 #include "AArch64RegisterInfo.h"
17 #include "llvm/IR/GlobalValue.h"
20 #include "llvm/ADT/SmallVector.h"
21 
22 #define GET_SUBTARGETINFO_TARGET_DESC
23 #define GET_SUBTARGETINFO_CTOR
24 #include "AArch64GenSubtargetInfo.inc"
25 
26 using namespace llvm;
27 
28 // Pin the vtable to this file.
29 void AArch64Subtarget::anchor() {}
30 
32  : AArch64GenSubtargetInfo(TT, CPU, FS), HasFPARMv8(false), HasNEON(false),
33  HasCrypto(false), TargetTriple(TT), CPUString(CPU) {
34 
35  initializeSubtargetFeatures(CPU, FS);
36 }
37 
38 void AArch64Subtarget::initializeSubtargetFeatures(StringRef CPU,
39  StringRef FS) {
40  if (CPU.empty())
41  CPUString = "generic";
42 
43  std::string FullFS = FS;
44  if (CPUString == "generic") {
45  // Enable FP by default.
46  if (FullFS.empty())
47  FullFS = "+fp-armv8";
48  else
49  FullFS = "+fp-armv8," + FullFS;
50  }
51 
52  ParseSubtargetFeatures(CPU, FullFS);
53 }
54 
56  Reloc::Model RelocM) const {
57  if (RelocM == Reloc::Static)
58  return false;
59 
60  return !GV->hasLocalLinkage() && !GV->hasHiddenVisibility();
61 }
bool GVIsIndirectSymbol(const GlobalValue *GV, Reloc::Model RelocM) const
#define false
Definition: ConvertUTF.c:64
AArch64Subtarget(StringRef TT, StringRef CPU, StringRef FS)
bool hasHiddenVisibility() const
Definition: GlobalValue.h:89
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
std::string CPUString
CPUString - String name of used CPU.
bool hasLocalLinkage() const
Definition: GlobalValue.h:211
bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:110