File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
include/swift/SILOptimizer/Utils Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -345,23 +345,17 @@ struct LoadOperation {
345345
346346 explicit operator bool () const { return !value.isNull (); }
347347
348- SingleValueInstruction *operator * () const {
348+ SingleValueInstruction *getLoadInst () const {
349349 if (value.is <LoadInst *>())
350350 return value.get <LoadInst *>();
351351 return value.get <LoadBorrowInst *>();
352352 }
353353
354- const SingleValueInstruction *operator ->() const {
355- if (value.is <LoadInst *>())
356- return value.get <LoadInst *>();
357- return value.get <LoadBorrowInst *>();
358- }
354+ SingleValueInstruction *operator *() const { return getLoadInst (); }
359355
360- SingleValueInstruction *operator ->() {
361- if (value.is <LoadInst *>())
362- return value.get <LoadInst *>();
363- return value.get <LoadBorrowInst *>();
364- }
356+ const SingleValueInstruction *operator ->() const { return getLoadInst (); }
357+
358+ SingleValueInstruction *operator ->() { return getLoadInst (); }
365359
366360 SILValue getOperand () const {
367361 if (value.is <LoadInst *>())
You can’t perform that action at this time.
0 commit comments