summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2017-06-23 21:57:40 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2017-06-23 21:57:40 +0000
commit2db0cfa61702552722720e822a9f8b564c6c5dad (patch)
treeda5f52da94156c5674007e22f01a28509173ac07 /llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
parenteabde9306da067d5d5c67f82b5618034a329a34e (diff)
downloadbcm5719-llvm-2db0cfa61702552722720e822a9f8b564c6c5dad.tar.gz
bcm5719-llvm-2db0cfa61702552722720e822a9f8b564c6c5dad.zip
[DebugInfo] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 306169
Diffstat (limited to 'llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp')
-rw-r--r--llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp b/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
index faf2442bc94..e45f4ae0ed9 100644
--- a/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
+++ b/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
@@ -8,23 +8,33 @@
//===----------------------------------------------------------------------===//
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
-
-#include "llvm/DebugInfo/MSF/IMSFFile.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/DebugInfo/MSF/MSFCommon.h"
#include "llvm/DebugInfo/MSF/MSFStreamLayout.h"
-#include "llvm/Support/BinaryStreamError.h"
+#include "llvm/Support/Endian.h"
+#include "llvm/Support/Error.h"
+#include "llvm/Support/MathExtras.h"
+#include <algorithm>
+#include <cassert>
+#include <cstdint>
+#include <cstring>
+#include <utility>
+#include <vector>
using namespace llvm;
using namespace llvm::msf;
namespace {
+
template <typename Base> class MappedBlockStreamImpl : public Base {
public:
template <typename... Args>
MappedBlockStreamImpl(Args &&... Params)
: Base(std::forward<Args>(Params)...) {}
};
-}
+
+} // end anonymous namespace
static void initializeFpmStreamLayout(const MSFLayout &Layout,
MSFStreamLayout &FpmLayout) {
@@ -39,7 +49,8 @@ static void initializeFpmStreamLayout(const MSFLayout &Layout,
FpmLayout.Length = msf::getFullFpmByteSize(Layout);
}
-typedef std::pair<uint32_t, uint32_t> Interval;
+using Interval = std::pair<uint32_t, uint32_t>;
+
static Interval intersect(const Interval &I1, const Interval &I2) {
return std::make_pair(std::max(I1.first, I2.first),
std::min(I1.second, I2.second));
@@ -214,7 +225,7 @@ bool MappedBlockStream::tryReadContiguously(uint32_t Offset, uint32_t Size,
uint32_t OffsetInBlock = Offset % BlockSize;
uint32_t BytesFromFirstBlock = std::min(Size, BlockSize - OffsetInBlock);
uint32_t NumAdditionalBlocks =
- llvm::alignTo(Size - BytesFromFirstBlock, BlockSize) / BlockSize;
+ alignTo(Size - BytesFromFirstBlock, BlockSize) / BlockSize;
uint32_t RequiredContiguousBlocks = NumAdditionalBlocks + 1;
uint32_t E = StreamLayout.Blocks[BlockNum];
OpenPOWER on IntegriCloud