From 544e4f97b3ada9e3483477c5479044f7d7f8e4c0 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 28 Mar 2016 00:03:12 +0000 Subject: [PATCH] BitcodeWriter: Replace dead code with an assertion, NFC The caller of ValueEnumerator::EnumerateOperandType never sends in metadata. Assert that, and remove the unnecessary logic. llvm-svn: 264558 --- llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp index 812baf202780..4e0a9dad2f85 100644 --- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -660,13 +660,7 @@ void ValueEnumerator::EnumerateType(Type *Ty) { void ValueEnumerator::EnumerateOperandType(const Value *V) { EnumerateType(V->getType()); - if (auto *MD = dyn_cast(V)) { - assert(!isa(MD->getMetadata()) && - "Function-local metadata should be left for later"); - - EnumerateMetadata(MD->getMetadata()); - return; - } + assert(!isa(V) && "Unexpected metadata operand"); const Constant *C = dyn_cast(V); if (!C)