[llvm] 76bdc60 - [Legacy ThinLTO] NFC: Move helper class to an "Impl" namespace (#112846)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 23 15:28:47 PDT 2024


Author: Hubert Tong
Date: 2024-10-23T18:28:43-04:00
New Revision: 76bdc608980b307a354580dfbbed844fee0b75a8

URL: https://github.com/llvm/llvm-project/commit/76bdc608980b307a354580dfbbed844fee0b75a8
DIFF: https://github.com/llvm/llvm-project/commit/76bdc608980b307a354580dfbbed844fee0b75a8.diff

LOG: [Legacy ThinLTO] NFC: Move helper class to an "Impl" namespace (#112846)

`::llvm::TargetMachineBuilder` is only a helper class for
`ThinLTOCodeGenerator` and not a real facility. Move it into an "Impl"
namespace.

Added: 
    

Modified: 
    llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
    llvm/lib/LTO/ThinLTOCodeGenerator.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h b/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
index 7eb30d56e10c10..676d4e179bed4b 100644
--- a/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
+++ b/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
@@ -31,8 +31,15 @@ namespace llvm {
 class StringRef;
 class TargetMachine;
 
+/// ThinLTOCodeGeneratorImpl - Namespace used for ThinLTOCodeGenerator
+/// implementation details. It should be considered private to the
+/// implementation.
+namespace ThinLTOCodeGeneratorImpl {
+struct TargetMachineBuilder;
+}
+
 /// Helper to gather options relevant to the target machine creation
-struct TargetMachineBuilder {
+struct ThinLTOCodeGeneratorImpl::TargetMachineBuilder {
   Triple TheTriple;
   std::string MCpu;
   std::string MAttr;
@@ -301,7 +308,7 @@ class ThinLTOCodeGenerator {
 
 private:
   /// Helper factory to build a TargetMachine
-  TargetMachineBuilder TMBuilder;
+  ThinLTOCodeGeneratorImpl::TargetMachineBuilder TMBuilder;
 
   /// Vector holding the in-memory buffer containing the produced binaries, when
   /// SavedObjectsDirectoryPath isn't set.

diff  --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
index 8074f8690cc1ce..311510ed9fabc2 100644
--- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -70,6 +70,7 @@
 #endif
 
 using namespace llvm;
+using namespace ThinLTOCodeGeneratorImpl;
 
 #define DEBUG_TYPE "thinlto"
 


        


More information about the llvm-commits mailing list