Skip to content

Commit

Permalink
[Legacy ThinLTO] NFC: Move helper class to an "Impl" namespace (llvm#…
Browse files Browse the repository at this point in the history
…112846)

`::llvm::TargetMachineBuilder` is only a helper class for
`ThinLTOCodeGenerator` and not a real facility. Move it into an "Impl"
namespace.
  • Loading branch information
hubert-reinterpretcast authored and NoumanAmir657 committed Nov 4, 2024
1 parent a2ab5c8 commit 1df1b74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/LTO/ThinLTOCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#endif

using namespace llvm;
using namespace ThinLTOCodeGeneratorImpl;

#define DEBUG_TYPE "thinlto"

Expand Down

0 comments on commit 1df1b74

Please sign in to comment.