summaryrefslogtreecommitdiffstats
path: root/lld/include
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-04-10 00:11:54 +0000
committerRui Ueyama <ruiu@google.com>2015-04-10 00:11:54 +0000
commit84f93415f4568eca92cc29e6ecdeb9b746bb8b57 (patch)
treef04e526b79a7e3298787609c961d7dc588863030 /lld/include
parent1ffe7c7d3623335710df4919f377563228fcb6de (diff)
downloadbcm5719-llvm-84f93415f4568eca92cc29e6ecdeb9b746bb8b57.tar.gz
bcm5719-llvm-84f93415f4568eca92cc29e6ecdeb9b746bb8b57.zip
ELF: Move Hexagon linker helper function to Hexagon directory.
Because no one except Hexagon uses the header, we don't need to maintain the header in the common directory. Also de-template the function for readability. llvm-svn: 234551
Diffstat (limited to 'lld/include')
-rw-r--r--lld/include/lld/ReaderWriter/RelocationHelperFunctions.h37
1 files changed, 0 insertions, 37 deletions
diff --git a/lld/include/lld/ReaderWriter/RelocationHelperFunctions.h b/lld/include/lld/ReaderWriter/RelocationHelperFunctions.h
deleted file mode 100644
index 6a242acaaee..00000000000
--- a/lld/include/lld/ReaderWriter/RelocationHelperFunctions.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//===- lld/ReaderWriter/RelocationHelperFunctions.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_RELOCATION_HELPER_FUNCTIONS_H
-#define LLD_READER_WRITER_RELOCATION_HELPER_FUNCTIONS_H
-
-namespace lld {
-
-/// Scatter val's bits as specified by the mask. Example:
-///
-/// Val: 0bABCDEFG
-/// Mask: 0b10111100001011
-/// Output: 0b00ABCD0000E0FG
-template <typename T> T scatterBits(T val, T mask) {
- T result = 0;
- size_t off = 0;
-
- for (size_t bit = 0; bit < sizeof(T) * 8; ++bit) {
- bool maskBit = (mask >> bit) & 1;
- if (maskBit) {
- bool valBit = (val >> off) & 1;
- result |= static_cast<T>(valBit) << bit;
- ++off;
- }
- }
- return result;
-}
-
-} // namespace lld
-
-#endif // LLD_READER_WRITER_RELOCATION_HELPER_FUNCTIONS_H
OpenPOWER on IntegriCloud