mirror of
https://github.com/intel/llvm.git
synced 2026-02-07 07:39:11 +08:00
[Metadata] Fix layer violation in D91576
There is a library layering issue. LLVMAnalysis provides llvm/Analysis/ScopedNoAliasAA.h and depends on LLVMCore. LLVMCore provides llvm/IR/Metadata.cpp and it should not include a header file in LLVMAnalysis
This commit is contained in:
@@ -25,27 +25,6 @@ class Function;
|
||||
class MDNode;
|
||||
class MemoryLocation;
|
||||
|
||||
/// This is a simple wrapper around an MDNode which provides a higher-level
|
||||
/// interface by hiding the details of how alias analysis information is encoded
|
||||
/// in its operands.
|
||||
class AliasScopeNode {
|
||||
const MDNode *Node = nullptr;
|
||||
|
||||
public:
|
||||
AliasScopeNode() = default;
|
||||
explicit AliasScopeNode(const MDNode *N) : Node(N) {}
|
||||
|
||||
/// Get the MDNode for this AliasScopeNode.
|
||||
const MDNode *getNode() const { return Node; }
|
||||
|
||||
/// Get the MDNode for this AliasScopeNode's domain.
|
||||
const MDNode *getDomain() const {
|
||||
if (Node->getNumOperands() < 2)
|
||||
return nullptr;
|
||||
return dyn_cast_or_null<MDNode>(Node->getOperand(1));
|
||||
}
|
||||
};
|
||||
|
||||
/// A simple AA result which uses scoped-noalias metadata to answer queries.
|
||||
class ScopedNoAliasAAResult : public AAResultBase<ScopedNoAliasAAResult> {
|
||||
friend AAResultBase<ScopedNoAliasAAResult>;
|
||||
|
||||
@@ -1190,6 +1190,27 @@ void TempMDNodeDeleter::operator()(MDNode *Node) const {
|
||||
MDNode::deleteTemporary(Node);
|
||||
}
|
||||
|
||||
/// This is a simple wrapper around an MDNode which provides a higher-level
|
||||
/// interface by hiding the details of how alias analysis information is encoded
|
||||
/// in its operands.
|
||||
class AliasScopeNode {
|
||||
const MDNode *Node = nullptr;
|
||||
|
||||
public:
|
||||
AliasScopeNode() = default;
|
||||
explicit AliasScopeNode(const MDNode *N) : Node(N) {}
|
||||
|
||||
/// Get the MDNode for this AliasScopeNode.
|
||||
const MDNode *getNode() const { return Node; }
|
||||
|
||||
/// Get the MDNode for this AliasScopeNode's domain.
|
||||
const MDNode *getDomain() const {
|
||||
if (Node->getNumOperands() < 2)
|
||||
return nullptr;
|
||||
return dyn_cast_or_null<MDNode>(Node->getOperand(1));
|
||||
}
|
||||
};
|
||||
|
||||
/// Typed iterator through MDNode operands.
|
||||
///
|
||||
/// An iterator that transforms an \a MDNode::iterator into an iterator over a
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/Analysis/ScopedNoAliasAA.h"
|
||||
#include "llvm/IR/Argument.h"
|
||||
#include "llvm/IR/BasicBlock.h"
|
||||
#include "llvm/IR/Constant.h"
|
||||
|
||||
Reference in New Issue
Block a user