llvm-6502/lib/MC
Kevin Enderby a89594947e Improve the time it takes to generating dwarf for assembly source files
that have been run through the 'C' pre-processor.

The implementation of SrcMgr.FindLineNumber() is slow but OK if
it uses its cache when called multiple times with an SMLoc that is
forward of the previous call.

In the case of generating dwarf for assembly source files that have
been run through the 'C' pre-processor we need to calculate the
logical line number based on the last parsed cpp hash file line
comment.  And the current code calls SrcMgr.FindLineNumber()
twice to do this causing its cache not to work and results in very
slow compile times:

% time /Volumes/SandBox/build-llvm/Debug+Asserts/bin/llvm-mc -triple thumbv7-apple-ios -filetype=obj -o /tmp/x.o mscorlib.dll.E -g
672.542u 0.299s 11:13.15 99.9%	0+0k 0+2io 2106pf+0w

So we save the info from the last parsed cpp hash file line comment
to avoid making the second call to SrcMgr.FindLineNumber() most times
and end up with compile times like:

% time /Volumes/SandBox/build-llvm/Debug+Asserts/bin/llvm-mc -triple thumbv7-apple-ios -filetype=obj -o /tmp/x.o mscorlib.dll.E -g
3.404u 0.104s 0:03.80 92.1%	0+0k 0+3io 2105pf+0w

rdar://14156934


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184592 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-21 20:51:39 +00:00
..
MCDisassembler Use pointers to the MCAsmInfo and MCRegInfo. 2013-06-18 07:20:20 +00:00
MCParser Improve the time it takes to generating dwarf for assembly source files 2013-06-21 20:51:39 +00:00
CMakeLists.txt MC: Disassembled CFG reconstruction. 2013-05-24 01:07:04 +00:00
ELFObjectWriter.cpp Remove MCELFObjectTargetWriter::adjustFixupOffset hack 2013-05-15 15:07:42 +00:00
LLVMBuild.txt
MachObjectWriter.cpp [MC/Mach-O] Load commands are supposed to 8-byte aligned on 64-bit. 2013-01-22 03:42:49 +00:00
Makefile
MCAsmBackend.cpp MachO: direct-to-object attribute for data-in-code markers. 2012-10-01 22:20:54 +00:00
MCAsmInfo.cpp [MC/DWARF] Support .debug_frame / .debug_line code alignment factors 2013-06-12 14:46:54 +00:00
MCAsmInfoCOFF.cpp Remove unused DwarfSectionOffsetDirective string 2013-04-22 22:49:11 +00:00
MCAsmInfoDarwin.cpp Fix alignment of .comm and .lcomm on mingw32. 2012-09-07 21:08:01 +00:00
MCAsmStreamer.cpp Use pointers to the MCAsmInfo and MCRegInfo. 2013-06-18 07:20:20 +00:00
MCAssembler.cpp [MC/DWARF] Support .debug_frame / .debug_line code alignment factors 2013-06-12 14:46:54 +00:00
MCAtom.cpp MC: Disassembled CFG reconstruction. 2013-05-24 01:07:04 +00:00
MCCodeEmitter.cpp
MCCodeGenInfo.cpp
MCContext.cpp Use pointers to the MCAsmInfo and MCRegInfo. 2013-06-18 07:20:20 +00:00
MCDisassembler.cpp Follow up of the introduction of MCSymbolizer. 2013-05-24 22:51:52 +00:00
MCDwarf.cpp Use pointers to the MCAsmInfo and MCRegInfo. 2013-06-18 07:20:20 +00:00
MCELF.cpp ELF symbol table field st_other support, 2013-02-19 21:57:35 +00:00
MCELFObjectTargetWriter.cpp Cleanup relocation sorting for ELF. 2013-05-15 18:22:01 +00:00
MCELFStreamer.cpp [PowerPC] Support various tls-related modifiers 2013-06-21 14:44:15 +00:00
MCExpr.cpp [PowerPC] Support various tls-related modifiers 2013-06-21 14:44:15 +00:00
MCExternalSymbolizer.cpp Follow up of the introduction of MCSymbolizer. 2013-05-24 22:51:52 +00:00
MCFunction.cpp MC: Disassembled CFG reconstruction. 2013-05-24 01:07:04 +00:00
MCInst.cpp Release build: guard dump functions with 2012-09-12 05:06:18 +00:00
MCInstPrinter.cpp Try to unbreak the build on hosts that don't transitively pull in a definition for int64_t. 2012-12-05 18:31:11 +00:00
MCInstrAnalysis.cpp MC: Disassembled CFG reconstruction. 2013-05-24 01:07:04 +00:00
MCLabel.cpp Release build: guard dump functions with 2012-09-12 05:06:18 +00:00
MCMachObjectTargetWriter.cpp
MCMachOStreamer.cpp Add support for subsections to the ELF assembler. Fixes PR8717. 2013-04-17 21:18:16 +00:00
MCModule.cpp Allow creation of single-byte MCAtoms. 2013-06-19 20:18:59 +00:00
MCNullStreamer.cpp Add support for subsections to the ELF assembler. Fixes PR8717. 2013-04-17 21:18:16 +00:00
MCObjectDisassembler.cpp Allow creation of single-byte MCAtoms. 2013-06-19 20:18:59 +00:00
MCObjectFileInfo.cpp [SystemZ] Update non-pic DWARF encodings 2013-05-06 17:28:30 +00:00
MCObjectStreamer.cpp [MC/DWARF] Generate multiple .debug_line entries for adjacent .loc directives 2013-06-19 21:27:27 +00:00
MCObjectSymbolizer.cpp Remove debug print added in r182949. 2013-05-30 23:46:47 +00:00
MCObjectWriter.cpp Move [SU]LEB128 encoding to a utility header. 2012-08-08 23:56:06 +00:00
MCPureStreamer.cpp Add support for subsections to the ELF assembler. Fixes PR8717. 2013-04-17 21:18:16 +00:00
MCRegisterInfo.cpp Make SubRegIndex size mandatory, following r183020. 2013-05-31 23:45:26 +00:00
MCRelocationInfo.cpp Follow up of the introduction of MCSymbolizer. 2013-05-24 22:51:52 +00:00
MCSection.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MCSectionCOFF.cpp Add support for subsections to the ELF assembler. Fixes PR8717. 2013-04-17 21:18:16 +00:00
MCSectionELF.cpp Add support for subsections to the ELF assembler. Fixes PR8717. 2013-04-17 21:18:16 +00:00
MCSectionMachO.cpp Add support for subsections to the ELF assembler. Fixes PR8717. 2013-04-17 21:18:16 +00:00
MCStreamer.cpp Use pointers to the MCAsmInfo and MCRegInfo. 2013-06-18 07:20:20 +00:00
MCSubtargetInfo.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MCSymbol.cpp Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
MCSymbolizer.cpp Add MCSymbolizer for symbolic/annotated disassembly. 2013-05-24 00:39:57 +00:00
MCValue.cpp Release build: guard dump functions with 2012-09-12 05:06:18 +00:00
MCWin64EH.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
SubtargetFeature.cpp Symbol hygiene: Make sure declarations and definitions match, make helper functions static. 2012-10-20 12:53:26 +00:00
WinCOFFObjectWriter.cpp COFF: Fix weak external aliases. 2013-04-22 18:48:56 +00:00
WinCOFFStreamer.cpp Give the MCStreamer class hierarchy LLVM RTTI facilities for use with 2013-01-31 23:29:57 +00:00