Skip to content

Commit 31cf38b

Browse files
nikicSvyatoslavScherbina
authored andcommitted
[ModRef] Default to ModRef in MemoryEffects ctors (NFC)
Allow writing something like MemoryEffects::argMemOnly() implying MemoryEffects::argMemOnly(ModRefInfo::ModRef). Having to write this out is a bit of an annoying than porting code using the existing attributes in D135780. (cherry picked from commit 9cfe8ee)
1 parent 5563ac1 commit 31cf38b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/include/llvm/IR/ModRef.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,18 @@ class MemoryEffects {
129129
}
130130

131131
/// Create MemoryEffects that can only access argument memory.
132-
static MemoryEffects argMemOnly(ModRefInfo MR) {
132+
static MemoryEffects argMemOnly(ModRefInfo MR = ModRefInfo::ModRef) {
133133
return MemoryEffects(ArgMem, MR);
134134
}
135135

136136
/// Create MemoryEffects that can only access inaccessible memory.
137-
static MemoryEffects inaccessibleMemOnly(ModRefInfo MR) {
137+
static MemoryEffects inaccessibleMemOnly(ModRefInfo MR = ModRefInfo::ModRef) {
138138
return MemoryEffects(InaccessibleMem, MR);
139139
}
140140

141141
/// Create MemoryEffects that can only access inaccessible or argument memory.
142-
static MemoryEffects inaccessibleOrArgMemOnly(ModRefInfo MR) {
142+
static MemoryEffects
143+
inaccessibleOrArgMemOnly(ModRefInfo MR = ModRefInfo::ModRef) {
143144
MemoryEffects FRMB = none();
144145
FRMB.setModRef(ArgMem, MR);
145146
FRMB.setModRef(InaccessibleMem, MR);

0 commit comments

Comments
 (0)