Skip to content

Commit c08fad8

Browse files
[llvm] Remove redundant initialization of std::optional (NFC)
1 parent 77c90c8 commit c08fad8

File tree

15 files changed

+21
-21
lines changed

15 files changed

+21
-21
lines changed

llvm/include/llvm/Analysis/InlineCost.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class InlineCost {
102102
const char *Reason = nullptr;
103103

104104
/// The cost-benefit pair computed by cost-benefit analysis.
105-
std::optional<CostBenefitPair> CostBenefit = std::nullopt;
105+
std::optional<CostBenefitPair> CostBenefit;
106106

107107
// Trivial constructor, interesting logic in the factory functions below.
108108
InlineCost(int Cost, int Threshold, int StaticBonusApplied,

llvm/include/llvm/DWP/DWP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct InfoSectionUnitHeader {
4444

4545
// dwo_id field. This resides in the header only if Version >= 5.
4646
// In earlier versions, it is read from DW_AT_GNU_dwo_id.
47-
std::optional<uint64_t> Signature = std::nullopt;
47+
std::optional<uint64_t> Signature;
4848

4949
// Derived from the length of Length field.
5050
dwarf::DwarfFormat Format = dwarf::DwarfFormat::DWARF32;

llvm/include/llvm/IR/Instructions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3612,7 +3612,7 @@ class SwitchInst : public Instruction {
36123612
/// their prof branch_weights metadata.
36133613
class SwitchInstProfUpdateWrapper {
36143614
SwitchInst &SI;
3615-
std::optional<SmallVector<uint32_t, 8>> Weights = std::nullopt;
3615+
std::optional<SmallVector<uint32_t, 8>> Weights;
36163616
bool Changed = false;
36173617

36183618
protected:

llvm/include/llvm/LTO/Config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct Config {
5353
/// For adding passes that run right before codegen.
5454
std::function<void(legacy::PassManager &)> PreCodeGenPassesHook;
5555
std::optional<Reloc::Model> RelocModel = Reloc::PIC_;
56-
std::optional<CodeModel::Model> CodeModel = std::nullopt;
56+
std::optional<CodeModel::Model> CodeModel;
5757
CodeGenOpt::Level CGOptLevel = CodeGenOpt::Default;
5858
CodeGenFileType CGFileType = CGFT_ObjectFile;
5959
unsigned OptLevel = 2;

llvm/include/llvm/Object/ELF.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ template <class T> struct DataRegion {
120120
}
121121

122122
const T *First;
123-
std::optional<uint64_t> Size = std::nullopt;
123+
std::optional<uint64_t> Size;
124124
const uint8_t *BufEnd = nullptr;
125125
};
126126

llvm/include/llvm/Target/TargetMachine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class TargetMachine {
110110
unsigned O0WantsFastISel : 1;
111111

112112
// PGO related tunables.
113-
std::optional<PGOOptions> PGOOption = std::nullopt;
113+
std::optional<PGOOptions> PGOOption;
114114

115115
public:
116116
const TargetOptions DefaultOptions;

llvm/include/llvm/Transforms/IPO/Attributor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ struct AttributorConfig {
13851385
DenseSet<const char *> *Allowed = nullptr;
13861386

13871387
/// Maximum number of iterations to run until fixpoint.
1388-
std::optional<unsigned> MaxFixpointIterations = std::nullopt;
1388+
std::optional<unsigned> MaxFixpointIterations;
13891389

13901390
/// A callback function that returns an ORE object from a Function pointer.
13911391
///{

llvm/include/llvm/Transforms/Scalar/GVN.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ class GVNLegacyPass;
7272
/// Intended use is to create a default object, modify parameters with
7373
/// additional setters and then pass it to GVN.
7474
struct GVNOptions {
75-
std::optional<bool> AllowPRE = std::nullopt;
76-
std::optional<bool> AllowLoadPRE = std::nullopt;
77-
std::optional<bool> AllowLoadInLoopPRE = std::nullopt;
78-
std::optional<bool> AllowLoadPRESplitBackedge = std::nullopt;
79-
std::optional<bool> AllowMemDep = std::nullopt;
75+
std::optional<bool> AllowPRE;
76+
std::optional<bool> AllowLoadPRE;
77+
std::optional<bool> AllowLoadInLoopPRE;
78+
std::optional<bool> AllowLoadPRESplitBackedge;
79+
std::optional<bool> AllowMemDep;
8080

8181
GVNOptions() = default;
8282

llvm/lib/Analysis/InlineCost.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
584584
bool DecidedByCostBenefit = false;
585585

586586
// The cost-benefit pair computed by cost-benefit analysis.
587-
std::optional<CostBenefitPair> CostBenefit = std::nullopt;
587+
std::optional<CostBenefitPair> CostBenefit;
588588

589589
bool SingleBB = true;
590590

llvm/lib/Analysis/MemorySSA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ class ClobberWalker {
719719
T &curNode() const { return W->Paths[*N]; }
720720

721721
Walker *W = nullptr;
722-
std::optional<ListIndex> N = std::nullopt;
722+
std::optional<ListIndex> N;
723723
};
724724

725725
using def_path_iterator = generic_def_path_iterator<DefPath, ClobberWalker>;

0 commit comments

Comments
 (0)