summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/AsmWriter.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2010-02-25 06:53:04 +0000
committerNick Lewycky <nicholas@mxc.ca>2010-02-25 06:53:04 +0000
commitba8ec9a9e48b5cb8ee5d5e342e2bd841d1eb0101 (patch)
tree4f81a3dcde5942c669ab041a2cf66b91c9ca0313 /llvm/lib/VMCore/AsmWriter.cpp
parent212e8c87ae0c0d9b856915465f1198a1cf58289f (diff)
downloadbcm5719-llvm-ba8ec9a9e48b5cb8ee5d5e342e2bd841d1eb0101.tar.gz
bcm5719-llvm-ba8ec9a9e48b5cb8ee5d5e342e2bd841d1eb0101.zip
Dump the presence of attached metadata even if we don't know what it is. This
format is not parsable, even if the module is legal. To get parsable output, dump the module instead of the function or smaller, since metadata kind are attached to the module (not the context). llvm-svn: 97124
Diffstat (limited to 'llvm/lib/VMCore/AsmWriter.cpp')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 1ed13843f0f..361c58e0820 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -1988,12 +1988,16 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
}
// Print Metadata info.
- if (!MDNames.empty()) {
- SmallVector<std::pair<unsigned, MDNode*>, 4> InstMD;
- I.getAllMetadata(InstMD);
- for (unsigned i = 0, e = InstMD.size(); i != e; ++i)
- Out << ", !" << MDNames[InstMD[i].first]
- << " !" << Machine.getMetadataSlot(InstMD[i].second);
+ SmallVector<std::pair<unsigned, MDNode*>, 4> InstMD;
+ I.getAllMetadata(InstMD);
+ for (unsigned i = 0, e = InstMD.size(); i != e; ++i) {
+ unsigned Kind = InstMD[i].first;
+ if (Kind < MDNames.size()) {
+ Out << ", !" << MDNames[Kind];
+ } else {
+ Out << ", !<unknown kind #" << Kind << ">";
+ }
+ Out << " !" << Machine.getMetadataSlot(InstMD[i].second);
}
printInfoComment(I);
}
OpenPOWER on IntegriCloud