clang  14.0.0git
AArch64.cpp
Go to the documentation of this file.
1 //===--- AArch64.cpp - AArch64 (not ARM) Helpers for Tools ------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "AArch64.h"
10 #include "clang/Driver/Driver.h"
12 #include "clang/Driver/Options.h"
13 #include "llvm/Option/ArgList.h"
14 #include "llvm/Support/TargetParser.h"
15 #include "llvm/Support/Host.h"
16 
17 using namespace clang::driver;
18 using namespace clang::driver::tools;
19 using namespace clang;
20 using namespace llvm::opt;
21 
22 /// \returns true if the given triple can determine the default CPU type even
23 /// if -arch is not specified.
24 static bool isCPUDeterminedByTriple(const llvm::Triple &Triple) {
25  return Triple.isOSDarwin();
26 }
27 
28 /// getAArch64TargetCPU - Get the (LLVM) name of the AArch64 cpu we are
29 /// targeting. Set \p A to the Arg corresponding to the -mcpu argument if it is
30 /// provided, or to nullptr otherwise.
31 std::string aarch64::getAArch64TargetCPU(const ArgList &Args,
32  const llvm::Triple &Triple, Arg *&A) {
33  std::string CPU;
34  // If we have -mcpu, use that.
35  if ((A = Args.getLastArg(options::OPT_mcpu_EQ))) {
36  StringRef Mcpu = A->getValue();
37  CPU = Mcpu.split("+").first.lower();
38  }
39 
40  // Handle CPU name is 'native'.
41  if (CPU == "native")
42  return std::string(llvm::sys::getHostCPUName());
43 
44  if (CPU.size())
45  return CPU;
46 
47  if (Triple.isTargetMachineMac() &&
48  Triple.getArch() == llvm::Triple::aarch64) {
49  // Apple Silicon macs default to M1 CPUs.
50  return "apple-m1";
51  }
52 
53  // arm64e requires v8.3a and only runs on apple-a12 and later CPUs.
54  if (Triple.isArm64e())
55  return "apple-a12";
56 
57  // Make sure we pick the appropriate Apple CPU if -arch is used or when
58  // targetting a Darwin OS.
59  if (Args.getLastArg(options::OPT_arch) || Triple.isOSDarwin())
60  return Triple.getArch() == llvm::Triple::aarch64_32 ? "apple-s4"
61  : "apple-a7";
62 
63  return "generic";
64 }
65 
66 // Decode AArch64 features from string like +[no]featureA+[no]featureB+...
67 static bool DecodeAArch64Features(const Driver &D, StringRef text,
68  std::vector<StringRef> &Features,
69  llvm::AArch64::ArchKind ArchKind) {
71  text.split(Split, StringRef("+"), -1, false);
72 
73  for (StringRef Feature : Split) {
74  StringRef FeatureName = llvm::AArch64::getArchExtFeature(Feature);
75  if (!FeatureName.empty())
76  Features.push_back(FeatureName);
77  else if (Feature == "neon" || Feature == "noneon")
78  D.Diag(clang::diag::err_drv_no_neon_modifier);
79  else
80  return false;
81 
82  if (Feature == "sve2")
83  Features.push_back("+sve");
84  else if (Feature == "sve2-bitperm" || Feature == "sve2-sha3" ||
85  Feature == "sve2-aes" || Feature == "sve2-sm4") {
86  Features.push_back("+sve");
87  Features.push_back("+sve2");
88  } else if (Feature == "nosve") {
89  Features.push_back("-sve2");
90  Features.push_back("-sve2-bitperm");
91  Features.push_back("-sve2-sha3");
92  Features.push_back("-sve2-aes");
93  Features.push_back("-sve2-sm4");
94  } else if (Feature == "nosve2") {
95  Features.push_back("-sve2-bitperm");
96  Features.push_back("-sve2-sha3");
97  Features.push_back("-sve2-aes");
98  Features.push_back("-sve2-sm4");
99  }
100 
101  // +sve implies +f32mm if the base architecture is v8.6A, v8.7A, v9.1A or
102  // v9.2A. It isn't the case in general that sve implies both f64mm and f32mm
103  if ((ArchKind == llvm::AArch64::ArchKind::ARMV8_6A ||
104  ArchKind == llvm::AArch64::ArchKind::ARMV8_7A ||
105  ArchKind == llvm::AArch64::ArchKind::ARMV9_1A ||
106  ArchKind == llvm::AArch64::ArchKind::ARMV9_2A) &&
107  Feature == "sve")
108  Features.push_back("+f32mm");
109  }
110  return true;
111 }
112 
113 // Check if the CPU name and feature modifiers in -mcpu are legal. If yes,
114 // decode CPU and feature.
115 static bool DecodeAArch64Mcpu(const Driver &D, StringRef Mcpu, StringRef &CPU,
116  std::vector<StringRef> &Features) {
117  std::pair<StringRef, StringRef> Split = Mcpu.split("+");
118  CPU = Split.first;
119  llvm::AArch64::ArchKind ArchKind = llvm::AArch64::ArchKind::ARMV8A;
120 
121  if (CPU == "native")
122  CPU = llvm::sys::getHostCPUName();
123 
124  if (CPU == "generic") {
125  Features.push_back("+neon");
126  } else {
127  ArchKind = llvm::AArch64::parseCPUArch(CPU);
128  if (!llvm::AArch64::getArchFeatures(ArchKind, Features))
129  return false;
130 
131  uint64_t Extension = llvm::AArch64::getDefaultExtensions(CPU, ArchKind);
132  if (!llvm::AArch64::getExtensionFeatures(Extension, Features))
133  return false;
134  }
135 
136  if (Split.second.size() &&
137  !DecodeAArch64Features(D, Split.second, Features, ArchKind))
138  return false;
139 
140  return true;
141 }
142 
143 static bool
144 getAArch64ArchFeaturesFromMarch(const Driver &D, StringRef March,
145  const ArgList &Args,
146  std::vector<StringRef> &Features) {
147  std::string MarchLowerCase = March.lower();
148  std::pair<StringRef, StringRef> Split = StringRef(MarchLowerCase).split("+");
149 
150  llvm::AArch64::ArchKind ArchKind = llvm::AArch64::parseArch(Split.first);
151  if (ArchKind == llvm::AArch64::ArchKind::INVALID ||
152  !llvm::AArch64::getArchFeatures(ArchKind, Features))
153  return false;
154 
155  // Enable SVE2 by default on Armv9-A.
156  // It can still be disabled if +nosve2 is present.
157  // We must do this early so that DecodeAArch64Features has the correct state
158  if ((ArchKind == llvm::AArch64::ArchKind::ARMV9A ||
159  ArchKind == llvm::AArch64::ArchKind::ARMV9_1A ||
160  ArchKind == llvm::AArch64::ArchKind::ARMV9_2A)) {
161  Features.push_back("+sve");
162  Features.push_back("+sve2");
163  }
164 
165  if ((Split.second.size() &&
166  !DecodeAArch64Features(D, Split.second, Features, ArchKind)))
167  return false;
168 
169  return true;
170 }
171 
172 static bool
173 getAArch64ArchFeaturesFromMcpu(const Driver &D, StringRef Mcpu,
174  const ArgList &Args,
175  std::vector<StringRef> &Features) {
176  StringRef CPU;
177  std::string McpuLowerCase = Mcpu.lower();
178  if (!DecodeAArch64Mcpu(D, McpuLowerCase, CPU, Features))
179  return false;
180 
181  return true;
182 }
183 
184 static bool
186  const ArgList &Args,
187  std::vector<StringRef> &Features) {
188  std::string MtuneLowerCase = Mtune.lower();
189  // Check CPU name is valid
190  std::vector<StringRef> MtuneFeatures;
191  StringRef Tune;
192  if (!DecodeAArch64Mcpu(D, MtuneLowerCase, Tune, MtuneFeatures))
193  return false;
194 
195  // Handle CPU name is 'native'.
196  if (MtuneLowerCase == "native")
197  MtuneLowerCase = std::string(llvm::sys::getHostCPUName());
198  if (MtuneLowerCase == "cyclone" ||
199  StringRef(MtuneLowerCase).startswith("apple")) {
200  Features.push_back("+zcm");
201  Features.push_back("+zcz");
202  }
203  return true;
204 }
205 
206 static bool
208  const ArgList &Args,
209  std::vector<StringRef> &Features) {
210  StringRef CPU;
211  std::vector<StringRef> DecodedFeature;
212  std::string McpuLowerCase = Mcpu.lower();
213  if (!DecodeAArch64Mcpu(D, McpuLowerCase, CPU, DecodedFeature))
214  return false;
215 
216  return getAArch64MicroArchFeaturesFromMtune(D, CPU, Args, Features);
217 }
218 
220  const llvm::Triple &Triple,
221  const ArgList &Args,
222  std::vector<StringRef> &Features,
223  bool ForAS) {
224  Arg *A;
225  bool success = true;
226  // Enable NEON by default.
227  Features.push_back("+neon");
228  llvm::StringRef WaMArch = "";
229  if (ForAS)
230  for (const auto *A :
231  Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler))
232  for (StringRef Value : A->getValues())
233  if (Value.startswith("-march="))
234  WaMArch = Value.substr(7);
235  // Call getAArch64ArchFeaturesFromMarch only if "-Wa,-march=" or
236  // "-Xassembler -march" is detected. Otherwise it may return false
237  // and causes Clang to error out.
238  if (WaMArch.size())
239  success = getAArch64ArchFeaturesFromMarch(D, WaMArch, Args, Features);
240  else if ((A = Args.getLastArg(options::OPT_march_EQ)))
241  success = getAArch64ArchFeaturesFromMarch(D, A->getValue(), Args, Features);
242  else if ((A = Args.getLastArg(options::OPT_mcpu_EQ)))
243  success = getAArch64ArchFeaturesFromMcpu(D, A->getValue(), Args, Features);
244  else if (Args.hasArg(options::OPT_arch) || isCPUDeterminedByTriple(Triple))
246  D, getAArch64TargetCPU(Args, Triple, A), Args, Features);
247  else
248  // Default to 'A' profile if the architecture is not specified.
249  success = getAArch64ArchFeaturesFromMarch(D, "armv8-a", Args, Features);
250 
251  if (success && (A = Args.getLastArg(clang::driver::options::OPT_mtune_EQ)))
252  success =
253  getAArch64MicroArchFeaturesFromMtune(D, A->getValue(), Args, Features);
254  else if (success && (A = Args.getLastArg(options::OPT_mcpu_EQ)))
255  success =
256  getAArch64MicroArchFeaturesFromMcpu(D, A->getValue(), Args, Features);
257  else if (success &&
258  (Args.hasArg(options::OPT_arch) || isCPUDeterminedByTriple(Triple)))
260  D, getAArch64TargetCPU(Args, Triple, A), Args, Features);
261 
262  if (!success)
263  D.Diag(diag::err_drv_clang_unsupported) << A->getAsString(Args);
264 
265  if (Args.getLastArg(options::OPT_mgeneral_regs_only)) {
266  Features.push_back("-fp-armv8");
267  Features.push_back("-crypto");
268  Features.push_back("-neon");
269  }
270 
271  if (Arg *A = Args.getLastArg(options::OPT_mtp_mode_EQ)) {
272  StringRef Mtp = A->getValue();
273  if (Mtp == "el3")
274  Features.push_back("+tpidr-el3");
275  else if (Mtp == "el2")
276  Features.push_back("+tpidr-el2");
277  else if (Mtp == "el1")
278  Features.push_back("+tpidr-el1");
279  else if (Mtp != "el0")
280  D.Diag(diag::err_drv_invalid_mtp) << A->getAsString(Args);
281  }
282 
283  // Enable/disable straight line speculation hardening.
284  if (Arg *A = Args.getLastArg(options::OPT_mharden_sls_EQ)) {
285  StringRef Scope = A->getValue();
286  bool EnableRetBr = false;
287  bool EnableBlr = false;
288  bool DisableComdat = false;
289  if (Scope != "none") {
291  Scope.split(Opts, ",");
292  for (auto Opt : Opts) {
293  Opt = Opt.trim();
294  if (Opt == "all") {
295  EnableBlr = true;
296  EnableRetBr = true;
297  continue;
298  }
299  if (Opt == "retbr") {
300  EnableRetBr = true;
301  continue;
302  }
303  if (Opt == "blr") {
304  EnableBlr = true;
305  continue;
306  }
307  if (Opt == "comdat") {
308  DisableComdat = false;
309  continue;
310  }
311  if (Opt == "nocomdat") {
312  DisableComdat = true;
313  continue;
314  }
315  D.Diag(diag::err_invalid_sls_hardening)
316  << Scope << A->getAsString(Args);
317  break;
318  }
319  }
320 
321  if (EnableRetBr)
322  Features.push_back("+harden-sls-retbr");
323  if (EnableBlr)
324  Features.push_back("+harden-sls-blr");
325  if (DisableComdat) {
326  Features.push_back("+harden-sls-nocomdat");
327  }
328  }
329 
330  // En/disable crc
331  if (Arg *A = Args.getLastArg(options::OPT_mcrc, options::OPT_mnocrc)) {
332  if (A->getOption().matches(options::OPT_mcrc))
333  Features.push_back("+crc");
334  else
335  Features.push_back("-crc");
336  }
337 
338  // Handle (arch-dependent) fp16fml/fullfp16 relationship.
339  // FIXME: this fp16fml option handling will be reimplemented after the
340  // TargetParser rewrite.
341  const auto ItRNoFullFP16 = std::find(Features.rbegin(), Features.rend(), "-fullfp16");
342  const auto ItRFP16FML = std::find(Features.rbegin(), Features.rend(), "+fp16fml");
343  if (llvm::is_contained(Features, "+v8.4a")) {
344  const auto ItRFullFP16 = std::find(Features.rbegin(), Features.rend(), "+fullfp16");
345  if (ItRFullFP16 < ItRNoFullFP16 && ItRFullFP16 < ItRFP16FML) {
346  // Only entangled feature that can be to the right of this +fullfp16 is -fp16fml.
347  // Only append the +fp16fml if there is no -fp16fml after the +fullfp16.
348  if (std::find(Features.rbegin(), ItRFullFP16, "-fp16fml") == ItRFullFP16)
349  Features.push_back("+fp16fml");
350  }
351  else
352  goto fp16_fml_fallthrough;
353  } else {
354 fp16_fml_fallthrough:
355  // In both of these cases, putting the 'other' feature on the end of the vector will
356  // result in the same effect as placing it immediately after the current feature.
357  if (ItRNoFullFP16 < ItRFP16FML)
358  Features.push_back("-fp16fml");
359  else if (ItRNoFullFP16 > ItRFP16FML)
360  Features.push_back("+fullfp16");
361  }
362 
363  // FIXME: this needs reimplementation too after the TargetParser rewrite
364  //
365  // Context sensitive meaning of Crypto:
366  // 1) For Arch >= ARMv8.4a: crypto = sm4 + sha3 + sha2 + aes
367  // 2) For Arch <= ARMv8.3a: crypto = sha2 + aes
368  const auto ItBegin = Features.begin();
369  const auto ItEnd = Features.end();
370  const auto ItRBegin = Features.rbegin();
371  const auto ItREnd = Features.rend();
372  const auto ItRCrypto = std::find(ItRBegin, ItREnd, "+crypto");
373  const auto ItRNoCrypto = std::find(ItRBegin, ItREnd, "-crypto");
374  const auto HasCrypto = ItRCrypto != ItREnd;
375  const auto HasNoCrypto = ItRNoCrypto != ItREnd;
376  const ptrdiff_t PosCrypto = ItRCrypto - ItRBegin;
377  const ptrdiff_t PosNoCrypto = ItRNoCrypto - ItRBegin;
378 
379  bool NoCrypto = false;
380  if (HasCrypto && HasNoCrypto) {
381  if (PosNoCrypto < PosCrypto)
382  NoCrypto = true;
383  }
384 
385  if (std::find(ItBegin, ItEnd, "+v8.4a") != ItEnd ||
386  std::find(ItBegin, ItEnd, "+v9a") != ItEnd ||
387  std::find(ItBegin, ItEnd, "+v9.1a") != ItEnd ||
388  std::find(ItBegin, ItEnd, "+v9.2a") != ItEnd) {
389  if (HasCrypto && !NoCrypto) {
390  // Check if we have NOT disabled an algorithm with something like:
391  // +crypto, -algorithm
392  // And if "-algorithm" does not occur, we enable that crypto algorithm.
393  const bool HasSM4 = (std::find(ItBegin, ItEnd, "-sm4") == ItEnd);
394  const bool HasSHA3 = (std::find(ItBegin, ItEnd, "-sha3") == ItEnd);
395  const bool HasSHA2 = (std::find(ItBegin, ItEnd, "-sha2") == ItEnd);
396  const bool HasAES = (std::find(ItBegin, ItEnd, "-aes") == ItEnd);
397  if (HasSM4)
398  Features.push_back("+sm4");
399  if (HasSHA3)
400  Features.push_back("+sha3");
401  if (HasSHA2)
402  Features.push_back("+sha2");
403  if (HasAES)
404  Features.push_back("+aes");
405  } else if (HasNoCrypto) {
406  // Check if we have NOT enabled a crypto algorithm with something like:
407  // -crypto, +algorithm
408  // And if "+algorithm" does not occur, we disable that crypto algorithm.
409  const bool HasSM4 = (std::find(ItBegin, ItEnd, "+sm4") != ItEnd);
410  const bool HasSHA3 = (std::find(ItBegin, ItEnd, "+sha3") != ItEnd);
411  const bool HasSHA2 = (std::find(ItBegin, ItEnd, "+sha2") != ItEnd);
412  const bool HasAES = (std::find(ItBegin, ItEnd, "+aes") != ItEnd);
413  if (!HasSM4)
414  Features.push_back("-sm4");
415  if (!HasSHA3)
416  Features.push_back("-sha3");
417  if (!HasSHA2)
418  Features.push_back("-sha2");
419  if (!HasAES)
420  Features.push_back("-aes");
421  }
422  } else {
423  if (HasCrypto && !NoCrypto) {
424  const bool HasSHA2 = (std::find(ItBegin, ItEnd, "-sha2") == ItEnd);
425  const bool HasAES = (std::find(ItBegin, ItEnd, "-aes") == ItEnd);
426  if (HasSHA2)
427  Features.push_back("+sha2");
428  if (HasAES)
429  Features.push_back("+aes");
430  } else if (HasNoCrypto) {
431  const bool HasSHA2 = (std::find(ItBegin, ItEnd, "+sha2") != ItEnd);
432  const bool HasAES = (std::find(ItBegin, ItEnd, "+aes") != ItEnd);
433  const bool HasV82a = (std::find(ItBegin, ItEnd, "+v8.2a") != ItEnd);
434  const bool HasV83a = (std::find(ItBegin, ItEnd, "+v8.3a") != ItEnd);
435  const bool HasV84a = (std::find(ItBegin, ItEnd, "+v8.4a") != ItEnd);
436  if (!HasSHA2)
437  Features.push_back("-sha2");
438  if (!HasAES)
439  Features.push_back("-aes");
440  if (HasV82a || HasV83a || HasV84a) {
441  Features.push_back("-sm4");
442  Features.push_back("-sha3");
443  }
444  }
445  }
446 
447  const char *Archs[] = {"+v8.6a", "+v8.7a", "+v9.1a", "+v9.2a"};
448  auto Pos = std::find_first_of(Features.begin(), Features.end(),
449  std::begin(Archs), std::end(Archs));
450  if (Pos != std::end(Features))
451  Pos = Features.insert(std::next(Pos), {"+i8mm", "+bf16"});
452 
453  if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access,
454  options::OPT_munaligned_access)) {
455  if (A->getOption().matches(options::OPT_mno_unaligned_access))
456  Features.push_back("+strict-align");
457  } else if (Triple.isOSOpenBSD())
458  Features.push_back("+strict-align");
459 
460  if (Args.hasArg(options::OPT_ffixed_x1))
461  Features.push_back("+reserve-x1");
462 
463  if (Args.hasArg(options::OPT_ffixed_x2))
464  Features.push_back("+reserve-x2");
465 
466  if (Args.hasArg(options::OPT_ffixed_x3))
467  Features.push_back("+reserve-x3");
468 
469  if (Args.hasArg(options::OPT_ffixed_x4))
470  Features.push_back("+reserve-x4");
471 
472  if (Args.hasArg(options::OPT_ffixed_x5))
473  Features.push_back("+reserve-x5");
474 
475  if (Args.hasArg(options::OPT_ffixed_x6))
476  Features.push_back("+reserve-x6");
477 
478  if (Args.hasArg(options::OPT_ffixed_x7))
479  Features.push_back("+reserve-x7");
480 
481  if (Args.hasArg(options::OPT_ffixed_x9))
482  Features.push_back("+reserve-x9");
483 
484  if (Args.hasArg(options::OPT_ffixed_x10))
485  Features.push_back("+reserve-x10");
486 
487  if (Args.hasArg(options::OPT_ffixed_x11))
488  Features.push_back("+reserve-x11");
489 
490  if (Args.hasArg(options::OPT_ffixed_x12))
491  Features.push_back("+reserve-x12");
492 
493  if (Args.hasArg(options::OPT_ffixed_x13))
494  Features.push_back("+reserve-x13");
495 
496  if (Args.hasArg(options::OPT_ffixed_x14))
497  Features.push_back("+reserve-x14");
498 
499  if (Args.hasArg(options::OPT_ffixed_x15))
500  Features.push_back("+reserve-x15");
501 
502  if (Args.hasArg(options::OPT_ffixed_x18))
503  Features.push_back("+reserve-x18");
504 
505  if (Args.hasArg(options::OPT_ffixed_x20))
506  Features.push_back("+reserve-x20");
507 
508  if (Args.hasArg(options::OPT_ffixed_x21))
509  Features.push_back("+reserve-x21");
510 
511  if (Args.hasArg(options::OPT_ffixed_x22))
512  Features.push_back("+reserve-x22");
513 
514  if (Args.hasArg(options::OPT_ffixed_x23))
515  Features.push_back("+reserve-x23");
516 
517  if (Args.hasArg(options::OPT_ffixed_x24))
518  Features.push_back("+reserve-x24");
519 
520  if (Args.hasArg(options::OPT_ffixed_x25))
521  Features.push_back("+reserve-x25");
522 
523  if (Args.hasArg(options::OPT_ffixed_x26))
524  Features.push_back("+reserve-x26");
525 
526  if (Args.hasArg(options::OPT_ffixed_x27))
527  Features.push_back("+reserve-x27");
528 
529  if (Args.hasArg(options::OPT_ffixed_x28))
530  Features.push_back("+reserve-x28");
531 
532  if (Args.hasArg(options::OPT_ffixed_x30))
533  Features.push_back("+reserve-x30");
534 
535  if (Args.hasArg(options::OPT_fcall_saved_x8))
536  Features.push_back("+call-saved-x8");
537 
538  if (Args.hasArg(options::OPT_fcall_saved_x9))
539  Features.push_back("+call-saved-x9");
540 
541  if (Args.hasArg(options::OPT_fcall_saved_x10))
542  Features.push_back("+call-saved-x10");
543 
544  if (Args.hasArg(options::OPT_fcall_saved_x11))
545  Features.push_back("+call-saved-x11");
546 
547  if (Args.hasArg(options::OPT_fcall_saved_x12))
548  Features.push_back("+call-saved-x12");
549 
550  if (Args.hasArg(options::OPT_fcall_saved_x13))
551  Features.push_back("+call-saved-x13");
552 
553  if (Args.hasArg(options::OPT_fcall_saved_x14))
554  Features.push_back("+call-saved-x14");
555 
556  if (Args.hasArg(options::OPT_fcall_saved_x15))
557  Features.push_back("+call-saved-x15");
558 
559  if (Args.hasArg(options::OPT_fcall_saved_x18))
560  Features.push_back("+call-saved-x18");
561 
562  if (Args.hasArg(options::OPT_mno_neg_immediates))
563  Features.push_back("+no-neg-immediates");
564 }
clang::comments::tok::text
@ text
Definition: CommentLexer.h:35
getAArch64MicroArchFeaturesFromMtune
static bool getAArch64MicroArchFeaturesFromMtune(const Driver &D, StringRef Mtune, const ArgList &Args, std::vector< StringRef > &Features)
Definition: AArch64.cpp:185
Driver.h
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::driver::tools::aarch64::getAArch64TargetFeatures
void getAArch64TargetFeatures(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args, std::vector< llvm::StringRef > &Features, bool ForAS)
llvm::SmallVector< StringRef, 8 >
DecodeAArch64Features
static bool DecodeAArch64Features(const Driver &D, StringRef text, std::vector< StringRef > &Features, llvm::AArch64::ArchKind ArchKind)
Definition: AArch64.cpp:67
clang::driver::tools
Definition: AIX.h:17
getAArch64ArchFeaturesFromMcpu
static bool getAArch64ArchFeaturesFromMcpu(const Driver &D, StringRef Mcpu, const ArgList &Args, std::vector< StringRef > &Features)
Definition: AArch64.cpp:173
isCPUDeterminedByTriple
static bool isCPUDeterminedByTriple(const llvm::Triple &Triple)
Definition: AArch64.cpp:24
AArch64.h
getAArch64MicroArchFeaturesFromMcpu
static bool getAArch64MicroArchFeaturesFromMcpu(const Driver &D, StringRef Mcpu, const ArgList &Args, std::vector< StringRef > &Features)
Definition: AArch64.cpp:207
clang::driver::Driver::Diag
DiagnosticBuilder Diag(unsigned DiagID) const
Definition: Driver.h:112
Options.h
clang::Scope
Scope - A scope is a transient data structure that is used while parsing the program.
Definition: Scope.h:40
clang::driver::tools::aarch64::getAArch64TargetCPU
std::string getAArch64TargetCPU(const llvm::opt::ArgList &Args, const llvm::Triple &Triple, llvm::opt::Arg *&A)
llvm::opt
Definition: DiagnosticOptions.h:19
DriverDiagnostic.h
clang::cross_tu::index_error_code::success
@ success
getAArch64ArchFeaturesFromMarch
static bool getAArch64ArchFeaturesFromMarch(const Driver &D, StringRef March, const ArgList &Args, std::vector< StringRef > &Features)
Definition: AArch64.cpp:144
Value
Value
Definition: UninitializedValues.cpp:102
DwarfFissionKind::Split
@ Split
DecodeAArch64Mcpu
static bool DecodeAArch64Mcpu(const Driver &D, StringRef Mcpu, StringRef &CPU, std::vector< StringRef > &Features)
Definition: AArch64.cpp:115
clang
Definition: CalledOnceCheck.h:17
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
ptrdiff_t
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
Definition: opencl-c-base.h:110
clang::driver
Definition: Action.h:31
getArchFeatures
static bool getArchFeatures(const Driver &D, StringRef Arch, std::vector< StringRef > &Features, const ArgList &Args)
Definition: RISCV.cpp:28