Commit 2d1ffad0 authored by Michael Liao's avatar Michael Liao
Browse files

[IR] Re-group AAMDNodes relevant interfaces. NFC.

parent 131e8786
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -307,9 +307,6 @@ public:
    Value::getAllMetadata(MDs);
  }

  /// Returns the AA metadata for this instruction.
  AAMDNodes getAAMetadata() const;

  /// Set the metadata of the specified kind to the specified node. This updates
  /// or replaces metadata if already present, or removes it if Node is null.
  void setMetadata(unsigned KindID, MDNode *Node);
@@ -350,7 +347,10 @@ public:
  /// to the existing node.
  void addAnnotationMetadata(StringRef Annotation);

  /// Sets the metadata on this instruction from the AAMDNodes structure.
  /// Returns the AA metadata for this instruction.
  AAMDNodes getAAMetadata() const;

  /// Sets the AA metadata on this instruction from the AAMDNodes structure.
  void setAAMetadata(const AAMDNodes &N);

  /// Retrieve the raw weight values of a conditional branch or select.
+0 −9
Original line number Diff line number Diff line
@@ -538,15 +538,6 @@ AAMDNodes AAMDNodes::concat(const AAMDNodes &Other) const {
  return Result;
}

AAMDNodes Instruction::getAAMetadata() const {
  AAMDNodes Result;
  Result.TBAA = getMetadata(LLVMContext::MD_tbaa);
  Result.TBAAStruct = getMetadata(LLVMContext::MD_tbaa_struct);
  Result.Scope = getMetadata(LLVMContext::MD_alias_scope);
  Result.NoAlias = getMetadata(LLVMContext::MD_noalias);
  return Result;
}

static const MDNode *createAccessTag(const MDNode *AccessType) {
  // If there is no access type or the access type is the root node, then
  // we don't have any useful access tag to return.
+9 −0
Original line number Diff line number Diff line
@@ -1367,6 +1367,15 @@ void Instruction::addAnnotationMetadata(StringRef Name) {
  setMetadata(LLVMContext::MD_annotation, MD);
}

AAMDNodes Instruction::getAAMetadata() const {
  AAMDNodes Result;
  Result.TBAA = getMetadata(LLVMContext::MD_tbaa);
  Result.TBAAStruct = getMetadata(LLVMContext::MD_tbaa_struct);
  Result.Scope = getMetadata(LLVMContext::MD_alias_scope);
  Result.NoAlias = getMetadata(LLVMContext::MD_noalias);
  return Result;
}

void Instruction::setAAMetadata(const AAMDNodes &N) {
  setMetadata(LLVMContext::MD_tbaa, N.TBAA);
  setMetadata(LLVMContext::MD_tbaa_struct, N.TBAAStruct);