mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Use error_code() instead of error_code::succes()
There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209952 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -490,7 +490,7 @@ error_code BitcodeReader::ParseAttributeBlock() {
|
||||
case BitstreamEntry::Error:
|
||||
return Error(MalformedBlock);
|
||||
case BitstreamEntry::EndBlock:
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
case BitstreamEntry::Record:
|
||||
// The interesting case.
|
||||
break;
|
||||
@ -619,7 +619,7 @@ error_code BitcodeReader::ParseAttrKind(uint64_t Code,
|
||||
*Kind = GetAttrFromCode(Code);
|
||||
if (*Kind == Attribute::None)
|
||||
return Error(InvalidValue);
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
}
|
||||
|
||||
error_code BitcodeReader::ParseAttributeGroupBlock() {
|
||||
@ -640,7 +640,7 @@ error_code BitcodeReader::ParseAttributeGroupBlock() {
|
||||
case BitstreamEntry::Error:
|
||||
return Error(MalformedBlock);
|
||||
case BitstreamEntry::EndBlock:
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
case BitstreamEntry::Record:
|
||||
// The interesting case.
|
||||
break;
|
||||
@ -731,7 +731,7 @@ error_code BitcodeReader::ParseTypeTableBody() {
|
||||
case BitstreamEntry::EndBlock:
|
||||
if (NumRecords != TypeList.size())
|
||||
return Error(MalformedBlock);
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
case BitstreamEntry::Record:
|
||||
// The interesting case.
|
||||
break;
|
||||
@ -947,7 +947,7 @@ error_code BitcodeReader::ParseValueSymbolTable() {
|
||||
case BitstreamEntry::Error:
|
||||
return Error(MalformedBlock);
|
||||
case BitstreamEntry::EndBlock:
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
case BitstreamEntry::Record:
|
||||
// The interesting case.
|
||||
break;
|
||||
@ -1002,7 +1002,7 @@ error_code BitcodeReader::ParseMetadata() {
|
||||
case BitstreamEntry::Error:
|
||||
return Error(MalformedBlock);
|
||||
case BitstreamEntry::EndBlock:
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
case BitstreamEntry::Record:
|
||||
// The interesting case.
|
||||
break;
|
||||
@ -1178,7 +1178,7 @@ error_code BitcodeReader::ResolveGlobalAndAliasInits() {
|
||||
FunctionPrefixWorklist.pop_back();
|
||||
}
|
||||
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
}
|
||||
|
||||
static APInt ReadWideAPInt(ArrayRef<uint64_t> Vals, unsigned TypeBits) {
|
||||
@ -1212,7 +1212,7 @@ error_code BitcodeReader::ParseConstants() {
|
||||
// Once all the constants have been read, go through and resolve forward
|
||||
// references.
|
||||
ValueList.ResolveConstantForwardRefs();
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
case BitstreamEntry::Record:
|
||||
// The interesting case.
|
||||
break;
|
||||
@ -1642,7 +1642,7 @@ error_code BitcodeReader::ParseUseLists() {
|
||||
case BitstreamEntry::Error:
|
||||
return Error(MalformedBlock);
|
||||
case BitstreamEntry::EndBlock:
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
case BitstreamEntry::Record:
|
||||
// The interesting case.
|
||||
break;
|
||||
@ -1682,7 +1682,7 @@ error_code BitcodeReader::RememberAndSkipFunctionBody() {
|
||||
// Skip over the function block for now.
|
||||
if (Stream.SkipBlock())
|
||||
return Error(InvalidRecord);
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
}
|
||||
|
||||
error_code BitcodeReader::GlobalCleanup() {
|
||||
@ -1711,7 +1711,7 @@ error_code BitcodeReader::GlobalCleanup() {
|
||||
// want lazy deserialization.
|
||||
std::vector<std::pair<GlobalVariable*, unsigned> >().swap(GlobalInits);
|
||||
std::vector<std::pair<GlobalAlias*, unsigned> >().swap(AliasInits);
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
}
|
||||
|
||||
error_code BitcodeReader::ParseModule(bool Resume) {
|
||||
@ -1791,7 +1791,7 @@ error_code BitcodeReader::ParseModule(bool Resume) {
|
||||
// just finish the parse now.
|
||||
if (LazyStreamer && SeenValueSymbolTable) {
|
||||
NextUnreadBit = Stream.GetCurrentBitNo();
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
}
|
||||
break;
|
||||
case bitc::USELIST_BLOCK_ID:
|
||||
@ -2054,7 +2054,7 @@ error_code BitcodeReader::ParseBitcodeInto(Module *M) {
|
||||
// need to understand them all.
|
||||
while (1) {
|
||||
if (Stream.AtEndOfStream())
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
|
||||
BitstreamEntry Entry =
|
||||
Stream.advance(BitstreamCursor::AF_DontAutoprocessAbbrevs);
|
||||
@ -2063,7 +2063,7 @@ error_code BitcodeReader::ParseBitcodeInto(Module *M) {
|
||||
case BitstreamEntry::Error:
|
||||
return Error(MalformedBlock);
|
||||
case BitstreamEntry::EndBlock:
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
|
||||
case BitstreamEntry::SubBlock:
|
||||
switch (Entry.ID) {
|
||||
@ -2079,7 +2079,7 @@ error_code BitcodeReader::ParseBitcodeInto(Module *M) {
|
||||
if (error_code EC = ParseModule(false))
|
||||
return EC;
|
||||
if (LazyStreamer)
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
break;
|
||||
default:
|
||||
if (Stream.SkipBlock())
|
||||
@ -2096,7 +2096,7 @@ error_code BitcodeReader::ParseBitcodeInto(Module *M) {
|
||||
if (Stream.getAbbrevIDWidth() == 2 && Entry.ID == 2 &&
|
||||
Stream.Read(6) == 2 && Stream.Read(24) == 0xa0a0a &&
|
||||
Stream.AtEndOfStream())
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
|
||||
return Error(InvalidRecord);
|
||||
}
|
||||
@ -2118,7 +2118,7 @@ error_code BitcodeReader::ParseModuleTriple(std::string &Triple) {
|
||||
case BitstreamEntry::Error:
|
||||
return Error(MalformedBlock);
|
||||
case BitstreamEntry::EndBlock:
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
case BitstreamEntry::Record:
|
||||
// The interesting case.
|
||||
break;
|
||||
@ -2161,7 +2161,7 @@ error_code BitcodeReader::ParseTriple(std::string &Triple) {
|
||||
case BitstreamEntry::Error:
|
||||
return Error(MalformedBlock);
|
||||
case BitstreamEntry::EndBlock:
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
|
||||
case BitstreamEntry::SubBlock:
|
||||
if (Entry.ID == bitc::MODULE_BLOCK_ID)
|
||||
@ -2193,7 +2193,7 @@ error_code BitcodeReader::ParseMetadataAttachment() {
|
||||
case BitstreamEntry::Error:
|
||||
return Error(MalformedBlock);
|
||||
case BitstreamEntry::EndBlock:
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
case BitstreamEntry::Record:
|
||||
// The interesting case.
|
||||
break;
|
||||
@ -3146,7 +3146,7 @@ OutOfRecordLoop:
|
||||
ValueList.shrinkTo(ModuleValueListSize);
|
||||
MDValueList.shrinkTo(ModuleMDValueListSize);
|
||||
std::vector<BasicBlock*>().swap(FunctionBBs);
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
}
|
||||
|
||||
/// Find the function body in the bitcode stream
|
||||
@ -3160,7 +3160,7 @@ error_code BitcodeReader::FindFunctionInStream(Function *F,
|
||||
if (error_code EC = ParseModule(true))
|
||||
return EC;
|
||||
}
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
@ -3180,7 +3180,7 @@ error_code BitcodeReader::Materialize(GlobalValue *GV) {
|
||||
Function *F = dyn_cast<Function>(GV);
|
||||
// If it's not a function or is already material, ignore the request.
|
||||
if (!F || !F->isMaterializable())
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
|
||||
DenseMap<Function*, uint64_t>::iterator DFII = DeferredFunctionInfo.find(F);
|
||||
assert(DFII != DeferredFunctionInfo.end() && "Deferred function not found!");
|
||||
@ -3208,7 +3208,7 @@ error_code BitcodeReader::Materialize(GlobalValue *GV) {
|
||||
}
|
||||
}
|
||||
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
}
|
||||
|
||||
bool BitcodeReader::isDematerializable(const GlobalValue *GV) const {
|
||||
@ -3272,7 +3272,7 @@ error_code BitcodeReader::MaterializeModule(Module *M) {
|
||||
UpgradeInstWithTBAATag(InstsWithTBAATag[I]);
|
||||
|
||||
UpgradeDebugInfo(*M);
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
}
|
||||
|
||||
error_code BitcodeReader::InitStream() {
|
||||
@ -3301,7 +3301,7 @@ error_code BitcodeReader::InitStreamFromBuffer() {
|
||||
StreamFile.reset(new BitstreamReader(BufPtr, BufEnd));
|
||||
Stream.init(*StreamFile);
|
||||
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
}
|
||||
|
||||
error_code BitcodeReader::InitLazyStream() {
|
||||
@ -3325,7 +3325,7 @@ error_code BitcodeReader::InitLazyStream() {
|
||||
Bytes->dropLeadingBytes(bitcodeStart - buf);
|
||||
Bytes->setKnownObjectSize(bitcodeEnd - bitcodeStart);
|
||||
}
|
||||
return error_code::success();
|
||||
return error_code();
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
Reference in New Issue
Block a user