llvm.org GIT mirror llvm / 9bf0b9b
Now that numbered types have their number printed, it's no longer interesting to print the number in a comment. Numbered instructions don't need their number in a comment either. Also, tidy up newline printing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78865 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 10 years ago
8 changed file(s) with 19 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
520520 /// MDNode map iterators.
521521 ValueMap::iterator mdnBegin() { return mdnMap.begin(); }
522522 ValueMap::iterator mdnEnd() { return mdnMap.end(); }
523 unsigned mdnSize() { return mdnMap.size(); }
523 unsigned mdnSize() const { return mdnMap.size(); }
524 bool mdnEmpty() const { return mdnMap.empty(); }
524525
525526 /// This function does the actual initialization.
526527 inline void initialize();
13421343 std::string Asm = M->getModuleInlineAsm();
13431344 size_t CurPos = 0;
13441345 size_t NewLine = Asm.find_first_of('\n', CurPos);
1346 Out << '\n';
13451347 while (NewLine != std::string::npos) {
13461348 // We found a newline, print the portion of the asm string from the
13471349 // last newline up to this newline.
13611363 Module::lib_iterator LI = M->lib_begin();
13621364 Module::lib_iterator LE = M->lib_end();
13631365 if (LI != LE) {
1366 Out << '\n';
13641367 Out << "deplibs = [ ";
13651368 while (LI != LE) {
13661369 Out << '"' << *LI << '"';
13681371 if (LI != LE)
13691372 Out << ", ";
13701373 }
1371 Out << " ]\n";
1374 Out << " ]";
13721375 }
13731376
13741377 // Loop over the symbol table, emitting all id'd types.
1378 if (!M->getTypeSymbolTable().empty() || !NumberedTypes.empty()) Out << '\n';
13751379 printTypeSymbolTable(M->getTypeSymbolTable());
13761380
1381 // Output all globals.
1382 if (!M->global_empty()) Out << '\n';
13771383 for (Module::const_global_iterator I = M->global_begin(), E = M->global_end();
13781384 I != E; ++I)
13791385 printGlobal(I);
13891395 printFunction(I);
13901396
13911397 // Output named metadata.
1398 if (!M->named_metadata_empty()) Out << '\n';
13921399 for (Module::const_named_metadata_iterator I = M->named_metadata_begin(),
13931400 E = M->named_metadata_end(); I != E; ++I) {
13941401 const NamedMDNode *NMD = I;
14021409 }
14031410
14041411 // Output metadata.
1412 if (!Machine.mdnEmpty()) Out << '\n';
14051413 WriteMDNodes(Out, TypePrinter, Machine);
14061414 }
14071415
15201528 // Make sure we print out at least one level of the type structure, so
15211529 // that we do not get %2 = type %2
15221530 TypePrinter.printAtLeastOneLevel(NumberedTypes[i], Out);
1523 Out.PadToColumn(50);
1524 Out << "; type %" << i << '\n';
1531 Out << '\n';
15251532 }
15261533
15271534 // Print the named types.
17121719 Out.PadToColumn(50);
17131720 Out << "; <";
17141721 TypePrinter.print(V.getType(), Out);
1715 Out << '>';
1716
1717 if (!V.hasName() && !isa(V)) {
1718 int SlotNum;
1719 if (const GlobalValue *GV = dyn_cast(&V))
1720 SlotNum = Machine.getGlobalSlot(GV);
1721 else
1722 SlotNum = Machine.getLocalSlot(&V);
1723 if (SlotNum == -1)
1724 Out << ":";
1725 else
1726 Out << ':' << SlotNum; // Print out the def slot taken.
1727 }
1728 Out << " [#uses=" << V.getNumUses() << ']'; // Output # uses
1722 Out << "> [#uses=" << V.getNumUses() << ']'; // Output # uses
17291723 }
17301724 }
17311725
0 ; ModuleID = ''
1
12 @b = constant i15 0 ; [#uses=0]
23 @c = constant i15 -2 ; [#uses=0]
34 @d = constant i15 0 ; [#uses=0]
0 ; ModuleID = ''
1
12 @b = constant i17 0 ; [#uses=0]
23 @c = constant i17 -2 ; [#uses=0]
34 @d = constant i17 0 ; [#uses=0]
0 ; ModuleID = ''
1
12 @b = constant i31 0 ; [#uses=0]
23 @c = constant i31 -2 ; [#uses=0]
34 @d = constant i31 0 ; [#uses=0]
0 ; ModuleID = ''
1
12 @b = constant i33 0 ; [#uses=0]
23 @c = constant i33 -2 ; [#uses=0]
34 @d = constant i33 0 ; [#uses=0]
0 ; ModuleID = ''
1
12 @b = constant i63 0 ; [#uses=0]
23 @c = constant i63 -2 ; [#uses=0]
34 @d = constant i63 0 ; [#uses=0]
0 ; ModuleID = ''
1
12 @b = constant i7 0 ; [#uses=0]
23 @q = constant i7 63 ; [#uses=0]
34 @c = constant i7 -2 ; [#uses=0]
0 ; ModuleID = ''
1
12 @b = constant i9 0 ; [#uses=0]
23 @c = constant i9 -2 ; [#uses=0]
34 @d = constant i9 0 ; [#uses=0]