LLVM: include/llvm/TargetParser/Triple.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_TARGETPARSER_TRIPLE_H

10#define LLVM_TARGETPARSER_TRIPLE_H

11

15

16

17

18#undef NetBSD

19#undef mips

20#undef sparc

21

22namespace llvm {

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

48public:

51

52 arm,

53 armeb,

54 aarch64,

55 aarch64_be,

56 aarch64_32,

57 arc,

58 avr,

59 bpfel,

60 bpfeb,

62 dxil,

66 m68k,

67 mips,

68 mipsel,

69 mips64,

70 mips64el,

72 ppc,

73 ppcle,

74 ppc64,

76 r600,

77 amdgcn,

78 riscv32,

79 riscv64,

80 riscv32be,

81 riscv64be,

84 sparcel,

86 tce,

87 tcele,

88 thumb,

89 thumbeb,

90 x86,

91 x86_64,

97 amdil64,

99 hsail64,

100 spir,

101 spir64,

102 spirv,

103 spirv32,

104 spirv64,

106 shave,

107 lanai,

108 wasm32,

109 wasm64,

112 ve,

114 };

117

153

156

160

162

164

165

173

174

186 };

331

332private:

333 std::string Data;

334

335

336 ArchType Arch{};

337

338

339 SubArchType SubArch{};

340

341

343

344

346

347

349

350

352

353public:

354

355

356

357

358

360

364 explicit Triple(const std::string &Str) : Triple(std::string(Str)) {}

366

368 const Twine &OSStr);

370 const Twine &OSStr, const Twine &EnvironmentStr);

371

373 return Arch == Other.Arch && SubArch == Other.SubArch &&

374 Vendor == Other.Vendor && OS == Other.OS &&

375 Environment == Other.Environment &&

376 ObjectFormat == Other.ObjectFormat;

377 }

378

380 return !(*this == Other);

381 }

382

383

384

385

386

387

394

395

396

397

398

399

402

403

407

408

409

410

411

412

414

415

417

418

420

421

423

424

428

429

431

432

433

434

435

437

438

440

441

442

443

444

446

447

448

450

451

452

453

454

456

457

458

460

461

462

464

465

467

468

469

471

472

473

475

476

477

478

479

480 const std::string &str() const { return Data; }

481

482 const std::string &getTriple() const { return Data; }

483

484

485 bool empty() const { return Data.empty(); }

486

487

489

490

492

493

495

496

497

499

500

501

503

504

505

506

507

509

510

511

512

513

514

516

517

521

522

524

525

526

527

528

529

530

531

533

534

535

536

538

539

540

541

543

544

545

547 unsigned Micro = 0) const {

548 if (Minor == 0) {

550 }

551 if (Micro == 0) {

553 }

555 }

556

558 unsigned Micro = 0) const {

560 }

561

565

569

570

571

573 unsigned Micro = 0) const;

574

576 unsigned Micro = 0) const {

578 }

579

580

581

585

586

587

588

589

590

594

595

599

600

604

608

609

611

612

614

615

617

619

620

624

625

626

631

635

639

640

645

649

653

657

661

663

667

671

673

683

684

688

689

693

694

698

699

703

704

709

710

715

719

723

727

731

732

736

737

742

743

747

748

752

753

757

758

762

763

767

768

774

775

779

783

784

788

789

793

794

796

797

801

802

806

807

811

812

816

817

822

823

829

830

836

837

839

840

842

854

855

868

869

870

872

874

876

877

881

885

887

889

901

902

906

907

912

913

915

916

920

921

925

926

928

930

931

935

936

940

941

942

957

958

959

960

961

962

963

964

970

978

985

986

1000 return false;

1001 default:

1002 return true;

1003 }

1004 }

1005

1006

1015 return true;

1016 default:

1017 return false;

1018 }

1019 }

1020

1021

1026

1027

1028

1030 assert(PointerWidth == 64 || PointerWidth == 32);

1032 return false;

1035 ? PointerWidth == 32

1036 : PointerWidth == 64;

1037 }

1038

1039

1041

1042

1044

1045

1047

1048

1052

1053

1057

1058

1062

1063

1068

1069

1073

1074

1078

1079

1086

1087

1095

1096

1100

1101

1105

1106

1108

1109

1113

1114

1116

1117

1119

1120

1124

1125

1129

1130

1132

1133

1135

1136

1140

1141

1145

1146

1150

1151

1156

1157

1162

1163

1168

1169

1173

1174

1180

1181

1189

1190

1195

1196

1197

1198

1203

1204

1208

1209

1213

1214

1216

1217

1218

1219

1220

1221

1223

1224

1226

1227

1229

1230

1232

1233

1235

1236

1238

1239

1241

1242

1244

1245

1247

1248

1250

1251

1252

1254

1255

1256

1257

1258

1259

1260

1261

1262

1263

1264

1266

1267

1268

1269

1270

1271

1272

1274

1275

1276

1277

1278

1279

1280

1282

1283

1284

1285

1286

1287

1288

1290

1291

1292

1293

1295

1296

1298

1299

1301

1302

1304

1305

1306

1307

1308

1310

1311

1312

1313

1314

1315

1317

1318

1320 SubArchType SubArch = NoSubArch);

1321

1322

1323

1324

1325

1326

1328

1329

1331

1332

1334

1335

1337

1338

1341

1342

1343

1344

1345

1346

1348

1349

1350

1351

1354 bool IsInValidRange);

1355

1356

1359

1361

1362

1363

1365};

1366

1367}

1368

1369

1370#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

Defines the llvm::VersionTuple class, which represents a version in the form major[....

StringRef - Represent a constant reference to a string, i.e.

Triple - Helper class for working with autoconf configuration names.

Definition Triple.h:47

LLVM_ABI bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const

Comparison function for checking OS X version compatibility, which handles supporting skewed version ...

LLVM_ABI VersionTuple getOSVersion() const

Parse the version number from the OS name component of the triple, if present.

bool isPPC() const

Tests whether the target is PowerPC (32- or 64-bit LE or BE).

Definition Triple.h:1064

bool isOSDragonFly() const

Definition Triple.h:662

LLVM_ABI StringRef getVendorName() const

Get the vendor (second) component of the triple.

LLVM_ABI VersionTuple getWatchOSVersion() const

Parse the version number as with getOSVersion.

LLVM_ABI void setArchName(StringRef Str)

Set the architecture (first) component of the triple by name.

bool isTargetMachineMac() const

Returns true for targets that run on a macOS machine.

Definition Triple.h:641

bool isArmT32() const

Tests whether the target is T32.

Definition Triple.h:987

LLVM_ABI void setObjectFormat(ObjectFormatType Kind)

Set the object file format.

bool isAndroidVersionLT(unsigned Major) const

Definition Triple.h:843

LLVM_ABI llvm::Triple get32BitArchVariant() const

Form a triple with a 32-bit variant of the current architecture.

bool isOSCygMing() const

Tests for either Cygwin or MinGW OS.

Definition Triple.h:733

bool isWatchABI() const

Definition Triple.h:605

Triple()=default

Default constructor is the same as an empty string and leaves all triple fields unknown.

EnvironmentType

Definition Triple.h:253

@ Cygnus

Definition Triple.h:286

@ MuslABIN32

Definition Triple.h:274

@ GNUILP32

Definition Triple.h:268

@ MacABI

Definition Triple.h:289

@ Android

Definition Triple.h:272

@ RayGeneration

Definition Triple.h:302

@ GNUABI64

Definition Triple.h:259

@ GNUEABIT64

Definition Triple.h:261

@ MuslABI64

Definition Triple.h:275

@ Musl

Definition Triple.h:273

@ Compute

Definition Triple.h:300

@ Library

Definition Triple.h:301

@ MTIA

Definition Triple.h:316

@ LastEnvironmentType

Definition Triple.h:317

@ LLVM

Definition Triple.h:282

@ Pixel

Definition Triple.h:295

@ OpenHOS

Definition Triple.h:312

@ Simulator

Definition Triple.h:288

@ GNUF64

Definition Triple.h:265

@ Mlibc

Definition Triple.h:313

@ GNUF32

Definition Triple.h:264

@ GNUT64

Definition Triple.h:257

@ MuslF32

Definition Triple.h:278

@ GNUEABIHF

Definition Triple.h:262

@ UnknownEnvironment

Definition Triple.h:254

@ MSVC

Definition Triple.h:284

@ Vertex

Definition Triple.h:296

@ GNUEABI

Definition Triple.h:260

@ PAuthTest

Definition Triple.h:315

@ GNUABIN32

Definition Triple.h:258

@ ClosestHit

Definition Triple.h:305

@ EABI

Definition Triple.h:270

@ OpenCL

Definition Triple.h:311

@ MuslEABI

Definition Triple.h:276

@ Domain

Definition Triple.h:299

@ GNUSF

Definition Triple.h:266

@ Mesh

Definition Triple.h:308

@ Itanium

Definition Triple.h:285

@ RootSignature

Definition Triple.h:310

@ GNUX32

Definition Triple.h:267

@ MuslWALI

Definition Triple.h:281

@ MuslEABIHF

Definition Triple.h:277

@ AnyHit

Definition Triple.h:304

@ Amplification

Definition Triple.h:309

@ Intersection

Definition Triple.h:303

@ Hull

Definition Triple.h:298

@ CODE16

Definition Triple.h:269

@ Miss

Definition Triple.h:306

@ Geometry

Definition Triple.h:297

@ Callable

Definition Triple.h:307

@ MuslX32

Definition Triple.h:280

@ GNUEABIHFT64

Definition Triple.h:263

@ GNU

Definition Triple.h:256

@ EABIHF

Definition Triple.h:271

@ CoreCLR

Definition Triple.h:287

@ MuslSF

Definition Triple.h:279

bool isThumb() const

Tests whether the target is Thumb (little and big endian).

Definition Triple.h:932

bool isPS4() const

Tests whether the target is the PS4 platform.

Definition Triple.h:824

bool isX86_64() const

Tests whether the target is x86 (64-bit).

Definition Triple.h:1134

bool isPPC64ELFv2ABI() const

Tests whether the target 64-bit PowerPC big endian ABI is ELFv2.

Definition Triple.h:1080

static LLVM_ABI VersionTuple getCanonicalVersionForOS(OSType OSKind, const VersionTuple &Version, bool IsInValidRange)

Returns a canonicalized OS version number for the specified OS.

bool isOSWASI() const

Tests whether the OS is WASI.

Definition Triple.h:759

bool isSPIR() const

Tests whether the target is SPIR (32- or 64-bit).

Definition Triple.h:903

CanonicalForm

Canonical form.

Definition Triple.h:388

@ THREE_IDENT

Definition Triple.h:390

@ FIVE_IDENT

Definition Triple.h:392

@ FOUR_IDENT

Definition Triple.h:391

@ ANY

Definition Triple.h:389

bool isOSBinFormatWasm() const

Tests whether the OS uses the Wasm binary format.

Definition Triple.h:803

bool isDriverKit() const

Is this an Apple DriverKit triple.

Definition Triple.h:616

unsigned getArchPointerBitWidth() const

Returns the pointer width of this architecture.

Definition Triple.h:518

LLVM_ABI llvm::Triple getLittleEndianArchVariant() const

Form a triple with a little endian variant of the current architecture.

bool isOSHurd() const

Tests whether the OS is Hurd.

Definition Triple.h:754

bool isHardFloatABI() const

Tests if the target forces hardfloat.

Definition Triple.h:1182

bool isBPF() const

Tests whether the target is eBPF.

Definition Triple.h:1170

bool isX32() const

Tests whether the target is X32.

Definition Triple.h:1164

static LLVM_ABI StringRef getVendorTypeName(VendorType Kind)

Get the canonical name for the Kind vendor.

Triple(const char *Str)

Definition Triple.h:363

ObjectFormatType getObjectFormat() const

Get the object format for this triple.

Definition Triple.h:439

bool isAArch64(int PointerWidth) const

Tests whether the target is AArch64 and pointers are the size specified by PointerWidth.

Definition Triple.h:1029

SubArchType getSubArch() const

get the parsed subarchitecture type for this triple.

Definition Triple.h:416

bool isX86() const

Tests whether the target is x86 (32- or 64-bit).

Definition Triple.h:1126

bool isArm64e() const

Tests whether the target is the Apple "arm64e" AArch64 subarch.

Definition Triple.h:1152

std::string normalize(CanonicalForm Form=CanonicalForm::ANY) const

Return the normalized form of this triple's string.

Definition Triple.h:404

bool isTargetEHABICompatible() const

Tests whether the target supports the EHABI exception handling standard.

Definition Triple.h:943

bool isOSBinFormatGOFF() const

Tests whether the OS uses the GOFF binary format.

Definition Triple.h:795

bool isWindowsGNUEnvironment() const

Definition Triple.h:728

LLVM_ABI void setVendorName(StringRef Str)

Set the vendor (second) component of the triple by name.

OSType

Definition Triple.h:207

@ CheriotRTOS

Definition Triple.h:250

@ Darwin

Definition Triple.h:210

@ AMDHSA

Definition Triple.h:231

@ DragonFly

Definition Triple.h:211

@ OpenBSD

Definition Triple.h:221

@ TvOS

Definition Triple.h:235

@ Lv2

Definition Triple.h:217

@ Serenity

Definition Triple.h:248

@ UnknownOS

Definition Triple.h:208

@ LastOSType

Definition Triple.h:251

@ HermitCore

Definition Triple.h:242

@ Haiku

Definition Triple.h:226

@ AIX

Definition Triple.h:228

@ DriverKit

Definition Triple.h:238

@ RTEMS

Definition Triple.h:227

@ PS4

Definition Triple.h:232

@ FreeBSD

Definition Triple.h:212

@ KFreeBSD

Definition Triple.h:215

@ PS5

Definition Triple.h:233

@ MacOSX

Definition Triple.h:218

@ NVCL

Definition Triple.h:230

@ Linux

Definition Triple.h:216

@ UEFI

Definition Triple.h:223

@ AMDPAL

Definition Triple.h:241

@ Mesa3D

Definition Triple.h:240

@ Vulkan

Definition Triple.h:249

@ WatchOS

Definition Triple.h:236

@ Fuchsia

Definition Triple.h:213

@ Managarm

Definition Triple.h:219

@ WASI

Definition Triple.h:244

@ XROS

Definition Triple.h:239

@ BridgeOS

Definition Triple.h:237

@ ShaderModel

Definition Triple.h:246

@ Solaris

Definition Triple.h:222

@ CUDA

Definition Triple.h:229

@ NetBSD

Definition Triple.h:220

@ Emscripten

Definition Triple.h:245

@ ELFIAMCU

Definition Triple.h:234

@ Hurd

Definition Triple.h:243

@ LiteOS

Definition Triple.h:247

@ IOS

Definition Triple.h:214

@ Win32

Definition Triple.h:224

@ ZOS

Definition Triple.h:225

bool isOSNetBSD() const

Definition Triple.h:646

LLVM_ABI std::string computeDataLayout(StringRef ABIName="") const

Compute the LLVM IR data layout string based on the triple.

LLVM_ABI void setOSAndEnvironmentName(StringRef Str)

Set the operating system and optional environment components with a single string.

bool isAndroid() const

Tests whether the target is Android.

Definition Triple.h:841

bool hasDefaultTLSDESC() const

True if the target uses TLSDESC by default.

Definition Triple.h:1205

LLVM_ABI llvm::Triple get64BitArchVariant() const

Form a triple with a 64-bit variant of the current architecture.

bool isOSMSVCRT() const

Is this a "Windows" OS targeting a "MSVCRT.dll" environment.

Definition Triple.h:738

bool isOSBinFormatMachO() const

Tests whether the environment is MachO.

Definition Triple.h:798

LLVM_ABI bool isLittleEndian() const

Tests whether the target triple is little endian.

LLVM_ABI void setEnvironment(EnvironmentType Kind)

Set the environment (fourth) component of the triple to a known type.

bool isABIN32() const

Definition Triple.h:1158

LLVM_ABI StringRef getOSName() const

Get the operating system (third) component of the triple.

bool supportsCOMDAT() const

Tests whether the target supports comdat.

Definition Triple.h:1191

bool isWindowsCoreCLREnvironment() const

Definition Triple.h:716

bool isSPIROrSPIRV() const

Definition Triple.h:914

LLVM_ABI ExceptionHandling getDefaultExceptionHandling() const

bool isMIPS64() const

Tests whether the target is MIPS 64-bit (little and big endian).

Definition Triple.h:1054

ArchType

Definition Triple.h:49

@ thumbeb

Definition Triple.h:89

@ r600

Definition Triple.h:76

@ sparcel

Definition Triple.h:84

@ loongarch32

Definition Triple.h:64

@ x86

Definition Triple.h:90

@ x86_64

Definition Triple.h:91

@ LastArchType

Definition Triple.h:113

@ renderscript64

Definition Triple.h:111

@ xcore

Definition Triple.h:92

@ csky

Definition Triple.h:61

@ sparcv9

Definition Triple.h:83

@ amdgcn

Definition Triple.h:77

@ shave

Definition Triple.h:106

@ ve

Definition Triple.h:112

@ ppcle

Definition Triple.h:73

@ spir

Definition Triple.h:100

@ ppc64le

Definition Triple.h:75

@ hexagon

Definition Triple.h:63

@ spir64

Definition Triple.h:101

@ UnknownArch

Definition Triple.h:50

@ kalimba

Definition Triple.h:105

@ amdil

Definition Triple.h:96

@ mipsel

Definition Triple.h:68

@ aarch64_be

Definition Triple.h:55

@ hsail64

Definition Triple.h:99

@ msp430

Definition Triple.h:71

@ loongarch64

Definition Triple.h:65

@ bpfel

Definition Triple.h:59

@ renderscript32

Definition Triple.h:110

@ mips

Definition Triple.h:67

@ arm

Definition Triple.h:52

@ lanai

Definition Triple.h:107

@ tcele

Definition Triple.h:87

@ nvptx64

Definition Triple.h:95

@ avr

Definition Triple.h:58

@ dxil

Definition Triple.h:62

@ sparc

Definition Triple.h:82

@ mips64

Definition Triple.h:69

@ riscv32be

Definition Triple.h:80

@ ppc64

Definition Triple.h:74

@ ppc

Definition Triple.h:72

@ thumb

Definition Triple.h:88

@ xtensa

Definition Triple.h:93

@ bpfeb

Definition Triple.h:60

@ wasm32

Definition Triple.h:108

@ hsail

Definition Triple.h:98

@ wasm64

Definition Triple.h:109

@ tce

Definition Triple.h:86

@ riscv64be

Definition Triple.h:81

@ amdil64

Definition Triple.h:97

@ nvptx

Definition Triple.h:94

@ spirv64

Definition Triple.h:104

@ m68k

Definition Triple.h:66

@ riscv64

Definition Triple.h:79

@ mips64el

Definition Triple.h:70

@ riscv32

Definition Triple.h:78

@ arc

Definition Triple.h:57

@ aarch64

Definition Triple.h:54

@ spirv

Definition Triple.h:102

@ systemz

Definition Triple.h:85

@ aarch64_32

Definition Triple.h:56

@ armeb

Definition Triple.h:53

@ spirv32

Definition Triple.h:103

bool hasDefaultDataSections() const

Tests whether the target uses -data-sections as default.

Definition Triple.h:1210

bool isTargetGNUAEABI() const

Definition Triple.h:971

bool isOSSolaris() const

Definition Triple.h:664

bool isRISCV32() const

Tests whether the target is 32-bit RISC-V.

Definition Triple.h:1097

bool isOSKFreeBSD() const

Tests whether the OS is kFreeBSD.

Definition Triple.h:749

LLVM_ABI void setTriple(const Twine &Str)

Set all components to the new triple Str.

OSType getOS() const

Get the parsed operating system type of this triple.

Definition Triple.h:422

LLVM_ABI VersionTuple getEnvironmentVersion() const

Parse the version number from the OS name component of the triple, if present.

static LLVM_ABI std::string normalize(StringRef Str, CanonicalForm Form=CanonicalForm::ANY)

Turn an arbitrary machine specification into the canonical triple form (or something sensible that th...

static LLVM_ABI ArchType getArchTypeForLLVMName(StringRef Str)

The canonical type for the given LLVM architecture name (e.g., "x86").

bool isOSVersionLT(const Triple &Other) const

Definition Triple.h:562

bool isPPC32() const

Tests whether the target is 32-bit PowerPC (little and big endian).

Definition Triple.h:1070

ArchType getArch() const

Get the parsed architecture type of this triple.

Definition Triple.h:413

LLVM_ABI unsigned getTrampolineSize() const

Returns the trampoline size in bytes for this configuration.

bool isOSBinFormatCOFF() const

Tests whether the OS uses the COFF binary format.

Definition Triple.h:790

bool isRISCV64() const

Tests whether the target is 64-bit RISC-V.

Definition Triple.h:1102

bool isCSKY() const

Definition Triple.h:1147

bool isLoongArch64() const

Tests whether the target is 64-bit LoongArch.

Definition Triple.h:1043

LLVM_ABI StringRef getEnvironmentName() const

Get the optional environment (fourth) component of the triple, or "" if empty.

bool isSPARC32() const

Tests whether the target is 32-bit SPARC (little and big endian).

Definition Triple.h:1110

bool isSimulatorEnvironment() const

Definition Triple.h:632

LLVM_ABI VersionTuple getDXILVersion() const

Parse the DXIL version number from the OSVersion and DXIL version (SubArch).

const std::string & str() const

Definition Triple.h:480

bool isOSzOS() const

Definition Triple.h:618

bool isOSSerenity() const

Definition Triple.h:780

bool isOHOSFamily() const

Tests whether the target is OHOS LiteOS default enviroment is also OHOS, but omited on triple.

Definition Triple.h:871

EnvironmentType getEnvironment() const

Get the parsed environment type of this triple.

Definition Triple.h:430

bool isOSOpenBSD() const

Definition Triple.h:650

LLVM_ABI VersionTuple getVulkanVersion() const

Parse the Vulkan version number from the OSVersion and SPIR-V version (SubArch).

bool isOSUnknown() const

Definition Triple.h:672

LLVM_ABI VersionTuple getDriverKitVersion() const

Parse the version number as with getOSVersion.

bool isMIPS32() const

Tests whether the target is MIPS 32-bit (little and big endian).

Definition Triple.h:1049

bool isShaderModelOS() const

Definition Triple.h:882

bool isUEFI() const

Tests whether the OS is UEFI.

Definition Triple.h:690

bool isOSWindows() const

Tests whether the OS is Windows.

Definition Triple.h:695

bool isMusl() const

Tests whether the environment is musl-libc.

Definition Triple.h:856

const std::string & getTriple() const

Definition Triple.h:482

static LLVM_ABI StringRef getArchTypeName(ArchType Kind)

Get the canonical name for the Kind architecture.

bool isOSVersionGE(const Triple &Other) const

Definition Triple.h:566

bool isOSBinFormatDXContainer() const

Tests whether the OS uses the DXContainer binary format.

Definition Triple.h:813

bool isGPU() const

Test whether the target triple is for a GPU.

Definition Triple.h:1300

bool isOSBinFormatXCOFF() const

Tests whether the OS uses the XCOFF binary format.

Definition Triple.h:808

static LLVM_ABI StringRef getOSTypeName(OSType Kind)

Get the canonical name for the Kind operating system.

bool isTargetMuslAEABI() const

Definition Triple.h:979

ObjectFormatType

Definition Triple.h:319

@ XCOFF

Definition Triple.h:329

@ MachO

Definition Triple.h:326

@ DXContainer

Definition Triple.h:323

@ ELF

Definition Triple.h:324

@ Wasm

Definition Triple.h:328

@ GOFF

Definition Triple.h:325

@ COFF

Definition Triple.h:322

@ SPIRV

Definition Triple.h:327

@ UnknownObjectFormat

Definition Triple.h:320

bool isARM() const

Tests whether the target is ARM (little and big endian).

Definition Triple.h:937

LLVM_ABI std::string merge(const Triple &Other) const

Merge target triples.

bool isArmMClass() const

Tests whether the target is an M-class.

Definition Triple.h:1007

bool isOSLinux() const

Tests whether the OS is Linux.

Definition Triple.h:744

bool isBridgeOS() const

Is this an Apple BridgeOS triple.

Definition Triple.h:613

bool isOSManagarm() const

Definition Triple.h:888

bool isRISCV() const

Tests whether the target is RISC-V (32- and 64-bit).

Definition Triple.h:1107

bool isAMDGCN() const

Tests whether the target is AMDGCN.

Definition Triple.h:927

bool isAMDGPU() const

Definition Triple.h:929

bool isLoongArch32() const

Tests whether the target is 32-bit LoongArch.

Definition Triple.h:1040

bool isOSLiteOS() const

Definition Triple.h:875

VendorType

Definition Triple.h:187

@ UnknownVendor

Definition Triple.h:188

@ OpenEmbedded

Definition Triple.h:202

@ Apple

Definition Triple.h:190

@ AMD

Definition Triple.h:199

@ SUSE

Definition Triple.h:201

@ Freescale

Definition Triple.h:193

@ Meta

Definition Triple.h:204

@ ImaginationTechnologies

Definition Triple.h:195

@ Mesa

Definition Triple.h:200

@ Intel

Definition Triple.h:203

@ LastVendorType

Definition Triple.h:205

@ MipsTechnologies

Definition Triple.h:196

@ IBM

Definition Triple.h:194

@ NVIDIA

Definition Triple.h:197

@ CSR

Definition Triple.h:198

@ SCEI

Definition Triple.h:192

@ PC

Definition Triple.h:191

bool isNVPTX() const

Tests whether the target is NVPTX (32- or 64-bit).

Definition Triple.h:922

bool isOSAIX() const

Tests whether the OS is AIX.

Definition Triple.h:776

LLVM_ABI VersionTuple getMinimumSupportedOSVersion() const

Some platforms have different minimum supported OS versions that varies by the architecture specified...

LLVM_ABI bool isArch64Bit() const

Test whether the architecture is 64-bit.

LLVM_ABI StringRef getOSAndEnvironmentName() const

Get the operating system and optional environment components as a single string (separated by a '-' i...

SubArchType

Definition Triple.h:115

@ ARMSubArch_v6t2

Definition Triple.h:149

@ NoSubArch

Definition Triple.h:116

@ MipsSubArch_r6

Definition Triple.h:161

@ DXILSubArch_v1_2

Definition Triple.h:177

@ ARMSubArch_v7

Definition Triple.h:140

@ ARMSubArch_v8m_mainline

Definition Triple.h:138

@ ARMSubArch_v9_6a

Definition Triple.h:119

@ ARMSubArch_v8r

Definition Triple.h:136

@ ARMSubArch_v9_1a

Definition Triple.h:124

@ DXILSubArch_v1_1

Definition Triple.h:176

@ LatestDXILSubArch

Definition Triple.h:185

@ SPIRVSubArch_v10

Definition Triple.h:166

@ SPIRVSubArch_v13

Definition Triple.h:169

@ ARMSubArch_v7k

Definition Triple.h:144

@ ARMSubArch_v8_7a

Definition Triple.h:128

@ ARMSubArch_v8

Definition Triple.h:135

@ SPIRVSubArch_v16

Definition Triple.h:172

@ ARMSubArch_v8_1a

Definition Triple.h:134

@ ARMSubArch_v9_2a

Definition Triple.h:123

@ DXILSubArch_v1_3

Definition Triple.h:178

@ SPIRVSubArch_v15

Definition Triple.h:171

@ ARMSubArch_v7m

Definition Triple.h:142

@ ARMSubArch_v9_7a

Definition Triple.h:118

@ ARMSubArch_v6k

Definition Triple.h:148

@ ARMSubArch_v5

Definition Triple.h:150

@ AArch64SubArch_arm64e

Definition Triple.h:154

@ ARMSubArch_v6

Definition Triple.h:146

@ ARMSubArch_v9_5a

Definition Triple.h:120

@ ARMSubArch_v7ve

Definition Triple.h:145

@ ARMSubArch_v8m_baseline

Definition Triple.h:137

@ ARMSubArch_v8_8a

Definition Triple.h:127

@ ARMSubArch_v8_2a

Definition Triple.h:133

@ ARMSubArch_v7s

Definition Triple.h:143

@ DXILSubArch_v1_0

Definition Triple.h:175

@ DXILSubArch_v1_7

Definition Triple.h:182

@ KalimbaSubArch_v3

Definition Triple.h:157

@ DXILSubArch_v1_5

Definition Triple.h:180

@ ARMSubArch_v8_4a

Definition Triple.h:131

@ ARMSubArch_v8_9a

Definition Triple.h:126

@ ARMSubArch_v7em

Definition Triple.h:141

@ SPIRVSubArch_v12

Definition Triple.h:168

@ SPIRVSubArch_v14

Definition Triple.h:170

@ KalimbaSubArch_v4

Definition Triple.h:158

@ ARMSubArch_v8_1m_mainline

Definition Triple.h:139

@ ARMSubArch_v8_3a

Definition Triple.h:132

@ AArch64SubArch_arm64ec

Definition Triple.h:155

@ ARMSubArch_v8_6a

Definition Triple.h:129

@ ARMSubArch_v5te

Definition Triple.h:151

@ KalimbaSubArch_v5

Definition Triple.h:159

@ ARMSubArch_v4t

Definition Triple.h:152

@ DXILSubArch_v1_6

Definition Triple.h:181

@ DXILSubArch_v1_8

Definition Triple.h:183

@ ARMSubArch_v9_4a

Definition Triple.h:121

@ ARMSubArch_v8_5a

Definition Triple.h:130

@ ARMSubArch_v6m

Definition Triple.h:147

@ ARMSubArch_v9_3a

Definition Triple.h:122

@ DXILSubArch_v1_9

Definition Triple.h:184

@ ARMSubArch_v9

Definition Triple.h:125

@ DXILSubArch_v1_4

Definition Triple.h:179

@ SPIRVSubArch_v11

Definition Triple.h:167

@ PPCSubArch_spe

Definition Triple.h:163

LLVM_ABI bool getMacOSXVersion(VersionTuple &Version) const

Parse the version number as with getOSVersion and then translate generic "darwin" versions to the cor...

bool isSPARC64() const

Tests whether the target is 64-bit SPARC (big endian).

Definition Triple.h:1115

bool isWindowsCygwinEnvironment() const

Definition Triple.h:724

static LLVM_ABI bool isValidVersionForOS(OSType OSKind, const VersionTuple &Version)

Returns whether an OS version is invalid and would not map to an Apple OS.

Triple(StringRef Str)

Definition Triple.h:362

bool isMacOSX() const

Is this a Mac OS X triple.

Definition Triple.h:582

Triple(const std::string &Str)

Definition Triple.h:364

bool isOSFreeBSD() const

Definition Triple.h:654

bool isXROS() const

Is this an Apple XROS triple.

Definition Triple.h:610

LLVM_ABI void setEnvironmentName(StringRef Str)

Set the optional environment (fourth) component of the triple by name.

LLVM_ABI void setOS(OSType Kind)

Set the operating system (third) component of the triple to a known type.

bool isX86_32() const

Tests whether the target is x86 (32-bit).

Definition Triple.h:1131

LLVM_ABI void setOSName(StringRef Str)

Set the operating system (third) component of the triple by name.

VendorType getVendor() const

Get the parsed vendor type of this triple.

Definition Triple.h:419

bool isSPARC() const

Tests whether the target is SPARC.

Definition Triple.h:1118

bool isPPC64() const

Tests whether the target is 64-bit PowerPC (little and big endian).

Definition Triple.h:1075

bool isOSDarwin() const

Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, DriverKit, XROS, or bridgeOS).

Definition Triple.h:627

bool hasDLLImportExport() const

Tests if the environment supports dllimport/export annotations.

Definition Triple.h:1215

bool isSPIRVLogical() const

Tests whether the target is SPIR-V Logical.

Definition Triple.h:917

static LLVM_ABI StringRef getEnvironmentTypeName(EnvironmentType Kind)

Get the canonical name for the Kind environment.

bool isOSVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const

Helper function for doing comparisons against version numbers included in the target triple.

Definition Triple.h:546

bool isTvOS() const

Is this an Apple tvOS triple.

Definition Triple.h:596

bool isOSEmscripten() const

Tests whether the OS is Emscripten.

Definition Triple.h:764

bool isWindowsArm64EC() const

Definition Triple.h:711

bool isOSVersionGE(unsigned Major, unsigned Minor=0, unsigned Micro=0) const

Definition Triple.h:557

bool operator==(const Triple &Other) const

Definition Triple.h:372

bool isWatchOS() const

Is this an Apple watchOS triple.

Definition Triple.h:601

bool empty() const

Whether the triple is empty / default constructed.

Definition Triple.h:485

bool isiOS() const

Is this an iOS triple.

Definition Triple.h:591

bool isMIPS() const

Tests whether the target is MIPS (little and big endian, 32- or 64-bit).

Definition Triple.h:1059

bool isMacOSXVersionGE(unsigned Major, unsigned Minor=0, unsigned Micro=0) const

Definition Triple.h:575

bool isWALI() const

Tests whether the target uses WALI Wasm.

Definition Triple.h:818

bool isOSGlibc() const

Tests whether the OS uses glibc.

Definition Triple.h:769

bool isTargetAEABI() const

Definition Triple.h:965

bool isPS() const

Tests whether the target is the PS4 or PS5 platform.

Definition Triple.h:838

bool isWasm() const

Tests whether the target is wasm (32- and 64-bit).

Definition Triple.h:1142

bool isVulkanOS() const

Definition Triple.h:886

LLVM_ABI StringRef getArchName() const

Get the architecture (first) component of the triple.

bool isOSIAMCU() const

Definition Triple.h:668

bool isOpenHOS() const

Definition Triple.h:873

bool isMacCatalystEnvironment() const

Definition Triple.h:636

bool isPS5() const

Tests whether the target is the PS5 platform.

Definition Triple.h:831

bool isSPIRV() const

Tests whether the target is SPIR-V (32/64-bit/Logical).

Definition Triple.h:908

bool isAArch64() const

Tests whether the target is AArch64 (little and big endian).

Definition Triple.h:1022

static LLVM_ABI StringRef getObjectFormatTypeName(ObjectFormatType ObjectFormat)

Get the name for the Object format.

bool isAppleMachO() const

Is this an Apple MachO triple.

Definition Triple.h:621

LLVM_ABI bool isArch16Bit() const

Test whether the architecture is 16-bit.

LLVM_ABI llvm::Triple getBigEndianArchVariant() const

Form a triple with a big endian variant of the current architecture.

LLVM_ABI VersionTuple getiOSVersion() const

Parse the version number as with getOSVersion.

bool hasDefaultEmulatedTLS() const

Tests whether the target uses emulated TLS as default.

Definition Triple.h:1199

bool isSystemZ() const

Tests whether the target is SystemZ.

Definition Triple.h:1121

LLVM_ABI StringRef getEnvironmentVersionString() const

Get the version component of the environment component as a single string (the version after the envi...

bool isPPC32SecurePlt() const

Tests whether the target 32-bit PowerPC uses Secure PLT.

Definition Triple.h:1088

bool isTime64ABI() const

Tests if the target forces 64-bit time_t on a 32-bit architecture.

Definition Triple.h:1175

LLVM_ABI bool isArch32Bit() const

Test whether the architecture is 32-bit.

bool operator!=(const Triple &Other) const

Definition Triple.h:379

unsigned getOSMajorVersion() const

Return just the major version number, this is specialized because it is a common query.

Definition Triple.h:449

LLVM_ABI bool isCompatibleWith(const Triple &Other) const

Test whether target triples are compatible.

bool isOSFuchsia() const

Definition Triple.h:658

bool isOSBinFormatELF() const

Tests whether the OS uses the ELF binary format.

Definition Triple.h:785

bool isWindowsMSVCEnvironment() const

Checks if the environment could be MSVC.

Definition Triple.h:705

bool hasEnvironment() const

Does this triple have the optional environment (fourth) component?

Definition Triple.h:425

bool isKnownWindowsMSVCEnvironment() const

Checks if the environment is MSVC.

Definition Triple.h:700

static LLVM_ABI StringRef getArchTypePrefix(ArchType Kind)

Get the "prefix" canonical name for the Kind architecture.

bool isOSHaiku() const

Tests whether the OS is Haiku.

Definition Triple.h:685

LLVM_ABI void setArch(ArchType Kind, SubArchType SubArch=NoSubArch)

Set the architecture (first) component of the triple to a known type.

bool isDXIL() const

Tests whether the target is DXIL.

Definition Triple.h:878

LLVM_ABI void setVendor(VendorType Kind)

Set the vendor (second) component of the triple to a known type.

bool isGNUEnvironment() const

Definition Triple.h:674

bool isLoongArch() const

Tests whether the target is LoongArch (32- and 64-bit).

Definition Triple.h:1046

bool isShaderStageEnvironment() const

Definition Triple.h:890

bool isWindowsItaniumEnvironment() const

Definition Triple.h:720

bool isVE() const

Tests whether the target is VE.

Definition Triple.h:1137

Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...

Represents a version number in the form major[.minor[.subminor[.build]]].

unsigned getMajor() const

Retrieve the major version number.

This is an optimization pass for GlobalISel generic memory operations.

FunctionAddr VTableAddr uintptr_t uintptr_t Version

FunctionAddr VTableAddr uintptr_t uintptr_t Data

Implement std::hash so that hash_code can be used in STL containers.