Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes.
Differential revision: reviews.llvm.org/D16568 llvm-svn: 258831
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include <deque>
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
@@ -497,7 +498,7 @@ private:
|
||||
std::error_code initStreamFromBuffer();
|
||||
std::error_code initLazyStream(std::unique_ptr<DataStreamer> Streamer);
|
||||
};
|
||||
} // namespace
|
||||
} // end anonymous namespace
|
||||
|
||||
BitcodeDiagnosticInfo::BitcodeDiagnosticInfo(std::error_code EC,
|
||||
DiagnosticSeverity Severity,
|
||||
@@ -872,7 +873,7 @@ public:
|
||||
/// Provide fast operand accessors
|
||||
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
|
||||
};
|
||||
}
|
||||
} // end anonymous namespace
|
||||
|
||||
// FIXME: can we inherit this from ConstantExpr?
|
||||
template <>
|
||||
@@ -880,7 +881,7 @@ struct OperandTraits<ConstantPlaceHolder> :
|
||||
public FixedNumOperandTraits<ConstantPlaceHolder, 1> {
|
||||
};
|
||||
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantPlaceHolder, Value)
|
||||
}
|
||||
} // end namespace llvm
|
||||
|
||||
void BitcodeReaderValueList::assignValue(Value *V, unsigned Idx) {
|
||||
if (Idx == size()) {
|
||||
@@ -908,11 +909,8 @@ void BitcodeReaderValueList::assignValue(Value *V, unsigned Idx) {
|
||||
OldV->replaceAllUsesWith(V);
|
||||
delete PrevVal;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Constant *BitcodeReaderValueList::getConstantFwdRef(unsigned Idx,
|
||||
Type *Ty) {
|
||||
if (Idx >= size())
|
||||
@@ -1129,7 +1127,6 @@ StructType *BitcodeReader::createIdentifiedStructType(LLVMContext &Context) {
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Functions for parsing blocks from the bitcode file
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -2178,7 +2175,7 @@ std::error_code BitcodeReader::parseMetadata(bool ModuleLevel) {
|
||||
getMDOrNull(Record[9]), getMDOrNull(Record[10]),
|
||||
getMDOrNull(Record[11]), getMDOrNull(Record[12]),
|
||||
getMDOrNull(Record[13]),
|
||||
Record.size() <= 15 ? 0 : getMDOrNull(Record[15]),
|
||||
Record.size() <= 15 ? nullptr : getMDOrNull(Record[15]),
|
||||
Record.size() <= 14 ? 0 : Record[14]),
|
||||
NextMetadataNo++);
|
||||
break;
|
||||
@@ -2701,7 +2698,6 @@ std::error_code BitcodeReader::parseConstants() {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case bitc::CST_CODE_CE_BINOP: { // CE_BINOP: [opcode, opval, opval]
|
||||
if (Record.size() < 3)
|
||||
return error("Invalid record");
|
||||
@@ -3375,7 +3371,6 @@ std::error_code BitcodeReader::parseModule(uint64_t ResumeBit,
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Read a record.
|
||||
auto BitCode = Stream.readRecord(Entry.ID, Record);
|
||||
switch (BitCode) {
|
||||
@@ -5816,7 +5811,7 @@ class BitcodeErrorCategoryType : public std::error_category {
|
||||
llvm_unreachable("Unknown error type!");
|
||||
}
|
||||
};
|
||||
}
|
||||
} // end anonymous namespace
|
||||
|
||||
static ManagedStatic<BitcodeErrorCategoryType> ErrorCategory;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user