diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-02-11 11:06:55 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-02-11 11:06:55 +0000 |
commit | 3264d3f56b8d3615dd35e0bc2f4e0256f0a3386b (patch) | |
tree | 96afd81878cccc63b21495b90f847cc3d232cc28 /lib/ObjectYAML | |
parent | 02524a88e42adad84fcdbcf4c3ab2df314a5712a (diff) |
Move symbols from the global namespace into (anonymous) namespaces. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294837 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ObjectYAML')
-rw-r--r-- | lib/ObjectYAML/DWARFEmitter.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/ObjectYAML/DWARFEmitter.cpp b/lib/ObjectYAML/DWARFEmitter.cpp index 1e2e960b9dc..2c2d8958e53 100644 --- a/lib/ObjectYAML/DWARFEmitter.cpp +++ b/lib/ObjectYAML/DWARFEmitter.cpp @@ -24,14 +24,14 @@ using namespace llvm; template <typename T> -void writeInteger(T Integer, raw_ostream &OS, bool IsLittleEndian) { +static void writeInteger(T Integer, raw_ostream &OS, bool IsLittleEndian) { if (IsLittleEndian != sys::IsLittleEndianHost) sys::swapByteOrder(Integer); OS.write(reinterpret_cast<char *>(&Integer), sizeof(T)); } -void writeVariableSizedInteger(uint64_t Integer, size_t Size, raw_ostream &OS, - bool IsLittleEndian) { +static void writeVariableSizedInteger(uint64_t Integer, size_t Size, + raw_ostream &OS, bool IsLittleEndian) { if (8 == Size) writeInteger((uint64_t)Integer, OS, IsLittleEndian); else if (4 == Size) @@ -44,7 +44,7 @@ void writeVariableSizedInteger(uint64_t Integer, size_t Size, raw_ostream &OS, assert(false && "Invalid integer write size."); } -void ZeroFillBytes(raw_ostream &OS, size_t Size) { +static void ZeroFillBytes(raw_ostream &OS, size_t Size) { std::vector<uint8_t> FillData; FillData.insert(FillData.begin(), Size, 0); OS.write(reinterpret_cast<char *>(FillData.data()), Size); @@ -236,7 +236,7 @@ void DWARFYAML::EmitDebugInfo(raw_ostream &OS, const DWARFYAML::Data &DI) { } } -void EmitFileEntry(raw_ostream &OS, const DWARFYAML::File &File) { +static void EmitFileEntry(raw_ostream &OS, const DWARFYAML::File &File) { OS.write(File.Name.data(), File.Name.size()); OS.write('\0'); encodeULEB128(File.DirIdx, OS); @@ -245,7 +245,7 @@ void EmitFileEntry(raw_ostream &OS, const DWARFYAML::File &File) { } void DWARFYAML::EmitDebugLine(raw_ostream &OS, const DWARFYAML::Data &DI) { - for (const auto LineTable : DI.DebugLines) { + for (const auto &LineTable : DI.DebugLines) { writeInteger((uint32_t)LineTable.TotalLength, OS, DI.IsLittleEndian); uint64_t SizeOfPrologueLength = 4; if (LineTable.TotalLength == UINT32_MAX) { @@ -333,9 +333,10 @@ void DWARFYAML::EmitDebugLine(raw_ostream &OS, const DWARFYAML::Data &DI) { typedef void (*EmitFuncType)(raw_ostream &, const DWARFYAML::Data &); -void EmitDebugSectionImpl( - const DWARFYAML::Data &DI, EmitFuncType EmitFunc, StringRef Sec, - StringMap<std::unique_ptr<MemoryBuffer>> &OutputBuffers) { +static void +EmitDebugSectionImpl(const DWARFYAML::Data &DI, EmitFuncType EmitFunc, + StringRef Sec, + StringMap<std::unique_ptr<MemoryBuffer>> &OutputBuffers) { std::string Data; raw_string_ostream DebugInfoStream(Data); EmitFunc(DebugInfoStream, DI); |