summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-11-05 18:16:03 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-11-05 18:16:03 +0000
commitc5754a65e64126743644aec2631f165a0ac3ffe4 (patch)
treeb35cb05d283e1a11cf2012f2ff4b44116725a2cd /llvm/lib/IR/Verifier.cpp
parent8f093f4138e1ffafb7ee5344e012ba8dd952a055 (diff)
downloadbcm5719-llvm-c5754a65e64126743644aec2631f165a0ac3ffe4.tar.gz
bcm5719-llvm-c5754a65e64126743644aec2631f165a0ac3ffe4.zip
IR: MDNode => Value: NamedMDNode::getOperator()
Change `NamedMDNode::getOperator()` from returning `MDNode *` to returning `Value *`. To reduce boilerplate at some call sites, add a `getOperatorAsMDNode()` for named metadata that's expected to only return `MDNode` -- for now, that's everything, but debug node named metadata (such as llvm.dbg.cu and llvm.dbg.sp) will soon change. This is part of PR21433. Note that there's a follow-up patch to clang for the API change. llvm-svn: 221375
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 1c54e9b062e..395f2e74d61 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -555,7 +555,7 @@ void Verifier::visitGlobalAlias(const GlobalAlias &GA) {
void Verifier::visitNamedMDNode(const NamedMDNode &NMD) {
for (unsigned i = 0, e = NMD.getNumOperands(); i != e; ++i) {
- MDNode *MD = NMD.getOperand(i);
+ MDNode *MD = NMD.getOperandAsMDNode(i);
if (!MD)
continue;
@@ -624,7 +624,7 @@ void Verifier::visitModuleIdents(const Module &M) {
// llvm.ident takes a list of metadata entry. Each entry has only one string.
// Scan each llvm.ident entry and make sure that this requirement is met.
for (unsigned i = 0, e = Idents->getNumOperands(); i != e; ++i) {
- const MDNode *N = Idents->getOperand(i);
+ const MDNode *N = Idents->getOperandAsMDNode(i);
Assert1(N->getNumOperands() == 1,
"incorrect number of operands in llvm.ident metadata", N);
Assert1(isa<MDString>(N->getOperand(0)),
@@ -642,7 +642,7 @@ void Verifier::visitModuleFlags(const Module &M) {
DenseMap<const MDString*, const MDNode*> SeenIDs;
SmallVector<const MDNode*, 16> Requirements;
for (unsigned I = 0, E = Flags->getNumOperands(); I != E; ++I) {
- visitModuleFlag(Flags->getOperand(I), SeenIDs, Requirements);
+ visitModuleFlag(Flags->getOperandAsMDNode(I), SeenIDs, Requirements);
}
// Validate that the requirements in the module are valid.
OpenPOWER on IntegriCloud