[MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 294813
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//===-- llvm/MC/MCLinkerOptimizationHint.cpp ----- LOH handling -*- C++ -*-===//
|
||||
//===- llvm/MC/MCLinkerOptimizationHint.cpp ----- LOH handling ------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
@@ -9,9 +9,11 @@
|
||||
|
||||
#include "llvm/MC/MCLinkerOptimizationHint.h"
|
||||
#include "llvm/MC/MCAsmLayout.h"
|
||||
#include "llvm/MC/MCAssembler.h"
|
||||
#include "llvm/MC/MCMachObjectWriter.h"
|
||||
#include "llvm/Support/LEB128.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
@@ -41,14 +43,14 @@ void MCLOHDirective::emit(MachObjectWriter &ObjWriter,
|
||||
uint64_t MCLOHDirective::getEmitSize(const MachObjectWriter &ObjWriter,
|
||||
const MCAsmLayout &Layout) const {
|
||||
class raw_counting_ostream : public raw_ostream {
|
||||
uint64_t Count;
|
||||
uint64_t Count = 0;
|
||||
|
||||
void write_impl(const char *, size_t size) override { Count += size; }
|
||||
|
||||
uint64_t current_pos() const override { return Count; }
|
||||
|
||||
public:
|
||||
raw_counting_ostream() : Count(0) {}
|
||||
raw_counting_ostream() = default;
|
||||
~raw_counting_ostream() override { flush(); }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user