Fix LLVMSetMetadata and LLVMAddNamedMetadataOperand for single value MDNodes
authorBjorn Steinbrink <bsteinbr@gmail.com>
Wed, 28 Jan 2015 16:35:59 +0000 (16:35 +0000)
committerBjorn Steinbrink <bsteinbr@gmail.com>
Wed, 28 Jan 2015 16:35:59 +0000 (16:35 +0000)
commit920382c5aaa60daa115c40faa572aff15762b2c1
tree812d3454d4030982032f87cebc966c3323c3df87
parent9c49a6d4491880a6363e9f08feb7bbad4a4cd370
Fix LLVMSetMetadata and LLVMAddNamedMetadataOperand for single value MDNodes

Summary:
MetadataAsValue uses a canonical format that strips the MDNode if it
contains only a single constant value. This triggers an assertion when
trying to cast the value to a MDNode.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7165

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227319 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Core.cpp
test/Bindings/llvm-c/add_named_metadata_operand.ll [new file with mode: 0644]
test/Bindings/llvm-c/set_metadata.ll [new file with mode: 0644]
tools/llvm-c-test/CMakeLists.txt
tools/llvm-c-test/llvm-c-test.h
tools/llvm-c-test/main.c
tools/llvm-c-test/metadata.c [new file with mode: 0644]