mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 06:32:24 +00:00
IR: MDNode => Value: Instruction::setMetadata()
Change `Instruction::setMetadata()` API to accept `Value` instead of `MDNode`. Part of PR21433. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220994 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2d32816a45
commit
815275f5de
@ -23,12 +23,12 @@
|
|||||||
#include "llvm/IR/DataLayout.h"
|
#include "llvm/IR/DataLayout.h"
|
||||||
#include "llvm/IR/Instructions.h"
|
#include "llvm/IR/Instructions.h"
|
||||||
#include "llvm/IR/LLVMContext.h"
|
#include "llvm/IR/LLVMContext.h"
|
||||||
|
#include "llvm/IR/Metadata.h"
|
||||||
#include "llvm/IR/Operator.h"
|
#include "llvm/IR/Operator.h"
|
||||||
#include "llvm/IR/ValueHandle.h"
|
#include "llvm/IR/ValueHandle.h"
|
||||||
#include "llvm/Support/CBindingWrapping.h"
|
#include "llvm/Support/CBindingWrapping.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
class MDNode;
|
|
||||||
|
|
||||||
/// \brief This provides the default implementation of the IRBuilder
|
/// \brief This provides the default implementation of the IRBuilder
|
||||||
/// 'InsertHelper' method that is called whenever an instruction is created by
|
/// 'InsertHelper' method that is called whenever an instruction is created by
|
||||||
|
@ -176,9 +176,9 @@ public:
|
|||||||
|
|
||||||
/// setMetadata - Set the metadata of the specified kind to the specified
|
/// setMetadata - Set the metadata of the specified kind to the specified
|
||||||
/// node. This updates/replaces metadata if already present, or removes it if
|
/// node. This updates/replaces metadata if already present, or removes it if
|
||||||
/// Node is null.
|
/// MD is null.
|
||||||
void setMetadata(unsigned KindID, MDNode *Node);
|
void setMetadata(unsigned KindID, Value *MD);
|
||||||
void setMetadata(StringRef Kind, MDNode *Node);
|
void setMetadata(StringRef Kind, Value *MD);
|
||||||
|
|
||||||
/// \brief Drop unknown metadata.
|
/// \brief Drop unknown metadata.
|
||||||
/// Passes are required to drop metadata they don't understand. This is a
|
/// Passes are required to drop metadata they don't understand. This is a
|
||||||
|
@ -600,9 +600,9 @@ StringRef NamedMDNode::getName() const {
|
|||||||
// Instruction Metadata method implementations.
|
// Instruction Metadata method implementations.
|
||||||
//
|
//
|
||||||
|
|
||||||
void Instruction::setMetadata(StringRef Kind, MDNode *Node) {
|
void Instruction::setMetadata(StringRef Kind, Value *MD) {
|
||||||
if (!Node && !hasMetadata()) return;
|
if (!MD && !hasMetadata()) return;
|
||||||
setMetadata(getContext().getMDKindID(Kind), Node);
|
setMetadata(getContext().getMDKindID(Kind), MD);
|
||||||
}
|
}
|
||||||
|
|
||||||
MDNode *Instruction::getMetadataImpl(StringRef Kind) const {
|
MDNode *Instruction::getMetadataImpl(StringRef Kind) const {
|
||||||
@ -655,9 +655,12 @@ void Instruction::dropUnknownMetadata(ArrayRef<unsigned> KnownIDs) {
|
|||||||
|
|
||||||
/// setMetadata - Set the metadata of of the specified kind to the specified
|
/// setMetadata - Set the metadata of of the specified kind to the specified
|
||||||
/// node. This updates/replaces metadata if already present, or removes it if
|
/// node. This updates/replaces metadata if already present, or removes it if
|
||||||
/// Node is null.
|
/// MD is null.
|
||||||
void Instruction::setMetadata(unsigned KindID, MDNode *Node) {
|
void Instruction::setMetadata(unsigned KindID, Value *MD) {
|
||||||
if (!Node && !hasMetadata()) return;
|
if (!MD && !hasMetadata()) return;
|
||||||
|
|
||||||
|
// For now, we only expect MDNodes here.
|
||||||
|
MDNode *Node = cast<MDNode>(MD);
|
||||||
|
|
||||||
// Handle 'dbg' as a special case since it is not stored in the hash table.
|
// Handle 'dbg' as a special case since it is not stored in the hash table.
|
||||||
if (KindID == LLVMContext::MD_dbg) {
|
if (KindID == LLVMContext::MD_dbg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user