Skip to content

Commit 01c4574

Browse files
committed
[Attributor] Create getName() method for abstract attribute
Summary: The `getName()` method returns the name of the abstract attribute Reviewers: jdoerfert, sstefan1, uenoku, homerdin, baziotis Reviewed By: sstefan1 Subscribers: uenoku, kuter, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D83109
1 parent c8ef3d5 commit 01c4574

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

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

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,6 +2014,9 @@ struct AbstractAttribute : public IRPosition {
20142014

20152015
/// This function should return the "summarized" assumed state as string.
20162016
virtual const std::string getAsStr() const = 0;
2017+
2018+
/// This function should return the name of the AbstractAttribute
2019+
virtual const std::string getName() const = 0;
20172020
///}
20182021

20192022
/// Allow the Attributor access to the protected methods.
@@ -2128,6 +2131,9 @@ struct AAReturnedValues
21282131
static AAReturnedValues &createForPosition(const IRPosition &IRP,
21292132
Attributor &A);
21302133

2134+
/// See AbstractAttribute::getName()
2135+
const std::string getName() const override { return "AAReturnedValues"; }
2136+
21312137
/// Unique ID (due to the unique address)
21322138
static const char ID;
21332139
};
@@ -2146,6 +2152,9 @@ struct AANoUnwind
21462152
/// Create an abstract attribute view for the position \p IRP.
21472153
static AANoUnwind &createForPosition(const IRPosition &IRP, Attributor &A);
21482154

2155+
/// See AbstractAttribute::getName()
2156+
const std::string getName() const override { return "AANoUnwind"; }
2157+
21492158
/// Unique ID (due to the unique address)
21502159
static const char ID;
21512160
};
@@ -2164,6 +2173,9 @@ struct AANoSync
21642173
/// Create an abstract attribute view for the position \p IRP.
21652174
static AANoSync &createForPosition(const IRPosition &IRP, Attributor &A);
21662175

2176+
/// See AbstractAttribute::getName()
2177+
const std::string getName() const override { return "AANoSync"; }
2178+
21672179
/// Unique ID (due to the unique address)
21682180
static const char ID;
21692181
};
@@ -2183,6 +2195,9 @@ struct AANonNull
21832195
/// Create an abstract attribute view for the position \p IRP.
21842196
static AANonNull &createForPosition(const IRPosition &IRP, Attributor &A);
21852197

2198+
/// See AbstractAttribute::getName()
2199+
const std::string getName() const override { return "AANonNull"; }
2200+
21862201
/// Unique ID (due to the unique address)
21872202
static const char ID;
21882203
};
@@ -2202,6 +2217,9 @@ struct AANoRecurse
22022217
/// Create an abstract attribute view for the position \p IRP.
22032218
static AANoRecurse &createForPosition(const IRPosition &IRP, Attributor &A);
22042219

2220+
/// See AbstractAttribute::getName()
2221+
const std::string getName() const override { return "AANoRecurse"; }
2222+
22052223
/// Unique ID (due to the unique address)
22062224
static const char ID;
22072225
};
@@ -2221,6 +2239,9 @@ struct AAWillReturn
22212239
/// Create an abstract attribute view for the position \p IRP.
22222240
static AAWillReturn &createForPosition(const IRPosition &IRP, Attributor &A);
22232241

2242+
/// See AbstractAttribute::getName()
2243+
const std::string getName() const override { return "AAWillReturn"; }
2244+
22242245
/// Unique ID (due to the unique address)
22252246
static const char ID;
22262247
};
@@ -2247,6 +2268,9 @@ struct AAUndefinedBehavior
22472268
static AAUndefinedBehavior &createForPosition(const IRPosition &IRP,
22482269
Attributor &A);
22492270

2271+
/// See AbstractAttribute::getName()
2272+
const std::string getName() const override { return "AAUndefinedBehavior"; }
2273+
22502274
/// Unique ID (due to the unique address)
22512275
static const char ID;
22522276
};
@@ -2275,6 +2299,9 @@ struct AAReachability : public StateWrapper<BooleanState, AbstractAttribute> {
22752299
static AAReachability &createForPosition(const IRPosition &IRP,
22762300
Attributor &A);
22772301

2302+
/// See AbstractAttribute::getName()
2303+
const std::string getName() const override { return "AAReachability"; }
2304+
22782305
/// Unique ID (due to the unique address)
22792306
static const char ID;
22802307
};
@@ -2294,6 +2321,9 @@ struct AANoAlias
22942321
/// Create an abstract attribute view for the position \p IRP.
22952322
static AANoAlias &createForPosition(const IRPosition &IRP, Attributor &A);
22962323

2324+
/// See AbstractAttribute::getName()
2325+
const std::string getName() const override { return "AANoAlias"; }
2326+
22972327
/// Unique ID (due to the unique address)
22982328
static const char ID;
22992329
};
@@ -2313,6 +2343,9 @@ struct AANoFree
23132343
/// Create an abstract attribute view for the position \p IRP.
23142344
static AANoFree &createForPosition(const IRPosition &IRP, Attributor &A);
23152345

2346+
/// See AbstractAttribute::getName()
2347+
const std::string getName() const override { return "AANoFree"; }
2348+
23162349
/// Unique ID (due to the unique address)
23172350
static const char ID;
23182351
};
@@ -2332,6 +2365,9 @@ struct AANoReturn
23322365
/// Create an abstract attribute view for the position \p IRP.
23332366
static AANoReturn &createForPosition(const IRPosition &IRP, Attributor &A);
23342367

2368+
/// See AbstractAttribute::getName()
2369+
const std::string getName() const override { return "AANoReturn"; }
2370+
23352371
/// Unique ID (due to the unique address)
23362372
static const char ID;
23372373
};
@@ -2386,6 +2422,9 @@ struct AAIsDead : public StateWrapper<BooleanState, AbstractAttribute> {
23862422
return F.hasPersonalityFn() && !canSimplifyInvokeNoUnwind(&F);
23872423
}
23882424

2425+
/// See AbstractAttribute::getName()
2426+
const std::string getName() const override { return "AAIsDead"; }
2427+
23892428
/// Unique ID (due to the unique address)
23902429
static const char ID;
23912430

@@ -2576,6 +2615,9 @@ struct AADereferenceable
25762615
static AADereferenceable &createForPosition(const IRPosition &IRP,
25772616
Attributor &A);
25782617

2618+
/// See AbstractAttribute::getName()
2619+
const std::string getName() const override { return "AADereferenceable"; }
2620+
25792621
/// Unique ID (due to the unique address)
25802622
static const char ID;
25812623
};
@@ -2594,6 +2636,9 @@ struct AAAlign : public IRAttribute<
25942636
/// Return known alignment.
25952637
unsigned getKnownAlign() const { return getKnown(); }
25962638

2639+
/// See AbstractAttribute::getName()
2640+
const std::string getName() const override { return "AAAlign"; }
2641+
25972642
/// Create an abstract attribute view for the position \p IRP.
25982643
static AAAlign &createForPosition(const IRPosition &IRP, Attributor &A);
25992644

@@ -2648,6 +2693,9 @@ struct AANoCapture
26482693
/// Create an abstract attribute view for the position \p IRP.
26492694
static AANoCapture &createForPosition(const IRPosition &IRP, Attributor &A);
26502695

2696+
/// See AbstractAttribute::getName()
2697+
const std::string getName() const override { return "AANoCapture"; }
2698+
26512699
/// Unique ID (due to the unique address)
26522700
static const char ID;
26532701
};
@@ -2666,6 +2714,9 @@ struct AAValueSimplify : public StateWrapper<BooleanState, AbstractAttribute> {
26662714
static AAValueSimplify &createForPosition(const IRPosition &IRP,
26672715
Attributor &A);
26682716

2717+
/// See AbstractAttribute::getName()
2718+
const std::string getName() const override { return "AAValueSimplify"; }
2719+
26692720
/// Unique ID (due to the unique address)
26702721
static const char ID;
26712722
};
@@ -2683,6 +2734,9 @@ struct AAHeapToStack : public StateWrapper<BooleanState, AbstractAttribute> {
26832734
/// Create an abstract attribute view for the position \p IRP.
26842735
static AAHeapToStack &createForPosition(const IRPosition &IRP, Attributor &A);
26852736

2737+
/// See AbstractAttribute::getName()
2738+
const std::string getName() const override { return "AAHeapToStack"; }
2739+
26862740
/// Unique ID (due to the unique address)
26872741
static const char ID;
26882742
};
@@ -2716,6 +2770,9 @@ struct AAPrivatizablePtr
27162770
static AAPrivatizablePtr &createForPosition(const IRPosition &IRP,
27172771
Attributor &A);
27182772

2773+
/// See AbstractAttribute::getName()
2774+
const std::string getName() const override { return "AAPrivatizablePtr"; }
2775+
27192776
/// Unique ID (due to the unique address)
27202777
static const char ID;
27212778
};
@@ -2767,6 +2824,9 @@ struct AAMemoryBehavior
27672824
static AAMemoryBehavior &createForPosition(const IRPosition &IRP,
27682825
Attributor &A);
27692826

2827+
/// See AbstractAttribute::getName()
2828+
const std::string getName() const override { return "AAMemoryBehavior"; }
2829+
27702830
/// Unique ID (due to the unique address)
27712831
static const char ID;
27722832
};
@@ -2925,6 +2985,9 @@ struct AAMemoryLocation
29252985
return getMemoryLocationsAsStr(getAssumedNotAccessedLocation());
29262986
}
29272987

2988+
/// See AbstractAttribute::getName()
2989+
const std::string getName() const override { return "AAMemoryLocation"; }
2990+
29282991
/// Unique ID (due to the unique address)
29292992
static const char ID;
29302993
};
@@ -2970,6 +3033,9 @@ struct AAValueConstantRange
29703033
return nullptr;
29713034
}
29723035

3036+
/// See AbstractAttribute::getName()
3037+
const std::string getName() const override { return "AAValueConstantRange"; }
3038+
29733039
/// Unique ID (due to the unique address)
29743040
static const char ID;
29753041
};

0 commit comments

Comments
 (0)