clang: lib/CodeGen/CodeGenFunction.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENFUNCTION_H

14#define LLVM_CLANG_LIB_CODEGEN_CODEGENFUNCTION_H

15

37#include "llvm/ADT/ArrayRef.h"

38#include "llvm/ADT/DenseMap.h"

39#include "llvm/ADT/MapVector.h"

40#include "llvm/ADT/SmallVector.h"

41#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"

42#include "llvm/IR/Instructions.h"

43#include "llvm/IR/ValueHandle.h"

44#include "llvm/Support/Debug.h"

45#include "llvm/Transforms/Utils/SanitizerStats.h"

46#include

47

48namespace llvm {

49class BasicBlock;

50class ConvergenceControlInst;

51class LLVMContext;

52class MDNode;

53class SwitchInst;

54class Twine;

56class CanonicalLoopInfo;

57}

58

85class OMPExecutableDirective;

86

89}

90

105

106

107

108

109

110

111

117

118

119

120

122 typedef llvm::PointerIntPair<llvm::Value *, 1, bool> saved_type;

123

124

126 if (!value)

127 return false;

128

129

131 return false;

132

133

135 return (block != &block->getParent()->getEntryBlock());

136 }

137

140};

141

142

143

150

151

154

162

166 return true;

167 return false;

168 }

179};

180

181

184 class saved_type {

185 enum Kind {

186 ScalarLiteral,

187 ScalarAddress,

188 AggregateLiteral,

189 AggregateAddress,

190 ComplexAddress

191 };

192 union {

193 struct {

197 };

198 LLVM_PREFERRED_TYPE(Kind)

199 unsigned K : 3;

200

203

206 : Vals{Val1, Val2}, K(ComplexAddress) {}

207

209 : AggregateAddr(AggregateAddr), K(K) {}

210

211 public:

215

216

217 };

218

219 static bool needsSaving(type value) { return saved_type::needsSaving(value); }

221 return saved_type::save(CGF, value);

222 }

224 return value.restore(CGF);

225 }

226};

227

228

229

230

231

232

233class ApplyAtomGroup {

234 uint64_t OriginalAtom = 0;

236

237 ApplyAtomGroup(const ApplyAtomGroup &) = delete;

238 void operator=(const ApplyAtomGroup &) = delete;

239

240public:

243};

244

245

246

248 CodeGenFunction(const CodeGenFunction &) = delete;

249 void operator=(const CodeGenFunction &) = delete;

250

252

253public:

254

255

259 unsigned Index)

260 : Block(Block), ScopeDepth(Depth), Index(Index) {}

261

262 bool isValid() const { return Block != nullptr; }

263 llvm::BasicBlock *getBlock() const { return Block; }

266

267

269 ScopeDepth = depth;

270 }

271

272 private:

273 llvm::BasicBlock *Block;

275 unsigned Index;

276 };

277

280

281

283

284 typedef std::pair<llvm::Value *, llvm::Value *> ComplexPairTy;

287

288

289

291

292

293

294

295

296

297

298

299

300

301

302

303

305

306

308

309

311

312

313

315

316

317 typedef llvm::function_ref<void(CodeGenFunction &, const OMPLoopDirective &,

320 typedef llvm::function_ref<void(CodeGenFunction &, SourceLocation,

321 const unsigned, const bool)>

323

324

325 typedef llvm::function_ref<std::pair<LValue, LValue>(

328

329

330 typedef llvm::function_ref<std::pair<llvm::Value *, llvm::Value *>(

334

335

336

337 void InsertHelper(llvm::Instruction *I, const llvm::Twine &Name,

338 llvm::BasicBlock::iterator InsertPt) const;

339

340

341

343

347 llvm::Function *CurFn = nullptr;

348

349

350

352

353

355

356

357

358

360 std::unique_ptr Data;

364 };

366

368

372

373

374

375

380

381

382

383

384

385

386

387

389 Twine const &SuspendPointName,

391

392

394

395

396

398

399

401

402

403

405

406

407

409

410

411

413

414

416 if (CurLexicalScope)

417 return CurLexicalScope->hasLabels();

418 return !LabelMap.empty();

419 }

420

421

422

424

425private:

426

427

428

429

430

431

432

433

434 llvm::AssertingVHllvm::Instruction PostAllocaInsertPt = nullptr;

435

436public:

437

438

440 if (!PostAllocaInsertPt) {

442 "Expected static alloca insertion point at function prologue");

443 assert(AllocaInsertPt->getParent()->isEntryBlock() &&

444 "EBB should be entry block of the current code gen function");

446 PostAllocaInsertPt->setName("postallocapt");

447 PostAllocaInsertPt->insertAfter(AllocaInsertPt->getIterator());

448 }

449

450 return PostAllocaInsertPt;

451 }

452

453

455 public:

460 : Kind(K), ThisValue(nullptr), CXXThisFieldDecl(nullptr) {

461

466 I != E; ++I, ++Field) {

467 if (I->capturesThis())

468 CXXThisFieldDecl = *Field;

469 else if (I->capturesVariable())

470 CaptureFields[I->getCapturedVar()->getCanonicalDecl()] = *Field;

471 else if (I->capturesVariableByCopy())

472 CaptureFields[I->getCapturedVar()->getCanonicalDecl()] = *Field;

473 }

474 }

475

477

479

481

483

484

488

491

493

494

499

500

501 virtual StringRef getHelperName() const { return "__captured_stmt"; }

502

503

505 return CaptureFields;

506 }

507

508 private:

509

511

512

513 llvm::SmallDenseMap<const VarDecl *, FieldDecl *> CaptureFields;

514

515

516

517 llvm::Value *ThisValue;

518

519

521 };

523

524

526 private:

527 CodeGenFunction &CGF;

529

530 public:

534 CGF.CapturedStmtInfo = NewCapturedStmtInfo;

535 }

537 };

538

539

541

542 const Decl *CalleeDecl;

543

544 public:

549 return isa_and_nonnull(CalleeDecl);

550 }

553 if (const auto *FD = dyn_cast(CalleeDecl))

554 return FD->getNumParams();

556 }

558 if (const auto *FD = dyn_cast(CalleeDecl))

559 return FD->getParamDecl(I);

561 }

562 };

563

564

566

567

569

570

572 CodeGenFunction *CGF;

573

574 public:

577 };

578

579

580

582

583

585

586

587

589

591

592

593

595

596

597

599

600

602

603

605

606

608

609

611

612

614 HLSLControlFlowHintAttr::SpellingNotCalculated;

615

616

617

619

620

621

623 if (CGM.getCodeGenOpts().getFiniteLoops() ==

625 return false;

626

627

628

629

630

631

632

633

634

636 }

637

638

639

640

642

645

648

649

650

651 llvm::DenseMap<const VarDecl *, llvm::Value *> NRVOFlags;

652

655

656

657

658

659

660

661

662

663

669

670

671

673 CodeGenFunction &CGF;

680

682 assert(Deactivated && "Deactivating already deactivated scope");

683 auto &Stack = CGF.DeferredDeactivationCleanupStack;

685 CGF.DeactivateCleanupBlock(Stack[I - 1].Cleanup,

686 Stack[I - 1].DominatingIP);

687 Stack[I - 1].DominatingIP->eraseFromParent();

688 }

691 }

692

698 };

699

701

703

705 bool isRedundantBeforeReturn() override { return true; }

706

707 llvm::Value *Addr;

708

709 public:

711

712 void Emit(CodeGenFunction &CGF, Flags flags) override {

714 }

715 };

716

717

718

719

720 class FakeUse final : public EHScopeStack::Cleanup {

722

723 public:

725

726 void Emit(CodeGenFunction &CGF, Flags flags) override {

728 }

729 };

730

731

733

735

738

739 LLVM_PREFERRED_TYPE(bool)

741

745 };

746

747

749

751

752

754

755

756

758

759

760

762

763

764

765

767

768

770

771

773

775

776

783

784

786 CodeGenFunction &CGF;

788

789 public:

791 CodeGenFunction &CGF,

793 : CGF(CGF),

795 CGF.OMPParentLoopDirectiveForScan = &ParentLoopDirectiveForScan;

796 }

798 CGF.OMPParentLoopDirectiveForScan = ParentLoopDirectiveForScan;

799 }

800 };

801

802 template

806

808 public:

812

813 private:

814 void ConstructorHelper(FPOptions FPFeatures);

815 CodeGenFunction &CGF;

817 llvm::fp::ExceptionBehavior OldExcept;

818 llvm::RoundingMode OldRounding;

819 std::optionalCGBuilderTy::FastMathFlagGuard FMFGuard;

820 };

822

824 public:

826 : CGM(CGM_), SavedAtomicOpts(CGM.getAtomicOpts()) {

827 CGM.setAtomicOpts(AO);

828 }

830 : CGM(CGM_), SavedAtomicOpts(CGM.getAtomicOpts()) {

831 if (!AA)

832 return;

834 for (auto Option : AA->atomicOptions()) {

835 switch (Option) {

836 case AtomicAttr::remote_memory:

837 AO.remote_memory = true;

838 break;

839 case AtomicAttr::no_remote_memory:

840 AO.remote_memory = false;

841 break;

842 case AtomicAttr::fine_grained_memory:

843 AO.fine_grained_memory = true;

844 break;

845 case AtomicAttr::no_fine_grained_memory:

846 AO.fine_grained_memory = false;

847 break;

848 case AtomicAttr::ignore_denormal_mode:

849 AO.ignore_denormal_mode = true;

850 break;

851 case AtomicAttr::no_ignore_denormal_mode:

852 AO.ignore_denormal_mode = false;

853 break;

854 }

855 }

856 CGM.setAtomicOpts(AO);

857 }

858

862

863 private:

866 };

867

868public:

869

870

872

873

875

877

878

879 llvm::FunctionCallee BeginCatchFn;

880

881

882

883 llvm::AllocaInst *ForEHVar = nullptr;

884

885

886

887 llvm::AllocaInst *SavedExnVar = nullptr;

888

889 public:

890 void enter(CodeGenFunction &CGF, const Stmt *Finally,

891 llvm::FunctionCallee beginCatchFn,

892 llvm::FunctionCallee endCatchFn, llvm::FunctionCallee rethrowFn);

893 void exit(CodeGenFunction &CGF);

894 };

895

896

898

899

903

904

905

906

907 template <class T, class... As>

909

910

912 return EHStack.pushCleanup<T>(kind, A...);

913

914

915 typedef std::tuple<typename DominatingValue::saved_type...> SavedTuple;

917

919 EHStack.pushCleanupTuple(kind, Saved);

921 }

922

923

924

925 template <class T, class... As>

930

933 "cleanup active flag should never need saving");

934

935 typedef std::tuple<typename DominatingValue::saved_type...> SavedTuple;

937

940 Saved);

941 }

942

943 template <class T, class... As>

948

952 (Header.IsConditional ? sizeof(ActiveFlag) : 0));

953

956 "Cleanup will be allocated on misaligned address");

959 new (Buffer + sizeof(Header)) T(A...);

961 new (Buffer + sizeof(Header) + sizeof(T)) RawAddress(ActiveFlag);

962 }

963

964

965

966

967 template <class T, class... As>

969

970 llvm::Instruction *DominatingIP =

971 Builder.CreateFlagLoad(llvm::Constant::getNullValue(Int8PtrTy));

972 EHStack.pushCleanup<T>(Kind, A...);

974 {EHStack.stable_begin(), DominatingIP});

975 }

976

977

978

982

985

986

987

988

989

991

992

993

994

997

998

999

1000 void PopCleanupBlock(bool FallThroughIsBranchThrough = false,

1002

1003

1004

1005

1006

1007

1008

1009

1010

1012 llvm::Instruction *DominatingIP);

1013

1014

1015

1016

1017

1018

1019

1020

1022 llvm::Instruction *DominatingIP);

1023

1024

1025

1026 class RunCleanupsScope {

1028 size_t LifetimeExtendedCleanupStackSize;

1030 bool OldDidCallStackSave;

1031

1032 protected:

1034

1035 private:

1036 RunCleanupsScope(const RunCleanupsScope &) = delete;

1037 void operator=(const RunCleanupsScope &) = delete;

1038

1039 protected:

1041

1042 public:

1043

1046 CleanupStackDepth = CGF.EHStack.stable_begin();

1047 LifetimeExtendedCleanupStackSize =

1048 CGF.LifetimeExtendedCleanupStack.size();

1049 OldDidCallStackSave = CGF.DidCallStackSave;

1050 CGF.DidCallStackSave = false;

1051 OldCleanupScopeDepth = CGF.CurrentCleanupScopeDepth;

1052 CGF.CurrentCleanupScopeDepth = CleanupStackDepth;

1053 }

1054

1055

1060

1061

1063 return CGF.EHStack.stable_begin() != CleanupStackDepth;

1064 }

1065

1066

1067

1068

1069

1070

1071

1072 void

1073 ForceCleanup(std::initializer_list<llvm::Value **> ValuesToReload = {}) {

1075 CGF.DidCallStackSave = OldDidCallStackSave;

1077 CGF.PopCleanupBlocks(CleanupStackDepth, LifetimeExtendedCleanupStackSize,

1078 ValuesToReload);

1081 }

1082 };

1083

1084

1087

1088 class LexicalScope : public RunCleanupsScope {

1091 LexicalScope *ParentScope;

1092

1093 LexicalScope(const LexicalScope &) = delete;

1094 void operator=(const LexicalScope &) = delete;

1095

1096 public:

1097

1098 explicit LexicalScope(CodeGenFunction &CGF, SourceRange Range);

1099

1101 assert(PerformCleanup && "adding label to dead scope?");

1102 Labels.push_back(label);

1103 }

1104

1105

1106

1108

1109

1110

1112 CGF.CurLexicalScope = ParentScope;

1114

1115 if (!Labels.empty())

1117 }

1118

1119 bool hasLabels() const { return !Labels.empty(); }

1120

1122 };

1123

1124 typedef llvm::DenseMap<const Decl *, Address> DeclMapTy;

1125

1126

1127 class OMPMapVars {

1130 OMPMapVars(const OMPMapVars &) = delete;

1131 void operator=(const OMPMapVars &) = delete;

1132

1133 public:

1136 assert(SavedLocals.empty() && "Did not restored original addresses.");

1137 };

1138

1139

1140

1141

1145

1146 if (SavedLocals.count(LocalVD))

1147 return false;

1148

1149

1150 auto it = CGF.LocalDeclMap.find(LocalVD);

1151 if (it != CGF.LocalDeclMap.end())

1152 SavedLocals.try_emplace(LocalVD, it->second);

1153 else

1155

1156

1161 TempAddr = Temp;

1162 }

1163 SavedTempAddresses.try_emplace(LocalVD, TempAddr);

1164

1165 return true;

1166 }

1167

1168

1169

1170

1171 bool apply(CodeGenFunction &CGF) {

1172 copyInto(SavedTempAddresses, CGF.LocalDeclMap);

1173 SavedTempAddresses.clear();

1174 return !SavedLocals.empty();

1175 }

1176

1177

1179 if (!SavedLocals.empty()) {

1180 copyInto(SavedLocals, CGF.LocalDeclMap);

1181 SavedLocals.clear();

1182 }

1183 }

1184

1185 private:

1186

1187

1189 for (auto &[Decl, Addr] : Src) {

1190 if (Addr.isValid())

1191 Dest.erase(Decl);

1192 else

1193 Dest.insert_or_assign(Decl, Addr);

1194 }

1195 }

1196 };

1197

1198

1199

1200

1201 class OMPPrivateScope : public RunCleanupsScope {

1203 OMPPrivateScope(const OMPPrivateScope &) = delete;

1204 void operator=(const OMPPrivateScope &) = delete;

1205

1206 public:

1207

1209

1210

1211

1212

1213

1214

1216 assert(PerformCleanup && "adding private to dead scope");

1217 return MappedVars.setVarAddr(CGF, LocalVD, Addr);

1218 }

1219

1220

1221

1222

1223

1224

1225

1226

1227

1229

1234

1235

1240

1241

1246

1247

1248

1249

1251 };

1252

1253

1254

1255

1257 CodeGenFunction &CGF;

1259

1260 public:

1262 : CGF(CGF), SavedMap(CGF.LocalDeclMap) {}

1264 };

1265

1266

1267

1268 void

1270 std::initializer_list<llvm::Value **> ValuesToReload = {});

1271

1272

1273

1274

1275 void

1276 PopCleanupBlocks(EHScopeStack::stable_iterator OldCleanupStackSize,

1277 size_t OldLifetimeExtendedStackSize,

1278 std::initializer_list<llvm::Value **> ValuesToReload = {});

1279

1281

1282

1283

1284

1289

1290

1291

1292

1296

1297

1298

1299

1301

1302

1303

1304

1306

1307

1308

1309

1311

1314 llvm::BasicBlock *

1316

1317

1319 llvm::BasicBlock *StartBB;

1320

1321 public:

1323 : StartBB(CGF.Builder.GetInsertBlock()) {}

1324

1325 void begin(CodeGenFunction &CGF) {

1326 assert(CGF.OutermostConditional != this);

1327 if (!CGF.OutermostConditional)

1328 CGF.OutermostConditional = this;

1329 }

1330

1331 void end(CodeGenFunction &CGF) {

1332 assert(CGF.OutermostConditional != nullptr);

1333 if (CGF.OutermostConditional == this)

1334 CGF.OutermostConditional = nullptr;

1335 }

1336

1337

1338

1340 };

1341

1342

1343

1345

1347 CodeGenFunction &CGF) {

1349 llvm::BasicBlock *block = OutermostConditional->getStartingBlock();

1350 auto store = new llvm::StoreInst(value, addr.emitRawPointer(CGF),

1351 block->back().getIterator());

1353 }

1354

1355

1356

1358 CodeGenFunction &CGF;

1359

1360

1361

1362

1364

1365 public:

1367 : CGF(CGF), SavedOutermostConditional(CGF.OutermostConditional) {

1368 CGF.OutermostConditional = nullptr;

1369 }

1370

1372 CGF.OutermostConditional = SavedOutermostConditional;

1373 CGF.EnsureInsertPoint();

1374 }

1375 };

1376

1377

1378

1379

1381 llvm::Instruction *Inst = nullptr;

1383

1384 public:

1386 };

1387

1388

1389

1390

1391

1392

1393

1394 class OpaqueValueMappingData {

1396 bool BoundLValue;

1398

1400 : OpaqueValue(ov), BoundLValue(boundLValue) {}

1401

1402 public:

1404

1406

1407

1408

1409

1410

1411 return expr->isGLValue() || expr->getType()->isFunctionType() ||

1413 }

1414

1421

1425 CGF.OpaqueLValues.insert(std::make_pair(ov, lv));

1427 }

1428

1432 CGF.OpaqueRValues.insert(std::make_pair(ov, rv));

1433

1434 OpaqueValueMappingData data(ov, false);

1435

1436

1437

1438

1440

1441 return data;

1442 }

1443

1444 bool isValid() const { return OpaqueValue != nullptr; }

1445 void clear() { OpaqueValue = nullptr; }

1446

1448 assert(OpaqueValue && "no data to unbind!");

1449

1450 if (BoundLValue) {

1451 CGF.OpaqueLValues.erase(OpaqueValue);

1452 } else {

1453 CGF.OpaqueRValues.erase(OpaqueValue);

1455 }

1456 }

1457 };

1458

1459

1461 CodeGenFunction &CGF;

1463

1464 public:

1468

1469

1470

1471

1472

1473

1476 : CGF(CGF) {

1478

1479 return;

1480

1484 }

1485

1486

1487

1489 : CGF(CGF) {

1490 if (OV) {

1491 assert(OV->getSourceExpr() && "wrong form of OpaqueValueMapping used "

1492 "for OVE with no source expression");

1494 }

1495 }

1496

1501

1506

1508 Data.unbind(CGF);

1509 Data.clear();

1510 }

1511

1513 if (Data.isValid())

1514 Data.unbind(CGF);

1515 }

1516 };

1517

1518private:

1520

1521 unsigned VLAExprCounter = 0;

1522 bool DisableDebugInfo = false;

1523

1524

1525

1526 bool DidCallStackSave = false;

1527

1528

1529

1530

1531

1532 llvm::IndirectBrInst *IndirectBranch = nullptr;

1533

1534

1535

1537

1538

1539

1540 llvm::DenseMap<const ParmVarDecl *, EHScopeStack::stable_iterator>

1541 CalleeDestructedParamCleanups;

1542

1543

1544

1545

1546 llvm::SmallDenseMap<const ParmVarDecl *, const ImplicitParamDecl *, 2>

1547 SizeArguments;

1548

1549

1550

1551 llvm::DenseMap<llvm::AllocaInst *, int> EscapedLocals;

1552

1553

1554 llvm::DenseMap<const LabelDecl *, JumpDest> LabelMap;

1555

1556

1557

1558 struct BreakContinue {

1559 BreakContinue(const Stmt &LoopOrSwitch, JumpDest Break, JumpDest Continue)

1560 : LoopOrSwitch(&LoopOrSwitch), BreakBlock(Break),

1561 ContinueBlock(Continue) {}

1562

1563 const Stmt *LoopOrSwitch;

1564 JumpDest BreakBlock;

1565 JumpDest ContinueBlock;

1566 };

1568

1569

1570 class OpenMPCancelExitStack {

1571

1572

1573 struct CancelExit {

1574 CancelExit() = default;

1575 CancelExit(OpenMPDirectiveKind Kind, JumpDest ExitBlock,

1576 JumpDest ContBlock)

1577 : Kind(Kind), ExitBlock(ExitBlock), ContBlock(ContBlock) {}

1579

1580

1581 bool HasBeenEmitted = false;

1582 JumpDest ExitBlock;

1583 JumpDest ContBlock;

1584 };

1585

1586 SmallVector<CancelExit, 8> Stack;

1587

1588 public:

1589 OpenMPCancelExitStack() : Stack(1) {}

1590 ~OpenMPCancelExitStack() = default;

1591

1592 JumpDest getExitBlock() const { return Stack.back().ExitBlock; }

1593

1594

1596 const llvm::function_ref<void(CodeGenFunction &)> CodeGen) {

1597 if (Stack.back().Kind == Kind && getExitBlock().isValid()) {

1598 assert(CGF.getOMPCancelDestination(Kind).isValid());

1599 assert(CGF.HaveInsertPoint());

1600 assert(!Stack.back().HasBeenEmitted);

1601 auto IP = CGF.Builder.saveAndClearIP();

1602 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());

1603 CodeGen(CGF);

1604 CGF.EmitBranch(Stack.back().ContBlock.getBlock());

1605 CGF.Builder.restoreIP(IP);

1606 Stack.back().HasBeenEmitted = true;

1607 }

1608 CodeGen(CGF);

1609 }

1610

1611

1612

1613

1614 void enter(CodeGenFunction &CGF, OpenMPDirectiveKind Kind, bool HasCancel) {

1615 Stack.push_back({Kind,

1616 HasCancel ? CGF.getJumpDestInCurrentScope("cancel.exit")

1617 : JumpDest(),

1618 HasCancel ? CGF.getJumpDestInCurrentScope("cancel.cont")

1619 : JumpDest()});

1620 }

1621

1622

1623 void exit(CodeGenFunction &CGF) {

1624 if (getExitBlock().isValid()) {

1625 assert(CGF.getOMPCancelDestination(Stack.back().Kind).isValid());

1626 bool HaveIP = CGF.HaveInsertPoint();

1627 if (!Stack.back().HasBeenEmitted) {

1628 if (HaveIP)

1629 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);

1630 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());

1631 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);

1632 }

1633 CGF.EmitBlock(Stack.back().ContBlock.getBlock());

1634 if (!HaveIP) {

1635 CGF.Builder.CreateUnreachable();

1636 CGF.Builder.ClearInsertionPoint();

1637 }

1638 }

1639 Stack.pop_back();

1640 }

1641 };

1642 OpenMPCancelExitStack OMPCancelStack;

1643

1644

1645 llvm::Value *emitCondLikelihoodViaExpectIntrinsic(llvm::Value *Cond,

1647

1648 std::unique_ptr PGO;

1649

1650

1652

1653

1654 llvm::MDNode *createProfileWeights(uint64_t TrueCount,

1655 uint64_t FalseCount) const;

1656 llvm::MDNode *createProfileWeights(ArrayRef<uint64_t> Weights) const;

1657 llvm::MDNode *createProfileWeightsForLoop(const Stmt *Cond,

1658 uint64_t LoopCount) const;

1659

1660public:

1661 std::pair<bool, bool> getIsCounterPair(const Stmt *S) const;

1664

1665

1666

1668

1670 return (CGM.getCodeGenOpts().hasProfileClangInstr() &&

1671 CGM.getCodeGenOpts().MCDCCoverage &&

1672 CurFn->hasFnAttribute(llvm::Attribute::NoProfile));

1673 }

1674

1675

1676

1678

1683

1684

1686

1687

1688

1690

1691

1693

1694

1696

1697

1699

1700

1701

1703

1704

1706 llvm::Value *Backup);

1707

1708

1710 llvm::Value *Backup, uint64_t Atom);

1711

1712

1713

1715 llvm::Value *Backup);

1716

1717private:

1718

1719

1720 llvm::SwitchInst *SwitchInsn = nullptr;

1721

1723

1724

1726

1727

1728

1729 llvm::BasicBlock *CaseRangeBlock = nullptr;

1730

1731

1732

1733 llvm::DenseMap<const OpaqueValueExpr *, LValue> OpaqueLValues;

1734 llvm::DenseMap<const OpaqueValueExpr *, RValue> OpaqueRValues;

1735

1736

1737

1738

1739

1740

1741

1742 llvm::DenseMap<const Expr *, llvm::Value *> VLASizeMap;

1743

1744

1745

1746 llvm::BasicBlock *UnreachableBlock = nullptr;

1747

1748

1749 unsigned NumReturnExprs = 0;

1750

1751

1752 unsigned NumSimpleReturnExprs = 0;

1753

1754

1756

1757public:

1758

1759

1763

1764

1765

1766

1768 public:

1770 : CGF(CGF), OldCXXDefaultInitExprThis(CGF.CXXDefaultInitExprThis) {

1771 CGF.CXXDefaultInitExprThis = This;

1772 }

1774 CGF.CXXDefaultInitExprThis = OldCXXDefaultInitExprThis;

1775 }

1776

1777 private:

1778 CodeGenFunction &CGF;

1779 Address OldCXXDefaultInitExprThis;

1780 };

1781

1782

1783

1785 public:

1790 CGF.CXXThisValue = CGF.CXXDefaultInitExprThis.getBasePointer();

1791 CGF.CXXThisAlignment = CGF.CXXDefaultInitExprThis.getAlignment();

1792 }

1797

1798 public:

1803 };

1804

1809

1810

1811

1813 public:

1815 : CGF(CGF), OldArrayInitIndex(CGF.ArrayInitIndex) {

1816 CGF.ArrayInitIndex = Index;

1817 }

1819

1820 private:

1821 CodeGenFunction &CGF;

1822 llvm::Value *OldArrayInitIndex;

1823 };

1824

1826 public:

1828 : CGF(CGF), OldCurGD(CGF.CurGD), OldCurFuncDecl(CGF.CurFuncDecl),

1830 OldCXXABIThisDecl(CGF.CXXABIThisDecl),

1831 OldCXXABIThisValue(CGF.CXXABIThisValue),

1832 OldCXXThisValue(CGF.CXXThisValue),

1833 OldCXXABIThisAlignment(CGF.CXXABIThisAlignment),

1834 OldCXXThisAlignment(CGF.CXXThisAlignment),

1836 OldCXXInheritedCtorInitExprArgs(

1837 std::move(CGF.CXXInheritedCtorInitExprArgs)) {

1838 CGF.CurGD = GD;

1839 CGF.CurFuncDecl = CGF.CurCodeDecl =

1841 CGF.CXXABIThisDecl = nullptr;

1842 CGF.CXXABIThisValue = nullptr;

1843 CGF.CXXThisValue = nullptr;

1844 CGF.CXXABIThisAlignment = CharUnits();

1845 CGF.CXXThisAlignment = CharUnits();

1848 CGF.CXXInheritedCtorInitExprArgs.clear();

1849 }

1851 CGF.CurGD = OldCurGD;

1852 CGF.CurFuncDecl = OldCurFuncDecl;

1853 CGF.CurCodeDecl = OldCurCodeDecl;

1854 CGF.CXXABIThisDecl = OldCXXABIThisDecl;

1855 CGF.CXXABIThisValue = OldCXXABIThisValue;

1856 CGF.CXXThisValue = OldCXXThisValue;

1857 CGF.CXXABIThisAlignment = OldCXXABIThisAlignment;

1858 CGF.CXXThisAlignment = OldCXXThisAlignment;

1859 CGF.ReturnValue = OldReturnValue;

1860 CGF.FnRetTy = OldFnRetTy;

1861 CGF.CXXInheritedCtorInitExprArgs =

1862 std::move(OldCXXInheritedCtorInitExprArgs);

1863 }

1864

1865 private:

1866 CodeGenFunction &CGF;

1868 const Decl *OldCurFuncDecl;

1869 const Decl *OldCurCodeDecl;

1871 llvm::Value *OldCXXABIThisValue;

1872 llvm::Value *OldCXXThisValue;

1873 CharUnits OldCXXABIThisAlignment;

1877 CallArgList OldCXXInheritedCtorInitExprArgs;

1878 };

1879

1880

1881

1882

1883

1884

1885

1886

1887

1888

1889

1890

1892

1896

1898

1899

1901

1902 private:

1903 llvm::CallInst *RTLFnCI;

1904

1905 public:

1907 RLFnCI->removeFromParent();

1908 }

1909

1910 void Emit(CodeGenFunction &CGF, Flags ) override {

1912 return;

1913 CGF.Builder.Insert(RTLFnCI);

1914 }

1915 };

1916

1917

1918

1919

1920

1921

1922

1926

1927

1930

1931

1932

1933

1934

1935

1937 StringRef FirstSeparator = ".",

1938 StringRef Separator = ".");

1939

1940

1941

1943 CGBuilderTy::InsertPointGuard IPG(CGF.Builder);

1944 assert(IP.getBlock()->end() != IP.getPoint() &&

1945 "OpenMP IR Builder should cause terminated block!");

1946

1947 llvm::BasicBlock *IPBB = IP.getBlock();

1948 llvm::BasicBlock *DestBB = IPBB->getUniqueSuccessor();

1949 assert(DestBB && "Finalization block should have one successor!");

1950

1951

1952 IPBB->getTerminator()->eraseFromParent();

1953 CGF.Builder.SetInsertPoint(IPBB);

1956 }

1957

1958

1959

1960

1961

1962

1963

1964

1966 const Stmt *RegionBodyStmt,

1969 Twine RegionName);

1970

1972 llvm::BasicBlock &FiniBB, llvm::Function *Fn,

1974 llvm::BasicBlock *CodeGenIPBB = CodeGenIP.getBlock();

1975 if (llvm::Instruction *CodeGenIPBBTI = CodeGenIPBB->getTerminator())

1976 CodeGenIPBBTI->eraseFromParent();

1977

1978 CGF.Builder.SetInsertPoint(CodeGenIPBB);

1979

1980 if (Fn->doesNotThrow())

1982 else

1984

1985 if (CGF.Builder.saveIP().isSet())

1986 CGF.Builder.CreateBr(&FiniBB);

1987 }

1988

1989

1990

1991

1992

1993

1994

1995

1996

1998 const Stmt *RegionBodyStmt,

2001 Twine RegionName);

2002

2003

2005

2006 llvm::AssertingVHllvm::Instruction OldAllocaIP;

2008 CodeGenFunction &CGF;

2009

2010 public:

2012 llvm::BasicBlock &RetBB)

2013 : CGF(cgf) {

2014 assert(AllocaIP.isSet() &&

2015 "Must specify Insertion point for allocas of outlined function");

2016 OldAllocaIP = CGF.AllocaInsertPt;

2017 CGF.AllocaInsertPt = &*AllocaIP.getPoint();

2018

2019 OldReturnBlock = CGF.ReturnBlock;

2020 CGF.ReturnBlock = CGF.getJumpDestInCurrentScope(&RetBB);

2021 }

2022

2024 CGF.AllocaInsertPt = OldAllocaIP;

2025 CGF.ReturnBlock = OldReturnBlock;

2026 }

2027 };

2028

2029

2031

2032 llvm::AssertingVHllvm::Instruction OldAllocaIP;

2033 CodeGenFunction &CGF;

2034

2035 public:

2037 llvm::BasicBlock &FiniBB)

2038 : CGF(cgf) {

2039

2040

2041

2042

2043 assert((!AllocaIP.isSet() ||

2044 CGF.AllocaInsertPt->getParent() == AllocaIP.getBlock()) &&

2045 "Insertion point should be in the entry block of containing "

2046 "function!");

2047 OldAllocaIP = CGF.AllocaInsertPt;

2048 if (AllocaIP.isSet())

2049 CGF.AllocaInsertPt = &*AllocaIP.getPoint();

2050

2051

2052

2053

2054

2055

2056 (void)CGF.getJumpDestInCurrentScope(&FiniBB);

2057 }

2058

2060 };

2061 };

2062

2063private:

2064

2065

2067 llvm::Value *CXXABIThisValue = nullptr;

2068 llvm::Value *CXXThisValue = nullptr;

2071

2072

2073

2075

2076

2077

2078 llvm::Value *ArrayInitIndex = nullptr;

2079

2080

2081

2082 CallArgList CXXInheritedCtorInitExprArgs;

2083

2084

2085

2087 llvm::Value *CXXStructorImplicitParamValue = nullptr;

2088

2089

2090

2091

2092 ConditionalEvaluation *OutermostConditional = nullptr;

2093

2094

2095 LexicalScope *CurLexicalScope = nullptr;

2096

2097

2098

2100

2101

2102

2103 llvm::DenseMap<const ValueDecl *, BlockByrefInfo> BlockByrefInfos;

2104

2105

2106

2107 llvm::Value *RetValNullabilityPrecondition = nullptr;

2108

2109

2110

2111 bool requiresReturnValueNullabilityCheck() const {

2112 return RetValNullabilityPrecondition;

2113 }

2114

2115

2116

2118

2119

2120 bool requiresReturnValueCheck() const;

2121

2124

2125 llvm::BasicBlock *TerminateLandingPad = nullptr;

2126 llvm::BasicBlock *TerminateHandler = nullptr;

2128

2129

2130 llvm::MapVector<llvm::Value *, llvm::BasicBlock *> TerminateFunclets;

2131

2132

2133

2134 unsigned LargestVectorWidth = 0;

2135

2136

2137

2138 bool ShouldEmitLifetimeMarkers;

2139

2140

2141

2142 void EmitKernelMetadata(const FunctionDecl *FD, llvm::Function *Fn);

2143

2144public:

2145 CodeGenFunction(CodeGenModule &cgm, bool suppressNewContext = false);

2147

2151 if (DisableDebugInfo)

2152 return nullptr;

2153 return DebugInfo;

2154 }

2157

2159 return CGM.getCodeGenOpts().OptimizationLevel == 0;

2160 }

2161

2163

2164

2165

2168

2169

2170

2173

2175

2177 if (!UnreachableBlock) {

2179 new llvm::UnreachableInst(getLLVMContext(), UnreachableBlock);

2180 }

2181 return UnreachableBlock;

2182 }

2183

2185 if (EHStack.requiresLandingPad())

2186 return nullptr;

2188 }

2189

2191

2195 return CGM.getTargetCodeGenInfo();

2196 }

2197

2198

2199

2200

2201

2203

2205 Address arrayEndPointer,

2210 llvm::Value *arrayEnd,

2214

2220 Destroyer *destroyer, bool useEHCleanupForArray);

2225 bool useEHCleanupForArray);

2228 bool useEHCleanupForArray);

2232 llvm::Value *CompletePtr,

2236 std::pair<llvm::Value *, llvm::Value *> AddrSizePair);

2238 bool useEHCleanupForArray);

2241 bool useEHCleanupForArray,

2245 Destroyer *destroyer, bool checkZeroLength,

2246 bool useEHCleanup);

2247

2249

2250

2251

2253 switch (kind) {

2255 return false;

2262 CGM.getCodeGenOpts().ObjCAutoRefCountExceptions;

2263 }

2264 llvm_unreachable("bad destruction kind");

2265 }

2266

2270

2271

2272

2273

2274

2276

2278

2279

2285 llvm::Constant *AtomicHelperFn);

2286

2289

2290

2291

2296 llvm::Constant *AtomicHelperFn);

2297

2298

2299

2300

2301

2302

2303

2304

2305

2307

2310 bool IsLambdaConversionToBlock,

2311 bool BuildGlobalBlock);

2312

2313

2315

2318 llvm::Constant *

2320 llvm::Constant *

2323

2326

2327 class AutoVarEmission;

2328

2330

2331

2332

2333

2334

2335

2336

2337

2338

2339

2340

2341

2342

2343

2344

2345

2346

2348 bool LoadBlockVarAddr, bool CanThrow);

2349

2351 llvm::Value *ptr);

2352

2355

2356

2357

2359 bool followForward = true);

2361 bool followForward, const llvm::Twine &name);

2362

2364

2366

2369

2370

2371

2373

2374

2375

2376

2381

2383

2389

2393 llvm::Constant *CallOpFn = nullptr);

2400 llvm::Function **ImplFn);

2406

2407

2408

2409

2410

2412

2413

2414

2416

2419

2421 const ThunkInfo *Thunk, bool IsUnprototyped);

2422

2424

2425

2427 llvm::FunctionCallee Callee);

2428

2429

2432 bool IsUnprototyped);

2433

2437

2440

2442

2443

2450

2451

2453

2455

2458

2460 CharUnits OffsetFromNearestVBase,

2461 bool BaseIsNonVirtualPrimaryBase,

2464

2466

2467

2468

2469

2475

2476

2477 llvm::Value *

2481

2491

2492

2493

2494

2497

2498

2499

2502

2503

2504

2507

2508

2509

2510

2513

2514

2515

2516

2518

2519

2521 llvm::Value *VTable,

2522 llvm::Type *VTableTy,

2523 uint64_t VTableByteOffset);

2524

2525

2526

2527

2528

2530

2531

2532

2534

2535

2536

2538

2539

2540

2542

2543

2544

2546

2547

2548

2550

2551

2552

2554

2555

2556

2557

2560

2561

2562

2563

2564

2567 uint64_t RetKeyInstructionsSourceAtom);

2568

2569

2571

2572

2574

2575

2577

2578

2580

2581

2582

2584

2585

2586

2587

2589

2593 llvm::Type *LLVMTy = nullptr);

2597

2598

2599

2601

2602

2604

2605

2607

2611

2615

2616

2618 llvm::Function *parent = nullptr,

2619 llvm::BasicBlock *before = nullptr) {

2620 return llvm::BasicBlock::Create(getLLVMContext(), name, parent, before);

2621 }

2622

2623

2624

2626

2627

2628

2629

2631

2632

2633

2634

2635

2636

2637

2638

2639

2640 void EmitBlock(llvm::BasicBlock *BB, bool IsFinished = false);

2641

2642

2643

2645

2646

2647

2648

2649

2650

2651

2652

2653

2655

2656

2657

2659

2660

2661

2662

2663

2668

2669

2670

2672

2673

2674

2675

2676

2678 llvm::BasicBlock *LHSBlock,

2679 llvm::BasicBlock *RHSBlock,

2680 llvm::BasicBlock *MergeBlock,

2682 Builder.SetInsertPoint(MergeBlock);

2683 llvm::PHINode *PtrPhi = Builder.CreatePHI(LHS.getType(), 2, "cond");

2684 PtrPhi->addIncoming(LHS.getBasePointer(), LHSBlock);

2685 PtrPhi->addIncoming(RHS.getBasePointer(), RHSBlock);

2688 return LHS;

2689 }

2690

2691

2692

2693

2694

2697 bool ForPointeeType = false, LValueBaseInfo *BaseInfo = nullptr,

2700 if (Alignment.isZero())

2701 Alignment =

2702 CGM.getNaturalTypeAlignment(T, BaseInfo, TBAAInfo, ForPointeeType);

2704 CGM.getPointerAuthInfoForPointeeType(T), nullptr,

2705 IsKnownNonNull);

2706 }

2707

2711 CGM.getTBAAAccessInfo(T));

2712 }

2713

2718

2724

2725

2726

2731 CGM.getTBAAAccessInfo(T));

2732 }

2733

2740

2741

2742

2744

2748

2749

2750

2752

2754

2763 CGM.getTBAAAccessInfo(RefTy));

2765 }

2766

2767

2768

2769

2774

2775private:

2776 struct AllocaTracker {

2777 void Add(llvm::AllocaInst *I) { Allocas.push_back(I); }

2779

2780 private:

2782 };

2783 AllocaTracker *Allocas = nullptr;

2784

2785

2786 void emitStoresForConstant(const VarDecl &D, Address Loc, bool isVolatile,

2787 llvm::Constant *constant, bool IsAutoInit);

2788

2789 void emitStoresForZeroInit(const VarDecl &D, Address Loc, bool isVolatile);

2790

2791 void emitStoresForPatternInit(const VarDecl &D, Address Loc, bool isVolatile);

2792

2793 void emitStoresForInitAfterBZero(llvm::Constant *Init, Address Loc,

2794 bool isVolatile, bool IsAutoInit);

2795

2796public:

2797

2800 : CGF(CGF), OldTracker(CGF.Allocas) {

2801 CGF.Allocas = &Tracker;

2802 }

2804

2806

2807 private:

2808 CodeGenFunction &CGF;

2809 AllocaTracker *OldTracker;

2810 AllocaTracker Tracker;

2811 };

2812

2813private:

2814

2815

2817 llvm::Value *ArraySize = nullptr);

2818

2819public:

2820

2821

2822

2823

2824

2825

2826

2827

2828

2829

2830

2831

2832

2833

2834

2835

2836

2837

2838

2839

2840

2841

2842

2843

2844

2845

2846 llvm::AllocaInst *CreateTempAlloca(llvm::Type *Ty, const Twine &Name = "tmp",

2847 llvm::Value *ArraySize = nullptr);

2848

2849

2850

2851

2853 CharUnits align, const Twine &Name = "tmp",

2854 llvm::Value *ArraySize = nullptr,

2856

2857

2858

2859

2860

2861

2863 const Twine &Name = "tmp",

2864 llvm::Value *ArraySize = nullptr,

2867 Alloca);

2868 }

2869

2871 const Twine &Name = "tmp",

2872 llvm::Value *ArraySize = nullptr);

2873

2874

2875

2876

2877

2878

2879

2880

2881

2882

2883

2885 const Twine &Name = "tmp");

2886

2887

2888

2889

2890

2891

2892

2893

2894

2896

2897

2898

2899

2903 const Twine &Name = "tmp",

2905

2906

2907

2910 const Twine &Name = "tmp");

2911

2912

2913

2921

2922

2923

2925

2926

2927

2928

2929

2933

2934

2935

2937 llvm::Value *Dst, QualType DstType,

2940

2941

2942

2944

2945

2946

2947

2948

2949

2950

2953 bool ignoreResult = false);

2954

2955

2956

2958

2959

2960

2961

2963

2964

2965

2967

2968

2969

2971 bool IsInitializer);

2972

2974

2975

2979

2980

2981

2983 bool capturedByInit);

2984

2985

2986

2988 if (const auto *RD = T->getAsRecordDecl())

2989 return RD->hasVolatileMember();

2990 return false;

2991 }

2992

2993

3000

3001

3003

3004

3005

3008 bool IsVirtual);

3009

3010

3016

3021

3022

3023

3024

3025

3026

3027

3028

3031 bool isVolatile = false);

3032

3033

3035 auto it = LocalDeclMap.find(VD);

3036 assert(it != LocalDeclMap.end() &&

3037 "Invalid argument to GetAddrOfLocalVar(), no decl!");

3038 return it->second;

3039 }

3040

3041

3042

3044

3045

3046

3048

3049

3050

3052

3053

3055

3056

3057

3058 static unsigned getAccessedFieldNo(unsigned Idx, const llvm::Constant *Elts);

3059

3062

3063

3065

3066

3067

3068

3070

3071

3072

3073

3074

3075

3076

3077 llvm::Value *EmitVAStartEnd(llvm::Value *ArgValue, bool IsStart);

3078

3079

3080

3081

3082

3083

3084

3085

3086

3089

3090

3091

3094

3095

3096

3097

3098

3100

3107

3108

3109

3112

3113

3114

3115

3116

3119

3120

3121

3123 assert(CXXThisValue && "no 'this' value for this function");

3124 return CXXThisValue;

3125 }

3127

3128

3129

3130

3131

3133 assert(CXXStructorImplicitParamValue && "no VTT value for this function");

3134 return CXXStructorImplicitParamValue;

3135 }

3136

3137

3138

3142 bool BaseIsVirtual);

3143

3145

3146

3147

3152

3156 bool NullCheckValue);

3157

3158

3159

3160

3161

3164

3169

3170

3171

3172

3175

3176

3177

3178

3179

3182 bool ForVirtualBase,

3185

3186

3187

3188

3191 bool InheritedFromVBase,

3193

3195 bool ForVirtualBase, bool Delegating,

3197

3199 bool ForVirtualBase, bool Delegating,

3203 llvm::CallBase **CallOrInvoke = nullptr);

3204

3205

3206

3208

3209

3211

3214

3218 bool NewPointerIsChecked,

3219 bool ZeroInitialization = false);

3220

3222 llvm::Value *NumElements, Address ArrayPtr,

3224 bool NewPointerIsChecked,

3225 bool ZeroInitialization = false);

3226

3228

3232

3234 llvm::Type *ElementTy, Address NewPtr,

3235 llvm::Value *NumElements,

3236 llvm::Value *AllocSizeWithoutCookie);

3237

3240

3245

3248

3251

3253 QualType DeleteTy, llvm::Value *NumElements = nullptr,

3255

3257 const CallExpr *TheCallExpr, bool IsDelete);

3258

3262

3263

3264

3265

3267

3269

3271

3272

3273

3275

3276

3278

3279

3281

3283

3284

3286

3287

3289

3290

3292

3293

3295

3297

3298

3300 };

3301

3302

3304

3305

3307

3308

3309

3311

3314 llvm::Value *ArraySize = nullptr) {

3316 return;

3318 SkippedChecks, ArraySize);

3319 }

3320

3324 llvm::Value *ArraySize = nullptr) {

3326 return;

3328 SkippedChecks, ArraySize);

3329 }

3330

3331

3332

3333

3337 llvm::Value *ArraySize = nullptr);

3338

3339

3340

3341

3343 llvm::Value *Index, QualType IndexType, bool Accessed);

3345 llvm::Value *IndexVal, QualType IndexType,

3346 llvm::Value *BoundsVal, QualType BoundsType,

3347 bool Accessed);

3348

3349

3350

3351

3352 llvm::DILocation *

3355

3356

3358

3360

3361

3363

3364

3366

3369

3370

3373

3374

3375

3378 llvm::Value *IndexVal, bool Accessed,

3379 bool FlexibleArray);

3380

3382 bool isInc, bool isPre);

3384 bool isInc, bool isPre);

3385

3386

3388

3389

3391

3392

3393

3394

3395

3396

3397

3398

3399 void EmitDecl(const Decl &D, bool EvaluateConditionDecl = false);

3400

3401

3402

3403

3405

3407 bool capturedByInit);

3408

3411

3412

3413

3415

3416

3417

3418

3420

3421 class AutoVarEmission {

3423

3424 const VarDecl *Variable;

3425

3426

3427

3428

3429

3431

3432 llvm::Value *NRVOFlag;

3433

3434

3435

3436 bool IsEscapingByRef;

3437

3438

3439

3440 bool IsConstantAggregate;

3441

3442

3443 bool UseLifetimeMarkers;

3444

3445

3446

3448

3449 struct Invalid {};

3453

3454 AutoVarEmission(const VarDecl &variable)

3456 IsEscapingByRef(false), IsConstantAggregate(false),

3458

3459 bool wasEmittedAsGlobal() const { return Addr.isValid(); }

3460

3461 public:

3462 static AutoVarEmission invalid() { return AutoVarEmission(Invalid()); }

3463

3465

3466

3467

3468

3470

3471

3473

3474

3475

3476

3478 if (!IsEscapingByRef)

3479 return Addr;

3480

3482 }

3483 };

3489

3491

3492

3493

3494

3495

3496

3498 bool EmitDebugInfo);

3499

3501 llvm::GlobalValue::LinkageTypes Linkage);

3502

3503 class ParamValue {

3504 union {

3507 };

3508

3509 bool IsIndirect;

3510

3513

3514 public:

3515 static ParamValue forDirect(llvm::Value *value) {

3516 return ParamValue(value);

3517 }

3520 return ParamValue(addr);

3521 }

3522

3527 assert(Addr.hasOffset() && "unexpected offset");

3528 return Addr.getBasePointer();

3529 }

3530

3535

3540 };

3541

3542

3544

3545

3546

3547

3548

3549

3550

3551

3552

3553

3556

3560 llvm::Value *Alignment,

3561 llvm::Value *OffsetValue,

3562 llvm::Value *TheCheck,

3563 llvm::Instruction *Assumption);

3564

3567 llvm::Value *Alignment,

3568 llvm::Value *OffsetValue = nullptr);

3569

3572 llvm::Value *Alignment,

3573 llvm::Value *OffsetValue = nullptr);

3574

3575

3576

3577

3578

3579

3581

3582

3583

3584

3585

3586

3587

3589

3590

3591

3592

3593

3594

3595

3597

3600 Address

3603

3604

3605

3607

3613

3616 void EmitForStmt(const ForStmt &S, ArrayRef<const Attr *> Attrs = {});

3622 void EmitDefaultStmt(const DefaultStmt &S, ArrayRef<const Attr *> Attrs);

3623 void EmitCaseStmt(const CaseStmt &S, ArrayRef<const Attr *> Attrs);

3624 void EmitCaseStmtRange(const CaseStmt &S, ArrayRef<const Attr *> Attrs);

3627

3629

3635

3640 bool ignoreResult = false);

3644 bool ignoreResult = false);

3647

3648 void EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock = false);

3649 void ExitCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock = false);

3650

3657 llvm::SmallPtrSet<llvm::BasicBlock *, 10> &V);

3658

3661 const Stmt *OutlinedStmt);

3662

3664 const SEHExceptStmt &Except);

3665

3667 const SEHFinallyStmt &Finally);

3668

3670 llvm::Value *ParentFP, llvm::Value *EntryEBP);

3674

3675

3677

3678

3679

3680

3682 bool IsFilter);

3683

3684

3685

3686

3687

3688

3690 Address ParentVar, llvm::Value *ParentFP);

3691

3693 ArrayRef<const Attr *> Attrs = {});

3694

3695

3697 CodeGenFunction &CGF;

3698

3699 public:

3701 bool HasCancel)

3702 : CGF(CGF) {

3703 CGF.OMPCancelStack.enter(CGF, Kind, HasCancel);

3704 }

3706 };

3707

3708

3714 llvm::Function *

3721

3722

3723

3724

3725

3726

3727

3728

3729

3732 const llvm::function_ref<void(Address, Address)> CopyGen);

3733

3734

3735

3736

3737

3738

3739

3740

3741

3742

3743

3747

3748

3749

3750

3751

3752

3753

3754

3755

3756

3757

3758

3759

3763 const llvm::function_ref<RValue(RValue)> CommonGen);

3765 OMPPrivateScope &PrivateScope);

3767 OMPPrivateScope &PrivateScope);

3770 const llvm::DenseMap<const ValueDecl *, llvm::Value *>

3771 CaptureDeviceAddrMap);

3774 const llvm::DenseMap<const ValueDecl *, llvm::Value *>

3775 CaptureDeviceAddrMap);

3776

3777

3778

3779

3780

3781

3782

3783

3784

3785

3786

3788

3789

3790

3791

3792

3793

3794

3795

3796

3797

3798

3800 OMPPrivateScope &PrivateScope);

3801

3802

3803

3804

3805

3806

3807

3809 bool NoFinals,

3810 llvm::Value *IsLastIterCond = nullptr);

3811

3814

3815

3816

3819 const llvm::function_ref<llvm::Value *(CodeGenFunction &)> CondGen);

3820

3821

3822

3823

3824

3825

3826

3828 OMPPrivateScope &PrivateScope,

3829 bool ForInscan = false);

3830

3831

3832

3833

3834

3837

3838

3839

3840

3841

3842

3844

3845 typedef const llvm::function_ref<void(CodeGenFunction & ,

3846 llvm::Function * ,

3869 OMPTargetDataInfo &InputInfo);

3872 OMPPrivateScope &Scope);

3912 void

3915 void

3923 void

3925 void

3945 void

3970

3971

3973 StringRef ParentName,

3975 static void

3978

3982

3986

3987 static void

3990

3994

3998

4000 StringRef ParentName,

4002

4003

4007

4008

4012

4013

4017

4021

4022

4023

4024

4025

4026

4028 int Depth);

4029

4030

4032

4033

4034

4035

4036

4037

4038

4039

4040

4041

4042

4045 const Expr *LoopCond, const Expr *IncExpr,

4046 const llvm::function_ref<void(CodeGenFunction &)> BodyGen,

4047 const llvm::function_ref<void(CodeGenFunction &)> PostIncGen);

4048

4050

4052 OMPPrivateScope &LoopScope);

4053

4054

4056

4057

4058

4059

4063

4064

4067

4068

4072 const llvm::function_ref<llvm::Value *(CodeGenFunction &)> CondGen);

4073

4074

4076

4077private:

4078

4080

4081

4082 struct OMPLoopArguments {

4083

4085

4087

4089

4091

4092 llvm::Value *Chunk = nullptr;

4093

4094 Expr *EUB = nullptr;

4095

4096 Expr *IncExpr = nullptr;

4097

4099

4101

4102 Expr *NextLB = nullptr;

4103

4104 Expr *NextUB = nullptr;

4105

4107 OMPLoopArguments() = default;

4109 llvm::Value *Chunk = nullptr, Expr *EUB = nullptr,

4110 Expr *IncExpr = nullptr, Expr *Init = nullptr,

4111 Expr *Cond = nullptr, Expr *NextLB = nullptr,

4112 Expr *NextUB = nullptr)

4113 : LB(LB), UB(UB), ST(ST), IL(IL), Chunk(Chunk), EUB(EUB),

4115 NextUB(NextUB) {}

4116 };

4117 void EmitOMPOuterLoop(bool DynamicOrOrdered, bool IsMonotonic,

4119 const OMPLoopArguments &LoopArgs,

4122 void EmitOMPForOuterLoop(const OpenMPScheduleTy &ScheduleKind,

4124 OMPPrivateScope &LoopScope, bool Ordered,

4125 const OMPLoopArguments &LoopArgs,

4127 void EmitOMPDistributeOuterLoop(OpenMPDistScheduleClauseKind ScheduleKind,

4129 OMPPrivateScope &LoopScope,

4130 const OMPLoopArguments &LoopArgs,

4132

4134

4135public:

4136

4137

4138

4140

4141

4142

4143 EmitStmt(S.getStructuredBlock());

4144 }

4145

4152

4159

4166

4171

4176

4183

4188

4193

4198

4203

4208

4219

4220

4221

4222

4223

4224

4226

4227

4229

4230

4231

4232

4234

4235

4236

4238

4239

4240

4241

4242

4243

4244

4245

4246

4247

4248

4249

4250

4251

4252

4253

4254

4257

4258private:

4260

4261public:

4262

4263

4264

4266

4268

4270

4272

4275

4277 llvm::AtomicOrdering AO, bool IsVolatile = false,

4279

4281

4283 bool IsVolatile, bool isInit);

4284

4287 llvm::AtomicOrdering Success =

4288 llvm::AtomicOrdering::SequentiallyConsistent,

4289 llvm::AtomicOrdering Failure =

4290 llvm::AtomicOrdering::SequentiallyConsistent,

4292

4293

4294

4296 llvm::AtomicRMWInst::BinOp Op, Address Addr, llvm::Value *Val,

4297 llvm::AtomicOrdering Order = llvm::AtomicOrdering::SequentiallyConsistent,

4298 llvm::SyncScope::ID SSID = llvm::SyncScope::System,

4300

4302 const llvm::function_ref<RValue(RValue)> &UpdateOp,

4303 bool IsVolatile);

4304

4305

4306

4308

4309

4310

4312

4313

4314

4315

4316

4319

4320

4321

4322

4326 bool isNontemporal = false) {

4328 CGM.getTBAAAccessInfo(Ty), isNontemporal);

4329 }

4330

4334 bool isNontemporal = false);

4335

4336

4337

4338

4339

4341

4342

4343

4344

4348 bool isInit = false, bool isNontemporal = false) {

4350 CGM.getTBAAAccessInfo(Ty), isInit, isNontemporal);

4351 }

4352

4356 bool isNontemporal = false);

4357

4358

4359

4360

4361

4362

4364 bool isInit = false);

4365

4366

4367

4368

4373

4374

4378

4379

4380

4381

4385

4386

4387

4388

4389

4390

4391

4393 llvm::Value **Result = nullptr);

4394

4395

4399 llvm::Value *&Result);

4400

4401

4404

4406 llvm::CallBase **CallOrInvoke = nullptr);

4407

4415 bool Accessed = false);

4419 bool IsLowerBound = true);

4431

4436

4438

4440

4442 LValueBaseInfo *BaseInfo = nullptr,

4443 TBAAAccessInfo *TBAAInfo = nullptr);

4444

4445 class ConstantEmission {

4446 llvm::PointerIntPair<llvm::Constant *, 1, bool> ValueAndIsReference;

4449

4450 public:

4455 static ConstantEmission forValue(llvm::Constant *C) {

4457 }

4458

4459 explicit operator bool() const {

4460 return ValueAndIsReference.getOpaqueValue() != nullptr;

4461 }

4462

4463 bool isReference() const { return ValueAndIsReference.getInt(); }

4469

4472 return ValueAndIsReference.getPointer();

4473 }

4474 };

4475

4479

4483

4486

4492 bool IsInBounds = true);

4495 llvm::Value *ThisValue);

4496

4497

4498

4499

4501

4503 const ObjCIvarDecl *Ivar, unsigned CVRQualifiers);

4504

4509

4516

4517

4518

4519

4520

4521

4522

4523

4526 llvm::CallBase **CallOrInvoke, bool IsMustTail,

4528 bool IsVirtualFunctionPointerThunk = false);

4531 llvm::CallBase **CallOrInvoke = nullptr,

4532 bool IsMustTail = false) {

4535 }

4538 llvm::CallBase **CallOrInvoke = nullptr,

4540

4541

4542

4545 llvm::CallBase **CallOrInvoke = nullptr);

4547 llvm::CallBase **CallOrInvoke = nullptr);

4549

4552

4554 const Twine &name = "");

4557 const Twine &name = "");

4559 const Twine &name = "");

4562 const Twine &name = "");

4565 const Twine &name = "");

4566

4569

4570 llvm::CallBase *EmitCallOrInvoke(llvm::FunctionCallee Callee,

4572 const Twine &Name = "");

4575 const Twine &name = "");

4577 const Twine &name = "");

4580

4583

4587

4589

4591

4592

4594 llvm::Value *Discriminator);

4596 llvm::Value *StorageAddress,

4599

4602

4605

4609 bool IsKnownNonNull);

4613

4617

4619 Address StorageAddress);

4623 bool IsKnownNonNull);

4625 const Expr *PointerExpr,

4626 Address StorageAddress);

4631 bool IsKnownNonNull);

4634

4635 std::pair<llvm::Value *, CGPointerAuthInfo>

4637

4642

4644

4648

4649

4650

4653 bool IsVolatile,

4655

4656

4659 bool IsVolatile,

4661

4662

4663

4671

4675 llvm::Value *ImplicitParam, QualType ImplicitParamTy, const CallExpr *E,

4676 CallArgList *RtlArgs, llvm::CallBase **CallOrInvoke);

4679 llvm::Value *ImplicitParam,

4681 llvm::CallBase **CallOrInvoke = nullptr);

4684 llvm::CallBase **CallOrInvoke = nullptr);

4688 const Expr *Base, llvm::CallBase **CallOrInvoke);

4689

4691 const Expr *E, Address base, llvm::Value *memberPtr,

4696 llvm::CallBase **CallOrInvoke);

4697

4701 llvm::CallBase **CallOrInvoke);

4703

4706 llvm::CallBase **CallOrInvoke);

4707

4710

4713

4715

4716

4718

4719

4721

4723

4727

4729 llvm::CallBase **CallOrInvoke);

4730

4731

4732

4735

4736 llvm::Value *

4738 const llvm::CmpInst::Predicate Pred,

4739 const llvm::Twine &Name = "");

4742 llvm::Triple::ArchType Arch);

4745 llvm::Triple::ArchType Arch);

4748 llvm::Triple::ArchType Arch);

4753

4754 llvm::Value *

4756 unsigned AltLLVMIntrinsic, const char *NameHint,

4757 unsigned Modifier, const CallExpr *E,

4759 Address PtrOp1, llvm::Triple::ArchType Arch);

4760

4762 unsigned Modifier, llvm::Type *ArgTy,

4764 llvm::Value *EmitNeonCall(llvm::Function *F,

4766 unsigned shift = 0, bool rightshift = false);

4769 const CallExpr *E, const char *name);

4771 llvm::Type *Ty1, bool Extract,

4773 const CallExpr *E, const char *name);

4775 llvm::Type *RetTy,

4777 const CallExpr *E, const char *name);

4779 llvm::Type *RetTy,

4781 const CallExpr *E, const char *name);

4783 const llvm::ElementCount &Count);

4786 bool negateForRightShift);

4787 llvm::Value *EmitNeonRShiftImm(llvm::Value *Vec, llvm::Value *Amt,

4788 llvm::Type *Ty, bool usgn, const char *name);

4790

4791

4792

4794

4804 llvm::Type *ReturnType,

4808 llvm::Value *EmitSVEDupX(llvm::Value *Scalar, llvm::Type *Ty);

4812 unsigned BuiltinID);

4815 unsigned BuiltinID);

4817 llvm::ScalableVectorType *VTy);

4819 llvm::StructType *Ty);

4822 unsigned IntID);

4825 unsigned IntID);

4828 unsigned BuiltinID, bool IsZExtReturn);

4831 unsigned BuiltinID);

4834 unsigned BuiltinID);

4837 unsigned IntID);

4840 unsigned IntID);

4843 unsigned IntID);

4845

4848 unsigned IntID);

4851 unsigned IntID);

4854 unsigned IntID);

4857 unsigned IntID);

4858

4862

4864

4866 llvm::Triple::ArchType Arch);

4868

4875

4876

4877

4878 llvm::Function *

4880

4892

4898

4902 llvm::AtomicOrdering &AO,

4903 llvm::SyncScope::ID &SSID);

4904

4907

4909

4915 llvm::Value *

4921

4922

4923

4928

4929

4942 bool resultIgnored);

4944 bool resultIgnored);

4947 llvm::Value *EmitARCRetainBlock(llvm::Value *value, bool mandatory);

4955

4956 llvm::Value *EmitObjCAutorelease(llvm::Value *value, llvm::Type *returnType);

4958 llvm::Type *returnType);

4960

4961 std::pair<LValue, llvm::Value *>

4964 bool ignored);

4965 std::pair<LValue, llvm::Value *>

4967

4968 llvm::Value *EmitObjCAlloc(llvm::Value *value, llvm::Type *returnType);

4970 llvm::Type *returnType);

4971 llvm::Value *EmitObjCAllocInit(llvm::Value *value, llvm::Type *resultType);

4972

4976

4979 bool allowUnsafeClaim);

4983

4985

4987

4993

4999

5000

5002

5003

5004

5005

5006

5007

5008

5009

5010

5011 llvm::Value *EmitScalarExpr(const Expr *E, bool IgnoreResultAssign = false);

5012

5013

5014

5017

5018

5019

5023

5024

5025

5026

5028

5029

5030

5032

5034

5035

5036

5039

5040

5041

5043 bool DstIsVolatile);

5044

5045

5046

5048

5049

5050

5052 bool IgnoreImag = false);

5053

5054

5055

5057

5058

5060

5061

5063

5069

5072

5073

5074

5075

5076

5078 llvm::GlobalVariable *GV);

5079

5080

5082

5083

5084

5086 bool PerformInit);

5087

5089 llvm::Constant *Addr);

5090

5092 llvm::FunctionCallee Dtor,

5093 llvm::Constant *Addr,

5094 llvm::FunctionCallee &AtExit);

5095

5096

5097

5099 llvm::Constant *addr);

5100

5101

5102

5104 llvm::Constant *addr);

5105

5106

5108

5109

5111

5112

5113

5114

5115

5116

5118 bool PerformInit);

5119

5121

5122

5124 llvm::BasicBlock *InitBlock,

5125 llvm::BasicBlock *NoInitBlock, GuardKind Kind,

5127

5128

5129

5130 void

5134

5135

5136

5138 llvm::Function *Fn,

5139 ArrayRef<std::tuple<llvm::FunctionType *, llvm::WeakTrackingVH,

5140 llvm::Constant *>>

5141 DtorsOrStermFinalizers);

5142

5144 llvm::GlobalVariable *Addr,

5145 bool PerformInit);

5146

5148

5150

5152

5154

5156

5157

5158

5159

5160

5161

5163 llvm::Value *AnnotatedVal,

5164 StringRef AnnotationStr,

5166 const AnnotateAttr *Attr);

5167

5168

5170

5171

5172

5174

5175

5176

5177

5178

5179

5180

5181

5182 static bool ContainsLabel(const Stmt *S, bool IgnoreCaseStmts = false);

5183

5184

5185

5186

5188

5189

5190

5192

5193

5194

5195

5197 bool AllowLabels = false);

5198

5199

5200

5201

5203 bool AllowLabels = false);

5204

5205

5207

5208

5209

5211

5212

5213

5214

5215

5217 llvm::BasicBlock *TrueBlock,

5218 llvm::BasicBlock *FalseBlock,

5219 uint64_t TrueCount = 0,

5221 const Expr *CntrIdx = nullptr);

5222

5223

5224

5225

5226

5227

5229 llvm::BasicBlock *FalseBlock, uint64_t TrueCount,

5231 const Expr *ConditionalOp = nullptr,

5232 const VarDecl *ConditionalDecl = nullptr);

5233

5234

5235

5237

5238

5239

5241

5242

5244 Expr *pointerOperand, llvm::Value *pointer,

5245 Expr *indexOperand, llvm::Value *index,

5246 bool isSubtraction);

5247

5248

5249

5250

5251

5252

5257 const Twine &Name = "");

5258

5260 llvm::Type *elementType, bool SignedIndices,

5262 CharUnits Align, const Twine &Name = "");

5263

5264

5265

5271

5272

5273

5275

5276

5277

5279

5280

5281

5283

5284

5285

5287

5288

5289

5291

5294

5295

5296

5297

5298 void

5299 EmitCheck(ArrayRef<std::pair<llvm::Value *, SanitizerKind::SanitizerOrdinal>>

5300 Checked,

5304

5305

5306

5308 llvm::Value *Cond, llvm::ConstantInt *TypeId,

5309 llvm::Value *Ptr,

5311

5312

5313

5315

5316

5317

5319 bool NoMerge = false, const TrapReason *TR = nullptr);

5320

5321

5322

5323 llvm::CallInst *EmitTrapCall(llvm::Intrinsic::ID IntrID);

5324

5325

5327

5328

5330

5331

5332

5334 AbstractCallee AC, unsigned ParmNum);

5335

5338 unsigned ParmNum);

5339

5340

5342

5343

5345

5346

5347

5348

5351

5352

5353

5354 void SetFPAccuracy(llvm::Value *Val, float Accuracy);

5355

5356

5357

5359

5360

5361

5363

5364

5366

5367

5369 unsigned NumElementsDst,

5370 const llvm::Twine &Name = "");

5371

5374

5375private:

5376

5377

5378 llvm::ConvergenceControlInst *emitConvergenceLoopToken(llvm::BasicBlock *BB);

5379

5380

5381

5382 llvm::CallBase *addConvergenceControlToken(llvm::CallBase *Input);

5383

5384

5385

5386 llvm::ConvergenceControlInst *

5387 getOrEmitConvergenceEntryToken(llvm::Function *F);

5388

5389private:

5390 llvm::MDNode *getRangeForLoadFromType(QualType Ty);

5392

5393 void deferPlaceholderReplacement(llvm::Instruction *Old, llvm::Value *New);

5394

5396 DeferredReplacements;

5397

5398

5400 assert(!LocalDeclMap.count(VD) && "Decl already exists in LocalDeclMap!");

5401 LocalDeclMap.insert({VD, Addr});

5402 }

5403

5404

5405

5406

5407

5408 void ExpandTypeFromArgs(QualType Ty, LValue Dst,

5409 llvm::Function::arg_iterator &AI);

5410

5411

5412

5413

5414 void ExpandTypeToArgs(QualType Ty, CallArg Arg, llvm::FunctionType *IRFuncTy,

5415 SmallVectorImpl<llvm::Value *> &IRCallArgs,

5416 unsigned &IRCallArgPos);

5417

5418 std::pair<llvm::Value *, llvm::Type *>

5419 EmitAsmInput(const TargetInfo::ConstraintInfo &Info, const Expr *InputExpr,

5420 std::string &ConstraintStr);

5421

5422 std::pair<llvm::Value *, llvm::Type *>

5423 EmitAsmInputLValue(const TargetInfo::ConstraintInfo &Info, LValue InputValue,

5424 QualType InputType, std::string &ConstraintStr,

5425 SourceLocation Loc);

5426

5427

5428

5429

5430

5431

5432 llvm::Value *evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type,

5433 llvm::IntegerType *ResType,

5434 llvm::Value *EmittedE,

5435 bool IsDynamic);

5436

5437

5438

5439

5440 llvm::Value *emitBuiltinObjectSize(const Expr *E, unsigned Type,

5441 llvm::IntegerType *ResType,

5442 llvm::Value *EmittedE, bool IsDynamic);

5443

5444 llvm::Value *emitCountedBySize(const Expr *E, llvm::Value *EmittedE,

5445 unsigned Type, llvm::IntegerType *ResType);

5446

5447 llvm::Value *emitCountedByMemberSize(const MemberExpr *E, const Expr *Idx,

5448 llvm::Value *EmittedE,

5449 QualType CastedArrayElementTy,

5450 unsigned Type,

5451 llvm::IntegerType *ResType);

5452

5453 llvm::Value *emitCountedByPointerSize(const ImplicitCastExpr *E,

5454 const Expr *Idx, llvm::Value *EmittedE,

5455 QualType CastedArrayElementTy,

5456 unsigned Type,

5457 llvm::IntegerType *ResType);

5458

5459 void emitZeroOrPatternForAutoVarInit(QualType type, const VarDecl &D,

5460 Address Loc);

5461

5462public:

5471

5472

5473

5475 llvm::PointerUnion<const FunctionProtoType *, const ObjCMethodDecl *> P;

5476

5479 };

5480

5482 llvm::iterator_rangeCallExpr::const\_arg\_iterator ArgRange,

5483 AbstractCallee AC = AbstractCallee(),

5484 unsigned ParamsToSkip = 0,

5486

5487

5488

5489

5490

5491

5492

5493

5494

5495

5496

5497

5498

5499

5500

5501

5502

5503

5508

5509

5510

5511

5513

5515

5520

5522 std::optional Arch = std::nullopt)

5524 };

5525

5526

5527

5528

5537

5538private:

5540

5541 void EmitDeclMetadata();

5542

5544 const AutoVarEmission &emission);

5545

5546 void AddObjCARCExceptionMetadata(llvm::Instruction *Inst);

5547

5548 llvm::Value *GetValueForARMHint(unsigned BuiltinID);

5549 llvm::Value *EmitX86CpuIs(const CallExpr *E);

5550 llvm::Value *EmitX86CpuIs(StringRef CPUStr);

5551 llvm::Value *EmitX86CpuSupports(const CallExpr *E);

5553 llvm::Value *EmitX86CpuSupports(std::array<uint32_t, 4> FeatureMask);

5554 llvm::Value *EmitX86CpuInit();

5555 llvm::Value *FormX86ResolverCondition(const FMVResolverOption &RO);

5556 llvm::Value *EmitAArch64CpuInit();

5557 llvm::Value *FormAArch64ResolverCondition(const FMVResolverOption &RO);

5558 llvm::Value *EmitAArch64CpuSupports(const CallExpr *E);

5560};

5561

5576

5579

5580 if (!value.getInt())

5581 return value.getPointer();

5582

5583

5586 alloca->getAlign());

5587}

5588

5589}

5590

5591

5592

5593llvm::fp::ExceptionBehavior

5595}

5596

5597#endif

Enums/classes describing ABI related information about constructors, destructors and thunks.

static bool CanThrow(Expr *E, ASTContext &Ctx)

static T * buildByrefHelpers(CodeGenModule &CGM, const BlockByrefInfo &byrefInfo, T &&generator)

Lazily build the copy and dispose helpers for a __block variable with the given information.

static bool isInAllocaArgument(CGCXXABI &ABI, QualType type)

CodeGenFunction::ComplexPairTy ComplexPairTy

Defines the clang::Expr interface and subclasses for C++ expressions.

FormatToken * Previous

The previous token in the unwrapped line.

llvm::MachO::Target Target

Defines some OpenMP-specific enums and functions.

This file defines OpenACC AST classes for statement-level contructs.

This file defines OpenMP AST classes for executable directives and clauses.

This file defines SYCL AST classes used to represent calls to SYCL kernels.

C Language Family Type Representation.

This represents 'pragma omp cancel' directive.

This represents 'pragma omp cancellation point' directive.

This represents 'pragma omp distribute' directive.

This represents 'pragma omp distribute parallel for' composite directive.

This represents 'pragma omp distribute parallel for simd' composite directive.

This represents 'pragma omp distribute simd' composite directive.

This represents 'pragma omp error' directive.

Represents the 'pragma omp fuse' loop transformation directive.

This represents 'pragma omp loop' directive.

Represents the 'pragma omp interchange' loop transformation directive.

This represents 'pragma omp interop' directive.

This represents 'pragma omp masked' directive.

This represents 'pragma omp masked taskloop' directive.

This represents 'pragma omp masked taskloop simd' directive.

This represents 'pragma omp master taskloop' directive.

This represents 'pragma omp master taskloop simd' directive.

This represents 'pragma omp parallel masked taskloop' directive.

This represents 'pragma omp parallel masked taskloop simd' directive.

This represents 'pragma omp parallel master taskloop' directive.

This represents 'pragma omp parallel master taskloop simd' directive.

Represents the 'pragma omp reverse' loop transformation directive.

This represents 'pragma omp scan' directive.

This represents the 'pragma omp stripe' loop transformation directive.

This represents 'pragma omp target data' directive.

This represents 'pragma omp target' directive.

This represents 'pragma omp target enter data' directive.

This represents 'pragma omp target exit data' directive.

This represents 'pragma omp target parallel' directive.

This represents 'pragma omp target parallel for' directive.

This represents 'pragma omp target parallel for simd' directive.

This represents 'pragma omp target parallel loop' directive.

This represents 'pragma omp target simd' directive.

This represents 'pragma omp target teams' directive.

This represents 'pragma omp target teams distribute' combined directive.

This represents 'pragma omp target teams distribute parallel for' combined directive.

This represents 'pragma omp target teams distribute parallel for simd' combined directive.

This represents 'pragma omp target teams distribute simd' combined directive.

This represents 'pragma omp target teams loop' directive.

This represents 'pragma omp target update' directive.

This represents 'pragma omp taskloop' directive.

This represents 'pragma omp taskloop simd' directive.

This represents 'pragma omp teams' directive.

This represents 'pragma omp teams distribute' directive.

This represents 'pragma omp teams distribute parallel for' composite directive.

This represents 'pragma omp teams distribute parallel for simd' composite directive.

This represents 'pragma omp teams distribute simd' combined directive.

This represents 'pragma omp teams loop' directive.

This represents the 'pragma omp tile' loop transformation directive.

This represents the 'pragma omp unroll' loop transformation directive.

const Stmt * getAssociatedStmt() const

Stmt * getStructuredBlock()

Stmt * getStructuredBlock()

This class represents a 'loop' construct. The 'loop' construct applies to a 'for' loop (or range-for ...

a trap message and trap category.

APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...

AbstractConditionalOperator - An abstract base class for ConditionalOperator and BinaryConditionalOpe...

This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...

ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.

Represents an array type, per C99 6.7.5.2 - Array Declarators.

AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...

Attr - This represents one attribute.

Represents an attribute applied to a statement.

BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...

OpaqueValueExpr * getOpaqueValue() const

getOpaqueValue - Return the opaque value placeholder.

Expr * getCommon() const

getCommon - Return the common expression, written to the left of the condition.

A builtin binary operation expression such as "x + y" or "x <= y".

static bool isLogicalOp(Opcode Opc)

BinaryOperatorKind Opcode

BlockExpr - Adaptor class for mixing a BlockDecl with expressions.

Represents a call to a CUDA kernel function.

Represents binding an expression to a temporary.

Represents a call to a C++ constructor.

Represents a C++ constructor within a class.

A default argument (C++ [dcl.fct.default]).

A use of a default initializer in a constructor or in aggregate initialization.

Represents a delete expression for memory deallocation and destructor calls, e.g.

Represents a C++ destructor within a class.

A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).

CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...

Represents a call to an inherited base class constructor from an inheriting constructor.

Represents a call to a member function that may be written either with member call syntax (e....

Represents a static or instance method of a struct/union/class.

Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".

A call to an overloaded operator written using operator syntax.

Represents a C++ pseudo-destructor (C++ [expr.pseudo]).

Represents a C++ struct/union/class.

Represents a C++ temporary.

A C++ throw-expression (C++ [except.throw]).

CXXTryStmt - A C++ try block, including all handlers.

A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...

A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...

CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).

This captures a statement into a function.

const Capture * const_capture_iterator

capture_iterator capture_end() const

Retrieve an iterator pointing past the end of the sequence of captures.

const RecordDecl * getCapturedRecordDecl() const

Retrieve the record declaration for captured variables.

capture_iterator capture_begin()

Retrieve an iterator pointing to the first capture.

CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...

const CXXBaseSpecifier *const * path_const_iterator

CharUnits - This is an opaque type for sizes expressed in character units.

bool isZero() const

isZero - Test whether the quantity equals zero.

llvm::Align getAsAlign() const

getAsAlign - Returns Quantity as a valid llvm::Align, Beware llvm::Align assumes power of two 8-bit b...

static CharUnits fromQuantity(QuantityType Quantity)

fromQuantity - Construct a CharUnits quantity from a raw integer type.

static CharUnits Zero()

Zero - Construct a CharUnits quantity of zero.

Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...

llvm::Value * getBasePointer() const

llvm::Value * emitRawPointer(CodeGenFunction &CGF) const

Return the pointer contained in this class after authenticating it and adding offset to it if necessa...

CharUnits getAlignment() const

llvm::Type * getElementType() const

Return the type of the values stored in this address.

void setAlignment(CharUnits Value)

llvm::Value * getOffset() const

void replaceBasePointer(llvm::Value *P)

This function is used in situations where the caller is doing some sort of opaque "laundering" of the...

llvm::PointerType * getType() const

Return the type of the pointer value.

static AggValueSlot ignored()

ignored - Returns an aggregate value slot indicating that the aggregate value is being ignored.

static AggValueSlot forAddr(Address addr, Qualifiers quals, IsDestructed_t isDestructed, NeedsGCBarriers_t needsGC, IsAliased_t isAliased, Overlap_t mayOverlap, IsZeroed_t isZeroed=IsNotZeroed, IsSanitizerChecked_t isChecked=IsNotSanitizerChecked)

forAddr - Make a slot for an aggregate value.

A scoped helper to set the current source atom group for CGDebugInfo::addInstToCurrentSourceAtom.

Definition CodeGenFunction.h:233

A pair of helper functions for a __block variable.

Information about the layout of a __block variable.

CGBlockInfo - Information to generate a block literal.

llvm::StoreInst * CreateStore(llvm::Value *Val, Address Addr, bool IsVolatile=false)

llvm::LoadInst * CreateAlignedLoad(llvm::Type *Ty, llvm::Value *Addr, CharUnits Align, const llvm::Twine &Name="")

Implements C++ ABI-specific code generation functions.

All available information about a concrete callee.

This class gathers all debug information during compilation and is responsible for emitting to llvm g...

CGFunctionInfo - Class to encapsulate the information about a function definition.

CallArgList - Type for representing both the value and type of arguments in a call.

AbstractCallee(const ObjCMethodDecl *OMD)

Definition CodeGenFunction.h:547

const ParmVarDecl * getParamDecl(unsigned I) const

Definition CodeGenFunction.h:557

const Decl * getDecl() const

Definition CodeGenFunction.h:551

unsigned getNumParams() const

Definition CodeGenFunction.h:552

bool hasFunctionDecl() const

Definition CodeGenFunction.h:548

AbstractCallee()

Definition CodeGenFunction.h:545

AbstractCallee(const FunctionDecl *FD)

Definition CodeGenFunction.h:546

ArrayInitLoopExprScope(CodeGenFunction &CGF, llvm::Value *Index)

Definition CodeGenFunction.h:1814

~ArrayInitLoopExprScope()

Definition CodeGenFunction.h:1818

Definition CodeGenFunction.h:3421

Address getAllocatedAddress() const

Returns the raw, allocated address, which is not necessarily the address of the object itself.

Definition CodeGenFunction.h:3469

friend class CodeGenFunction

Definition CodeGenFunction.h:3422

bool useLifetimeMarkers() const

Definition CodeGenFunction.h:3464

RawAddress getOriginalAllocatedAddress() const

Returns the address for the original alloca instruction.

Definition CodeGenFunction.h:3472

Address getObjectAddress(CodeGenFunction &CGF) const

Returns the address of the object within this declaration.

Definition CodeGenFunction.h:3477

static AutoVarEmission invalid()

Definition CodeGenFunction.h:3462

CGAtomicOptionsRAII(CodeGenModule &CGM_, AtomicOptions AO)

Definition CodeGenFunction.h:825

CGAtomicOptionsRAII(CodeGenModule &CGM_, const AtomicAttr *AA)

Definition CodeGenFunction.h:829

CGAtomicOptionsRAII(const CGAtomicOptionsRAII &)=delete

~CGAtomicOptionsRAII()

Definition CodeGenFunction.h:861

CGAtomicOptionsRAII & operator=(const CGAtomicOptionsRAII &)=delete

API for captured statement code generation.

Definition CodeGenFunction.h:454

CapturedRegionKind getKind() const

Definition CodeGenFunction.h:478

virtual llvm::Value * getContextValue() const

Definition CodeGenFunction.h:482

virtual ~CGCapturedStmtInfo()

static bool classof(const CGCapturedStmtInfo *)

Definition CodeGenFunction.h:492

virtual void setContextValue(llvm::Value *V)

Definition CodeGenFunction.h:480

bool isCXXThisExprCaptured() const

Definition CodeGenFunction.h:489

virtual FieldDecl * getThisFieldDecl() const

Definition CodeGenFunction.h:490

llvm::SmallDenseMap< const VarDecl *, FieldDecl * > getCaptureFields()

Get the CaptureFields.

Definition CodeGenFunction.h:504

CGCapturedStmtInfo(CapturedRegionKind K=CR_Default)

Definition CodeGenFunction.h:456

virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S)

Emit the captured statement body.

Definition CodeGenFunction.h:495

virtual StringRef getHelperName() const

Get the name of the capture helper.

Definition CodeGenFunction.h:501

CGCapturedStmtInfo(const CapturedStmt &S, CapturedRegionKind K=CR_Default)

Definition CodeGenFunction.h:458

virtual const FieldDecl * lookup(const VarDecl *VD) const

Lookup the captured field decl for a variable.

Definition CodeGenFunction.h:485

~CGCapturedStmtRAII()

Definition CodeGenFunction.h:536

CGCapturedStmtRAII(CodeGenFunction &CGF, CGCapturedStmtInfo *NewCapturedStmtInfo)

Definition CodeGenFunction.h:531

CGFPOptionsRAII(CodeGenFunction &CGF, FPOptions FPFeatures)

CharUnits OldCXXThisAlignment

Definition CodeGenFunction.h:1801

~CXXDefaultInitExprScope()

Definition CodeGenFunction.h:1793

CodeGenFunction & CGF

Definition CodeGenFunction.h:1799

SourceLocExprScopeGuard SourceLocScope

Definition CodeGenFunction.h:1802

llvm::Value * OldCXXThisValue

Definition CodeGenFunction.h:1800

CXXDefaultInitExprScope(CodeGenFunction &CGF, const CXXDefaultInitExpr *E)

Definition CodeGenFunction.h:1786

void Emit(CodeGenFunction &CGF, Flags flags) override

Definition CodeGenFunction.h:712

CallLifetimeEnd(RawAddress addr)

Definition CodeGenFunction.h:710

An object to manage conditionally-evaluated expressions.

Definition CodeGenFunction.h:1318

llvm::BasicBlock * getStartingBlock() const

Returns a block which will be executed prior to each evaluation of the conditional code.

Definition CodeGenFunction.h:1339

void begin(CodeGenFunction &CGF)

Definition CodeGenFunction.h:1325

ConditionalEvaluation(CodeGenFunction &CGF)

Definition CodeGenFunction.h:1322

void end(CodeGenFunction &CGF)

Definition CodeGenFunction.h:1331

static ConstantEmission forValue(llvm::Constant *C)

Definition CodeGenFunction.h:4455

static ConstantEmission forReference(llvm::Constant *C)

Definition CodeGenFunction.h:4452

bool isReference() const

Definition CodeGenFunction.h:4463

ConstantEmission()

Definition CodeGenFunction.h:4451

LValue getReferenceLValue(CodeGenFunction &CGF, const Expr *RefExpr) const

Definition CodeGenFunction.h:4464

llvm::Constant * getValue() const

Definition CodeGenFunction.h:4470

void Emit(CodeGenFunction &CGF, Flags flags) override

Definition CodeGenFunction.h:726

FakeUse(Address addr)

Definition CodeGenFunction.h:724

FieldConstructionScope(CodeGenFunction &CGF, Address This)

Definition CodeGenFunction.h:1769

~FieldConstructionScope()

Definition CodeGenFunction.h:1773

A class controlling the emission of a finally block.

Definition CodeGenFunction.h:874

void exit(CodeGenFunction &CGF)

void enter(CodeGenFunction &CGF, const Stmt *Finally, llvm::FunctionCallee beginCatchFn, llvm::FunctionCallee endCatchFn, llvm::FunctionCallee rethrowFn)

Enters a finally block for an implementation using zero-cost exceptions.

InlinedInheritingConstructorScope(CodeGenFunction &CGF, GlobalDecl GD)

Definition CodeGenFunction.h:1827

~InlinedInheritingConstructorScope()

Definition CodeGenFunction.h:1850

void rescopeLabels()

Change the cleanup scope of the labels in this lexical scope to match the scope of the enclosing cont...

void addLabel(const LabelDecl *label)

Definition CodeGenFunction.h:1100

bool hasLabels() const

Definition CodeGenFunction.h:1119

~LexicalScope()

Exit this cleanup scope, emitting any accumulated cleanups.

void ForceCleanup()

Force the emission of cleanups now, instead of waiting until this object is destroyed.

Definition CodeGenFunction.h:1111

~InlinedRegionBodyRAII()

Definition CodeGenFunction.h:2059

InlinedRegionBodyRAII(CodeGenFunction &cgf, InsertPointTy &AllocaIP, llvm::BasicBlock &FiniBB)

Definition CodeGenFunction.h:2036

OMPAllocateCleanupTy(llvm::CallInst *RLFnCI)

Definition CodeGenFunction.h:1906

void Emit(CodeGenFunction &CGF, Flags) override

Definition CodeGenFunction.h:1910

OutlinedRegionBodyRAII(CodeGenFunction &cgf, InsertPointTy &AllocaIP, llvm::BasicBlock &RetBB)

Definition CodeGenFunction.h:2011

~OutlinedRegionBodyRAII()

Definition CodeGenFunction.h:2023

~OMPCancelStackRAII()

Definition CodeGenFunction.h:3705

OMPCancelStackRAII(CodeGenFunction &CGF, OpenMPDirectiveKind Kind, bool HasCancel)

Definition CodeGenFunction.h:3700

~OMPLocalDeclMapRAII()

Definition CodeGenFunction.h:1263

OMPLocalDeclMapRAII(CodeGenFunction &CGF)

Definition CodeGenFunction.h:1261

The class used to assign some variables some temporarily addresses.

Definition CodeGenFunction.h:1127

~OMPMapVars()

Definition CodeGenFunction.h:1135

bool apply(CodeGenFunction &CGF)

Applies new addresses to the list of the variables.

Definition CodeGenFunction.h:1171

void restore(CodeGenFunction &CGF)

Restores original addresses of the variables.

Definition CodeGenFunction.h:1178

bool setVarAddr(CodeGenFunction &CGF, const VarDecl *LocalVD, Address TempAddr)

Sets the address of the variable LocalVD to be TempAddr in function CGF.

Definition CodeGenFunction.h:1142

The scope used to remap some variables as private in the OpenMP loop body (or other captured region e...

Definition CodeGenFunction.h:1201

void restoreMap()

Restore all mapped variables w/o clean up.

Definition CodeGenFunction.h:1250

bool Privatize()

Privatizes local variables previously registered as private.

Definition CodeGenFunction.h:1228

void ForceCleanup()

Definition CodeGenFunction.h:1230

bool isGlobalVarCaptured(const VarDecl *VD) const

Checks if the global variable is captured in current function.

Definition CodeGenFunction.h:1242

OMPPrivateScope(CodeGenFunction &CGF)

Enter a new OpenMP private scope.

Definition CodeGenFunction.h:1208

~OMPPrivateScope()

Exit scope - all the mapped variables are restored.

Definition CodeGenFunction.h:1236

bool addPrivate(const VarDecl *LocalVD, Address Addr)

Registers LocalVD variable as a private with Addr as the address of the corresponding private variabl...

Definition CodeGenFunction.h:1215

A non-RAII class containing all the information about a bound opaque value.

Definition CodeGenFunction.h:1394

static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const LValue &lv)

Definition CodeGenFunction.h:1423

static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const RValue &rv)

Definition CodeGenFunction.h:1430

static bool shouldBindAsLValue(const Expr *expr)

Definition CodeGenFunction.h:1405

void unbind(CodeGenFunction &CGF)

Definition CodeGenFunction.h:1447

bool isValid() const

Definition CodeGenFunction.h:1444

OpaqueValueMappingData()

Definition CodeGenFunction.h:1403

static OpaqueValueMappingData bind(CodeGenFunction &CGF, const OpaqueValueExpr *ov, const Expr *e)

Definition CodeGenFunction.h:1416

void clear()

Definition CodeGenFunction.h:1445

OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *OV)

Build the opaque value mapping for an OpaqueValueExpr whose source expression is set to the expressio...

Definition CodeGenFunction.h:1488

OpaqueValueMapping(CodeGenFunction &CGF, const AbstractConditionalOperator *op)

Build the opaque value mapping for the given conditional operator if it's the GNU ?

Definition CodeGenFunction.h:1474

void pop()

Definition CodeGenFunction.h:1507

~OpaqueValueMapping()

Definition CodeGenFunction.h:1512

static bool shouldBindAsLValue(const Expr *expr)

Definition CodeGenFunction.h:1465

OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *opaqueValue, RValue rvalue)

Definition CodeGenFunction.h:1502

OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *opaqueValue, LValue lvalue)

Definition CodeGenFunction.h:1497

Definition CodeGenFunction.h:3503

llvm::Value * getDirectValue() const

Definition CodeGenFunction.h:3531

bool isIndirect() const

Definition CodeGenFunction.h:3523

Address getIndirectAddress() const

Definition CodeGenFunction.h:3536

static ParamValue forIndirect(Address addr)

Definition CodeGenFunction.h:3518

static ParamValue forDirect(llvm::Value *value)

Definition CodeGenFunction.h:3515

Address Addr

Definition CodeGenFunction.h:3505

llvm::Value * getAnyValue() const

Definition CodeGenFunction.h:3524

llvm::Value * Value

Definition CodeGenFunction.h:3506

ParentLoopDirectiveForScanRegion(CodeGenFunction &CGF, const OMPExecutableDirective &ParentLoopDirectiveForScan)

Definition CodeGenFunction.h:790

~ParentLoopDirectiveForScanRegion()

Definition CodeGenFunction.h:797

An object which temporarily prevents a value from being destroyed by aggressive peephole optimization...

Definition CodeGenFunction.h:1380

friend class CodeGenFunction

Definition CodeGenFunction.h:1382

PeepholeProtection()=default

RunCleanupsScope(CodeGenFunction &CGF)

Enter a new cleanup scope.

Definition CodeGenFunction.h:1044

~RunCleanupsScope()

Exit this cleanup scope, emitting any accumulated cleanups.

Definition CodeGenFunction.h:1056

void ForceCleanup(std::initializer_list< llvm::Value ** > ValuesToReload={})

Force the emission of cleanups now, instead of waiting until this object is destroyed.

Definition CodeGenFunction.h:1073

CodeGenFunction & CGF

Definition CodeGenFunction.h:1040

bool PerformCleanup

Definition CodeGenFunction.h:1033

bool requiresCleanups() const

Determine whether this scope requires any cleanups.

Definition CodeGenFunction.h:1062

SanitizerScope(CodeGenFunction *CGF)

StmtExprEvaluation(CodeGenFunction &CGF)

Definition CodeGenFunction.h:1366

~StmtExprEvaluation()

Definition CodeGenFunction.h:1371

CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...

Definition CodeGenFunction.h:247

void CreateCoercedStore(llvm::Value *Src, Address Dst, llvm::TypeSize DstSize, bool DstIsVolatile)

Create a store to.

EHScopeStack::stable_iterator CurrentCleanupScopeDepth

Definition CodeGenFunction.h:1085

RValue EmitAMDGPUDevicePrintfCallExpr(const CallExpr *E)

LValue EmitMatrixSubscriptExpr(const MatrixSubscriptExpr *E)

friend class CGCXXABI

Definition CodeGenFunction.h:251

void emitArrayDestroy(llvm::Value *begin, llvm::Value *end, QualType elementType, CharUnits elementAlign, Destroyer *destroyer, bool checkZeroLength, bool useEHCleanup)

emitArrayDestroy - Destroys all the elements of the given array, beginning from last to first.

LValue EmitCoawaitLValue(const CoawaitExpr *E)

llvm::Value * GetVTablePtr(Address This, llvm::Type *VTableTy, const CXXRecordDecl *VTableClass, VTableAuthMode AuthMode=VTableAuthMode::Authenticate)

GetVTablePtr - Return the Value of the vtable pointer member pointed to by This.

void EmitOMPParallelMaskedTaskLoopDirective(const OMPParallelMaskedTaskLoopDirective &S)

RValue EmitNVPTXDevicePrintfCallExpr(const CallExpr *E)

llvm::Value * EmitSVEPredicateCast(llvm::Value *Pred, llvm::ScalableVectorType *VTy)

llvm::Value * EmitObjCConsumeObject(QualType T, llvm::Value *Ptr)

Produce the code for a CK_ARCConsumeObject.

llvm::Value * EmitFP8NeonFMLACall(unsigned IID, bool ExtendLaneArg, llvm::Type *RetTy, SmallVectorImpl< llvm::Value * > &Ops, const CallExpr *E, const char *name)

void EmitCXXGuardedInit(const VarDecl &D, llvm::GlobalVariable *DeclPtr, bool PerformInit)

Emit code in this function to perform a guarded variable initialization.

void EmitBoundsCheckImpl(const Expr *ArrayExpr, QualType ArrayBaseType, llvm::Value *IndexVal, QualType IndexType, llvm::Value *BoundsVal, QualType BoundsType, bool Accessed)

VTableAuthMode

Definition CodeGenFunction.h:2470

@ MustTrap

Definition CodeGenFunction.h:2472

@ UnsafeUbsanStrip

Definition CodeGenFunction.h:2473

@ Authenticate

Definition CodeGenFunction.h:2471

void EmitRISCVMultiVersionResolver(llvm::Function *Resolver, ArrayRef< FMVResolverOption > Options)

void EmitOMPParallelMaskedDirective(const OMPParallelMaskedDirective &S)

void EmitOMPTaskyieldDirective(const OMPTaskyieldDirective &S)

LValue EmitLoadOfReferenceLValue(LValue RefLVal)

void EmitCXXTryStmt(const CXXTryStmt &S)

GlobalDecl CurGD

CurGD - The GlobalDecl for the current function being compiled.

Definition CodeGenFunction.h:393

void EmitBranchOnBoolExpr(const Expr *Cond, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock, uint64_t TrueCount, Stmt::Likelihood LH=Stmt::LH_None, const Expr *ConditionalOp=nullptr, const VarDecl *ConditionalDecl=nullptr)

EmitBranchOnBoolExpr - Emit a branch on a boolean condition (e.g.

void setCurrentProfileCount(uint64_t Count)

Set the profiler's current count.

llvm::Constant * createAtExitStub(const VarDecl &VD, llvm::FunctionCallee Dtor, llvm::Constant *Addr)

Create a stub function, suitable for being passed to atexit, which passes the given address to the gi...

void EmitSehCppScopeBegin()

llvm::Value * EmitObjCAutorelease(llvm::Value *value, llvm::Type *returnType)

Autorelease the given object.

RValue EmitObjCMessageExpr(const ObjCMessageExpr *E, ReturnValueSlot Return=ReturnValueSlot())

llvm::Value * emitBoolVecConversion(llvm::Value *SrcVec, unsigned NumElementsDst, const llvm::Twine &Name="")

void EmitOMPLastprivateClauseFinal(const OMPExecutableDirective &D, bool NoFinals, llvm::Value *IsLastIterCond=nullptr)

Emit final copying of lastprivate values to original variables at the end of the worksharing or simd ...

void EmitCXXConstructExpr(const CXXConstructExpr *E, AggValueSlot Dest)

CurrentSourceLocExprScope CurSourceLocExprScope

Source location information about the default argument or member initializer expression we're evaluat...

Definition CodeGenFunction.h:1760

void EmitARCMoveWeak(Address dst, Address src)

void @objc_moveWeak(i8** dest, i8** src) Disregards the current value in dest.

llvm::BasicBlock * getFuncletEHDispatchBlock(EHScopeStack::stable_iterator scope)

void EmitAArch64MultiVersionResolver(llvm::Function *Resolver, ArrayRef< FMVResolverOption > Options)

void EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor, const FunctionArgList &Args)

void processInReduction(const OMPExecutableDirective &S, OMPTaskDataTy &Data, CodeGenFunction &CGF, const CapturedStmt *CS, OMPPrivateScope &Scope)

llvm::Value * EmitARCRetainAutoreleaseReturnValue(llvm::Value *value)

Do a fused retain/autorelease of the given object.

void emitDestroy(Address addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)

emitDestroy - Immediately perform the destruction of the given object.

LValue EmitCXXConstructLValue(const CXXConstructExpr *E)

void EmitMustTailThunk(GlobalDecl GD, llvm::Value *AdjustedThisPtr, llvm::FunctionCallee Callee)

Emit a musttail call for a thunk with a potentially adjusted this pointer.

static Destroyer destroyNonTrivialCStruct

Definition CodeGenFunction.h:4992

AggValueSlot::Overlap_t getOverlapForFieldInit(const FieldDecl *FD)

Determine whether a field initialization may overlap some other object.

RValue EmitCoroutineIntrinsic(const CallExpr *E, unsigned int IID)

bool isBinaryLogicalOp(const Expr *E) const

Definition CodeGenFunction.h:1679

ExprValueKind

Definition CodeGenFunction.h:5033

@ EVK_RValue

Definition CodeGenFunction.h:5033

@ EVK_NonRValue

Definition CodeGenFunction.h:5033

llvm::Value * BuildVector(ArrayRef< llvm::Value * > Ops)

void EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor, CXXCtorType CtorType, const FunctionArgList &Args, SourceLocation Loc)

void ActivateCleanupBlock(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)

ActivateCleanupBlock - Activates an initially-inactive cleanup.

void emitByrefStructureInit(const AutoVarEmission &emission)

Initialize the structural components of a __block variable, i.e.

JumpDest getJumpDestInCurrentScope(llvm::BasicBlock *Target)

The given basic block lies in the current EH scope, but may be a target of a potentially scope-crossi...

Definition CodeGenFunction.h:1285

LValue EmitConditionalOperatorLValue(const AbstractConditionalOperator *E)

llvm::Value * EmitARCReclaimReturnedObject(const Expr *e, bool allowUnsafeClaim)

std::pair< LValue, llvm::Value * > EmitARCStoreAutoreleasing(const BinaryOperator *e)

void EmitOMPTaskLoopBasedDirective(const OMPLoopDirective &S)

ComplexPairTy EmitComplexPrePostIncDec(const UnaryOperator *E, LValue LV, bool isInc, bool isPre)

void SetDivFPAccuracy(llvm::Value *Val)

Set the minimum required accuracy of the given sqrt operation based on CodeGenOpts.

llvm::Value * EmitARCUnsafeUnretainedScalarExpr(const Expr *expr)

EmitARCUnsafeUnretainedScalarExpr - Semantically equivalent to immediately releasing the resut of Emi...

llvm::Value * EmitObjCSelectorExpr(const ObjCSelectorExpr *E)

Emit a selector.

llvm::Value * EmitScalarOrConstFoldImmArg(unsigned ICEArguments, unsigned Idx, const CallExpr *E)

void BuildBlockRelease(llvm::Value *DeclPtr, BlockFieldFlags flags, bool CanThrow)

llvm::Function * createTLSAtExitStub(const VarDecl &VD, llvm::FunctionCallee Dtor, llvm::Constant *Addr, llvm::FunctionCallee &AtExit)

Create a stub function, suitable for being passed to __pt_atexit_np, which passes the given address t...

SanitizerSet SanOpts

Sanitizers enabled for this function.

Definition CodeGenFunction.h:565

void emitOMPSimpleStore(LValue LVal, RValue RVal, QualType RValTy, SourceLocation Loc)

static void EmitOMPTargetParallelDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetParallelDirective &S)

void EmitAsanPrologueOrEpilogue(bool Prologue)

void callCStructMoveConstructor(LValue Dst, LValue Src)

void EmitInlinedInheritingCXXConstructorCall(const CXXConstructorDecl *Ctor, CXXCtorType CtorType, bool ForVirtualBase, bool Delegating, CallArgList &Args)

Emit a call to an inheriting constructor (that is, one that invokes a constructor inherited from a ba...

void pushStackRestore(CleanupKind kind, Address SPMem)

LValue EmitInitListLValue(const InitListExpr *E)

bool isUnderlyingBasePointerConstantNull(const Expr *E)

Check whether the underlying base pointer is a constant null.

llvm::DenseMap< const VarDecl *, llvm::Value * > NRVOFlags

A mapping from NRVO variables to the flags used to indicate when the NRVO has been applied to this va...

Definition CodeGenFunction.h:651

void EmitNullInitialization(Address DestPtr, QualType Ty)

EmitNullInitialization - Generate code to set a value of the given type to null, If the type contains...

bool IsOutlinedSEHHelper

True if the current function is an outlined SEH helper.

Definition CodeGenFunction.h:594

void EmitARCInitWeak(Address addr, llvm::Value *value)

i8* @objc_initWeak(i8** addr, i8* value) Returns value.

RawAddress CreateIRTemp(QualType T, const Twine &Name="tmp")

CreateIRTemp - Create a temporary IR object of the given type, with appropriate alignment.

void EmitOMPCanonicalLoop(const OMPCanonicalLoop *S)

Emit an OMPCanonicalLoop using the OpenMPIRBuilder.

llvm::Value * getSelectorFromSlot()

llvm::Value * getExceptionFromSlot()

Returns the contents of the function's exception object and selector slots.

void checkTargetFeatures(const CallExpr *E, const FunctionDecl *TargetDecl)

LValue EmitArraySubscriptExpr(const ArraySubscriptExpr *E, bool Accessed=false)

llvm::Value * EmitSVEStructLoad(const SVETypeFlags &TypeFlags, SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)

Address LoadCXXThisAddress()

static bool ContainsLabel(const Stmt *S, bool IgnoreCaseStmts=false)

ContainsLabel - Return true if the statement contains a label in it.

llvm::Value * EmitSVEMaskedLoad(const CallExpr *, llvm::Type *ReturnTy, SmallVectorImpl< llvm::Value * > &Ops, unsigned BuiltinID, bool IsZExtReturn)

llvm::CallInst * EmitRuntimeCall(llvm::FunctionCallee callee, ArrayRef< llvm::Value * > args, const Twine &name="")

Address LoadBlockStruct()

bool ShouldSkipSanitizerInstrumentation()

ShouldSkipSanitizerInstrumentation - Return true if the current function should not be instrumented w...

llvm::Value * EmitObjCDictionaryLiteral(const ObjCDictionaryLiteral *E)

void EmitCXXForRangeStmt(const CXXForRangeStmt &S, ArrayRef< const Attr * > Attrs={})

void EmitOMPGenericLoopDirective(const OMPGenericLoopDirective &S)

SmallVector< Address, 1 > SEHCodeSlotStack

A stack of exception code slots.

Definition CodeGenFunction.h:766

JumpDest getJumpDestInCurrentScope(StringRef Name=StringRef())

The given basic block lies in the current EH scope, but may be a target of a potentially scope-crossi...

Definition CodeGenFunction.h:1293

llvm::Value * EmitFP8NeonCall(unsigned IID, ArrayRef< llvm::Type * > Tys, SmallVectorImpl< llvm::Value * > &O, const CallExpr *E, const char *name)

LValue EmitObjCMessageExprLValue(const ObjCMessageExpr *E)

llvm::Value * GetCountedByFieldExprGEP(const Expr *Base, const FieldDecl *FD, const FieldDecl *CountDecl)

llvm::BlockAddress * GetAddrOfLabel(const LabelDecl *L)

void VolatilizeTryBlocks(llvm::BasicBlock *BB, llvm::SmallPtrSet< llvm::BasicBlock *, 10 > &V)

LValue MakeAddrLValue(llvm::Value *V, QualType T, CharUnits Alignment, AlignmentSource Source=AlignmentSource::Type)

Definition CodeGenFunction.h:2719

llvm::Value * EmitRISCVCpuSupports(const CallExpr *E)

void EmitOMPScanDirective(const OMPScanDirective &S)

void EmitComplexExprIntoLValue(const Expr *E, LValue dest, bool isInit)

EmitComplexExprIntoLValue - Emit the given expression of complex type and place its result into the s...

llvm::BasicBlock * getInvokeDestImpl()

llvm::Value * EmitRISCVCpuInit()

const CastExpr * CurCast

If a cast expression is being visited, this holds the current cast's expression.

Definition CodeGenFunction.h:351

static bool hasScalarEvaluationKind(QualType T)

Definition CodeGenFunction.h:2608

llvm::Type * ConvertType(QualType T)

bool isCleanupPadScope() const

Returns true while emitting a cleanuppad.

Definition CodeGenFunction.h:900

llvm::Value * EmitNeonSplat(llvm::Value *V, llvm::Constant *Idx)

void EmitOpenACCExitDataConstruct(const OpenACCExitDataConstruct &S)

Definition CodeGenFunction.h:4172

void GenerateCode(GlobalDecl GD, llvm::Function *Fn, const CGFunctionInfo &FnInfo)

Address EmitCXXUuidofExpr(const CXXUuidofExpr *E)

AwaitSuspendWrapperInfo CurAwaitSuspendWrapper

Definition CodeGenFunction.h:379

void EmitFakeUse(Address Addr)

llvm::function_ref< std::pair< llvm::Value *, llvm::Value * >(CodeGenFunction &, const OMPExecutableDirective &S, Address LB, Address UB)> CodeGenDispatchBoundsTy

Definition CodeGenFunction.h:333

void EmitSanitizerStatReport(llvm::SanitizerStatKind SSK)

static Destroyer destroyARCWeak

Definition CodeGenFunction.h:4990

LValue InitCapturedStruct(const CapturedStmt &S)

void addInstToNewSourceAtom(llvm::Instruction *KeyInstruction, llvm::Value *Backup)

Add KeyInstruction and an optional Backup instruction to a new atom group (See ApplyAtomGroup for mor...

FieldDecl * LambdaThisCaptureField

Definition CodeGenFunction.h:647

CGCapturedStmtInfo * CapturedStmtInfo

Definition CodeGenFunction.h:522

void EmitOMPDistributeDirective(const OMPDistributeDirective &S)

BuiltinCheckKind

Specifies which type of sanitizer check to apply when handling a particular builtin.

Definition CodeGenFunction.h:5266

@ BCK_CLZPassedZero

Definition CodeGenFunction.h:5268

@ BCK_AssumePassedFalse

Definition CodeGenFunction.h:5269

@ BCK_CTZPassedZero

Definition CodeGenFunction.h:5267

Address recoverAddrOfEscapedLocal(CodeGenFunction &ParentCGF, Address ParentVar, llvm::Value *ParentFP)

Recovers the address of a local in a parent function.

RValue EmitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *E)

llvm::Value * EmitSVEGatherPrefetch(const SVETypeFlags &TypeFlags, SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)

llvm::Value * EmitObjCProtocolExpr(const ObjCProtocolExpr *E)

void EmitOMPParallelForDirective(const OMPParallelForDirective &S)

llvm::CallBase * EmitCallOrInvoke(llvm::FunctionCallee Callee, ArrayRef< llvm::Value * > Args, const Twine &Name="")

Emits a call or invoke instruction to the given function, depending on the current state of the EH st...

llvm::Value * EmitSystemZBuiltinExpr(unsigned BuiltinID, const CallExpr *E)

void pushEHDestroy(QualType::DestructionKind dtorKind, Address addr, QualType type)

pushEHDestroy - Push the standard destructor for the given type as an EH-only cleanup.

void EmitNoreturnRuntimeCallOrInvoke(llvm::FunctionCallee callee, ArrayRef< llvm::Value * > args)

Emits a call or invoke to the given noreturn runtime function.

llvm::CallBase * EmitRuntimeCallOrInvoke(llvm::FunctionCallee callee, ArrayRef< llvm::Value * > args, const Twine &name="")

Emits a call or invoke instruction to the given runtime function.

void callCStructDestructor(LValue Dst)

RValue EmitCXXMemberOrOperatorMemberCallExpr(const CallExpr *CE, const CXXMethodDecl *MD, ReturnValueSlot ReturnValue, bool HasQualifier, NestedNameSpecifier Qualifier, bool IsArrow, const Expr *Base, llvm::CallBase **CallOrInvoke)

PeepholeProtection protectFromPeepholes(RValue rvalue)

protectFromPeepholes - Protect a value that we're intending to store to the side, but which will prob...

ComplexPairTy EmitLoadOfComplex(LValue src, SourceLocation loc)

EmitLoadOfComplex - Load a complex number from the specified l-value.

void EmitOMPMasterDirective(const OMPMasterDirective &S)

llvm::Value * EmitSEHAbnormalTermination()

void EmitOMPParallelMasterTaskLoopSimdDirective(const OMPParallelMasterTaskLoopSimdDirective &S)

llvm::Value * EmitARCAutoreleaseReturnValue(llvm::Value *value)

Autorelease the given object.

bool inSuspendBlock() const

Definition CodeGenFunction.h:369

llvm::Value * EmitARCRetain(QualType type, llvm::Value *value)

Produce the code to do a retain.

llvm::Value * EmitPointerAuthQualify(PointerAuthQualifier Qualifier, llvm::Value *Pointer, QualType ValueType, Address StorageAddress, bool IsKnownNonNull)

bool OMPFirstScanLoop

Definition CodeGenFunction.h:782

void EmitVTablePtrCheckForCall(const CXXRecordDecl *RD, llvm::Value *VTable, CFITypeCheckKind TCK, SourceLocation Loc)

EmitVTablePtrCheckForCall - Virtual method MD is being called via VTable.

void EmitLambdaStaticInvokeBody(const CXXMethodDecl *MD)

CleanupKind getARCCleanupKind()

Retrieves the default cleanup kind for an ARC cleanup.

Definition CodeGenFunction.h:4924

GuardKind

Definition CodeGenFunction.h:5120

@ TlsGuard

Definition CodeGenFunction.h:5120

@ VariableGuard

Definition CodeGenFunction.h:5120

llvm::Value * EmitARCAutorelease(llvm::Value *value)

Autorelease the given object.

void EmitOMPSimdInit(const OMPLoopDirective &D)

Helpers for the OpenMP loop directives.

llvm::Value * EmitARCRetainAutoreleaseScalarExpr(const Expr *expr)

llvm::Value * EmitSMEReadWrite(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)

llvm::Type * SVEBuiltinMemEltTy(const SVETypeFlags &TypeFlags)

SVEBuiltinMemEltTy - Returns the memory element type for this memory access builtin.

const OMPExecutableDirective * OMPParentLoopDirectiveForScan

Parent loop-based directive for scan directive.

Definition CodeGenFunction.h:777

bool shouldUseFusedARCCalls()

Definition CodeGenFunction.h:2158

llvm::Value * EmitSVEScatterStore(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)

void EmitOpenACCInitConstruct(const OpenACCInitConstruct &S)

Definition CodeGenFunction.h:4189

bool CurFuncIsThunk

In C++, whether we are code generating a thunk.

Definition CodeGenFunction.h:581

void EmitAtomicInit(Expr *E, LValue lvalue)

void EmitLambdaDelegatingInvokeBody(const CXXMethodDecl *MD, CallArgList &CallArgs)

void EmitAggFinalDestCopy(QualType Type, AggValueSlot Dest, const LValue &Src, ExprValueKind SrcKind)

EmitAggFinalDestCopy - Emit copy of the specified aggregate into destination address.

void EmitARCDestroyWeak(Address addr)

void @objc_destroyWeak(i8** addr) Essentially objc_storeWeak(addr, nil).

Address GetAddressOfBaseClass(Address Value, const CXXRecordDecl *Derived, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd, bool NullCheckValue, SourceLocation Loc)

GetAddressOfBaseClass - This function will add the necessary delta to the load of 'this' and returns ...

LValue MakeNaturalAlignPointeeAddrLValue(llvm::Value *V, QualType T)

Given a value of type T* that may not be to a complete object, construct an l-value with the natural ...

void EmitOMPFlushDirective(const OMPFlushDirective &S)

void EmitStoreThroughExtVectorComponentLValue(RValue Src, LValue Dst)

llvm::Value * EmitVAStartEnd(llvm::Value *ArgValue, bool IsStart)

Emits a call to an LLVM variable-argument intrinsic, either llvm.va_start or llvm....

RValue EmitBlockCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke)

static void EmitOMPTargetDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetDirective &S)

Emit device code for the target directive.

llvm::Value * EmitSVEMaskedStore(const CallExpr *, SmallVectorImpl< llvm::Value * > &Ops, unsigned BuiltinID)

LValue EmitObjCEncodeExprLValue(const ObjCEncodeExpr *E)

void EmitSehTryScopeEnd()

bool EmitOMPFirstprivateClause(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)

void EmitObjCRelease(llvm::Value *value, ARCPreciseLifetime_t precise)

Release the given object.

void EmitOMPTaskgroupDirective(const OMPTaskgroupDirective &S)

JumpDest getJumpDestForLabel(const LabelDecl *S)

getBasicBlockForLabel - Return the LLVM basicblock that the specified label maps to.

void EmitCoreturnStmt(const CoreturnStmt &S)

void EmitOMPTargetTeamsDistributeParallelForSimdDirective(const OMPTargetTeamsDistributeParallelForSimdDirective &S)

void pushRegularPartialArrayCleanup(llvm::Value *arrayBegin, llvm::Value *arrayEnd, QualType elementType, CharUnits elementAlignment, Destroyer *destroyer)

pushRegularPartialArrayCleanup - Push an EH cleanup to destroy already-constructed elements of the gi...

void EmitCXXThrowExpr(const CXXThrowExpr *E, bool KeepInsertionPoint=true)

SmallVector< llvm::ConvergenceControlInst *, 4 > ConvergenceTokenStack

Stack to track the controlled convergence tokens.

Definition CodeGenFunction.h:310

static void EmitOMPTargetTeamsDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsDirective &S)

Emit device code for the target teams directive.

llvm::Value * EmitAMDGPUBuiltinExpr(unsigned BuiltinID, const CallExpr *E)

LValue EmitCompoundLiteralLValue(const CompoundLiteralExpr *E)

bool isSEHTryScope() const

Returns true inside SEH __try blocks.

Definition CodeGenFunction.h:897

void registerGlobalDtorWithAtExit(const VarDecl &D, llvm::FunctionCallee fn, llvm::Constant *addr)

Call atexit() with a function that passes the given argument to the given function.

llvm::Value * EmitObjCAllocInit(llvm::Value *value, llvm::Type *resultType)

void unprotectFromPeepholes(PeepholeProtection protection)

void EmitOMPReductionClauseInit(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope, bool ForInscan=false)

Emit initial code for reduction variables.

void EmitObjCAtThrowStmt(const ObjCAtThrowStmt &S)

void EmitOMPDistributeSimdDirective(const OMPDistributeSimdDirective &S)

void EmitSynthesizedCXXCopyCtor(Address Dest, Address Src, const Expr *Exp)

RValue convertTempToRValue(Address addr, QualType type, SourceLocation Loc)

Given the address of a temporary variable, produce an r-value of its type.

LValue EmitObjCIsaExpr(const ObjCIsaExpr *E)

void EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst, llvm::Value **Result=nullptr)

EmitStoreThroughBitfieldLValue - Store Src into Dst with same constraints as EmitStoreThroughLValue.

llvm::Value * EmitAArch64SMEBuiltinExpr(unsigned BuiltinID, const CallExpr *E)

void EmitAutoVarDecl(const VarDecl &D)

EmitAutoVarDecl - Emit an auto variable declaration.

llvm::Constant * EmitCheckSourceLocation(SourceLocation Loc)

Emit a description of a source location in a format suitable for passing to a runtime sanitizer handl...

void EmitObjCAutoreleasePoolCleanup(llvm::Value *Ptr)

LValue EmitCXXUuidofLValue(const CXXUuidofExpr *E)

bool hasVolatileMember(QualType T)

hasVolatileMember - returns true if aggregate type has a volatile member.

Definition CodeGenFunction.h:2987

void enterByrefCleanup(CleanupKind Kind, Address Addr, BlockFieldFlags Flags, bool LoadBlockVarAddr, bool CanThrow)

Enter a cleanup to destroy a __block variable.

void EmitAutoVarInit(const AutoVarEmission &emission)

llvm::Value * EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV, bool isInc, bool isPre)

void SetSqrtFPAccuracy(llvm::Value *Val)

Set the minimum required accuracy of the given sqrt operation based on CodeGenOpts.

static void EmitOMPTargetTeamsDistributeDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsDistributeDirective &S)

Emit device code for the target teams distribute directive.

RValue EmitSimpleCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke=nullptr)

Emit a CallExpr without considering whether it might be a subclass.

llvm::SmallVector< DeferredDeactivateCleanup > DeferredDeactivationCleanupStack

Definition CodeGenFunction.h:668

RValue EmitVAArg(VAArgExpr *VE, Address &VAListAddr, AggValueSlot Slot=AggValueSlot::ignored())

Generate code to get an argument from the passed in pointer and update it accordingly.

static bool isNullPointerAllowed(TypeCheckKind TCK)

Determine whether the pointer type check TCK permits null pointers.

void EmitForwardingCallToLambda(const CXXMethodDecl *LambdaCallOperator, CallArgList &CallArgs, const CGFunctionInfo *CallOpFnInfo=nullptr, llvm::Constant *CallOpFn=nullptr)

void EmitReturnValueCheck(llvm::Value *RV)

Emit a test that checks if the return value RV is nonnull.

llvm::Value * getAsNaturalPointerTo(Address Addr, QualType PointeeType)

Definition CodeGenFunction.h:4645

bool EmitSimpleStmt(const Stmt *S, ArrayRef< const Attr * > Attrs)

EmitSimpleStmt - Try to emit a "simple" statement which does not necessarily require an insertion poi...

RValue emitBuiltinOSLogFormat(const CallExpr &E)

Emit IR for __builtin_os_log_format.

llvm::Value * emitPointerAuthResignCall(llvm::Value *Pointer, const CGPointerAuthInfo &CurInfo, const CGPointerAuthInfo &NewInfo)

void EmitOMPTaskwaitDirective(const OMPTaskwaitDirective &S)

RValue EmitPseudoObjectRValue(const PseudoObjectExpr *e, AggValueSlot slot=AggValueSlot::ignored())

void EmitDelegateCallArg(CallArgList &args, const VarDecl *param, SourceLocation loc)

EmitDelegateCallArg - We are performing a delegate call; that is, the current function is delegating ...

llvm::BasicBlock * createBasicBlock(const Twine &name="", llvm::Function *parent=nullptr, llvm::BasicBlock *before=nullptr)

createBasicBlock - Create an LLVM basic block.

Definition CodeGenFunction.h:2617

void EmitOMPTargetParallelForDirective(const OMPTargetParallelForDirective &S)

void maybeUpdateMCDCTestVectorBitmap(const Expr *E)

Increment the profiler's counter for the given expression by StepV.

void addInstToCurrentSourceAtom(llvm::Instruction *KeyInstruction, llvm::Value *Backup)

See CGDebugInfo::addInstToCurrentSourceAtom.

unsigned getDebugInfoFIndex(const RecordDecl *Rec, unsigned FieldIndex)

Get the record field index as represented in debug info.

AggValueSlot::Overlap_t getOverlapForBaseInit(const CXXRecordDecl *RD, const CXXRecordDecl *BaseRD, bool IsVirtual)

Determine whether a base class initialization may overlap some other object.

void EmitCXXDeleteExpr(const CXXDeleteExpr *E)

llvm::Value * EmitObjCArrayLiteral(const ObjCArrayLiteral *E)

llvm::Function * generateBuiltinOSLogHelperFunction(const analyze_os_log::OSLogBufferLayout &Layout, CharUnits BufferAlignment)

llvm::Value * EmitPromotedScalarExpr(const Expr *E, QualType PromotionType)

const LangOptions & getLangOpts() const

Definition CodeGenFunction.h:2162

void addInstToSpecificSourceAtom(llvm::Instruction *KeyInstruction, llvm::Value *Backup, uint64_t Atom)

See CGDebugInfo::addInstToSpecificSourceAtom.

void EmitCfiCheckFail()

Emit a cross-DSO CFI failure handling function.

RValue EmitReferenceBindingToExpr(const Expr *E)

Emits a reference binding to the passed in expression.

llvm::Value * EmitARCRetainAutorelease(QualType type, llvm::Value *value)

Do a fused retain/autorelease of the given object.

llvm::Value * EmitARCStoreStrong(LValue lvalue, llvm::Value *value, bool resultIgnored)

Store into a strong object.

llvm::Value * EmitARCRetainAutoreleasedReturnValue(llvm::Value *value)

Retain the given object which is the result of a function call.

bool isPointerKnownNonNull(const Expr *E)

void StartObjCMethod(const ObjCMethodDecl *MD, const ObjCContainerDecl *CD)

StartObjCMethod - Begin emission of an ObjCMethod.

LValue MakeNaturalAlignAddrLValue(llvm::Value *V, QualType T, KnownNonNull_t IsKnownNonNull=NotKnownNonNull)

AutoVarEmission EmitAutoVarAlloca(const VarDecl &var)

EmitAutoVarAlloca - Emit the alloca and debug information for a local variable.

LValue EmitPointerToDataMemberBinaryExpr(const BinaryOperator *E)

llvm::Value * EmitARCUnsafeClaimAutoreleasedReturnValue(llvm::Value *value)

Claim a possibly-autoreleased return value at +0.

llvm::Value * EmitObjCMRRAutoreleasePoolPush()

Produce the code to do an MRR version objc_autoreleasepool_push.

void EmitVarAnnotations(const VarDecl *D, llvm::Value *V)

Emit local annotations for the local variable V, declared by D.

llvm::BasicBlock * EHResumeBlock

EHResumeBlock - Unified block containing a call to llvm.eh.resume.

Definition CodeGenFunction.h:753

void EmitOpenACCShutdownConstruct(const OpenACCShutdownConstruct &S)

Definition CodeGenFunction.h:4194

LValue EmitLValueForIvar(QualType ObjectTy, llvm::Value *Base, const ObjCIvarDecl *Ivar, unsigned CVRQualifiers)

void EmitAtomicUpdate(LValue LVal, llvm::AtomicOrdering AO, const llvm::function_ref< RValue(RValue)> &UpdateOp, bool IsVolatile)

bool InNoConvergentAttributedStmt

True if the current statement has noconvergent attribute.

Definition CodeGenFunction.h:610

static bool IsConstructorDelegationValid(const CXXConstructorDecl *Ctor)

Checks whether the given constructor is a valid subject for the complete-to-base constructor delegati...

void GenerateObjCCtorDtorMethod(ObjCImplementationDecl *IMP, ObjCMethodDecl *MD, bool ctor)

void EmitTypeCheck(TypeCheckKind TCK, SourceLocation Loc, Address Addr, QualType Type, CharUnits Alignment=CharUnits::Zero(), SanitizerSet SkippedChecks=SanitizerSet(), llvm::Value *ArraySize=nullptr)

Definition CodeGenFunction.h:3321

Address GetAddressOfDerivedClass(Address Value, const CXXRecordDecl *Derived, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd, bool NullCheckValue)

llvm::Value * EmitObjCAllocWithZone(llvm::Value *value, llvm::Type *returnType)

Allocate the given objc object.

void EmitIgnoredConditionalOperator(const AbstractConditionalOperator *E)

void GetAArch64SVEProcessedOperands(unsigned BuiltinID, const CallExpr *E, SmallVectorImpl< llvm::Value * > &Ops, SVETypeFlags TypeFlags)

void EmitVTablePtrCheck(const CXXRecordDecl *RD, llvm::Value *VTable, CFITypeCheckKind TCK, SourceLocation Loc)

EmitVTablePtrCheck - Emit a check that VTable is a valid virtual table for RD using llvm....

llvm::Value * EmitSVEGatherLoad(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)

llvm::Function * GenerateBlockFunction(GlobalDecl GD, const CGBlockInfo &Info, const DeclMapTy &ldm, bool IsLambdaConversionToBlock, bool BuildGlobalBlock)

void EmitCountedByBoundsChecking(const Expr *ArrayExpr, QualType ArrayType, Address ArrayInst, QualType IndexType, llvm::Value *IndexVal, bool Accessed, bool FlexibleArray)

EmitCountedByBoundsChecking - If the array being accessed has a "counted_by" attribute,...

Address EmitFieldAnnotations(const FieldDecl *D, Address V)

Emit field annotations for the given field & value.

llvm::Function * LookupNeonLLVMIntrinsic(unsigned IntrinsicID, unsigned Modifier, llvm::Type *ArgTy, const CallExpr *E)

void pushDestroy(QualType::DestructionKind dtorKind, Address addr, QualType type)

pushDestroy - Push the standard destructor for the given type as at least a normal cleanup.

void EmitScalarInit(const Expr *init, const ValueDecl *D, LValue lvalue, bool capturedByInit)

void EmitNullabilityCheck(LValue LHS, llvm::Value *RHS, SourceLocation Loc)

Given an assignment *LHS = RHS, emit a test that checks if RHS is nonnull, if LHS is marked _Nonnull.

void EmitConstructorBody(FunctionArgList &Args)

EmitConstructorBody - Emits the body of the current constructor.

const CodeGen::CGBlockInfo * BlockInfo

Definition CodeGenFunction.h:643

void EmitKCFIOperandBundle(const CGCallee &Callee, SmallVectorImpl< llvm::OperandBundleDef > &Bundles)

llvm::Value * EmitPointerAuthUnqualify(PointerAuthQualifier Qualifier, llvm::Value *Pointer, QualType PointerType, Address StorageAddress, bool IsKnownNonNull)

void EmitAggregateCopyCtor(LValue Dest, LValue Src, AggValueSlot::Overlap_t MayOverlap)

Definition CodeGenFunction.h:3017

void EmitDeclRefExprDbgValue(const DeclRefExpr *E, const APValue &Init)

Address makeNaturalAddressForPointer(llvm::Value *Ptr, QualType T, CharUnits Alignment=CharUnits::Zero(), bool ForPointeeType=false, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr, KnownNonNull_t IsKnownNonNull=NotKnownNonNull)

Construct an address with the natural alignment of T.

Definition CodeGenFunction.h:2695

void EmitOpenACCWaitConstruct(const OpenACCWaitConstruct &S)

Definition CodeGenFunction.h:4184

static Destroyer destroyCXXObject

Definition CodeGenFunction.h:3227

llvm::AllocaInst * EHSelectorSlot

The selector slot.

Definition CodeGenFunction.h:761

Address EmitLoadOfPointer(Address Ptr, const PointerType *PtrTy, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr)

Load a pointer with type PtrTy stored at address Ptr.

LValue MakeNaturalAlignPointeeRawAddrLValue(llvm::Value *V, QualType T)

Same as MakeNaturalAlignPointeeAddrLValue except that the pointer is known to be unsigned.

llvm::BasicBlock * EmitLandingPad()

Emits a landing pad for the current EH stack.

void EmitLambdaInAllocaImplFn(const CXXMethodDecl *CallOp, const CGFunctionInfo **ImplFnInfo, llvm::Function **ImplFn)

llvm::Constant * GenerateCopyHelperFunction(const CGBlockInfo &blockInfo)

Generate the copy-helper function for a block closure object: static void block_copy_helper(block_t *...

void EmitCXXAggrConstructorCall(const CXXConstructorDecl *D, const ArrayType *ArrayTy, Address ArrayPtr, const CXXConstructExpr *E, bool NewPointerIsChecked, bool ZeroInitialization=false)

EmitCXXAggrConstructorCall - Emit a loop to call a particular constructor for each of several members...

std::pair< RValue, llvm::Value * > EmitAtomicCompareExchange(LValue Obj, RValue Expected, RValue Desired, SourceLocation Loc, llvm::AtomicOrdering Success=llvm::AtomicOrdering::SequentiallyConsistent, llvm::AtomicOrdering Failure=llvm::AtomicOrdering::SequentiallyConsistent, bool IsWeak=false, AggValueSlot Slot=AggValueSlot::ignored())

Emit a compare-and-exchange op for atomic type.

CurrentSourceLocExprScope::SourceLocExprScopeGuard SourceLocExprScopeGuard

Definition CodeGenFunction.h:1761

void EmitBlockAfterUses(llvm::BasicBlock *BB)

EmitBlockAfterUses - Emit the given block somewhere hopefully near its uses, and leave the insertion ...

RValue EmitLoadOfGlobalRegLValue(LValue LV)

Load of global named registers are always calls to intrinsics.

VPtrsVector getVTablePointers(const CXXRecordDecl *VTableClass)

void EmitSehCppScopeEnd()

void EmitVTablePtrCheckForCast(QualType T, Address Derived, bool MayBeNull, CFITypeCheckKind TCK, SourceLocation Loc)

Derived is the presumed address of an object of type T after a cast.

TypeCheckKind

Situations in which we might emit a check for the suitability of a pointer or glvalue.

Definition CodeGenFunction.h:3266

@ TCK_DowncastPointer

Checking the operand of a static_cast to a derived pointer type.

Definition CodeGenFunction.h:3285

@ TCK_DowncastReference

Checking the operand of a static_cast to a derived reference type.

Definition CodeGenFunction.h:3288

@ TCK_MemberAccess

Checking the object expression in a non-static data member access.

Definition CodeGenFunction.h:3277

@ TCK_ConstructorCall

Checking the 'this' pointer for a constructor call.

Definition CodeGenFunction.h:3282

@ TCK_Store

Checking the destination of a store. Must be suitably sized and aligned.

Definition CodeGenFunction.h:3270

@ TCK_NonnullAssign

Checking the value assigned to a _Nonnull pointer. Must not be null.

Definition CodeGenFunction.h:3296

@ TCK_UpcastToVirtualBase

Checking the operand of a cast to a virtual base object.

Definition CodeGenFunction.h:3294

@ TCK_MemberCall

Checking the 'this' pointer for a call to a non-static member function.

Definition CodeGenFunction.h:3280

@ TCK_DynamicOperation

Checking the operand of a dynamic_cast or a typeid expression.

Definition CodeGenFunction.h:3299

@ TCK_ReferenceBinding

Checking the bound value in a reference binding.

Definition CodeGenFunction.h:3274

@ TCK_Load

Checking the operand of a load. Must be suitably sized and aligned.

Definition CodeGenFunction.h:3268

@ TCK_Upcast

Checking the operand of a cast to a base object.

Definition CodeGenFunction.h:3291

llvm::Type * getEltType(const SVETypeFlags &TypeFlags)

void SimplifyForwardingBlocks(llvm::BasicBlock *BB)

SimplifyForwardingBlocks - If the given basic block is only a branch to another basic block,...

static std::string getNonTrivialDestructorStr(QualType QT, CharUnits Alignment, bool IsVolatile, ASTContext &Ctx)

llvm::Value * EmitCXXNewExpr(const CXXNewExpr *E)

llvm::Value * EmitObjCThrowOperand(const Expr *expr)

void EmitCXXDestructorCall(const CXXDestructorDecl *D, CXXDtorType Type, bool ForVirtualBase, bool Delegating, Address This, QualType ThisTy)

LValue MakeAddrLValue(Address Addr, QualType T, LValueBaseInfo BaseInfo, TBAAAccessInfo TBAAInfo)

Definition CodeGenFunction.h:2714

const BlockByrefInfo & getBlockByrefInfo(const VarDecl *var)

BuildByrefInfo - This routine changes a __block variable declared as T x into:

void EmitBranchThroughCleanup(JumpDest Dest)

EmitBranchThroughCleanup - Emit a branch from the current insert block through the normal cleanup han...

void EmitOMPReductionClauseFinal(const OMPExecutableDirective &D, const OpenMPDirectiveKind ReductionKind)

Emit final update of reduction values to original variables at the end of the directive.

llvm::Value * EmitCommonNeonBuiltinExpr(unsigned BuiltinID, unsigned LLVMIntrinsic, unsigned AltLLVMIntrinsic, const char *NameHint, unsigned Modifier, const CallExpr *E, SmallVectorImpl< llvm::Value * > &Ops, Address PtrOp0, Address PtrOp1, llvm::Triple::ArchType Arch)

llvm::Value * EmitRISCVBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue)

LValue EmitBinaryOperatorLValue(const BinaryOperator *E)

bool InNoMergeAttributedStmt

True if the current statement has nomerge attribute.

Definition CodeGenFunction.h:601

llvm::Value * EmitNeonSplat(llvm::Value *V, llvm::Constant *Idx, const llvm::ElementCount &Count)

LValue EmitComplexCompoundAssignmentLValue(const CompoundAssignOperator *E)

void pushIrregularPartialArrayCleanup(llvm::Value *arrayBegin, Address arrayEndPointer, QualType elementType, CharUnits elementAlignment, Destroyer *destroyer)

pushIrregularPartialArrayCleanup - Push a NormalAndEHCleanup to destroy already-constructed elements ...

llvm::Value * EmitCheckedArgForBuiltin(const Expr *E, BuiltinCheckKind Kind)

Emits an argument for a call to a builtin.

void EmitOMPLoopBody(const OMPLoopDirective &D, JumpDest LoopExit)

Helper for the OpenMP loop directives.

Address EmitCheckedInBoundsGEP(Address Addr, ArrayRef< llvm::Value * > IdxList, llvm::Type *elementType, bool SignedIndices, bool IsSubtraction, SourceLocation Loc, CharUnits Align, const Twine &Name="")

void EmitOMPScopeDirective(const OMPScopeDirective &S)

const Decl * CurCodeDecl

CurCodeDecl - This is the inner-most code context, which includes blocks.

Definition CodeGenFunction.h:344

LValue MakeAddrLValueWithoutTBAA(Address Addr, QualType T, AlignmentSource Source=AlignmentSource::Type)

Definition CodeGenFunction.h:2735

llvm::BasicBlock * getUnreachableBlock()

Definition CodeGenFunction.h:2176

Destroyer * getDestroyer(QualType::DestructionKind destructionKind)

llvm::AssertingVH< llvm::Instruction > AllocaInsertPt

AllocaInsertPoint - This is an instruction in the entry block before which we prefer to insert alloca...

Definition CodeGenFunction.h:423

void EmitAggregateAssign(LValue Dest, LValue Src, QualType EltTy)

Emit an aggregate assignment.

Definition CodeGenFunction.h:3011

void EmitARCRelease(llvm::Value *value, ARCPreciseLifetime_t precise)

Release the given object.

void maybeAttachRangeForLoad(llvm::LoadInst *Load, QualType Ty, SourceLocation Loc)

void EmitCXXGlobalVarDeclInit(const VarDecl &D, llvm::GlobalVariable *GV, bool PerformInit)

EmitCXXGlobalVarDeclInit - Create the initializer for a C++ variable with global storage.

void EmitBitfieldConversionCheck(llvm::Value *Src, QualType SrcType, llvm::Value *Dst, QualType DstType, const CGBitFieldInfo &Info, SourceLocation Loc)

Emit a check that an [implicit] conversion of a bitfield.

bool currentFunctionUsesSEHTry() const

Definition CodeGenFunction.h:2190

void PushDestructorCleanup(QualType T, Address Addr)

PushDestructorCleanup - Push a cleanup to call the complete-object destructor of an object of the giv...

llvm::SmallVector< const JumpDest *, 2 > SEHTryEpilogueStack

Definition CodeGenFunction.h:700

CodeGenFunction * ParentCGF

Definition CodeGenFunction.h:282

void pushCallObjectDeleteCleanup(const FunctionDecl *OperatorDelete, llvm::Value *CompletePtr, QualType ElementType)

void EmitFunctionBody(const Stmt *Body)

JumpDest ReturnBlock

ReturnBlock - Unified return block.

Definition CodeGenFunction.h:400

void EmitOMPTargetTeamsDistributeSimdDirective(const OMPTargetTeamsDistributeSimdDirective &S)

RValue EmitCXXMemberOrOperatorCall(const CXXMethodDecl *Method, const CGCallee &Callee, ReturnValueSlot ReturnValue, llvm::Value *This, llvm::Value *ImplicitParam, QualType ImplicitParamTy, const CallExpr *E, CallArgList *RtlArgs, llvm::CallBase **CallOrInvoke)

DominatingValue< T >::saved_type saveValueInCond(T value)

Definition CodeGenFunction.h:803

void EmitSEHExceptionCodeSave(CodeGenFunction &ParentCGF, llvm::Value *ParentFP, llvm::Value *EntryEBP)

const llvm::function_ref< void(CodeGenFunction &, llvm::Function *, const OMPTaskDataTy &)> TaskGenTy

Definition CodeGenFunction.h:3848

std::pair< LValue, llvm::Value * > EmitARCStoreUnsafeUnretained(const BinaryOperator *e, bool ignored)

llvm::DebugLoc SourceLocToDebugLoc(SourceLocation Location)

Converts Location to a DebugLoc, if debug information is enabled.

static bool cxxDestructorCanThrow(QualType T)

Check if T is a C++ class that has a destructor that can throw.

llvm::Value * ExceptionSlot

The exception slot.

Definition CodeGenFunction.h:757

LValue EmitPseudoObjectLValue(const PseudoObjectExpr *e)

ComplexPairTy EmitPromotedComplexExpr(const Expr *E, QualType PromotionType)

llvm::Constant * EmitCheckTypeDescriptor(QualType T)

Emit a description of a type in a format suitable for passing to a runtime sanitizer handler.

void EmitCallAndReturnForThunk(llvm::FunctionCallee Callee, const ThunkInfo *Thunk, bool IsUnprototyped)

bool EmitOMPCopyinClause(const OMPExecutableDirective &D)

Emit code for copyin clause in D directive.

llvm::Value * EmitSVEDupX(llvm::Value *Scalar)

LValue EmitOpaqueValueLValue(const OpaqueValueExpr *e)

void EmitOMPLinearClause(const OMPLoopDirective &D, CodeGenFunction::OMPPrivateScope &PrivateScope)

Emit initial code for linear clauses.

llvm::Value * LoadPassedObjectSize(const Expr *E, QualType EltTy)

If E references a parameter with pass_object_size info or a constant array size modifier,...

void EmitAnyExprToExn(const Expr *E, Address Addr)

EvaluationOrder

Definition CodeGenFunction.h:5463

@ ForceLeftToRight

! Language semantics require left-to-right evaluation.

Definition CodeGenFunction.h:5467

@ Default

! No language constraints on evaluation order.

Definition CodeGenFunction.h:5465

@ ForceRightToLeft

! Language semantics require right-to-left evaluation.

Definition CodeGenFunction.h:5469

LValue EmitScalarCompoundAssignWithComplex(const CompoundAssignOperator *E, llvm::Value *&Result)

llvm::BasicBlock * OMPBeforeScanBlock

Definition CodeGenFunction.h:778

void EmitOMPInterchangeDirective(const OMPInterchangeDirective &S)

void EmitOMPPrivateLoopCounters(const OMPLoopDirective &S, OMPPrivateScope &LoopScope)

Emit initial code for loop counters of loop-based directives.

llvm::SmallPtrSet< const CXXRecordDecl *, 4 > VisitedVirtualBasesSetTy

Definition CodeGenFunction.h:2456

void GenerateObjCGetter(ObjCImplementationDecl *IMP, const ObjCPropertyImplDecl *PID)

GenerateObjCGetter - Synthesize an Objective-C property getter function.

llvm::Value * EmitIvarOffsetAsPointerDiff(const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar)

void initFullExprCleanupWithFlag(RawAddress ActiveFlag)

RValue EmitCUDAKernelCallExpr(const CUDAKernelCallExpr *E, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke)

void pushCleanupAndDeferDeactivation(CleanupKind Kind, As... A)

Definition CodeGenFunction.h:968

llvm::DebugLoc EmitReturnBlock()

Emit the unified return block, trying to avoid its emission when possible.

void EmitNonNullArgCheck(RValue RV, QualType ArgType, SourceLocation ArgLoc, AbstractCallee AC, unsigned ParmNum)

Create a check for a function parameter that may potentially be declared as non-null.

RValue EmitLoadOfAnyValue(LValue V, AggValueSlot Slot=AggValueSlot::ignored(), SourceLocation Loc={})

Like EmitLoadOfLValue but also handles complex and aggregate types.

llvm::BasicBlock * getEHResumeBlock(bool isCleanup)

void EmitAggregateCopy(LValue Dest, LValue Src, QualType EltTy, AggValueSlot::Overlap_t MayOverlap, bool isVolatile=false)

EmitAggregateCopy - Emit an aggregate copy.

llvm::DenseMap< const Decl *, Address > DeclMapTy

Definition CodeGenFunction.h:1124

LValue EmitLValueForField(LValue Base, const FieldDecl *Field, bool IsInBounds=true)

RawAddress CreateDefaultAlignTempAlloca(llvm::Type *Ty, const Twine &Name="tmp")

CreateDefaultAlignedTempAlloca - This creates an alloca with the default ABI alignment of the given L...

const TargetInfo & getTarget() const

Definition CodeGenFunction.h:2192

RValue emitRotate(const CallExpr *E, bool IsRotateRight)

void initFullExprCleanup()

Set up the last cleanup that was pushed as a conditional full-expression cleanup.

Definition CodeGenFunction.h:979

void defaultInitNonTrivialCStructVar(LValue Dst)

llvm::Value * EmitAArch64SVEBuiltinExpr(unsigned BuiltinID, const CallExpr *E)

llvm::Function * getSpecConstantFunction(const clang::QualType &SpecConstantType)

LValue EmitCompoundAssignmentLValue(const CompoundAssignOperator *E)

llvm::Value * EmitAnnotationCall(llvm::Function *AnnotationFn, llvm::Value *AnnotatedVal, StringRef AnnotationStr, SourceLocation Location, const AnnotateAttr *Attr)

Emit an annotation call (intrinsic).

void EmitStaticVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)

bool isInConditionalBranch() const

isInConditionalBranch - Return true if we're currently emitting one branch or the other of a conditio...

Definition CodeGenFunction.h:1344

llvm::Value * EmitFP8NeonCvtCall(unsigned IID, llvm::Type *Ty0, llvm::Type *Ty1, bool Extract, SmallVectorImpl< llvm::Value * > &Ops, const CallExpr *E, const char *name)

Address EmitCompoundStmtWithoutScope(const CompoundStmt &S, bool GetLast=false, AggValueSlot AVS=AggValueSlot::ignored())

void pushKmpcAllocFree(CleanupKind Kind, std::pair< llvm::Value *, llvm::Value * > AddrSizePair)

void GenerateOpenMPCapturedVars(const CapturedStmt &S, SmallVectorImpl< llvm::Value * > &CapturedVars)

llvm::Value * EmitBlockCopyAndAutorelease(llvm::Value *Block, QualType Ty)

Address EmitCXXMemberDataPointerAddress(const Expr *E, Address base, llvm::Value *memberPtr, const MemberPointerType *memberPtrType, bool IsInBounds, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr)

Emit the address of a field using a member data pointer.

void EmitGotoStmt(const GotoStmt &S)

llvm::BasicBlock * getTerminateHandler()

getTerminateHandler - Return a handler (not a landing pad, just a catch handler) that just calls term...

void PopCleanupBlocks(EHScopeStack::stable_iterator OldCleanupStackSize, std::initializer_list< llvm::Value ** > ValuesToReload={})

Takes the old cleanup stack size and emits the cleanup blocks that have been added.

void EmitOMPDepobjDirective(const OMPDepobjDirective &S)

bool isCoroutine() const

Definition CodeGenFunction.h:367

void maybeCreateMCDCCondBitmap()

Allocate a temp value on the stack that MCDC can use to track condition results.

void EmitOMPMetaDirective(const OMPMetaDirective &S)

llvm::Value * EmitARMBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue, llvm::Triple::ArchType Arch)

LValue EmitHLSLOutArgExpr(const HLSLOutArgExpr *E, CallArgList &Args, QualType Ty)

static bool isVptrCheckRequired(TypeCheckKind TCK, QualType Ty)

Determine whether the pointer type check TCK requires a vptr check.

CGCallee EmitCallee(const Expr *E)

void EmitWritebacks(const CallArgList &Args)

EmitWriteback - Emit callbacks for function.

void EmitOMPCriticalDirective(const OMPCriticalDirective &S)

void EmitIgnoredExpr(const Expr *E)

EmitIgnoredExpr - Emit an expression in a context which ignores the result.

void EnterSEHTryStmt(const SEHTryStmt &S)

llvm::Value * EmitRISCVCpuIs(const CallExpr *E)

RValue EmitCallExpr(const CallExpr *E, ReturnValueSlot ReturnValue=ReturnValueSlot(), llvm::CallBase **CallOrInvoke=nullptr)

llvm::ScalableVectorType * getSVEType(const SVETypeFlags &TypeFlags)

void callCStructDefaultConstructor(LValue Dst)

void EmitOMPTaskLoopDirective(const OMPTaskLoopDirective &S)

RValue EmitLoadOfLValue(LValue V, SourceLocation Loc)

EmitLoadOfLValue - Given an expression that represents a value lvalue, this method emits the address ...

void EmitOMPCancelDirective(const OMPCancelDirective &S)

void pushDestroyAndDeferDeactivation(QualType::DestructionKind dtorKind, Address addr, QualType type)

LValue EmitArraySectionExpr(const ArraySectionExpr *E, bool IsLowerBound=true)

const Expr * RetExpr

If a return statement is being visited, this holds the return statment's result expression.

Definition CodeGenFunction.h:412

Address GetAddrOfBlockDecl(const VarDecl *var)

void EmitOMPBarrierDirective(const OMPBarrierDirective &S)

llvm::Value * EmitComplexToScalarConversion(ComplexPairTy Src, QualType SrcTy, QualType DstTy, SourceLocation Loc)

Emit a conversion from the specified complex type to the specified destination type,...

static bool isInstrumentedCondition(const Expr *C)

isInstrumentedCondition - Determine whether the given condition is an instrumentable condition (i....

void EmitOMPOrderedDirective(const OMPOrderedDirective &S)

void EmitARCDestroyStrong(Address addr, ARCPreciseLifetime_t precise)

Destroy a __strong variable.

void pushCleanupAfterFullExpr(CleanupKind Kind, As... A)

Queue a cleanup to be pushed after finishing the current full-expression, potentially with an active ...

Definition CodeGenFunction.h:926

void DeactivateCleanupBlock(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)

DeactivateCleanupBlock - Deactivates the given cleanup block.

void EmitCfiCheckStub()

Emit a stub for the cross-DSO CFI check function.

void callCStructCopyAssignmentOperator(LValue Dst, LValue Src)

VlaSizePair getVLAElements1D(const VariableArrayType *vla)

Return the number of elements for a single dimension for the given array type.

llvm::Value * EmitBPFBuiltinExpr(unsigned BuiltinID, const CallExpr *E)

bool EmitOMPWorksharingLoop(const OMPLoopDirective &S, Expr *EUB, const CodeGenLoopBoundsTy &CodeGenLoopBounds, const CodeGenDispatchBoundsTy &CGDispatchBounds)

Emit code for the worksharing loop-based directive.

void EmitForStmt(const ForStmt &S, ArrayRef< const Attr * > Attrs={})

CGCallee BuildAppleKextVirtualDestructorCall(const CXXDestructorDecl *DD, CXXDtorType Type, const CXXRecordDecl *RD)

BuildVirtualCall - This routine makes indirect vtable call for call to virtual destructors.

void pushFullExprCleanup(CleanupKind kind, As... A)

pushFullExprCleanup - Push a cleanup to be run at the end of the current full-expression.

Definition CodeGenFunction.h:908

bool AlwaysEmitXRayCustomEvents() const

AlwaysEmitXRayCustomEvents - Return true if we must unconditionally emit XRay custom event handling c...

void EnterDtorCleanups(const CXXDestructorDecl *Dtor, CXXDtorType Type)

EnterDtorCleanups - Enter the cleanups necessary to complete the given phase of destruction for a des...

llvm::Value * EmitSMELdrStr(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)

LValue EmitOMPSharedLValue(const Expr *E)

Emits the lvalue for the expression with possibly captured variable.

QualType TypeOfSelfObject()

TypeOfSelfObject - Return type of object that this self represents.

static Destroyer destroyARCStrongImprecise

Definition CodeGenFunction.h:4988

llvm::CanonicalLoopInfo * EmitOMPCollapsedCanonicalLoopNest(const Stmt *S, int Depth)

Emit the Stmt S and return its topmost canonical loop, if any.

void EmitOMPSectionsDirective(const OMPSectionsDirective &S)

void EmitObjCAutoreleasePoolStmt(const ObjCAutoreleasePoolStmt &S)

llvm::BasicBlock * getInvokeDest()

Definition CodeGenFunction.h:2184

void StartFunction(GlobalDecl GD, QualType RetTy, llvm::Function *Fn, const CGFunctionInfo &FnInfo, const FunctionArgList &Args, SourceLocation Loc=SourceLocation(), SourceLocation StartLoc=SourceLocation())

Emit code for the start of a function.

LValue EmitAggExprToLValue(const Expr *E)

EmitAggExprToLValue - Emit the computation of the specified expression of aggregate type into a tempo...

void EmitOMPInteropDirective(const OMPInteropDirective &S)

void SetFPAccuracy(llvm::Value *Val, float Accuracy)

SetFPAccuracy - Set the minimum required accuracy of the given floating point operation,...

Address mergeAddressesInConditionalExpr(Address LHS, Address RHS, llvm::BasicBlock *LHSBlock, llvm::BasicBlock *RHSBlock, llvm::BasicBlock *MergeBlock, QualType MergedType)

Definition CodeGenFunction.h:2677

Address emitAddrOfImagComponent(Address complex, QualType complexType)

llvm::Value * EmitPointerAuthSign(const CGPointerAuthInfo &Info, llvm::Value *Pointer)

llvm::Value * EmitSVETupleCreate(const SVETypeFlags &TypeFlags, llvm::Type *ReturnType, ArrayRef< llvm::Value * > Ops)

void EmitOMPParallelSectionsDirective(const OMPParallelSectionsDirective &S)

void EmitCXXConstructorCall(const CXXConstructorDecl *D, CXXCtorType Type, bool ForVirtualBase, bool Delegating, AggValueSlot ThisAVS, const CXXConstructExpr *E)

llvm::Value * EmitSVEPMull(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned BuiltinID)

llvm::Value * EmitObjCBoxedExpr(const ObjCBoxedExpr *E)

EmitObjCBoxedExpr - This routine generates code to call the appropriate expression boxing method.

void EmitOMPTargetParallelDirective(const OMPTargetParallelDirective &S)

void EmitBoundsCheck(const Expr *ArrayExpr, const Expr *ArrayExprBase, llvm::Value *Index, QualType IndexType, bool Accessed)

Emit a check that Base points into an array object, which we can access at index Index.

void EmitOMPCopy(QualType OriginalType, Address DestAddr, Address SrcAddr, const VarDecl *DestVD, const VarDecl *SrcVD, const Expr *Copy)

Emit proper copying of data from one variable to another.

void markAsIgnoreThreadCheckingAtRuntime(llvm::Function *Fn)

Annotate the function with an attribute that disables TSan checking at runtime.

llvm::Value * EvaluateExprAsBool(const Expr *E)

EvaluateExprAsBool - Perform the usual unary conversions on the specified expression and compare the ...

void EmitCallArg(CallArgList &args, const Expr *E, QualType ArgType)

EmitCallArg - Emit a single call argument.

void maybeResetMCDCCondBitmap(const Expr *E)

Zero-init the MCDC temp value.

RValue EmitCoyieldExpr(const CoyieldExpr &E, AggValueSlot aggSlot=AggValueSlot::ignored(), bool ignoreResult=false)

void EmitWhileStmt(const WhileStmt &S, ArrayRef< const Attr * > Attrs={})

JumpDest getOMPCancelDestination(OpenMPDirectiveKind Kind)

void generateObjCSetterBody(const ObjCImplementationDecl *classImpl, const ObjCPropertyImplDecl *propImpl, llvm::Constant *AtomicHelperFn)

void GenerateCXXGlobalInitFunc(llvm::Function *Fn, ArrayRef< llvm::Function * > CXXThreadLocals, ConstantAddress Guard=ConstantAddress::invalid())

GenerateCXXGlobalInitFunc - Generates code for initializing global variables.

llvm::Value * EmitPPCBuiltinExpr(unsigned BuiltinID, const CallExpr *E)

LValue EmitPredefinedLValue(const PredefinedExpr *E)

void EmitPointerAuthOperandBundle(const CGPointerAuthInfo &Info, SmallVectorImpl< llvm::OperandBundleDef > &Bundles)

void EmitOMPTargetParallelForSimdDirective(const OMPTargetParallelForSimdDirective &S)

void EmitOMPTargetParallelGenericLoopDirective(const OMPTargetParallelGenericLoopDirective &S)

Emit combined directive 'target parallel loop' as if its constituent constructs are 'target',...

void EmitOpenACCCombinedConstruct(const OpenACCCombinedConstruct &S)

Definition CodeGenFunction.h:4153

void EmitOMPUseDeviceAddrClause(const OMPUseDeviceAddrClause &C, OMPPrivateScope &PrivateScope, const llvm::DenseMap< const ValueDecl *, llvm::Value * > CaptureDeviceAddrMap)

void EmitCheck(ArrayRef< std::pair< llvm::Value *, SanitizerKind::SanitizerOrdinal > > Checked, SanitizerHandler Check, ArrayRef< llvm::Constant * > StaticArgs, ArrayRef< llvm::Value * > DynamicArgs, const TrapReason *TR=nullptr)

Create a basic block that will either trap or call a handler function in the UBSan runtime with the p...

llvm::Value * BlockPointer

Definition CodeGenFunction.h:644

void GenerateCXXGlobalVarDeclInitFunc(llvm::Function *Fn, const VarDecl *D, llvm::GlobalVariable *Addr, bool PerformInit)

Emit the code necessary to initialize the given global variable.

llvm::Value * EmitSVEDupX(llvm::Value *Scalar, llvm::Type *Ty)

void EmitExtendGCLifetime(llvm::Value *object)

EmitExtendGCLifetime - Given a pointer to an Objective-C object, make sure it survives garbage collec...

void ResolveBranchFixups(llvm::BasicBlock *Target)

LValue EmitDeclRefLValue(const DeclRefExpr *E)

void InsertHelper(llvm::Instruction *I, const llvm::Twine &Name, llvm::BasicBlock::iterator InsertPt) const

CGBuilder insert helper.

void EmitOMPTeamsDistributeParallelForSimdDirective(const OMPTeamsDistributeParallelForSimdDirective &S)

SmallVector< const BinaryOperator *, 16 > MCDCLogOpStack

Stack to track the Logical Operator recursion nest for MC/DC.

Definition CodeGenFunction.h:307

LValue EmitStringLiteralLValue(const StringLiteral *E)

llvm::Value * EmitARMMVEBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue, llvm::Triple::ArchType Arch)

void EmitOMPMaskedDirective(const OMPMaskedDirective &S)

Address getAsNaturalAddressOf(Address Addr, QualType PointeeTy)

AggValueSlot CreateAggTemp(QualType T, const Twine &Name="tmp", RawAddress *Alloca=nullptr)

CreateAggTemp - Create a temporary memory object for the given aggregate type.

Definition CodeGenFunction.h:2914

bool checkIfLoopMustProgress(const Expr *, bool HasEmptyBody)

Returns true if a loop must make progress, which means the mustprogress attribute can be added.

RValue getOrCreateOpaqueRValueMapping(const OpaqueValueExpr *e)

Given an opaque value expression, return its RValue mapping if it exists, otherwise create one.

RValue EmitCall(const CGFunctionInfo &CallInfo, const CGCallee &Callee, ReturnValueSlot ReturnValue, const CallArgList &Args, llvm::CallBase **CallOrInvoke=nullptr, bool IsMustTail=false)

Definition CodeGenFunction.h:4529

llvm::Value * emitArrayLength(const ArrayType *arrayType, QualType &baseType, Address &addr)

emitArrayLength - Compute the length of an array, even if it's a VLA, and drill down to the base elem...

void callCStructCopyConstructor(LValue Dst, LValue Src)

void EmitOMPAggregateAssign(Address DestAddr, Address SrcAddr, QualType OriginalType, const llvm::function_ref< void(Address, Address)> CopyGen)

Perform element by element copying of arrays with type OriginalType from SrcAddr to DestAddr using co...

Address getExceptionSlot()

Returns a pointer to the function's exception object and selector slot, which is assigned in every la...

void EmitCXXGuardedInitBranch(llvm::Value *NeedsInit, llvm::BasicBlock *InitBlock, llvm::BasicBlock *NoInitBlock, GuardKind Kind, const VarDecl *D)

Emit a branch to select whether or not to perform guarded initialization.

bool isMCDCCoverageEnabled() const

Definition CodeGenFunction.h:1669

bool HaveInsertPoint() const

HaveInsertPoint - True if an insertion point is defined.

Definition CodeGenFunction.h:2658

void EmitOMPTeamsDistributeSimdDirective(const OMPTeamsDistributeSimdDirective &S)

llvm::Function * GenerateVarArgsThunk(llvm::Function *Fn, const CGFunctionInfo &FnInfo, GlobalDecl GD, const ThunkInfo &Thunk)

RValue EmitAtomicLoad(LValue LV, SourceLocation SL, AggValueSlot Slot=AggValueSlot::ignored())

bool AlwaysEmitXRayTypedEvents() const

AlwaysEmitXRayTypedEvents - Return true if clang must unconditionally emit XRay typed event handling ...

void EmitVTableAssumptionLoads(const CXXRecordDecl *ClassDecl, Address This)

Emit assumption load for all bases.

llvm::Value * EmitARCRetainBlock(llvm::Value *value, bool mandatory)

Retain the given block, with _Block_copy semantics.

llvm::Value * EmitObjCCollectionLiteral(const Expr *E, const ObjCMethodDecl *MethodWithObjects)

llvm::BasicBlock * getTerminateFunclet()

getTerminateLandingPad - Return a cleanup funclet that just calls terminate.

void EmitInvariantStart(llvm::Constant *Addr, CharUnits Size)

llvm::Value * EmitNeonRShiftImm(llvm::Value *Vec, llvm::Value *Amt, llvm::Type *Ty, bool usgn, const char *name)

llvm::BasicBlock * getTerminateLandingPad()

getTerminateLandingPad - Return a landing pad that just calls terminate.

CGDebugInfo * getDebugInfo()

Definition CodeGenFunction.h:2150

void EmitOMPDistributeLoop(const OMPLoopDirective &S, const CodeGenLoopTy &CodeGenLoop, Expr *IncExpr)

Emit code for the distribute loop-based directive.

llvm::Function * GenerateSEHFinallyFunction(CodeGenFunction &ParentCGF, const SEHFinallyStmt &Finally)

llvm::Value * emitScalarConstant(const ConstantEmission &Constant, Expr *E)

void AddAMDGPUFenceAddressSpaceMMRA(llvm::Instruction *Inst, const CallExpr *E)

void EmitOMPMasterTaskLoopDirective(const OMPMasterTaskLoopDirective &S)

llvm::Value * EmitARCRetainScalarExpr(const Expr *expr)

EmitARCRetainScalarExpr - Semantically equivalent to EmitARCRetainObject(e->getType(),...

void EmitOMPReverseDirective(const OMPReverseDirective &S)

llvm::Value * getTypeSize(QualType Ty)

Returns calculated size of the specified type.

bool EmitLifetimeStart(llvm::Value *Addr)

Emit a lifetime.begin marker if some criteria are satisfied.

void EmitStartEHSpec(const Decl *D)

EmitStartEHSpec - Emit the start of the exception spec.

void popCatchScope()

popCatchScope - Pops the catch scope at the top of the EHScope stack, emitting any required code (oth...

LValue EmitUnsupportedLValue(const Expr *E, const char *Name)

EmitUnsupportedLValue - Emit a dummy l-value using the type of E and issue an ErrorUnsupported style ...

void EmitOMPCancellationPointDirective(const OMPCancellationPointDirective &S)

void EmitDestructorBody(FunctionArgList &Args)

EmitDestructorBody - Emits the body of the current destructor.

void EmitOpenACCDataConstruct(const OpenACCDataConstruct &S)

Definition CodeGenFunction.h:4160

LValue MakeRawAddrLValue(llvm::Value *V, QualType T, CharUnits Alignment, AlignmentSource Source=AlignmentSource::Type)

Same as MakeAddrLValue above except that the pointer is known to be unsigned.

Definition CodeGenFunction.h:2727

llvm::MDNode * buildAllocToken(QualType AllocType)

Build metadata used by the AllocToken instrumentation.

RValue EmitCXXMemberCallExpr(const CXXMemberCallExpr *E, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke=nullptr)

void EmitX86MultiVersionResolver(llvm::Function *Resolver, ArrayRef< FMVResolverOption > Options)

LValue EmitLValueForFieldInitialization(LValue Base, const FieldDecl *Field)

EmitLValueForFieldInitialization - Like EmitLValueForField, except that if the Field is a reference,...

llvm::Value * EmitSEHExceptionCode()

llvm::Value * EmitBlockLiteral(const BlockExpr *)

Emit block literal.

@ NotSubtraction

Definition CodeGenFunction.h:5240

@ IsSubtraction

Definition CodeGenFunction.h:5240

void EmitOMPTargetTeamsDistributeParallelForDirective(const OMPTargetTeamsDistributeParallelForDirective &S)

llvm::Value * EmitToMemory(llvm::Value *Value, QualType Ty)

EmitToMemory - Change a scalar value from its value representation to its in-memory representation.

Address GetAddressOfDirectBaseInCompleteClass(Address Value, const CXXRecordDecl *Derived, const CXXRecordDecl *Base, bool BaseIsVirtual)

GetAddressOfBaseOfCompleteClass - Convert the given pointer to a complete class to the given direct b...

void EmitOMPMaskedTaskLoopDirective(const OMPMaskedTaskLoopDirective &S)

Address emitBlockByrefAddress(Address baseAddr, const VarDecl *V, bool followForward=true)

BuildBlockByrefAddress - Computes the location of the data in a variable which is declared as __block...

void enableDebugInfo()

Definition CodeGenFunction.h:2156

llvm::BasicBlock * OMPScanDispatch

Definition CodeGenFunction.h:781

llvm::AllocaInst * CreateTempAlloca(llvm::Type *Ty, const Twine &Name="tmp", llvm::Value *ArraySize=nullptr)

CreateTempAlloca - This creates an alloca and inserts it into the entry block if ArraySize is nullptr...

void EmitObjCAtTryStmt(const ObjCAtTryStmt &S)

GlobalDecl CurSEHParent

Definition CodeGenFunction.h:590

SmallVector< llvm::Type *, 2 > getSVEOverloadTypes(const SVETypeFlags &TypeFlags, llvm::Type *ReturnType, ArrayRef< llvm::Value * > Ops)

bool ShouldInstrumentFunction()

ShouldInstrumentFunction - Return true if the current function should be instrumented with __cyg_prof...

void startOutlinedSEHHelper(CodeGenFunction &ParentCGF, bool IsFilter, const Stmt *OutlinedStmt)

Arrange a function prototype that can be called by Windows exception handling personalities.

void maybeUpdateMCDCCondBitmap(const Expr *E, llvm::Value *Val)

Update the MCDC temp value with the condition's evaluated result.

LValue getOrCreateOpaqueLValueMapping(const OpaqueValueExpr *e)

Given an opaque value expression, return its LValue mapping if it exists, otherwise create one.

void EmitSehTryScopeBegin()

llvm::function_ref< std::pair< LValue, LValue >(CodeGenFunction &, const OMPExecutableDirective &S)> CodeGenLoopBoundsTy

Definition CodeGenFunction.h:327

llvm::Function * generateAwaitSuspendWrapper(Twine const &CoroName, Twine const &SuspendPointName, CoroutineSuspendExpr const &S)

bool EmitScalarRangeCheck(llvm::Value *Value, QualType Ty, SourceLocation Loc)

Check if the scalar Value is within the valid range for the given type Ty.

ComplexPairTy EmitComplexExpr(const Expr *E, bool IgnoreReal=false, bool IgnoreImag=false)

EmitComplexExpr - Emit the computation of the specified expression of complex type,...

void emitAlignmentAssumptionCheck(llvm::Value *Ptr, QualType Ty, SourceLocation Loc, SourceLocation AssumptionLoc, llvm::Value *Alignment, llvm::Value *OffsetValue, llvm::Value *TheCheck, llvm::Instruction *Assumption)

RValue EmitCall(const CGFunctionInfo &CallInfo, const CGCallee &Callee, ReturnValueSlot ReturnValue, const CallArgList &Args, llvm::CallBase **CallOrInvoke, bool IsMustTail, SourceLocation Loc, bool IsVirtualFunctionPointerThunk=false)

EmitCall - Generate a call of the given function, expecting the given result type,...

const TargetCodeGenInfo & getTargetHooks() const

Definition CodeGenFunction.h:2194

void setBeforeOutermostConditional(llvm::Value *value, Address addr, CodeGenFunction &CGF)

Definition CodeGenFunction.h:1346

CGPointerAuthInfo EmitPointerAuthInfo(const PointerAuthSchema &Schema, llvm::Value *StorageAddress, GlobalDecl SchemaDecl, QualType SchemaType)

Emit the concrete pointer authentication informaton for the given authentication schema.

void EmitOMPTargetExitDataDirective(const OMPTargetExitDataDirective &S)

void EmitCtorPrologue(const CXXConstructorDecl *CD, CXXCtorType Type, FunctionArgList &Args)

EmitCtorPrologue - This routine generates necessary code to initialize base classes and non-static da...

llvm::ConstantInt * getUBSanFunctionTypeHash(QualType T) const

Return a type hash constant for a function instrumented by -fsanitize=function.

RValue EmitBuiltinAlignTo(const CallExpr *E, bool AlignUp)

Emit IR for __builtin_align_up/__builtin_align_down.

LValue EmitHLSLArrayAssignLValue(const BinaryOperator *E)

void EmitSEHLeaveStmt(const SEHLeaveStmt &S)

void EmitLifetimeEnd(llvm::Value *Addr)

RawAddress CreateMemTempWithoutCast(QualType T, const Twine &Name="tmp")

CreateMemTemp - Create a temporary memory object of the given type, with appropriate alignmen without...

void EmitBranchToCounterBlock(const Expr *Cond, BinaryOperator::Opcode LOp, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock, uint64_t TrueCount=0, Stmt::Likelihood LH=Stmt::LH_None, const Expr *CntrIdx=nullptr)

EmitBranchToCounterBlock - Emit a conditional branch to a new block that increments a profile counter...

void EmitPointerAuthCopy(PointerAuthQualifier Qualifier, QualType Type, Address DestField, Address SrcField)

CGBuilderTy Builder

Definition CodeGenFunction.h:286

void incrementProfileCounter(const Stmt *S, llvm::Value *StepV=nullptr)

Increment the profiler's counter for the given statement by StepV.

void EmitOMPTargetEnterDataDirective(const OMPTargetEnterDataDirective &S)

LValue EmitVAArgExprLValue(const VAArgExpr *E)

bool InNoInlineAttributedStmt

True if the current statement has noinline attribute.

Definition CodeGenFunction.h:604

SmallVector< llvm::OperandBundleDef, 1 > getBundlesForFunclet(llvm::Value *Callee)

void EmitOMPMaskedTaskLoopSimdDirective(const OMPMaskedTaskLoopSimdDirective &S)

llvm::Value * EmitWebAssemblyBuiltinExpr(unsigned BuiltinID, const CallExpr *E)

EHScopeStack EHStack

Definition CodeGenFunction.h:653

llvm::Value * EmitNeonShiftVector(llvm::Value *V, llvm::Type *Ty, bool negateForRightShift)

void EmitTypeMetadataCodeForVCall(const CXXRecordDecl *RD, llvm::Value *VTable, SourceLocation Loc)

If whole-program virtual table optimization is enabled, emit an assumption that VTable is a member of...

void EmitCapturedLocals(CodeGenFunction &ParentCGF, const Stmt *OutlinedStmt, bool IsFilter)

Scan the outlined statement for captures from the parent function.

llvm::Value * EmitObjCAlloc(llvm::Value *value, llvm::Type *returnType)

Allocate the given objc object.

llvm::Value * LoadObjCSelf()

LoadObjCSelf - Load the value of self.

void GenerateObjCMethod(const ObjCMethodDecl *OMD)

Generate an Objective-C method.

void callCStructMoveAssignmentOperator(LValue Dst, LValue Src)

std::pair< bool, RValue > EmitOMPAtomicSimpleUpdateExpr(LValue X, RValue E, BinaryOperatorKind BO, bool IsXLHSInRHSPart, llvm::AtomicOrdering AO, SourceLocation Loc, const llvm::function_ref< RValue(RValue)> CommonGen)

Emit atomic update code for constructs: X = X BO E or X = E BO E.

bool IsInPreservedAIRegion

True if CodeGen currently emits code inside presereved access index region.

Definition CodeGenFunction.h:598

RValue EmitAnyExprToTemp(const Expr *E)

EmitAnyExprToTemp - Similarly to EmitAnyExpr(), however, the result will always be accessible even if...

void EmitCoroutineBody(const CoroutineBodyStmt &S)

void pushCleanupAfterFullExprWithActiveFlag(CleanupKind Kind, RawAddress ActiveFlag, As... A)

Definition CodeGenFunction.h:944

VlaSizePair getVLASize(const VariableArrayType *vla)

Returns an LLVM value that corresponds to the size, in non-variably-sized elements,...

LValue EmitStmtExprLValue(const StmtExpr *E)

void EmitOMPParallelDirective(const OMPParallelDirective &S)

void EmitOMPTaskDirective(const OMPTaskDirective &S)

llvm::Value * unregisterGlobalDtorWithUnAtExit(llvm::Constant *dtorStub)

Call unatexit() with function dtorStub.

void EmitOMPMasterTaskLoopSimdDirective(const OMPMasterTaskLoopSimdDirective &S)

void pushSEHCleanup(CleanupKind kind, llvm::Function *FinallyFunc)

llvm::Value * EmitARCLoadWeakRetained(Address addr)

i8* @objc_loadWeakRetained(i8** addr)

void EmitOMPDistributeParallelForDirective(const OMPDistributeParallelForDirective &S)

void EmitOMPAssumeDirective(const OMPAssumeDirective &S)

llvm::Value * emitPointerAuthResign(llvm::Value *Pointer, QualType PointerType, const CGPointerAuthInfo &CurAuthInfo, const CGPointerAuthInfo &NewAuthInfo, bool IsKnownNonNull)

int ExpectedOMPLoopDepth

Number of nested loop to be consumed by the last surrounding loop-associated directive.

Definition CodeGenFunction.h:314

void EmitOMPPrivateClause(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)

llvm::CallInst * EmitNounwindRuntimeCall(llvm::FunctionCallee callee, const Twine &name="")

void EmitOMPTeamsDistributeDirective(const OMPTeamsDistributeDirective &S)

ASTContext & getContext() const

Definition CodeGenFunction.h:2149

llvm::Value * EmitDirectXBuiltinExpr(unsigned BuiltinID, const CallExpr *E)

llvm::Value * EmitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E, llvm::Triple::ArchType Arch)

void EmitStopPoint(const Stmt *S)

EmitStopPoint - Emit a debug stoppoint if we are emitting debug info.

RawAddress CreateTempAllocaWithoutCast(llvm::Type *Ty, CharUnits align, const Twine &Name="tmp", llvm::Value *ArraySize=nullptr)

CreateTempAlloca - This creates a alloca and inserts it into the entry block.

void EmitOMPTargetUpdateDirective(const OMPTargetUpdateDirective &S)

llvm::Value * EmitWithOriginalRHSBitfieldAssignment(const BinaryOperator *E, llvm::Value **Previous, QualType *SrcType)

Retrieve the implicit cast expression of the rhs in a binary operator expression by passing pointers ...

LoopInfoStack LoopStack

Definition CodeGenFunction.h:285

llvm::Value * EmitMSVCBuiltinExpr(MSVCIntrin BuiltinID, const CallExpr *E)

llvm::Value * EmitLoadOfScalar(Address Addr, bool Volatile, QualType Ty, SourceLocation Loc, AlignmentSource Source=AlignmentSource::Type, bool isNontemporal=false)

EmitLoadOfScalar - Load a scalar value from an address, taking care to appropriately convert from the...

Definition CodeGenFunction.h:4323

void EmitOMPTargetTeamsGenericLoopDirective(const OMPTargetTeamsGenericLoopDirective &S)

llvm::Value * EmitFP8NeonFDOTCall(unsigned IID, bool ExtendLaneArg, llvm::Type *RetTy, SmallVectorImpl< llvm::Value * > &Ops, const CallExpr *E, const char *name)

void EmitMultiVersionResolver(llvm::Function *Resolver, ArrayRef< FMVResolverOption > Options)

void EmitIfStmt(const IfStmt &S)

void emitAutoVarTypeCleanup(const AutoVarEmission &emission, QualType::DestructionKind dtorKind)

Enter a destroy cleanup for the given local variable.

void emitARCMoveAssignWeak(QualType Ty, Address DstAddr, Address SrcAddr)

llvm::Value * vectorWrapScalar16(llvm::Value *Op)

void Destroyer(CodeGenFunction &CGF, Address addr, QualType ty)

Definition CodeGenFunction.h:2202

void EmitStoreOfComplex(ComplexPairTy V, LValue dest, bool isInit)

EmitStoreOfComplex - Store a complex number into the specified l-value.

const Decl * CurFuncDecl

CurFuncDecl - Holds the Decl for the current outermost non-closure context.

Definition CodeGenFunction.h:342

llvm::CallInst * EmitNounwindRuntimeCall(llvm::FunctionCallee callee, ArrayRef< llvm::Value * > args, const Twine &name="")

void EmitAutoVarCleanups(const AutoVarEmission &emission)

LValue EmitObjCIvarRefLValue(const ObjCIvarRefExpr *E)

llvm::Value * EmitARMCDEBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue, llvm::Triple::ArchType Arch)

void EmitAndRegisterVariableArrayDimensions(CGDebugInfo *DI, const VarDecl &D, bool EmitDebugInfo)

Emits the alloca and debug information for the size expressions for each dimension of an array.

static const Expr * stripCond(const Expr *C)

Ignore parentheses and logical-NOT to track conditions consistently.

void EmitFunctionProlog(const CGFunctionInfo &FI, llvm::Function *Fn, const FunctionArgList &Args)

EmitFunctionProlog - Emit the target specific LLVM code to load the arguments for the given function.

void EmitDeferStmt(const DeferStmt &S)

void registerGlobalDtorWithLLVM(const VarDecl &D, llvm::FunctionCallee fn, llvm::Constant *addr)

Registers the dtor using 'llvm.global_dtors' for platforms that do not support an 'atexit()' function...

void EmitStoreThroughLValue(RValue Src, LValue Dst, bool isInit=false)

EmitStoreThroughLValue - Store the specified rvalue into the specified lvalue, where both are guarant...

SmallVector< llvm::CanonicalLoopInfo *, 4 > OMPLoopNestStack

List of recently emitted OMPCanonicalLoops.

Definition CodeGenFunction.h:304

Address EmitArrayToPointerDecay(const Expr *Array, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr)

void SetFastMathFlags(FPOptions FPFeatures)

Set the codegen fast-math flags.

void pushLifetimeExtendedDestroy(CleanupKind kind, Address addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)

llvm::Value * EmitAArch64CompareBuiltinExpr(llvm::Value *Op, llvm::Type *Ty, const llvm::CmpInst::Predicate Pred, const llvm::Twine &Name="")

llvm::SmallVector< char, 256 > LifetimeExtendedCleanupStack

Definition CodeGenFunction.h:654

llvm::Constant * GenerateObjCAtomicSetterCopyHelperFunction(const ObjCPropertyImplDecl *PID)

GenerateObjCAtomicSetterCopyHelperFunction - Given a c++ object type with non-trivial copy assignment...

llvm::Value * EmitSPIRVBuiltinExpr(unsigned BuiltinID, const CallExpr *E)

void EmitOpenACCAtomicConstruct(const OpenACCAtomicConstruct &S)

Definition CodeGenFunction.h:4209

void EmitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt &S)

Address EmitCompoundStmt(const CompoundStmt &S, bool GetLast=false, AggValueSlot AVS=AggValueSlot::ignored())

EmitCompoundStmt - Emit a compound statement {..} node.

llvm::Value * LoadCXXVTT()

LoadCXXVTT - Load the VTT parameter to base constructors/destructors have virtual bases.

Definition CodeGenFunction.h:3132

RValue EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue)

void EmitOpenACCCacheConstruct(const OpenACCCacheConstruct &S)

Definition CodeGenFunction.h:4215

Address EmitVAListRef(const Expr *E)

void EmitOpenACCLoopConstruct(const OpenACCLoopConstruct &S)

Definition CodeGenFunction.h:4146

void EmitOMPTeamsDistributeParallelForDirective(const OMPTeamsDistributeParallelForDirective &S)

RValue GetUndefRValue(QualType Ty)

GetUndefRValue - Get an appropriate 'undef' rvalue for the given type.

void EmitParmDecl(const VarDecl &D, ParamValue Arg, unsigned ArgNo)

EmitParmDecl - Emit a ParmVarDecl or an ImplicitParamDecl.

llvm::Instruction * getPostAllocaInsertPoint()

Return PostAllocaInsertPt.

Definition CodeGenFunction.h:439

RValue EmitBuiltinIsAligned(const CallExpr *E)

Emit IR for __builtin_is_aligned.

void EmitAllocToken(llvm::CallBase *CB, QualType AllocType)

Emit and set additional metadata used by the AllocToken instrumentation.

void EmitARCNoopIntrinsicUse(ArrayRef< llvm::Value * > values)

Emit a call to "clang.arc.noop.use", which consumes the result of a call that has operand bundle "cla...

llvm::AtomicRMWInst * emitAtomicRMWInst(llvm::AtomicRMWInst::BinOp Op, Address Addr, llvm::Value *Val, llvm::AtomicOrdering Order=llvm::AtomicOrdering::SequentiallyConsistent, llvm::SyncScope::ID SSID=llvm::SyncScope::System, const AtomicExpr *AE=nullptr)

Emit an atomicrmw instruction, and applying relevant metadata when applicable.

LValue EmitComplexAssignmentLValue(const BinaryOperator *E)

Emit an l-value for an assignment (simple or compound) of complex type.

LValue EmitCastLValue(const CastExpr *E)

EmitCastLValue - Casts are never lvalues unless that cast is to a reference type.

void EmitOMPFuseDirective(const OMPFuseDirective &S)

llvm::Value * EmitPointerArithmetic(const BinaryOperator *BO, Expr *pointerOperand, llvm::Value *pointer, Expr *indexOperand, llvm::Value *index, bool isSubtraction)

Emit pointer + index arithmetic.

void EmitInitializerForField(FieldDecl *Field, LValue LHS, Expr *Init)

LValue EmitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *E)

CFITypeCheckKind

Definition CodeGenFunction.h:2482

@ CFITCK_NVMFCall

Definition CodeGenFunction.h:2488

@ CFITCK_UnrelatedCast

Definition CodeGenFunction.h:2486

@ CFITCK_DerivedCast

Definition CodeGenFunction.h:2485

@ CFITCK_VCall

Definition CodeGenFunction.h:2483

@ CFITCK_ICall

Definition CodeGenFunction.h:2487

@ CFITCK_VMFCall

Definition CodeGenFunction.h:2489

@ CFITCK_NVCall

Definition CodeGenFunction.h:2484

LValue EmitLoadOfPointerLValue(Address Ptr, const PointerType *PtrTy)

void EmitAsmStmt(const AsmStmt &S)

void EmitDefaultStmt(const DefaultStmt &S, ArrayRef< const Attr * > Attrs)

void EmitOMPTargetTeamsDistributeDirective(const OMPTargetTeamsDistributeDirective &S)

void EmitLambdaInAllocaCallOpBody(const CXXMethodDecl *MD)

void EmitSwitchStmt(const SwitchStmt &S)

Address ReturnValuePointer

ReturnValuePointer - The temporary alloca to hold a pointer to sret.

Definition CodeGenFunction.h:408

void EmitOMPUseDevicePtrClause(const OMPUseDevicePtrClause &C, OMPPrivateScope &PrivateScope, const llvm::DenseMap< const ValueDecl *, llvm::Value * > CaptureDeviceAddrMap)

llvm::Value * SEHInfo

Value returned by __exception_info intrinsic.

Definition CodeGenFunction.h:769

static bool mightAddDeclToScope(const Stmt *S)

Determine if the given statement might introduce a declaration into the current scope,...

RawAddress getNormalCleanupDestSlot()

llvm::Value * EmitCheckValue(llvm::Value *V)

Convert a value into a format suitable for passing to a runtime sanitizer handler.

void EmitAnyExprToMem(const Expr *E, Address Location, Qualifiers Quals, bool IsInitializer)

EmitAnyExprToMem - Emits the code necessary to evaluate an arbitrary expression into the given memory...

RValue EmitAnyExpr(const Expr *E, AggValueSlot aggSlot=AggValueSlot::ignored(), bool ignoreResult=false)

EmitAnyExpr - Emit code to compute the specified expression which can have any type.

bool needsEHCleanup(QualType::DestructionKind kind)

Determines whether an EH cleanup is required to destroy a type with the given destruction kind.

Definition CodeGenFunction.h:2252

LValue EmitExtVectorElementExpr(const ExtVectorElementExpr *E)

void EmitStmt(const Stmt *S, ArrayRef< const Attr * > Attrs={})

EmitStmt - Emit the code for the statement.

llvm::GlobalVariable * AddInitializerToStaticVarDecl(const VarDecl &D, llvm::GlobalVariable *GV)

AddInitializerToStaticVarDecl - Add the initializer for 'D' to the global variable that has already b...

llvm::DenseMap< const ValueDecl *, FieldDecl * > LambdaCaptureFields

Definition CodeGenFunction.h:646

QualType FnRetTy

Definition CodeGenFunction.h:346

RValue EmitBuiltinNewDeleteCall(const FunctionProtoType *Type, const CallExpr *TheCallExpr, bool IsDelete)

RValue EmitUnsupportedRValue(const Expr *E, const char *Name)

EmitUnsupportedRValue - Emit a dummy r-value using the type of E and issue an ErrorUnsupported style ...

void EmitOMPParallelForSimdDirective(const OMPParallelForSimdDirective &S)

bool AutoreleaseResult

In ARC, whether we should autorelease the return value.

Definition CodeGenFunction.h:584

CleanupKind getCleanupKind(QualType::DestructionKind kind)

Definition CodeGenFunction.h:2267

llvm::CallInst * EmitRuntimeCall(llvm::FunctionCallee callee, const Twine &name="")

uint64_t getCurrentProfileCount()

Get the profiler's current count.

std::pair< LValue, LValue > EmitHLSLOutArgLValues(const HLSLOutArgExpr *E, QualType Ty)

LValue EmitObjCSelectorLValue(const ObjCSelectorExpr *E)

llvm::Value * EmitARCRetainNonBlock(llvm::Value *value)

Retain the given object, with normal retain semantics.

llvm::Type * ConvertTypeForMem(QualType T)

static std::string getNonTrivialCopyConstructorStr(QualType QT, CharUnits Alignment, bool IsVolatile, ASTContext &Ctx)

void generateObjCGetterBody(const ObjCImplementationDecl *classImpl, const ObjCPropertyImplDecl *propImpl, const ObjCMethodDecl *GetterMothodDecl, llvm::Constant *AtomicHelperFn)

LValue EmitCallExprLValue(const CallExpr *E, llvm::CallBase **CallOrInvoke=nullptr)

llvm::Value * EmitARCRetainAutoreleaseNonBlock(llvm::Value *value)

Do a fused retain/autorelease of the given object.

llvm::Value * EmitSVEMovl(const SVETypeFlags &TypeFlags, llvm::ArrayRef< llvm::Value * > Ops, unsigned BuiltinID)

void EmitOMPInnerLoop(const OMPExecutableDirective &S, bool RequiresCleanup, const Expr *LoopCond, const Expr *IncExpr, const llvm::function_ref< void(CodeGenFunction &)> BodyGen, const llvm::function_ref< void(CodeGenFunction &)> PostIncGen)

Emit inner loop of the worksharing/simd construct.

void EmitEndEHSpec(const Decl *D)

EmitEndEHSpec - Emit the end of the exception spec.

void EmitSynthesizedCXXCopyCtorCall(const CXXConstructorDecl *D, Address This, Address Src, const CXXConstructExpr *E)

void GenerateCXXGlobalCleanUpFunc(llvm::Function *Fn, ArrayRef< std::tuple< llvm::FunctionType *, llvm::WeakTrackingVH, llvm::Constant * > > DtorsOrStermFinalizers)

GenerateCXXGlobalCleanUpFunc - Generates code for cleaning up global variables.

void EmitDeleteCall(const FunctionDecl *DeleteFD, llvm::Value *Ptr, QualType DeleteTy, llvm::Value *NumElements=nullptr, CharUnits CookieSize=CharUnits())

void EmitOMPTaskLoopSimdDirective(const OMPTaskLoopSimdDirective &S)

static void EmitOMPTargetTeamsDistributeParallelForDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsDistributeParallelForDirective &S)

llvm::Value * EmitObjCAutoreleasePoolPush()

Produce the code to do a objc_autoreleasepool_push.

RValue EmitLoadOfBitfieldLValue(LValue LV, SourceLocation Loc)

RValue EmitAtomicExpr(AtomicExpr *E)

void GenerateObjCSetter(ObjCImplementationDecl *IMP, const ObjCPropertyImplDecl *PID)

GenerateObjCSetter - Synthesize an Objective-C property setter function for the given property.

llvm::Value * EmitARCLoadWeak(Address addr)

i8* @objc_loadWeak(i8** addr) Essentially objc_autorelease(objc_loadWeakRetained(addr)).

void EmitOMPTargetDirective(const OMPTargetDirective &S)

void ExitSEHTryStmt(const SEHTryStmt &S)

void EmitOpenACCEnterDataConstruct(const OpenACCEnterDataConstruct &S)

Definition CodeGenFunction.h:4167

LValue EmitLValueForLambdaField(const FieldDecl *Field)

static void EmitOMPTargetParallelForSimdDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetParallelForSimdDirective &S)

Emit device code for the target parallel for simd directive.

llvm::Value * EmitSVEPredicateTupleCast(llvm::Value *PredTuple, llvm::StructType *Ty)

void markStmtMaybeUsed(const Stmt *S)

llvm::Value * EmitHexagonBuiltinExpr(unsigned BuiltinID, const CallExpr *E)

CodeGenTypes & getTypes() const

Definition CodeGenFunction.h:2148

llvm::Function * EmitCapturedStmt(const CapturedStmt &S, CapturedRegionKind K)

Generate an outlined function for the body of a CapturedStmt, store any captured variables into the c...

llvm::Value * EmitX86BuiltinExpr(unsigned BuiltinID, const CallExpr *E)

static TypeEvaluationKind getEvaluationKind(QualType T)

getEvaluationKind - Return the TypeEvaluationKind of QualType T.

void generateThunk(llvm::Function *Fn, const CGFunctionInfo &FnInfo, GlobalDecl GD, const ThunkInfo &Thunk, bool IsUnprototyped)

Generate a thunk for the given method.

void ExitCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock=false)

llvm::Value * EmitIvarOffset(const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar)

llvm::BasicBlock * OMPScanExitBlock

Definition CodeGenFunction.h:780

llvm::Value * EmitSVEPrefetchLoad(const SVETypeFlags &TypeFlags, SmallVectorImpl< llvm::Value * > &Ops, unsigned BuiltinID)

bool IsSanitizerScope

True if CodeGen currently emits code implementing sanitizer checks.

Definition CodeGenFunction.h:568

void FlattenAccessAndTypeLValue(LValue LVal, SmallVectorImpl< LValue > &AccessList)

void EmitOMPTeamsDirective(const OMPTeamsDirective &S)

static bool containsBreak(const Stmt *S)

containsBreak - Return true if the statement contains a break out of it.

void emitImplicitAssignmentOperatorBody(FunctionArgList &Args)

void EmitSimpleOMPExecutableDirective(const OMPExecutableDirective &D)

Emit simple code for OpenMP directives in Simd-only mode.

HLSLControlFlowHintAttr::Spelling HLSLControlFlowAttr

HLSL Branch attribute.

Definition CodeGenFunction.h:613

LValue EmitCoyieldLValue(const CoyieldExpr *E)

bool InAlwaysInlineAttributedStmt

True if the current statement has always_inline attribute.

Definition CodeGenFunction.h:607

void EmitCaseStmt(const CaseStmt &S, ArrayRef< const Attr * > Attrs)

RawAddress CreateTempAlloca(llvm::Type *Ty, CharUnits align, const Twine &Name="tmp", llvm::Value *ArraySize=nullptr, RawAddress *Alloca=nullptr)

CreateTempAlloca - This creates a alloca and inserts it into the entry block.

Definition CodeGenFunction.h:2862

llvm::Constant * GenerateObjCAtomicGetterCopyHelperFunction(const ObjCPropertyImplDecl *PID)

void EmitOMPErrorDirective(const OMPErrorDirective &S)

void EmitOMPTargetTaskBasedDirective(const OMPExecutableDirective &S, const RegionCodeGenTy &BodyGen, OMPTargetDataInfo &InputInfo)

void EmitBreakStmt(const BreakStmt &S)

void EmitOMPParallelMaskedTaskLoopSimdDirective(const OMPParallelMaskedTaskLoopSimdDirective &S)

void EmitOMPTargetTeamsDirective(const OMPTargetTeamsDirective &S)

void EmitOpenACCComputeConstruct(const OpenACCComputeConstruct &S)

Definition CodeGenFunction.h:4139

void EmitTypeCheck(TypeCheckKind TCK, SourceLocation Loc, LValue LV, QualType Type, SanitizerSet SkippedChecks=SanitizerSet(), llvm::Value *ArraySize=nullptr)

Definition CodeGenFunction.h:3312

void EmitLambdaBlockInvokeBody()

void EmitCfiSlowPathCheck(SanitizerKind::SanitizerOrdinal Ordinal, llvm::Value *Cond, llvm::ConstantInt *TypeId, llvm::Value *Ptr, ArrayRef< llvm::Constant * > StaticArgs)

Emit a slow path cross-DSO CFI check which calls __cfi_slowpath if Cond if false.

CodeGenModule & CGM

Definition CodeGenFunction.h:278

RValue EmitCoawaitExpr(const CoawaitExpr &E, AggValueSlot aggSlot=AggValueSlot::ignored(), bool ignoreResult=false)

llvm::SmallVector< const ParmVarDecl *, 4 > FnArgs

Save Parameter Decl for coroutine.

Definition CodeGenFunction.h:354

void EmitDoStmt(const DoStmt &S, ArrayRef< const Attr * > Attrs={})

void EmitOMPTargetDataDirective(const OMPTargetDataDirective &S)

llvm::Value * EmitSMEZero(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)

const TargetInfo & Target

Definition CodeGenFunction.h:279

void EmitCXXTemporary(const CXXTemporary *Temporary, QualType TempType, Address Ptr)

Emits all the code to cause the given temporary to be cleaned up.

llvm::Value * authPointerToPointerCast(llvm::Value *ResultPtr, QualType SourceType, QualType DestType)

Address GenerateCapturedStmtArgument(const CapturedStmt &S)

LValue EmitUnaryOpLValue(const UnaryOperator *E)

bool EmitOMPLastprivateClauseInit(const OMPExecutableDirective &D, OMPPrivateScope &PrivateScope)

Emit initial code for lastprivate variables.

void StartThunk(llvm::Function *Fn, GlobalDecl GD, const CGFunctionInfo &FnInfo, bool IsUnprototyped)

CGCoroInfo CurCoro

Definition CodeGenFunction.h:365

void EmitFunctionEpilog(const CGFunctionInfo &FI, bool EmitRetDbgLoc, SourceLocation EndLoc, uint64_t RetKeyInstructionsSourceAtom)

EmitFunctionEpilog - Emit the target specific LLVM code to return the given temporary.

Address EmitPointerWithAlignment(const Expr *Addr, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr, KnownNonNull_t IsKnownNonNull=NotKnownNonNull)

EmitPointerWithAlignment - Given an expression with a pointer type, emit the value and compute our be...

static void EmitOMPTargetTeamsDistributeParallelForSimdDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsDistributeParallelForSimdDirective &S)

Emit device code for the target teams distribute parallel for simd directive.

llvm::BasicBlock * getEHDispatchBlock(EHScopeStack::stable_iterator scope)

void EmitBranch(llvm::BasicBlock *Block)

EmitBranch - Emit a branch to the specified basic block from the current insert block,...

bool LValueIsSuitableForInlineAtomic(LValue Src)

An LValue is a candidate for having its loads and stores be made atomic if we are operating under /vo...

llvm::Function * GenerateOpenMPCapturedStmtFunction(const CapturedStmt &S, const OMPExecutableDirective &D)

void EmitOMPSimdDirective(const OMPSimdDirective &S)

llvm::Value * EmitSVEStructStore(const SVETypeFlags &TypeFlags, SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)

LValue EmitCheckedLValue(const Expr *E, TypeCheckKind TCK)

Same as EmitLValue but additionally we generate checking code to guard against undefined behavior.

void EmitInheritedCXXConstructorCall(const CXXConstructorDecl *D, bool ForVirtualBase, Address This, bool InheritedFromVBase, const CXXInheritedCtorInitExpr *E)

Emit a call to a constructor inherited from a base class, passing the current constructor's arguments...

RawAddress CreateMemTemp(QualType T, const Twine &Name="tmp", RawAddress *Alloca=nullptr)

CreateMemTemp - Create a temporary memory object of the given type, with appropriate alignmen and cas...

Address EmitLoadOfReference(LValue RefLVal, LValueBaseInfo *PointeeBaseInfo=nullptr, TBAAAccessInfo *PointeeTBAAInfo=nullptr)

CGCallee BuildAppleKextVirtualCall(const CXXMethodDecl *MD, NestedNameSpecifier Qual, llvm::Type *Ty)

BuildAppleKextVirtualCall - This routine is to support gcc's kext ABI making indirect call to virtual...

RValue EmitRValueForField(LValue LV, const FieldDecl *FD, SourceLocation Loc)

void EmitOMPParallelGenericLoopDirective(const OMPLoopDirective &S)

void EmitOMPTargetSimdDirective(const OMPTargetSimdDirective &S)

RawAddress NormalCleanupDest

i32s containing the indexes of the cleanup destinations.

Definition CodeGenFunction.h:748

llvm::Value * EmitObjCExtendObjectLifetime(QualType T, llvm::Value *Ptr)

SmallVector< llvm::Value *, 8 > ObjCEHValueStack

ObjCEHValueStack - Stack of Objective-C exception values, used for rethrows.

Definition CodeGenFunction.h:871

void EmitOMPTeamsGenericLoopDirective(const OMPTeamsGenericLoopDirective &S)

void setBlockContextParameter(const ImplicitParamDecl *D, unsigned argNum, llvm::Value *ptr)

LValue EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E)

RValue EmitCXXMemberPointerCallExpr(const CXXMemberCallExpr *E, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke)

llvm::Type * convertTypeForLoadStore(QualType ASTTy, llvm::Type *LLVMTy=nullptr)

llvm::Value * EmitSMELd1St1(const SVETypeFlags &TypeFlags, llvm::SmallVectorImpl< llvm::Value * > &Ops, unsigned IntID)

llvm::Value * EmitPointerAuthBlendDiscriminator(llvm::Value *StorageAddress, llvm::Value *Discriminator)

Create the discriminator from the storage address and the entity hash.

void EmitVarDecl(const VarDecl &D)

EmitVarDecl - Emit a local variable declaration.

unsigned NextCleanupDestIndex

Definition CodeGenFunction.h:750

std::pair< bool, bool > getIsCounterPair(const Stmt *S) const

AggValueSlot::Overlap_t getOverlapForReturnValue()

Determine whether a return value slot may overlap some other object.

Definition CodeGenFunction.h:2994

bool sanitizePerformTypeCheck() const

Whether any type-checking sanitizers are enabled.

const BreakContinue * GetDestForLoopControlStmt(const LoopControlStmt &S)

Address EmitExtVectorElementLValue(LValue V)

Generates lvalue for partial ext_vector access.

bool EmitOMPLinearClauseInit(const OMPLoopDirective &D)

Emit initial code for linear variables.

void SpecialInitFn(CodeGenFunction &Init, const VarDecl &D, llvm::Value *Address)

Definition CodeGenFunction.h:3409

llvm::Value * EmitCheckedInBoundsGEP(llvm::Type *ElemTy, llvm::Value *Ptr, ArrayRef< llvm::Value * > IdxList, bool SignedIndices, bool IsSubtraction, SourceLocation Loc, const Twine &Name="")

Same as IRBuilder::CreateInBoundsGEP, but additionally emits a check to detect undefined behavior whe...

void EmitInitializationToLValue(const Expr *E, LValue LV, AggValueSlot::IsZeroed_t IsZeroed=AggValueSlot::IsNotZeroed)

EmitInitializationToLValue - Emit an initializer to an LValue.

void EmitAggExpr(const Expr *E, AggValueSlot AS)

EmitAggExpr - Emit the computation of the specified expression of aggregate type.

VarBypassDetector Bypasses

Definition CodeGenFunction.h:290

llvm::BasicBlock * GetIndirectGotoBlock()

static void EmitOMPTargetParallelGenericLoopDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetParallelGenericLoopDirective &S)

Emit device code for the target parallel loop directive.

llvm::Value * EmitBuiltinAvailable(const VersionTuple &Version)

void EmitOpenACCHostDataConstruct(const OpenACCHostDataConstruct &S)

Definition CodeGenFunction.h:4177

Address emitAddrOfRealComponent(Address complex, QualType complexType)

llvm::DILocation * SanitizerAnnotateDebugInfo(ArrayRef< SanitizerKind::SanitizerOrdinal > Ordinals, SanitizerHandler Handler)

Returns debug info, with additional annotation if CGM.getCodeGenOpts().SanitizeAnnotateDebugInfo[Ordi...

EHScopeStack::stable_iterator PrologueCleanupDepth

PrologueCleanupDepth - The cleanup depth enclosing all the cleanups associated with the parameters.

Definition CodeGenFunction.h:397

void EmitOpenACCUpdateConstruct(const OpenACCUpdateConstruct &S)

Definition CodeGenFunction.h:4204

llvm::Value * GetVTTParameter(GlobalDecl GD, bool ForVirtualBase, bool Delegating)

GetVTTParameter - Return the VTT parameter that should be passed to a base constructor/destructor wit...

void EmitOMPUnrollDirective(const OMPUnrollDirective &S)

void EmitOMPStripeDirective(const OMPStripeDirective &S)

Address EmitMSVAListRef(const Expr *E)

Emit a "reference" to a __builtin_ms_va_list; this is always the value of the expression,...

llvm::Value * EmitScalarExpr(const Expr *E, bool IgnoreResultAssign=false)

EmitScalarExpr - Emit the computation of the specified expression of LLVM scalar type,...

RValue EmitLoadOfExtVectorElementLValue(LValue V)

static bool hasAggregateEvaluationKind(QualType T)

Definition CodeGenFunction.h:2612

static bool IsWrappedCXXThis(const Expr *E)

Check if E is a C++ "this" pointer wrapped in value-preserving casts.

void EmitCallArgs(CallArgList &Args, PrototypeWrapper Prototype, llvm::iterator_range< CallExpr::const_arg_iterator > ArgRange, AbstractCallee AC=AbstractCallee(), unsigned ParamsToSkip=0, EvaluationOrder Order=EvaluationOrder::Default)

EmitCallArgs - Emit call arguments for a function.

llvm::Value * EmitMatrixIndexExpr(const Expr *E)

void EmitCaseStmtRange(const CaseStmt &S, ArrayRef< const Attr * > Attrs)

EmitCaseStmtRange - If case statement range is not too big then add multiple cases to switch instruct...

ComplexPairTy EmitUnPromotedValue(ComplexPairTy result, QualType PromotionType)

llvm::CallInst * EmitTrapCall(llvm::Intrinsic::ID IntrID)

Emit a call to trap or debugtrap and attach function attribute "trap-func-name" if specified.

llvm::Function * CurFn

Definition CodeGenFunction.h:347

LValue MakeAddrLValue(Address Addr, QualType T, AlignmentSource Source=AlignmentSource::Type)

Definition CodeGenFunction.h:2708

void EmitOMPSingleDirective(const OMPSingleDirective &S)

void EmitTrapCheck(llvm::Value *Checked, SanitizerHandler CheckHandlerID, bool NoMerge=false, const TrapReason *TR=nullptr)

Create a basic block that will call the trap intrinsic, and emit a conditional branch to it,...

void EmitReturnStmt(const ReturnStmt &S)

EmitReturnStmt - Note that due to GCC extensions, this can have an operand if the function returns vo...

void EmitLambdaVLACapture(const VariableArrayType *VAT, LValue LV)

Definition CodeGenFunction.h:2402

void FinishFunction(SourceLocation EndLoc=SourceLocation())

FinishFunction - Complete IR generation of the current function.

llvm::Value * LoadCXXThis()

LoadCXXThis - Load the value of 'this'.

Definition CodeGenFunction.h:3122

llvm::function_ref< void(CodeGenFunction &, SourceLocation, const unsigned, const bool)> CodeGenOrderedTy

Definition CodeGenFunction.h:322

void EmitAtomicStore(RValue rvalue, LValue lvalue, bool isInit)

llvm::Value * EmitFromMemory(llvm::Value *Value, QualType Ty)

EmitFromMemory - Change a scalar value from its memory representation to its value representation.

llvm::Value * EmitCheckedArgForAssume(const Expr *E)

Emits an argument for a call to a __builtin_assume.

llvm::Value * EmitARCStoreStrongCall(Address addr, llvm::Value *value, bool resultIgnored)

Store into a strong object.

FPOptions CurFPFeatures

Definition CodeGenFunction.h:821

static void EmitOMPTargetSimdDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetSimdDirective &S)

Emit device code for the target simd directive.

RawAddress createCleanupActiveFlag()

llvm::Function * GenerateCapturedStmtFunction(const CapturedStmt &S)

Creates the outlined function for a CapturedStmt.

const CallExpr * MustTailCall

Definition CodeGenFunction.h:618

static void EmitOMPTargetParallelForDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetParallelForDirective &S)

Emit device code for the target parallel for directive.

void EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock=false)

const CGFunctionInfo * CurFnInfo

Definition CodeGenFunction.h:345

uint64_t getProfileCount(const Stmt *S)

Get the profiler's count for the given statement.

llvm::Value * EmitLoadOfCountedByField(const Expr *Base, const FieldDecl *FD, const FieldDecl *CountDecl)

Build an expression accessing the "counted_by" field.

Address GetAddrOfLocalVar(const VarDecl *VD)

GetAddrOfLocalVar - Return the address of a local variable.

Definition CodeGenFunction.h:3034

llvm::Value * EmitNVPTXBuiltinExpr(unsigned BuiltinID, const CallExpr *E)

llvm::Value * getArrayInitIndex()

Get the index of the current ArrayInitLoopExpr, if any.

Definition CodeGenFunction.h:3054

void EmitDeclStmt(const DeclStmt &S)

void InitializeVTablePointer(const VPtr &vptr)

Initialize the vtable pointer of the given subobject.

void EmitLabelStmt(const LabelStmt &S)

llvm::Value * EmitVTableTypeCheckedLoad(const CXXRecordDecl *RD, llvm::Value *VTable, llvm::Type *VTableTy, uint64_t VTableByteOffset)

Emit a type checked load from the given vtable.

void EmitUnreachable(SourceLocation Loc)

Emit a reached-unreachable diagnostic if Loc is valid and runtime checking is enabled.

bool ConstantFoldsToSimpleInteger(const Expr *Cond, bool &Result, bool AllowLabels=false)

ConstantFoldsToSimpleInteger - If the specified expression does not fold to a constant,...

static void EmitOMPTargetTeamsGenericLoopDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsGenericLoopDirective &S)

Emit device code for the target teams loop directive.

llvm::Value * EmitObjCStringLiteral(const ObjCStringLiteral *E)

Emits an instance of NSConstantString representing the object.

void ErrorUnsupported(const Stmt *S, const char *Type)

ErrorUnsupported - Print out an error that codegen doesn't support the specified stmt yet.

llvm::Value * EmitSVEAllTruePred(const SVETypeFlags &TypeFlags)

llvm::Value * EmitSVEReinterpret(llvm::Value *Val, llvm::Type *Ty)

void disableDebugInfo()

Definition CodeGenFunction.h:2155

void EmitOMPTileDirective(const OMPTileDirective &S)

void EmitDecl(const Decl &D, bool EvaluateConditionDecl=false)

EmitDecl - Emit a declaration.

LValue EmitCXXTypeidLValue(const CXXTypeidExpr *E)

llvm::Function * generateDestroyHelper(Address addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray, const VarDecl *VD)

generateDestroyHelper - Generates a helper function which, when invoked, destroys the given object.

void EmitOMPAtomicDirective(const OMPAtomicDirective &S)

LValue EmitMemberExpr(const MemberExpr *E)

void EmitOpenACCSetConstruct(const OpenACCSetConstruct &S)

Definition CodeGenFunction.h:4199

llvm::BasicBlock * OMPAfterScanBlock

Definition CodeGenFunction.h:779

std::pair< llvm::Value *, llvm::Value * > ComplexPairTy

Definition CodeGenFunction.h:284

Address ReturnValue

ReturnValue - The temporary alloca to hold the return value.

Definition CodeGenFunction.h:404

ConstantEmission tryEmitAsConstant(const DeclRefExpr *RefExpr)

Try to emit a reference to the given value without producing it as an l-value.

void EmitObjCMRRAutoreleasePoolPop(llvm::Value *Ptr)

Produce the code to do a primitive release.

LValue EmitLValue(const Expr *E, KnownNonNull_t IsKnownNonNull=NotKnownNonNull)

EmitLValue - Emit code to compute a designator that specifies the location of the expression.

void EmitStoreThroughGlobalRegLValue(RValue Src, LValue Dst)

Store of global named registers are always calls to intrinsics.

void EmitAttributedStmt(const AttributedStmt &S)

llvm::Value * EmitARCExtendBlockObject(const Expr *expr)

bool ShouldXRayInstrumentFunction() const

ShouldXRayInstrument - Return true if the current function should be instrumented with XRay nop sleds...

bool isOpaqueValueEmitted(const OpaqueValueExpr *E)

isOpaqueValueEmitted - Return true if the opaque value expression has already been emitted.

std::pair< llvm::Value *, CGPointerAuthInfo > EmitOrigPointerRValue(const Expr *E)

Retrieve a pointer rvalue and its ptrauth info.

void EmitOMPParallelMasterTaskLoopDirective(const OMPParallelMasterTaskLoopDirective &S)

void EmitOMPDistributeParallelForSimdDirective(const OMPDistributeParallelForSimdDirective &S)

void markStmtAsUsed(bool Skipped, const Stmt *S)

llvm::Instruction * CurrentFuncletPad

Definition CodeGenFunction.h:702

llvm::Value * EmitARCStoreWeak(Address addr, llvm::Value *value, bool ignored)

i8* @objc_storeWeak(i8** addr, i8* value) Returns value.

bool ShouldEmitVTableTypeCheckedLoad(const CXXRecordDecl *RD)

Returns whether we should perform a type checked load when loading a virtual function for virtual cal...

void EmitOMPSectionDirective(const OMPSectionDirective &S)

llvm::Constant * GenerateDestroyHelperFunction(const CGBlockInfo &blockInfo)

Generate the destroy-helper function for a block closure object: static void block_destroy_helper(blo...

void EnsureInsertPoint()

EnsureInsertPoint - Ensure that an insertion point is defined so that emitted IR has a place to go.

Definition CodeGenFunction.h:2664

void EmitOMPForSimdDirective(const OMPForSimdDirective &S)

llvm::LLVMContext & getLLVMContext()

Definition CodeGenFunction.h:2193

bool SawAsmBlock

Whether we processed a Microsoft-style asm block during CodeGen.

Definition CodeGenFunction.h:588

void EmitNewArrayInitializer(const CXXNewExpr *E, QualType elementType, llvm::Type *ElementTy, Address NewPtr, llvm::Value *NumElements, llvm::Value *AllocSizeWithoutCookie)

RValue EmitCXXOperatorMemberCallExpr(const CXXOperatorCallExpr *E, const CXXMethodDecl *MD, ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke)

static Destroyer destroyARCStrongPrecise

Definition CodeGenFunction.h:4989

ComplexPairTy EmitPromotedValue(ComplexPairTy result, QualType PromotionType)

bool checkIfFunctionMustProgress()

Returns true if a function must make progress, which means the mustprogress attribute can be added.

Definition CodeGenFunction.h:622

void EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S)

llvm::SmallVector< VPtr, 4 > VPtrsVector

Definition CodeGenFunction.h:2454

static unsigned getAccessedFieldNo(unsigned Idx, const llvm::Constant *Elts)

getAccessedFieldNo - Given an encoded value and a result number, return the input field number being ...

llvm::Value * EmitTargetBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue)

EmitTargetBuiltinExpr - Emit the given builtin call.

void emitAlignmentAssumption(llvm::Value *PtrValue, QualType Ty, SourceLocation Loc, SourceLocation AssumptionLoc, llvm::Value *Alignment, llvm::Value *OffsetValue=nullptr)

static void EmitOMPTargetTeamsDistributeSimdDeviceFunction(CodeGenModule &CGM, StringRef ParentName, const OMPTargetTeamsDistributeSimdDirective &S)

Emit device code for the target teams distribute simd directive.

void EmitObjCAutoreleasePoolPop(llvm::Value *Ptr)

Produce the code to do a primitive release.

void InitializeVTablePointers(const CXXRecordDecl *ClassDecl)

llvm::Value * EmitObjCRetainNonBlock(llvm::Value *value, llvm::Type *returnType)

Retain the given object, with normal retain semantics.

void EmitARCCopyWeak(Address dst, Address src)

void @objc_copyWeak(i8** dest, i8** src) Disregards the current value in dest.

llvm::Value * EmitSEHExceptionInfo()

llvm::function_ref< void(CodeGenFunction &, const OMPLoopDirective &, JumpDest)> CodeGenLoopTy

Definition CodeGenFunction.h:319

llvm::Value * EmitScalarConversion(llvm::Value *Src, QualType SrcTy, QualType DstTy, SourceLocation Loc)

Emit a conversion from the specified type to the specified destination type, both of which are LLVM s...

void EmitIndirectGotoStmt(const IndirectGotoStmt &S)

void EmitVariablyModifiedType(QualType Ty)

EmitVLASize - Capture all the sizes for the VLA expressions in the given variably-modified type and s...

static bool ShouldNullCheckClassCastValue(const CastExpr *Cast)

void EmitVTableAssumptionLoad(const VPtr &vptr, Address This)

Emit assumption that vptr load == global vtable.

llvm::Value * EmitHLSLBuiltinExpr(unsigned BuiltinID, const CallExpr *E, ReturnValueSlot ReturnValue)

void MaybeEmitDeferredVarDeclInit(const VarDecl *var)

void ProcessOrderScopeAMDGCN(llvm::Value *Order, llvm::Value *Scope, llvm::AtomicOrdering &AO, llvm::SyncScope::ID &SSID)

bool isObviouslyBranchWithoutCleanups(JumpDest Dest) const

isObviouslyBranchWithoutCleanups - Return true if a branch to the specified destination obviously has...

void EmitSEHTryStmt(const SEHTryStmt &S)

bool isTrivialInitializer(const Expr *Init)

Determine whether the given initializer is trivial in the sense that it requires no code to be genera...

void EmitOMPParallelMasterDirective(const OMPParallelMasterDirective &S)

llvm::ScalableVectorType * getSVEPredType(const SVETypeFlags &TypeFlags)

void emitARCCopyAssignWeak(QualType Ty, Address DstAddr, Address SrcAddr)

void EmitBlockWithFallThrough(llvm::BasicBlock *BB, const Stmt *S)

When instrumenting to collect profile data, the counts for some blocks such as switch cases need to n...

llvm::CallInst * EmitNounwindRuntimeCall(llvm::FunctionCallee callee, ArrayRef< Address > args, const Twine &name="")

llvm::Value * EmitNonNullRValueCheck(RValue RV, QualType T)

Create a check that a scalar RValue is non-null.

static Destroyer emitARCIntrinsicUse

Definition CodeGenFunction.h:4991

void EmitARCIntrinsicUse(ArrayRef< llvm::Value * > values)

Given a number of pointers, inform the optimizer that they're being intrinsically used up until this ...

llvm::Value * EmitCMSEClearRecord(llvm::Value *V, llvm::IntegerType *ITy, QualType RTy)

void EmitOMPTaskBasedDirective(const OMPExecutableDirective &S, const OpenMPDirectiveKind CapturedRegion, const RegionCodeGenTy &BodyGen, const TaskGenTy &TaskGen, OMPTaskDataTy &Data)

llvm::Value * EmitNeonCall(llvm::Function *F, SmallVectorImpl< llvm::Value * > &O, const char *name, unsigned shift=0, bool rightshift=false)

void PopCleanupBlock(bool FallThroughIsBranchThrough=false, bool ForDeactivation=false)

PopCleanupBlock - Will pop the cleanup entry on the stack and process all branch fixups.

void EmitStoreOfScalar(llvm::Value *Value, Address Addr, bool Volatile, QualType Ty, AlignmentSource Source=AlignmentSource::Type, bool isInit=false, bool isNontemporal=false)

EmitStoreOfScalar - Store a scalar value to an address, taking care to appropriately convert from the...

Definition CodeGenFunction.h:4345

Address getEHSelectorSlot()

void EmitOMPForDirective(const OMPForDirective &S)

bool hasLabelBeenSeenInCurrentScope() const

Return true if a label was seen in the current scope.

Definition CodeGenFunction.h:415

llvm::Function * GenerateSEHFilterFunction(CodeGenFunction &ParentCGF, const SEHExceptStmt &Except)

Create a stub filter function that will ultimately hold the code of the filter expression.

void EmitLabel(const LabelDecl *D)

EmitLabel - Emit the block for the given label.

llvm::Value * EmitDynamicCast(Address V, const CXXDynamicCastExpr *DCE)

void EmitOMPLinearClauseFinal(const OMPLoopDirective &D, const llvm::function_ref< llvm::Value *(CodeGenFunction &)> CondGen)

Emit final code for linear clauses.

void EmitBlock(llvm::BasicBlock *BB, bool IsFinished=false)

EmitBlock - Emit the given block.

void EmitExprAsInit(const Expr *init, const ValueDecl *D, LValue lvalue, bool capturedByInit)

EmitExprAsInit - Emits the code necessary to initialize a location in memory with the given initializ...

LValue MakeNaturalAlignRawAddrLValue(llvm::Value *V, QualType T)

LValue EmitLoadOfReferenceLValue(Address RefAddr, QualType RefTy, AlignmentSource Source=AlignmentSource::Type)

Definition CodeGenFunction.h:2760

llvm::Value * EmitSVETupleSetOrGet(const SVETypeFlags &TypeFlags, ArrayRef< llvm::Value * > Ops)

QualType BuildFunctionArgList(GlobalDecl GD, FunctionArgList &Args)

llvm::Value * EmitPointerAuthAuth(const CGPointerAuthInfo &Info, llvm::Value *Pointer)

void EmitContinueStmt(const ContinueStmt &S)

llvm::Value * EmitCXXTypeidExpr(const CXXTypeidExpr *E)

void EmitOMPSimdFinal(const OMPLoopDirective &D, const llvm::function_ref< llvm::Value *(CodeGenFunction &)> CondGen)

llvm::Type * ConvertType(const TypeDecl *T)

Definition CodeGenFunction.h:2594

This class organizes the cross-function state that is used while generating LLVM code.

const llvm::DataLayout & getDataLayout() const

This class organizes the cross-module state that is used while lowering AST types to LLVM types.

A specialization of Address that requires the address to be an LLVM Constant.

static ConstantAddress invalid()

Definition CodeGenFunction.h:184

static bool needsSaving(RValue value)

DominatingLLVMValue::saved_type second

Definition CodeGenFunction.h:194

DominatingLLVMValue::saved_type first

Definition CodeGenFunction.h:194

DominatingValue< Address >::saved_type AggregateAddr

Definition CodeGenFunction.h:196

static saved_type save(CodeGenFunction &CGF, RValue value)

RValue restore(CodeGenFunction &CGF)

ConditionalCleanup stores the saved form of its parameters, then restores them and performs the clean...

A saved depth on the scope stack.

A stack of scopes which respond to exceptions, including cleanups and catch blocks.

static stable_iterator stable_end()

Create a stable reference to the bottom of the EH stack.

FunctionArgList - Type for representing both the decl and type of parameters to a function.

LValue - This represents an lvalue references.

CharUnits getAlignment() const

static LValue MakeAddr(Address Addr, QualType type, ASTContext &Context, LValueBaseInfo BaseInfo, TBAAAccessInfo TBAAInfo)

llvm::Value * emitRawPointer(CodeGenFunction &CGF) const

A stack of loop information corresponding to loop nesting levels.

RValue - This trivial value class is used to represent the result of an expression that is evaluated.

static RValue get(llvm::Value *V)

An abstract representation of an aligned address.

static RawAddress invalid()

Class provides a way to call simple version of codegen for OpenMP region, or an advanced with possibl...

ReturnValueSlot - Contains the address where the return value of a function can be stored,...

TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...

The class detects jumps which bypass local variables declaration: goto L; int a; L:

CompoundAssignOperator - For compound assignments (e.g.

CompoundLiteralExpr - [C99 6.5.2.5].

CompoundStmt - This represents a group of statements like { stmt stmt }.

Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...

SourceLocExprScopeGuard(const Expr *DefaultExpr, CurrentSourceLocExprScope &Current)

Represents the current source location and context used to determine the value of the source location...

A reference to a declared variable, function, enum, etc.

Decl - This represents one declaration (or definition), e.g.

This represents one expression.

Expr * IgnoreParens() LLVM_READONLY

Skip past any parentheses which might surround this expression until reaching a fixed point.

ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...

Represents a member of a struct/union/class.

Represents a function declaration or definition.

Represents a prototype with parameter type info, e.g.

GlobalDecl - represents a global declaration.

const Decl * getDecl() const

GotoStmt - This represents a direct goto.

This class represents temporary values used to represent inout and out arguments in HLSL.

IfStmt - This represents an if/then/else.

IndirectGotoStmt - This represents an indirect goto.

Describes an C or C++ initializer list.

Represents the declaration of a label.

LabelStmt - Represents a label, which has a substatement.

FPExceptionModeKind

Possible floating point exception behavior.

Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...

Represents a point when we exit a loop.

Represents a prvalue temporary that is written into memory so that a reference can bind to it.

MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.

MemberExpr - [C99 6.5.2.3] Structure and Union Members.

A pointer to member type per C++ 8.3.3 - Pointers to members.

Represents a C++ nested name specifier, such as "\::std::vector::".

This represents clause 'use_device_addr' in the 'pragma omp ...' directives.

This represents clause 'use_device_ptr' in the 'pragma omp ...' directives.

ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...

Represents Objective-C's @synchronized statement.

Represents Objective-C's @throw statement.

Represents Objective-C's @try ... @catch ... @finally statement.

Represents Objective-C's @autoreleasepool Statement.

ObjCBoxedExpr - used for generalized expression boxing.

ObjCContainerDecl - Represents a container for method declarations.

ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...

ObjCEncodeExpr, used for @encode in Objective-C.

Represents Objective-C's collection statement.

ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...

Represents an ObjC class declaration.

ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.

ObjCIvarDecl - Represents an ObjC instance variable.

ObjCIvarRefExpr - A reference to an ObjC instance variable.

An expression that sends a message to the given Objective-C object or class.

ObjCMethodDecl - Represents an instance or class method declaration.

ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...

ObjCProtocolExpr used for protocol expression in Objective-C.

ObjCSelectorExpr used for @selector in Objective-C.

ObjCStringLiteral, used for Objective-C string literals i.e.

OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.

Expr * getSourceExpr() const

The source expression of an opaque value expression is the expression which originally generated the ...

Represents a parameter to a function.

Pointer-authentication qualifiers.

PointerType - C99 6.7.5.1 - Pointer Declarators.

[C99 6.4.2.2] - A predefined identifier such as func.

PseudoObjectExpr - An expression which accesses a pseudo-object l-value.

A (possibly-)qualified type.

@ DK_objc_strong_lifetime

The collection of all-type qualifiers we support.

Represents a struct/union/class.

specific_decl_iterator< FieldDecl > field_iterator

Flags to identify the types for overloaded SVE builtins.

Scope - A scope is a transient data structure that is used while parsing the program.

Encodes a location in the source.

A trivial tuple used to represent a source range.

StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).

Stmt - This represents one statement.

Likelihood

The likelihood of a branch being taken.

@ LH_None

No attribute set or branches of the IfStmt have the same attribute.

StringLiteral - This represents a string literal expression, e.g.

Exposes information about the current target.

Represents a declaration of a type.

bool isReferenceType() const

UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...

Represents a call to the builtin function __builtin_va_arg.

Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...

Represents a variable declaration or definition.

VarDecl * getCanonicalDecl() override

Retrieves the "canonical" declaration of the given declaration.

bool isLocalVarDeclOrParm() const

Similar to isLocalVarDecl but also includes parameters.

Represents a C array with a specified size that is not an integer-constant-expression.

Expr * getSizeExpr() const

WhileStmt - This represents a 'while' stmt.

Defines the clang::TargetInfo interface.

AlignmentSource

The source of the alignment of an l-value; an expression of confidence in the alignment actually matc...

@ Type

The l-value was considered opaque, so the alignment was determined from a type.

@ Decl

The l-value was an access to a declared entity or something equivalently strong, like the address of ...

TypeEvaluationKind

The kind of evaluation to perform on values of a particular type.

Definition CodeGenFunction.h:112

@ TEK_Aggregate

Definition CodeGenFunction.h:115

@ TEK_Scalar

Definition CodeGenFunction.h:113

@ TEK_Complex

Definition CodeGenFunction.h:114

@ NormalCleanup

Denotes a cleanup that should run when a scope is exited using normal control flow (falling off the e...

ARCPreciseLifetime_t

Does an ARC strong l-value have precise lifetime?

const internal::VariadicAllOfMatcher< Type > type

Matches Types in the clang AST.

const AstTypeMatcher< ArrayType > arrayType

const AstTypeMatcher< ComplexType > complexType

const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr

Matches expressions.

The JSON file list parser is used to communicate input to InstallAPI.

CXXCtorType

C++ constructor types.

bool isa(CodeGen::Address addr)

@ Success

Annotation was successful.

nullptr

This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...

CapturedRegionKind

The different kinds of captured statement.

OpenACCComputeConstruct(OpenACCDirectiveKind K, SourceLocation Start, SourceLocation DirectiveLoc, SourceLocation End, ArrayRef< const OpenACCClause * > Clauses, Stmt *StructuredBlock)

Linkage

Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.

@ Result

The result type of a method or function.

const FunctionProtoType * T

bool IsXLHSInRHSPart

True if UE has the first form and false if the second.

CXXDtorType

C++ destructor types.

LangAS

Defines the address space values used by the address space qualifier of QualType.

llvm::omp::Directive OpenMPDirectiveKind

OpenMP directives.

ExprValueKind

The categorization of expression values, currently following the C++11 scheme.

llvm::fp::ExceptionBehavior ToConstrainedExceptMD(LangOptions::FPExceptionModeKind Kind)

U cast(CodeGen::Address addr)

@ Interface

The "__interface" keyword introduces the elaborated-type-specifier.

Diagnostic wrappers for TextAPI types for error reporting.

Structure with information about how a bitfield should be accessed.

llvm::SmallVector< llvm::AllocaInst * > Take()

Definition CodeGenFunction.h:2805

AllocaTrackerRAII(CodeGenFunction &CGF)

Definition CodeGenFunction.h:2799

~AllocaTrackerRAII()

Definition CodeGenFunction.h:2803

Definition CodeGenFunction.h:376

llvm::Value * FramePtr

Definition CodeGenFunction.h:377

Definition CodeGenFunction.h:359

std::unique_ptr< CGCoroData > Data

Definition CodeGenFunction.h:360

bool InSuspendBlock

Definition CodeGenFunction.h:361

CXXDefaultArgExprScope(CodeGenFunction &CGF, const CXXDefaultArgExpr *E)

Definition CodeGenFunction.h:1806

Definition CodeGenFunction.h:672

size_t OldDeactivateCleanupStackSize

Definition CodeGenFunction.h:674

CleanupDeactivationScope(CodeGenFunction &CGF)

Definition CodeGenFunction.h:676

CodeGenFunction & CGF

Definition CodeGenFunction.h:673

~CleanupDeactivationScope()

Definition CodeGenFunction.h:693

void ForceDeactivate()

Definition CodeGenFunction.h:681

bool Deactivated

Definition CodeGenFunction.h:675

Definition CodeGenFunction.h:664

llvm::Instruction * DominatingIP

Definition CodeGenFunction.h:666

EHScopeStack::stable_iterator Cleanup

Definition CodeGenFunction.h:665

std::optional< StringRef > Architecture

Definition CodeGenFunction.h:5519

FMVResolverOption(llvm::Function *F, ArrayRef< StringRef > Feats, std::optional< StringRef > Arch=std::nullopt)

Definition CodeGenFunction.h:5521

llvm::SmallVector< StringRef, 8 > Features

Definition CodeGenFunction.h:5518

llvm::Function * Function

Definition CodeGenFunction.h:5517

A jump destination is an abstract label, branching to which may require a jump out through normal cle...

Definition CodeGenFunction.h:256

void setScopeDepth(EHScopeStack::stable_iterator depth)

Definition CodeGenFunction.h:268

JumpDest()

Definition CodeGenFunction.h:257

llvm::BasicBlock * getBlock() const

Definition CodeGenFunction.h:263

EHScopeStack::stable_iterator getScopeDepth() const

Definition CodeGenFunction.h:264

bool isValid() const

Definition CodeGenFunction.h:262

unsigned getDestIndex() const

Definition CodeGenFunction.h:265

JumpDest(llvm::BasicBlock *Block, EHScopeStack::stable_iterator Depth, unsigned Index)

Definition CodeGenFunction.h:258

static Address getAddrOfThreadPrivate(CodeGenFunction &CGF, const VarDecl *VD, Address VDAddr, SourceLocation Loc)

Returns address of the threadprivate variable for the current thread.

OMPBuilderCBHelpers()=delete

llvm::OpenMPIRBuilder::InsertPointTy InsertPointTy

Definition CodeGenFunction.h:1897

static void EmitOMPOutlinedRegionBody(CodeGenFunction &CGF, const Stmt *RegionBodyStmt, InsertPointTy AllocaIP, InsertPointTy CodeGenIP, Twine RegionName)

Emit the body of an OMP region that will be outlined in OpenMPIRBuilder::finalize().

static Address getAddressOfLocalVariable(CodeGenFunction &CGF, const VarDecl *VD)

Gets the OpenMP-specific address of the local variable /p VD.

static void EmitCaptureStmt(CodeGenFunction &CGF, InsertPointTy CodeGenIP, llvm::BasicBlock &FiniBB, llvm::Function *Fn, ArrayRef< llvm::Value * > Args)

Definition CodeGenFunction.h:1971

static std::string getNameWithSeparators(ArrayRef< StringRef > Parts, StringRef FirstSeparator=".", StringRef Separator=".")

Get the platform-specific name separator.

static void FinalizeOMPRegion(CodeGenFunction &CGF, InsertPointTy IP)

Emit the Finalization for an OMP region.

Definition CodeGenFunction.h:1942

static void EmitOMPInlinedRegionBody(CodeGenFunction &CGF, const Stmt *RegionBodyStmt, InsertPointTy AllocaIP, InsertPointTy CodeGenIP, Twine RegionName)

Emit the body of an OMP region.

OMPBuilderCBHelpers & operator=(const OMPBuilderCBHelpers &)=delete

OMPBuilderCBHelpers(const OMPBuilderCBHelpers &)=delete

Address SizesArray

Definition CodeGenFunction.h:3856

unsigned NumberOfTargetItems

Definition CodeGenFunction.h:3858

OMPTargetDataInfo(Address BasePointersArray, Address PointersArray, Address SizesArray, Address MappersArray, unsigned NumberOfTargetItems)

Definition CodeGenFunction.h:3860

OMPTargetDataInfo()=default

Address PointersArray

Definition CodeGenFunction.h:3855

Address MappersArray

Definition CodeGenFunction.h:3857

Address BasePointersArray

Definition CodeGenFunction.h:3854

PrototypeWrapper(const FunctionProtoType *FT)

Definition CodeGenFunction.h:5477

llvm::PointerUnion< const FunctionProtoType *, const ObjCMethodDecl * > P

Definition CodeGenFunction.h:5475

PrototypeWrapper(const ObjCMethodDecl *MD)

Definition CodeGenFunction.h:5478

Struct with all information about dynamic [sub]class needed to set vptr.

Definition CodeGenFunction.h:2444

BaseSubobject Base

Definition CodeGenFunction.h:2445

const CXXRecordDecl * NearestVBase

Definition CodeGenFunction.h:2446

const CXXRecordDecl * VTableClass

Definition CodeGenFunction.h:2448

CharUnits OffsetFromNearestVBase

Definition CodeGenFunction.h:2447

VlaSizePair(llvm::Value *NE, QualType T)

Definition CodeGenFunction.h:3105

llvm::Value * NumElts

Definition CodeGenFunction.h:3102

QualType Type

Definition CodeGenFunction.h:3103

This structure provides a set of types that are commonly used during IR emission.

llvm::PointerType * Int8PtrTy

Helper class with most of the code for saving a value for a conditional expression cleanup.

Definition CodeGenFunction.h:121

llvm::PointerIntPair< llvm::Value *, 1, bool > saved_type

Definition CodeGenFunction.h:122

static llvm::Value * restore(CodeGenFunction &CGF, saved_type value)

Definition CodeGenFunction.h:5577

static saved_type save(CodeGenFunction &CGF, llvm::Value *value)

Definition CodeGenFunction.h:5563

static bool needsSaving(llvm::Value *value)

Answer whether the given value needs extra work to be saved.

Definition CodeGenFunction.h:125

T * type

Definition CodeGenFunction.h:145

static type restore(CodeGenFunction &CGF, saved_type value)

Definition CodeGenFunction.h:146

Definition CodeGenFunction.h:155

llvm::Type * ElementType

Definition CodeGenFunction.h:157

CharUnits Alignment

Definition CodeGenFunction.h:158

DominatingLLVMValue::saved_type Offset

Definition CodeGenFunction.h:159

llvm::PointerType * EffectiveType

Definition CodeGenFunction.h:160

DominatingLLVMValue::saved_type BasePtr

Definition CodeGenFunction.h:156

static type restore(CodeGenFunction &CGF, saved_type value)

Definition CodeGenFunction.h:174

static bool needsSaving(type value)

Definition CodeGenFunction.h:163

Address type

Definition CodeGenFunction.h:153

static saved_type save(CodeGenFunction &CGF, type value)

Definition CodeGenFunction.h:169

static bool needsSaving(type value)

Definition CodeGenFunction.h:219

static saved_type save(CodeGenFunction &CGF, type value)

Definition CodeGenFunction.h:220

static type restore(CodeGenFunction &CGF, saved_type value)

Definition CodeGenFunction.h:223

RValue type

Definition CodeGenFunction.h:183

A metaprogramming class for ensuring that a value will dominate an arbitrary position in a function.

static bool needsSaving(type value)

static saved_type save(CodeGenFunction &CGF, type value)

The this pointer adjustment as well as an optional return adjustment for a thunk.