diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-11-05 18:16:03 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-11-05 18:16:03 +0000 |
commit | c5754a65e64126743644aec2631f165a0ac3ffe4 (patch) | |
tree | b35cb05d283e1a11cf2012f2ff4b44116725a2cd /llvm/lib/IR/Module.cpp | |
parent | 8f093f4138e1ffafb7ee5344e012ba8dd952a055 (diff) | |
download | bcm5719-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/Module.cpp')
-rw-r--r-- | llvm/lib/IR/Module.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp index e35eefbd45c..35d28481fcb 100644 --- a/llvm/lib/IR/Module.cpp +++ b/llvm/lib/IR/Module.cpp @@ -276,7 +276,8 @@ getModuleFlagsMetadata(SmallVectorImpl<ModuleFlagEntry> &Flags) const { const NamedMDNode *ModFlags = getModuleFlagsMetadata(); if (!ModFlags) return; - for (const MDNode *Flag : ModFlags->operands()) { + for (const Value *FlagMD : ModFlags->operands()) { + const MDNode *Flag = cast<MDNode>(FlagMD); ModFlagBehavior MFB; if (Flag->getNumOperands() >= 3 && isValidModFlagBehavior(Flag->getOperand(0), MFB) && |