[lld] r353331 - Remove a small header that is used only by one file. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 6 11:28:23 PST 2019


Author: ruiu
Date: Wed Feb  6 11:28:23 2019
New Revision: 353331

URL: http://llvm.org/viewvc/llvm-project?rev=353331&view=rev
Log:
Remove a small header that is used only by one file. NFC.

Removed:
    lld/trunk/ELF/Bits.h
Modified:
    lld/trunk/ELF/SyntheticSections.cpp

Removed: lld/trunk/ELF/Bits.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Bits.h?rev=353330&view=auto
==============================================================================
--- lld/trunk/ELF/Bits.h (original)
+++ lld/trunk/ELF/Bits.h (removed)
@@ -1,34 +0,0 @@
-//===- Bits.h ---------------------------------------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_ELF_BITS_H
-#define LLD_ELF_BITS_H
-
-#include "Config.h"
-#include "llvm/Support/Endian.h"
-
-namespace lld {
-namespace elf {
-
-inline uint64_t readUint(uint8_t *Buf) {
-  if (Config->Is64)
-    return llvm::support::endian::read64(Buf, Config->Endianness);
-  return llvm::support::endian::read32(Buf, Config->Endianness);
-}
-
-inline void writeUint(uint8_t *Buf, uint64_t Val) {
-  if (Config->Is64)
-    llvm::support::endian::write64(Buf, Val, Config->Endianness);
-  else
-    llvm::support::endian::write32(Buf, Val, Config->Endianness);
-}
-
-} // namespace elf
-} // namespace lld
-
-#endif

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=353331&r1=353330&r2=353331&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed Feb  6 11:28:23 2019
@@ -14,7 +14,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "SyntheticSections.h"
-#include "Bits.h"
 #include "Config.h"
 #include "InputFiles.h"
 #include "LinkerScript.h"
@@ -58,6 +57,17 @@ using llvm::support::endian::write64le;
 
 constexpr size_t MergeNoTailSection::NumShards;
 
+static uint64_t readUint(uint8_t *Buf) {
+  return Config->Is64 ? read64(Buf) : read32(Buf);
+}
+
+static void writeUint(uint8_t *Buf, uint64_t Val) {
+  if (Config->Is64)
+    write64(Buf, Val);
+  else
+    write32(Buf, Val);
+}
+
 // Returns an LLD version string.
 static ArrayRef<uint8_t> getVersion() {
   // Check LLD_VERSION first for ease of testing.




More information about the llvm-commits mailing list