diff options
Diffstat (limited to 'llvm/lib/IR/TypeFinder.cpp')
-rw-r--r-- | llvm/lib/IR/TypeFinder.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/IR/TypeFinder.cpp b/llvm/lib/IR/TypeFinder.cpp index 403ae45756a1..724b8f6b6ad2 100644 --- a/llvm/lib/IR/TypeFinder.cpp +++ b/llvm/lib/IR/TypeFinder.cpp @@ -14,6 +14,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constant.h" +#include "llvm/IR/DebugInfoMetadata.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" #include "llvm/IR/Instruction.h" @@ -152,6 +153,14 @@ void TypeFinder::incorporateMDNode(const MDNode *V) { if (!VisitedMetadata.insert(V).second) return; + // The arguments in DIArgList are not exposed as operands, so handle such + // nodes specifically here. + if (const auto *AL = dyn_cast<DIArgList>(V)) { + for (auto *Arg : AL->getArgs()) + incorporateValue(Arg->getValue()); + return; + } + // Look in operands for types. for (Metadata *Op : V->operands()) { if (!Op) |