Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions llvm/lib/Bitcode/Reader/MetadataLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@
#include <tuple>
#include <utility>
#include <vector>
namespace llvm {
class Argument;
}

using namespace llvm;

Expand All @@ -83,8 +80,6 @@ static cl::opt<bool> DisableLazyLoading(

namespace {

static int64_t unrotateSign(uint64_t U) { return (U & 1) ? ~(U >> 1) : U >> 1; }

class BitcodeReaderMetadataList {
/// Array of metadata references.
///
Expand Down Expand Up @@ -129,10 +124,7 @@ class BitcodeReaderMetadataList {
void pop_back() { MetadataPtrs.pop_back(); }
bool empty() const { return MetadataPtrs.empty(); }

Metadata *operator[](unsigned i) const {
assert(i < MetadataPtrs.size());
return MetadataPtrs[i];
}
Metadata *operator[](unsigned i) const { return MetadataPtrs[i]; }

Metadata *lookup(unsigned I) const {
if (I < MetadataPtrs.size())
Expand Down Expand Up @@ -178,6 +170,9 @@ class BitcodeReaderMetadataList {
private:
Metadata *resolveTypeRefArray(Metadata *MaybeTuple);
};
} // namespace

static int64_t unrotateSign(uint64_t U) { return (U & 1) ? ~(U >> 1) : U >> 1; }

void BitcodeReaderMetadataList::assignValue(Metadata *MD, unsigned Idx) {
if (auto *MDN = dyn_cast<MDNode>(MD))
Expand Down Expand Up @@ -392,8 +387,6 @@ void PlaceholderQueue::flush(BitcodeReaderMetadataList &MetadataList) {
}
}

} // anonymous namespace

static Error error(const Twine &Message) {
return make_error<StringError>(
Message, make_error_code(BitcodeError::CorruptedBitcode));
Expand Down