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

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


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

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.


>From 3ee0d9a92c3901bd4009ee090ab3ddbfd9d26f77 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 21 Aug 2024 11:12:54 -0700
Subject: [PATCH] [LTO] Use enum class for ImportFailureReason (NFC)

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.
---
 llvm/include/llvm/Transforms/IPO/FunctionImport.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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



More information about the llvm-commits mailing list