[lld] r234867 - ELF: Remove a header which is used only by one .cpp file.
Rui Ueyama
ruiu at google.com
Tue Apr 14 00:09:03 PDT 2015
Author: ruiu
Date: Tue Apr 14 02:09:03 2015
New Revision: 234867
URL: http://llvm.org/viewvc/llvm-project?rev=234867&view=rev
Log:
ELF: Remove a header which is used only by one .cpp file.
The data and the inline function defined in the header is used only
by HexagonRelocationHandler.cpp.
Removed:
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationFunctions.h
Modified:
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp
Removed: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationFunctions.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationFunctions.h?rev=234866&view=auto
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationFunctions.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationFunctions.h (removed)
@@ -1,49 +0,0 @@
-//===- HexagonRelocationFunction.h ----------------------------------------===//
-//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLD_READER_WRITER_ELF_HEXAGON_HEXAGON_RELOCATION_FUNCTIONS_H
-#define LLD_READER_WRITER_ELF_HEXAGON_HEXAGON_RELOCATION_FUNCTIONS_H
-
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Endian.h"
-
-namespace lld {
-namespace elf {
-
-/// \brief Applying fixup on Hexagon requires the relocator to fetch the fixup
-/// mask from the instruction. To fetch the fixup encoding, the linker uses a
-/// static array that contains the instruction mask, the compare mask and the
-/// relocation mask.
-typedef struct {
- uint32_t insnMask; // Instruction mask.
- uint32_t insnCmpMask; // Compare mask.
- uint32_t insnBitMask; // Relocation mask.
- bool isDuplex; // Indicates if the instruction is a duplex instruction.
-} Instruction;
-
-#include "HexagonEncodings.h"
-
-/// \brief finds the scatter Bits that need to be used to apply relocations
-inline uint32_t findv4bitmask(uint8_t *location) {
- uint32_t insn = llvm::support::endian::read32le(location);
- for (int32_t i = 0, e = llvm::array_lengthof(insn_encodings); i < e; i++) {
- if (((insn & 0xc000) == 0) && !(insn_encodings[i].isDuplex))
- continue;
- if (((insn & 0xc000) != 0) && (insn_encodings[i].isDuplex))
- continue;
- if (((insn_encodings[i].insnMask) & insn) == insn_encodings[i].insnCmpMask)
- return insn_encodings[i].insnBitMask;
- }
- llvm_unreachable("found unknown Hexagon instruction");
-}
-
-} // elf
-} // lld
-
-#endif // LLD_READER_WRITER_ELF_HEXAGON_HEXAGON_RELOCATION_FUNCTIONS_H
Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp?rev=234867&r1=234866&r2=234867&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp Tue Apr 14 02:09:03 2015
@@ -8,9 +8,9 @@
//===----------------------------------------------------------------------===//
#include "HexagonLinkingContext.h"
-#include "HexagonRelocationFunctions.h"
#include "HexagonRelocationHandler.h"
#include "HexagonTargetHandler.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Endian.h"
using namespace lld;
@@ -18,6 +18,33 @@ using namespace lld::elf;
using namespace llvm::ELF;
using namespace llvm::support::endian;
+/// \brief Applying fixup on Hexagon requires the relocator to fetch the fixup
+/// mask from the instruction. To fetch the fixup encoding, the linker uses a
+/// static array that contains the instruction mask, the compare mask and the
+/// relocation mask.
+typedef struct {
+ uint32_t insnMask; // Instruction mask.
+ uint32_t insnCmpMask; // Compare mask.
+ uint32_t insnBitMask; // Relocation mask.
+ bool isDuplex; // Indicates if the instruction is a duplex instruction.
+} Instruction;
+
+#include "HexagonEncodings.h"
+
+/// \brief finds the scatter Bits that need to be used to apply relocations
+inline uint32_t findv4bitmask(uint8_t *location) {
+ uint32_t insn = llvm::support::endian::read32le(location);
+ for (int32_t i = 0, e = llvm::array_lengthof(insn_encodings); i < e; i++) {
+ if (((insn & 0xc000) == 0) && !(insn_encodings[i].isDuplex))
+ continue;
+ if (((insn & 0xc000) != 0) && (insn_encodings[i].isDuplex))
+ continue;
+ if (((insn_encodings[i].insnMask) & insn) == insn_encodings[i].insnCmpMask)
+ return insn_encodings[i].insnBitMask;
+ }
+ llvm_unreachable("found unknown Hexagon instruction");
+}
+
// Scatter val's bits as specified by the mask. Example:
//
// Val: 0bABCDEFG
More information about the llvm-commits
mailing list