From f3f3523b9c714d9b98f6102ce79ed3d0c9050169 Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Sat, 15 Jun 2013 00:31:46 +0000 Subject: [yaml2obj] Move some classes into anonymous namespaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184025 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/yaml2obj/yaml2elf.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/yaml2obj') diff --git a/tools/yaml2obj/yaml2elf.cpp b/tools/yaml2obj/yaml2elf.cpp index e6a157cfd8..2f4774f562 100644 --- a/tools/yaml2obj/yaml2elf.cpp +++ b/tools/yaml2obj/yaml2elf.cpp @@ -33,6 +33,7 @@ using namespace llvm; // to deduplicate suffixes. std::map<> with a custom comparator is likely // to be the simplest implementation, but a suffix trie could be more // suitable for the job. +namespace { class StringTableBuilder { /// \brief Indices of strings currently present in `Buf`. StringMap StringIndices; @@ -60,10 +61,12 @@ public: OS.write(Buf.data(), Buf.size()); } }; +} // end anonymous namespace // This class is used to build up a contiguous binary blob while keeping // track of an offset in the output (which notionally begins at // `InitialOffset`). +namespace { class ContiguousBlobAccumulator { const uint64_t InitialOffset; raw_svector_ostream OS; @@ -75,9 +78,11 @@ public: uint64_t currentOffset() const { return InitialOffset + OS.tell(); } void writeBlobToStream(raw_ostream &Out) { Out << OS.str(); } }; +} // end anonymous namespace // Used to keep track of section names, so that in the YAML file sections // can be referenced by name instead of by index. +namespace { class SectionNameToIdxMap { StringMap Map; public: @@ -98,6 +103,7 @@ public: return false; } }; +} // end anonymous namespace template static size_t vectorDataSize(const std::vector &Vec) { -- cgit v1.2.3