Deleted Added
full compact
1//===-- AsmPrinter.cpp - Common AsmPrinter code ---------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 1360 unchanged lines hidden (view full) ---

1369 if (CurDLT.Scope == 0)
1370 return;
1371
1372 if (BeforePrintingInsn) {
1373 if (CurDLT != PrevDLT) {
1374 unsigned L = DW->RecordSourceLine(CurDLT.Line, CurDLT.Col,
1375 CurDLT.Scope);
1376 printLabel(L);
1377 O << '\n';
1378 DW->BeginScope(MI, L);
1379 PrevDLT = CurDLT;
1380 }
1381 } else {
1382 // After printing instruction
1383 DW->EndScope(MI);
1384 }
1385}

--- 447 unchanged lines hidden (view full) ---

1833
1834 bool Newline = false;
1835
1836 if (!MI.getDebugLoc().isUnknown()) {
1837 DebugLocTuple DLT = MF->getDebugLocTuple(MI.getDebugLoc());
1838
1839 // Print source line info.
1840 O.PadToColumn(MAI->getCommentColumn());
1840 O << MAI->getCommentString() << " SrcLine ";
1841 if (DLT.Scope) {
1842 DICompileUnit CU(DLT.Scope);
1843 if (!CU.isNull())
1844 O << CU.getFilename() << " ";
1845 }
1846 O << DLT.Line;
1841 O << MAI->getCommentString() << ' ';
1842 DIScope Scope(DLT.Scope);
1843 // Omit the directory, because it's likely to be long and uninteresting.
1844 if (!Scope.isNull())
1845 O << Scope.getFilename();
1846 else
1847 O << "<unknown>";
1848 O << ':' << DLT.Line;
1849 if (DLT.Col != 0)
1848 O << ":" << DLT.Col;
1850 O << ':' << DLT.Col;
1851 Newline = true;
1852 }
1853
1854 // Check for spills and reloads
1855 int FI;
1856
1857 const MachineFrameInfo *FrameInfo =
1858 MI.getParent()->getParent()->getFrameInfo();
1859
1860 // We assume a single instruction only has a spill or reload, not
1861 // both.
1862 const MachineMemOperand *MMO;
1863 if (TM.getInstrInfo()->isLoadFromStackSlotPostFE(&MI, FI)) {
1864 if (FrameInfo->isSpillSlotObjectIndex(FI)) {
1865 MMO = *MI.memoperands_begin();
1866 if (Newline) O << '\n';
1867 O.PadToColumn(MAI->getCommentColumn());
1864 O << MAI->getCommentString() << " Reload";
1868 O << MAI->getCommentString() << ' ' << MMO->getSize() << "-byte Reload";
1869 Newline = true;
1870 }
1871 }
1868 else if (TM.getInstrInfo()->hasLoadFromStackSlot(&MI, FI)) {
1872 else if (TM.getInstrInfo()->hasLoadFromStackSlot(&MI, MMO, FI)) {
1873 if (FrameInfo->isSpillSlotObjectIndex(FI)) {
1874 if (Newline) O << '\n';
1875 O.PadToColumn(MAI->getCommentColumn());
1872 O << MAI->getCommentString() << " Folded Reload";
1876 O << MAI->getCommentString() << ' '
1877 << MMO->getSize() << "-byte Folded Reload";
1878 Newline = true;
1879 }
1880 }
1881 else if (TM.getInstrInfo()->isStoreToStackSlotPostFE(&MI, FI)) {
1882 if (FrameInfo->isSpillSlotObjectIndex(FI)) {
1883 MMO = *MI.memoperands_begin();
1884 if (Newline) O << '\n';
1885 O.PadToColumn(MAI->getCommentColumn());
1880 O << MAI->getCommentString() << " Spill";
1886 O << MAI->getCommentString() << ' ' << MMO->getSize() << "-byte Spill";
1887 Newline = true;
1888 }
1889 }
1884 else if (TM.getInstrInfo()->hasStoreToStackSlot(&MI, FI)) {
1890 else if (TM.getInstrInfo()->hasStoreToStackSlot(&MI, MMO, FI)) {
1891 if (FrameInfo->isSpillSlotObjectIndex(FI)) {
1892 if (Newline) O << '\n';
1893 O.PadToColumn(MAI->getCommentColumn());
1888 O << MAI->getCommentString() << " Folded Spill";
1894 O << MAI->getCommentString() << ' '
1895 << MMO->getSize() << "-byte Folded Spill";
1896 Newline = true;
1897 }
1898 }
1899
1900 // Check for spill-induced copies
1901 unsigned SrcReg, DstReg, SrcSubIdx, DstSubIdx;
1902 if (TM.getInstrInfo()->isMoveInstr(MI, SrcReg, DstReg,
1903 SrcSubIdx, DstSubIdx)) {

--- 86 unchanged lines hidden ---