From 30f67f3ea8bf2945ea1c8318cce5ef699e24df04 Mon Sep 17 00:00:00 2001 From: Hubert Tong Date: Fri, 18 Oct 2024 02:45:51 -0400 Subject: [PATCH] [Legacy ThinLTO] NFC: Move helper class to an "Impl" namespace `::llvm::TargetMachineBuilder` is only a helper class for `ThinLTOCodeGenerator` and not a real facility. Move it into an "Impl" namespace. --- llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h | 11 +++++++++-- llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h b/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h index 7eb30d56e10c1..676d4e179bed4 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 8074f8690cc1c..311510ed9fabc 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"