[llvm] [LTO] Use enum class for ImportFailureReason (NFC) (PR #105564)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 11:23:22 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

It turns out that all uses of the enum values here are already
qualified like FunctionImporter::ImportFailureReason::None, so we can
switch to enum class without touching the rest of the codebase.


---
Full diff: https://github.com/llvm/llvm-project/pull/105564.diff


1 Files Affected:

- (modified) llvm/include/llvm/Transforms/IPO/FunctionImport.h (+1-1) 


``````````diff
diff --git a/llvm/include/llvm/Transforms/IPO/FunctionImport.h b/llvm/include/llvm/Transforms/IPO/FunctionImport.h
index 6df597c300c180..5dad572532c8ae 100644
--- a/llvm/include/llvm/Transforms/IPO/FunctionImport.h
+++ b/llvm/include/llvm/Transforms/IPO/FunctionImport.h
@@ -42,7 +42,7 @@ class FunctionImporter {
 
   /// The different reasons selectCallee will chose not to import a
   /// candidate.
-  enum ImportFailureReason {
+  enum class ImportFailureReason {
     None,
     // We can encounter a global variable instead of a function in rare
     // situations with SamplePGO. See comments where this failure type is

``````````

</details>


https://github.com/llvm/llvm-project/pull/105564


More information about the llvm-commits mailing list