diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-28 20:10:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-28 20:10:43 +0000 |
commit | e5bb39b20ea026d0e85d622cd2cce444a8cad2b9 (patch) | |
tree | 71f8c23f6c6a275b9674620119278f2bf9d34485 /lib/VMCore/AsmWriter.cpp | |
parent | 2c90c0d687d7031cf437bea16b9e10f894a37acf (diff) | |
download | external_llvm-e5bb39b20ea026d0e85d622cd2cce444a8cad2b9.zip external_llvm-e5bb39b20ea026d0e85d622cd2cce444a8cad2b9.tar.gz external_llvm-e5bb39b20ea026d0e85d622cd2cce444a8cad2b9.tar.bz2 |
rename getHandlerNames to getMDKindNames, simplify its interface
and simplify all the clients that use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 4ef57fe..c9c9bf0 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1330,8 +1330,8 @@ class AssemblyWriter { TypePrinting TypePrinter; AssemblyAnnotationWriter *AnnotationWriter; std::vector<const Type*> NumberedTypes; - DenseMap<unsigned, StringRef> MDNames; - + SmallVector<StringRef, 8> MDNames; + public: inline AssemblyWriter(formatted_raw_ostream &o, SlotTracker &Mac, const Module *M, @@ -1339,16 +1339,8 @@ public: : Out(o), Machine(Mac), TheModule(M), AnnotationWriter(AAW) { AddModuleTypesToPrinter(TypePrinter, NumberedTypes, M); // FIXME: Provide MDPrinter - if (M) { - MetadataContext &TheMetadata = M->getContext().getMetadata(); - SmallVector<std::pair<unsigned, StringRef>, 4> Names; - TheMetadata.getHandlerNames(Names); - for (SmallVector<std::pair<unsigned, StringRef>, 4>::iterator - I = Names.begin(), - E = Names.end(); I != E; ++I) { - MDNames[I->first] = I->second; - } - } + if (M) + M->getContext().getMetadata().getMDKindNames(MDNames); } void write(const Module *M) { printModule(M); } @@ -2075,14 +2067,14 @@ void AssemblyWriter::printInstruction(const Instruction &I) { } } - // Print post operand alignment for load/store + // Print post operand alignment for load/store. if (isa<LoadInst>(I) && cast<LoadInst>(I).getAlignment()) { Out << ", align " << cast<LoadInst>(I).getAlignment(); } else if (isa<StoreInst>(I) && cast<StoreInst>(I).getAlignment()) { Out << ", align " << cast<StoreInst>(I).getAlignment(); } - // Print Metadata info + // Print Metadata info. if (!MDNames.empty()) { MetadataContext &TheMetadata = I.getContext().getMetadata(); typedef SmallVector<std::pair<unsigned, MDNode*>, 2> MDMapTy; |