Skip to content

AddNamedMetadata fails for strings in the C interface #142367

Open
@demoitem

Description

@demoitem

Calling this via the C interface

LLVMAddNamedMetadataOperand(M, "llvm.ident",
LLVMMetadataAsValue(LLVMGetModuleContext(M),
LLVMMDStringInContext2(LLVMGetModuleContext(M), "foo", 3)));

produces an assert

Core.cpp:1094: llvm::MDNode* extractMDNode(llvm::MetadataAsValue*): Assertion `(isa(MD) || isa(MD)) && "Expected a metadata node or a canonicalized constant"' failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions