[MLGO] Fix InlineAdvisor and ModelUnderTrainingRunner after hasValue removal
authorAiden Grossman <agrossman154@yahoo.com>
Thu, 24 Nov 2022 03:36:13 +0000 (03:36 +0000)
committerAiden Grossman <agrossman154@yahoo.com>
Thu, 24 Nov 2022 03:48:34 +0000 (03:48 +0000)
commit65abca4611256794176b791a1380ad83ccf0741f
treeaaadccf4d81bc44468fa079831b068a3ddb1f3d1
parent241accea2a9d27ec284497d7555fe7f70164b39a
[MLGO] Fix InlineAdvisor and ModelUnderTrainingRunner after hasValue removal

Recentlyin 4b6b248, llvm::Optional's hasValue method was removed as
described in
https://discourse.llvm.org/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor
This breaks InlineAdvisor and ModelUnderTrainingRunner. This patch fixes
them by changing the method to has_value, which hasValue was evaluating
to before.

Differential Revision: https://reviews.llvm.org/D138635
llvm/lib/Analysis/InlineAdvisor.cpp
llvm/lib/Analysis/ModelUnderTrainingRunner.cpp