1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

578 Commits

Author SHA1 Message Date
Devang Patel
5920acc861 If there is not any llvm instruction associated with each lexical scope encoded in debug info then create such scope on demand for variable info.
llvm-svn: 84262
2009-10-16 18:18:03 +00:00
Devang Patel
22761afada Add support to record DbgScope as inlined scope.
llvm-svn: 84134
2009-10-14 21:08:09 +00:00
Devang Patel
72f708ec2f s/DebugLoc.CompileUnit/DebugLoc.Scope/g
s/DebugLoc.InlinedLoc/DebugLoc.InlinedAtLoc/g

llvm-svn: 84054
2009-10-13 23:28:53 +00:00
Daniel Dunbar
592c5055dd Fix a -Asserts warning.
llvm-svn: 83950
2009-10-13 06:47:08 +00:00
Devang Patel
aeac1241b8 Find enclosing subprogram info.
llvm-svn: 83922
2009-10-12 23:11:24 +00:00
Devang Patel
c97c44b584 Extract scope information from the variable itself, instead of relying on alloca or llvm.dbg.declare location.
While recording beginning of a function, use scope info from the first location entry instead of just relying on first location entry itself.

llvm-svn: 83684
2009-10-09 22:42:28 +00:00
Devang Patel
a772046766 Check invalid debug info for enums. This may happen when underlyng enum is optimized away. Eventually DwarfChecker will clean this up during llvm verification stage.
llvm-svn: 83655
2009-10-09 17:51:49 +00:00
Devang Patel
e16aac2206 Do not record line number to implicitly mark start of function if function has arguments. Extra line number entries trip gdb in some cases.
llvm-svn: 83563
2009-10-08 18:48:03 +00:00
Devang Patel
1639c0e45a Add support to handle debug info attached to an instruction.
This is not yet enabled.

llvm-svn: 83400
2009-10-06 18:37:31 +00:00
Dan Gohman
a803c712dd Instead of printing unnecessary basic block labels as labels in
verbose-asm mode, print comments instead. This eliminates a non-comment
difference between verbose-asm mode and non-verbose-asm mode.

Also, factor out the relevant code out of all the targets and into
target-independent code.

llvm-svn: 83392
2009-10-06 17:38:38 +00:00
Devang Patel
bad114ca60 Fix cut-n-pasto.
llvm-svn: 83367
2009-10-06 03:15:38 +00:00
Devang Patel
a8f35ac640 Update processDebugLoc() so that it can be used to process debug info before and after printing an instruction.
llvm-svn: 83363
2009-10-06 02:19:11 +00:00
Devang Patel
3200e99109 Remove dead code.
llvm-svn: 83362
2009-10-06 02:01:32 +00:00
Devang Patel
0141a90812 Add utility routine to set begin and end labels for DbgScopes.
This will be used by processDebugLoc().

llvm-svn: 83361
2009-10-06 01:50:42 +00:00
Devang Patel
2001f5878b Remove unintentional function decl.
llvm-svn: 83356
2009-10-06 01:31:35 +00:00
Devang Patel
ac511d1acf Add utility routine to collect variable debug info. This is not yet used.
llvm-svn: 83355
2009-10-06 01:26:37 +00:00
Devang Patel
3b3d8a9d09 Existence of a compile unit for input source file is a good indicator to check debug info's presence in a module.
llvm-svn: 83348
2009-10-06 00:03:14 +00:00
Devang Patel
f129b0d44f If subprogram die is not available then construct new one.
This can happen if debug info is processed lazily.

llvm-svn: 83347
2009-10-05 23:59:00 +00:00
Devang Patel
dff583ac49 Adjust context for the global variables that are not at file scope, e.g.
void foo() { static int bar = 42; }
Here, foo's DIE is parent of bar's DIE.

llvm-svn: 83344
2009-10-05 23:40:42 +00:00
Devang Patel
4e9591a170 Set address while constructing DIE.
llvm-svn: 83343
2009-10-05 23:22:08 +00:00
Devang Patel
28b7c6155c Gracefully handle various scopes while recording source line info.
llvm-svn: 83317
2009-10-05 18:03:19 +00:00
Chris Lattner
a3cf123e86 strength reduce a ton of type equality tests to check the typeid (Through
the new predicates I added) instead of going through a context and doing a
pointer comparison.  Besides being cheaper, this allows a smart compiler
to turn the if sequence into a switch.

llvm-svn: 83297
2009-10-05 05:54:46 +00:00
Devang Patel
7aa19711f8 Add support to extract lexical scope information from DebugLoc attached with an machine instruction.
This is not yet enabled.

llvm-svn: 83210
2009-10-01 20:31:14 +00:00
Devang Patel
7b4ba71afa Record first and last instruction of a scope in DbgScope.
llvm-svn: 83207
2009-10-01 18:25:23 +00:00
Devang Patel
4f1147e386 Add another MDNode into DebugLocTuple. This will be used to keep track of inlined functions.
llvm-svn: 83190
2009-10-01 01:15:28 +00:00
Devang Patel
e097bf49d0 Use MachineInstr as an processDebugLoc() argument.
This will allow processDebugLoc() to handle scopes for DWARF debug info. 

llvm-svn: 83183
2009-09-30 23:12:50 +00:00
Devang Patel
044648c2d7 Use MDNode * directly as an RecordSourceLine() argument.
llvm-svn: 83182
2009-09-30 22:51:28 +00:00
Bob Wilson
1cf44c8225 Add a new virtual EmitStartOfAsmFile method to the AsmPrinter and use this
to emit target-specific things at the beginning of the asm output.  This
fixes a problem for PPC, where the text sections are not being kept together
as expected.  The base class doInitialization code calls DW->BeginModule()
which emits a bunch of DWARF section directives.  The PPC doInitialization
code then emits all the TEXT section directives, with the intention that they
will be kept together. But as I understand it, the Darwin assembler treats
the default TEXT section as a special case and moves it to the beginning of
the file, which means that all those DWARF sections are in the middle of
the text.  With this change, the EmitStartOfAsmFile hook is called before
the DWARF section directives are emitted, so that all the PPC text section
directives come out right at the beginning of the file.

llvm-svn: 83176
2009-09-30 22:06:26 +00:00
Bob Wilson
44b5a5a58c Fix a comment.
llvm-svn: 83171
2009-09-30 21:26:13 +00:00
Mike Stump
a3bce35a07 Add a way for a frontend to generate more complex dwarf location
information.  This allows arbitrary code involving DW_OP_plus_uconst
and DW_OP_deref.  The scheme allows for easy extention to include,
any, or all of the DW_OP_ opcodes.  I thought about just exposing all
of them, but, wasn't sure if people wanted the dwarf opcodes exposed
in the api.  Is that a layering violation?

With this scheme, the entire existing block scheme used by llvm-gcc
can be switched over to the new scheme.  I think that would be
cleaner, as then the compiler specific bits are not present in llvm
proper.  Before the old code can be yanked however, similar code in
clang would have to be removed.

Next up, more testing.

llvm-svn: 83120
2009-09-30 00:08:22 +00:00
Devang Patel
e5be8e79df Remove std::string uses from DebugInfo interface.
llvm-svn: 83083
2009-09-29 18:40:58 +00:00
Mike Stump
d7a3b26009 Delete space after function name, before (, reflow a comment and
delete a few blank lines.

llvm-svn: 82729
2009-09-24 23:21:26 +00:00
Mike Stump
26e902d371 Fix spacing.
llvm-svn: 82727
2009-09-24 23:11:08 +00:00
Chris Lattner
8155f3948c unconditionally compute MMI even if the target doesn't support EH or Debug info, because the target may use it for other things, this fixes PR5036
llvm-svn: 82684
2009-09-24 05:44:53 +00:00
Mike Stump
1f53a128a9 This is overly constraining with respect to clang.
llvm-svn: 82591
2009-09-23 00:13:30 +00:00
Bill Wendling
69ad4a0004 --- Reverse-merging r82282 into '.':
U    lib/CodeGen/AsmPrinter/DwarfException.cpp
U    lib/CodeGen/AsmPrinter/DwarfException.h

--- Reverse-merging r82274 into '.':
U    lib/Target/TargetLoweringObjectFile.cpp
G    lib/CodeGen/AsmPrinter/DwarfException.cpp

These revisions were breaking everything.

llvm-svn: 82396
2009-09-20 09:13:15 +00:00
Bill Wendling
d402d7374a Here's fun! It turns out that these filter functions can be internal. If they're
internal, they shouldn't use the indirect pointer stuff. In the case of
throw_rethrow_test, it was marked as 'internal' and calculated its own offset to
its contents.

llvm-svn: 82354
2009-09-20 02:19:49 +00:00
Daniel Dunbar
9ae3c56c92 Fix indentation.
llvm-svn: 82333
2009-09-19 20:40:14 +00:00
Daniel Dunbar
39c0d90339 Strip trailing whitespace.
llvm-svn: 82332
2009-09-19 20:40:05 +00:00
Bill Wendling
5e030245e8 Factor out label difference creation.
llvm-svn: 82282
2009-09-18 21:37:56 +00:00
Bill Wendling
6ddbe2a6ad It's inefficient to have place the exception tables (which contain the LSDA)
into the __DATA section. At launch time, dyld has to update most of the section
to fix up the type info pointers. It's better to place it into the __TEXT
section and use pc-rel indirect pointer encodings. Similar to the personality
routine.

llvm-svn: 82274
2009-09-18 21:14:36 +00:00
Chris Lattner
f50872c2c4 add a new hook to allow targets to splat stuff at the end of the file.
Overriding doFinalization is pretty lame.

llvm-svn: 82268
2009-09-18 20:17:03 +00:00
Anton Korobeynikov
fb7ac49d96 Allow symbols to start from the digit if target requests it. This allows, e.g. pinning
variables to specified absolute address. Make use of this feature for MSP430.
This unbreaks PR4776.

llvm-svn: 82227
2009-09-18 16:57:42 +00:00
Chris Lattner
be5afd41e3 pass machinemoduleinfo down into getSymbolForDwarfGlobalReference,
currently unused.

llvm-svn: 82157
2009-09-17 18:49:52 +00:00
Chris Lattner
0a6f37ec43 remove the AsmPrinter::printMCInst hook hack now that
we have MCInstPrinter.

llvm-svn: 82006
2009-09-16 04:57:15 +00:00
Chris Lattner
7b52d90c9e Big change #1 for personality function references:
Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding
fields from MAI: they aren't part of the asm syntax, they are
related to the structure of the object file.

To replace their functionality, add a new 
TLOF::getSymbolForDwarfGlobalReference method which asks targets
to decide how to reference a global from EH in a pc-relative way.

The default implementation just returns the symbol.  The default
darwin implementation references the symbol through an indirect
$non_lazy_ptr stub.  The bizarro x86-64 darwin specialization
handles the weird "foo@GOTPCREL+4" hack.

DwarfException.cpp now uses this to emit the reference to the
symbol in the right way, and this also eliminates another 
horrible hack from DwarfException.cpp:

-    if (strcmp(MAI->getPersonalitySuffix(), "+4@GOTPCREL"))
-      O << "-" << MAI->getPCSymbol();

llvm-svn: 81991
2009-09-16 01:46:41 +00:00
Chris Lattner
7a4748ad3a inline AsmPrinter::getCurrentFunctionEHName into its only caller.
llvm-svn: 81970
2009-09-16 00:35:39 +00:00
Chris Lattner
7a07d794ee Eliminate AsmPrinter::EmitExternalGlobal, inlining its (now)
one implementation into its one caller.  This eliminates a totally
awesome and gratuitous hack where we casted a Function* to 
GlobalVariable*.

llvm-svn: 81967
2009-09-16 00:17:39 +00:00
Chris Lattner
f720dd9257 eliminate the horrid AsmPrinter::getGlobalLinkName method, inlining
it into all of its call sites and simplifying them.

llvm-svn: 81962
2009-09-16 00:08:41 +00:00
Chris Lattner
249d5fe8b9 remove some horrible MAI hooks which fortunately turn out to be always empty.
llvm-svn: 81946
2009-09-15 23:11:32 +00:00
Chris Lattner
c06870ad45 strength reduce a call to PrintRelDirective(true).
llvm-svn: 81942
2009-09-15 22:58:35 +00:00
Chris Lattner
ec805c1a5d PIC16 does allow colon after MBB labels, simplify EmitBasicBlockStart.
llvm-svn: 81755
2009-09-14 03:15:54 +00:00
Chris Lattner
4a33f01892 Change MCAsmStreamer to take an MCInstPrinter instead of a
full AsmPrinter, and change TargetRegistry to keep track
of registered MCInstPrinters.

llvm-mc is still linking in the entire
target foo to get the code emitter stuff, but this is an
important step in the right direction.

llvm-svn: 81754
2009-09-14 03:02:37 +00:00
Chris Lattner
1e264d7506 eliminate an extraneous use of TRI::getAsmName in a comment.
llvm-svn: 81705
2009-09-13 19:48:37 +00:00
Chris Lattner
cb05a87447 remove MAI::JumpTableSpecialLabelPrefix now that MAI
has real information about linker private linkage.

llvm-svn: 81695
2009-09-13 19:02:16 +00:00
Chris Lattner
cbcbedf254 replace printBasicBlockLabel with EmitBasicBlockStart,
now that printBasicBlockLabel is only used for starting
a MBB.  This allows elimination of a bunch of arguments.

llvm-svn: 81684
2009-09-13 18:25:37 +00:00
Chris Lattner
de1324146e convert some uses of printBasicBlockLabel to use GetMBBSymbol
instead.

llvm-svn: 81677
2009-09-13 17:14:04 +00:00
Chris Lattner
ff9d0f20fa devirtualize AsmPrinter::printBasicBlockLabel since it is never overridden.
Move GetMBBSymbol up to AsmPrinter and make printBasicBlockLabel use it so that
we only have one place that decides what to name bb labels.  Hopefully various
clients of printBasicBlockLabel can start using GetMBBSymbol instead.

llvm-svn: 81652
2009-09-12 23:02:08 +00:00
Caroline Tice
9584af22be Don't generate Dwarf line table entries for source line 0.
llvm-svn: 81542
2009-09-11 18:25:54 +00:00
Duncan Sands
6fb64b1b17 Fix PR4948 (and a leak): by not destroying the DwarfException
object, the timer it creates was not being deleted.  Since the
timer belonged to a static timer group, the timer group would
be destroyed on shutdown, and would notice and complain that
not all timers it contained were destroyed.

llvm-svn: 81533
2009-09-11 17:24:29 +00:00
Bill Wendling
68a3bafe53 Exit early if exception handling isn't supported.
llvm-svn: 81454
2009-09-10 18:28:06 +00:00
Bill Wendling
23f9e3a98e Comment and whitespace cleanups. No intentional functionality change.
llvm-svn: 81436
2009-09-10 06:50:01 +00:00
Bill Wendling
988ed7ed19 Revert part of my r81424 patch. I removed what looked like superfluous padding
from the exception tables. However, Duncan explained why it's a can of worms to
do it the GCC way. I went back to doing it the LLVM way and added Duncan's
explanation so that I don't do this again in the future.

llvm-svn: 81434
2009-09-10 06:27:16 +00:00
Bill Wendling
4ee473352a Don't hardcode the TType format size. In fact, rework the code so that it's more
like what GCC outputs. The mysterious code to insert padding wasn't in GCC at
all. I modified the TType base offset code to calculate the offset like GCC
does, though.

llvm-svn: 81424
2009-09-10 02:07:37 +00:00
Bill Wendling
11a9ab2879 Remove the "#if 0" that Noone loved. It wasn't really necessary, because the
code within it was the same inside and out. There's still a problem of the
TypeInfoSize should be the size of the TType format encoding (at least that's
what GCC thinks it should be).

llvm-svn: 81417
2009-09-10 01:12:47 +00:00
Bill Wendling
0ec5ddeecf Pull check for SJLJ EH into a boolean and use that.
llvm-svn: 81409
2009-09-10 00:17:04 +00:00
Bill Wendling
bf36b07bff Use the SizeOfEncodedValue function instead of magic variables for the
sizeof(DW_EH_PE_udata4).

llvm-svn: 81408
2009-09-10 00:13:16 +00:00
Bill Wendling
e55fe46dec Add helpful comment.
llvm-svn: 81406
2009-09-10 00:04:48 +00:00
Bill Wendling
ef6636d4b1 Believe it or not, this is a simplification. :-)
Basically, this patch is working towards removing the hard-coded values that are
output for the CIE. In particular, the CIE augmentation and the CIE augmentation
size. Both of these should be calculated. In the process, I was able to make a
bunch of code simpler.

The encodings for the personality, LSDA, and FDE in the CIE are still not
correct. They should be generated either from target-specific callbacks (blech!)
or grokked from first-principles.

llvm-svn: 81404
2009-09-09 23:56:55 +00:00
Chris Lattner
b9aca1a178 remove DebugLoc from MCInst and eliminate "Comment printing" from
the MCInst path of the asmprinter.  Instead, pull comment printing
out of the autogenerated asmprinter into each target that uses the
autogenerated asmprinter.  This causes code duplication into each
target, but in a way that will be easier to clean up later when more
asmprinter stuff is commonized into the base AsmPrinter class.

This also fixes an xcore strangeness where it inserted two tabs
before every instruction.

llvm-svn: 81396
2009-09-09 23:14:36 +00:00
Bill Wendling
626d5a2539 Use the EOL that takes the encoding and translates it into DWARF-English.
llvm-svn: 81382
2009-09-09 21:26:19 +00:00
Bill Wendling
61f199a83c Early exit from function.
llvm-svn: 81381
2009-09-09 21:08:12 +00:00
Bill Wendling
de0ad2660f Small amount of code clean-up: Don't use ".size()" when not necessary.
llvm-svn: 81380
2009-09-09 21:06:24 +00:00
Devang Patel
c174e064b2 Ignore malformed global variable debug info.
llvm-svn: 81055
2009-09-04 23:59:07 +00:00
Jim Grosbach
d0f70494f5 reduce size of SmallString to something more reasonable
llvm-svn: 80710
2009-09-01 18:55:08 +00:00
Jim Grosbach
38fc5b0277 Use raw_ostream instead of sstream
llvm-svn: 80704
2009-09-01 18:49:12 +00:00
Jim Grosbach
7c2ffde625 revert inadvertant change from previous commit
llvm-svn: 80689
2009-09-01 17:19:13 +00:00
Jim Grosbach
ecd541affd Simply LSDA lable emission to use a direct special-case output instead of
EmitLabel()

llvm-svn: 80677
2009-09-01 16:43:35 +00:00
Jim Grosbach
9a220088ac Clean up LSDA name generation and use for SJLJ exception handling. This
makes an eggregious hack somewhat more palatable. Bringing the LSDA forward
and making it a GV available for reference would be even better, but is
beyond the scope of what I'm looking to solve at this point.

Objective C++ code could generate function names that broke the previous
scheme. This fixes that.

llvm-svn: 80649
2009-09-01 01:57:56 +00:00
Devang Patel
fb8892d0e1 Subprogram is a scope. Derive DISubprogram from DIScope.
llvm-svn: 80637
2009-08-31 22:47:13 +00:00
Devang Patel
4a89fae1fe Rename DIBlock as DILexicalBlock.
llvm-svn: 80633
2009-08-31 22:00:15 +00:00
Caroline Tice
e49e2d352c Add flag to mark structs for Apple Block "byref" variables; also add code to
modify the type and location debug information for these variables to match the
programmer's expectations.

llvm-svn: 80625
2009-08-31 21:19:37 +00:00
Devang Patel
29f14e754f Simplify isDerivedType() and other predicate interface.
llvm-svn: 80602
2009-08-31 18:49:10 +00:00
Bill Wendling
f1610b9af1 Output a hex value, because all of the others are hex.
llvm-svn: 80601
2009-08-31 18:26:48 +00:00
Duncan Sands
66fce0befb Revert commit 80428. It completely broke exception
handling on x86-32 linux.

llvm-svn: 80592
2009-08-31 16:45:16 +00:00
Jim Grosbach
a09b5ac346 PR4747
Shared landing pads run into trouble with SJLJ, as the dispatch table is
mapped to call sites, and merging the pads will throw that off. There needs
to be a one-to-one mapping of landing pad exception table entries to invoke
call points.

Detecting the shared pad during lowering of SJLJ info insn't sufficient, as
the dispatch function may still need separate destinations to properly
handle phi-nodes.

llvm-svn: 80530
2009-08-31 01:35:03 +00:00
Bill Wendling
ccb2d3a3b8 Nuke moribund "std::string" version of EOL(..., Encoding).
llvm-svn: 80466
2009-08-30 00:28:57 +00:00
Bill Wendling
9dddea2ec3 - Add target lowering methods to get the preferred format for the FDE and LSDA
encodings.
- Make some of the values emitted by the FDEs dependent upon the pointer
  size. This is in line with how GCC does things. And it has the benefit of
  working for Darwin in 64-bit mode now.

llvm-svn: 80428
2009-08-29 12:20:54 +00:00
Bill Wendling
08c68ad0a9 Add a form of EOL which emits the text version of a DWARF format encoding. This
doesn't handle all values of the formatting. Those can be added as needed.

llvm-svn: 80427
2009-08-29 12:17:53 +00:00
Eric Christopher
77fd01a639 Make the augmentation size and next set of bytes agree on size,
and make the reference pointer size as it should be.

Fixes an abort on a testcase derived from libunwind's personality
test in 64-bit.

llvm-svn: 80414
2009-08-29 01:12:46 +00:00
Devang Patel
fbaeda732e Reapply 79977.
Use MDNodes to encode debug info in llvm IR.

llvm-svn: 80406
2009-08-28 23:24:31 +00:00
Eric Christopher
f70a6035e0 Nuke trailing whitespace.
llvm-svn: 80401
2009-08-28 22:33:43 +00:00
Devang Patel
c1fe40a1b3 Closure is a very generic name. Use AppleBlock instead.
llvm-svn: 80307
2009-08-27 23:51:51 +00:00
Bill Wendling
9d9a3b7f82 Revert accidental commit.
llvm-svn: 80198
2009-08-27 03:32:50 +00:00
Bill Wendling
5f74a3e3b9 --- Reverse-merging r80147 into '.':
A    include/llvm/ADT/iterator.cmake
U    autoconf/configure.ac
--- Reverse-merging r80161 into '.':
U    cmake/config-ix.cmake
--- Reverse-merging r80171 into '.':
U    Makefile
--- Reverse-merging r80173 into '.':
U    configure
U    include/llvm/Config/config.h.in
--- Reverse-merging r80180 into '.':
A    include/llvm/ADT/iterator.h.in

Despite common miscomceptions, iterator.h is alive and well. It broke the build
bots for several hours. And yet no one bothered to look at them.

Gabor and Doug, please review your changes and make sure that they actually
build before resubmitting them.

llvm-svn: 80197
2009-08-27 03:29:26 +00:00
Eric Christopher
8a04a49040 If we're emitting additional CIEs due to personality functions
don't emit the default one. Explicitly check for the NULL
CIE later.

llvm-svn: 80146
2009-08-26 21:30:49 +00:00
Devang Patel
10c075a316 Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
llvm-svn: 80073
2009-08-26 05:01:18 +00:00
Devang Patel
7bee319f4a Add isClosure() predicate. This is used to add DW_AT_APPLE_block attribute.
Patch by Caroline Tice.

llvm-svn: 80061
2009-08-26 00:39:50 +00:00
Bill Wendling
487ba86a78 - Rename EmitCommonInformationEntry to EmitCIE.
- Rename EmitFunctionDescriptionEntry to EmitFDE.

llvm-svn: 79981
2009-08-25 08:08:33 +00:00
Devang Patel
7d42bfab6c Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.
This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!)

llvm-svn: 79977
2009-08-25 05:24:07 +00:00
Bill Wendling
96768fec57 - Emit new line after each FDE.
- Fix comment.

llvm-svn: 79971
2009-08-25 02:32:05 +00:00
Bill Wendling
ded9b7d024 Rename functions to something more descriptive. At the very least mention the
CIE and FDE in their names.

llvm-svn: 79969
2009-08-25 02:27:42 +00:00
Chris Lattner
39262eb119 prune the #includes in raw_ostream.h by moving a
member out of line. ftostr is not particularly speedy,
so that method is presumably not perf sensitive.

llvm-svn: 79885
2009-08-24 03:52:50 +00:00
Chris Lattner
3203639c35 Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files.

This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
   for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
   clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
   instead.
4. Weans llvm-db off <iostream>

sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.

llvm-svn: 79869
2009-08-23 22:45:37 +00:00
Chris Lattner
f536c93134 convert LoopInfo.h and GraphWriter.h to use raw_ostream
llvm-svn: 79836
2009-08-23 07:19:13 +00:00
Chris Lattner
cf11411573 convert the DIE printing stuff to use raw_ostream instead of std::ostream.
Tweak #includes.

llvm-svn: 79800
2009-08-23 01:01:17 +00:00
Chris Lattner
2c5fb733fa random code cleanups.
llvm-svn: 79798
2009-08-23 00:51:47 +00:00
Chris Lattner
1c6c358071 remove some random indentation stuff, yay for efficiency.
llvm-svn: 79797
2009-08-23 00:51:00 +00:00
Chris Lattner
8d06945fff rename TAI -> MAI, being careful not to make MAILJMP instructions :)
llvm-svn: 79777
2009-08-22 21:43:10 +00:00
Chris Lattner
5d8af49626 Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
llvm-svn: 79763
2009-08-22 20:48:53 +00:00
Devang Patel
c071d6c1b4 Record variable debug info at ISel time directly.
llvm-svn: 79742
2009-08-22 17:12:53 +00:00
Bill Wendling
ee0f476fd4 Attempt to comment this code more.
llvm-svn: 79567
2009-08-20 22:02:24 +00:00
David Greene
8dfc73dbbf Add missing includes.
llvm-svn: 79475
2009-08-19 21:59:18 +00:00
David Greene
1fff843647 Add missing includes.
llvm-svn: 79474
2009-08-19 21:55:33 +00:00
David Greene
1df248be05 Add missing includes.
llvm-svn: 79473
2009-08-19 21:52:55 +00:00
Daniel Dunbar
2cf5eb67b4 Switch to SmallString::str from SmallString::c_str, and remove
SmallString::c_str.

llvm-svn: 79456
2009-08-19 20:07:03 +00:00
Chris Lattner
57b873fda0 switch asmprinter to emit alignments through OutStreamer.
llvm-svn: 79406
2009-08-19 06:12:02 +00:00
Chris Lattner
9cbc9c2d13 eliminate AsmPrinter::SwitchToSection and just have clients
talk to the MCStreamer directly instead.

llvm-svn: 79405
2009-08-19 05:49:37 +00:00
David Greene
4347d5d424 Make various changes suggested by Chris.
llvm-svn: 79358
2009-08-18 19:22:55 +00:00
Chris Lattner
17c3a9cf99 fix COFF targets (mingw/cygwin) to provide ehframe and LSDA sections
llvm-svn: 79346
2009-08-18 16:56:17 +00:00
Chris Lattner
b82fc63e02 Make AsmStreamer maintain a notion of the current section, pushing it up from the
MCAsmStreamer.  Based on this, eliminate the current section from AsmPrinter.

While I'm at it, clean up the last of the horrible "switch to null section" stuff
and add an assert.  This change is in preparation for completely eliminating 
asmprinter::switchtosection.

llvm-svn: 79324
2009-08-18 06:15:16 +00:00
Chris Lattner
7a382434b5 add a horrible hack to the dwarf printer. It looks like mingw is not specifying
an EHFrame section, so we just emit ehframe data into a random section.

This is clearly bad.

llvm-svn: 79323
2009-08-18 06:13:03 +00:00
Jim Grosbach
5d064eeb2a Remove a bit more cruft from the sjlj moving to a backend pass.
llvm-svn: 79272
2009-08-17 20:25:04 +00:00
Jim Grosbach
4643e96d36 Move the sjlj exception handling conversions to a back-end pass where they
more properly belong. This allows removing the front-end conditionalized
SJLJ code, and cleans up the generated IR considerably. All of the
infrastructure code (calling _Unwind_SjLj_Register/Unregister, etc) is
added by the SjLjEHPrepare pass.

llvm-svn: 79250
2009-08-17 16:41:22 +00:00
Chris Lattner
0ed3ef52af the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.

llvm-svn: 79246
2009-08-17 15:48:08 +00:00
Chris Lattner
fc68e5368b change AsmPrinter to switch sections using AsmStreamer instead of
doing it directly.  This requires const'izing a bunch of stuff that
took sections, but this seems like the right semantic thing to do:
emitting a label to a section shouldn't mutate the MCSection object
itself, for example.

llvm-svn: 79227
2009-08-17 05:49:08 +00:00
Chris Lattner
69a19050c0 give MCAsmStreamer a TargetAsmInfo.
llvm-svn: 79222
2009-08-17 04:23:44 +00:00
Devang Patel
b6add4ace3 Do not completely skip subrange info for a zero sized array.
llvm-svn: 79044
2009-08-14 20:59:16 +00:00
Daniel Dunbar
ca38bc510e Add virtual printMCInst method to AsmPrinter, as a quick way to expose the API
to print one instruction.

llvm-svn: 78985
2009-08-14 03:43:57 +00:00
Owen Anderson
9df206d02d Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Dan Gohman
4b9cae5af3 Various AsmWriter output cleanups. Use WriteAsOperand instead of
PrintUnmangledNameSafely.

llvm-svn: 78878
2009-08-13 01:36:44 +00:00
Dan Gohman
8ce3f1d1df Use WriteAsOperand to print BasicBlock names.
llvm-svn: 78838
2009-08-12 20:56:56 +00:00
Dan Gohman
1da933d3e3 Fix a few more places to use PadToColumn instead of tabs. And fix
the basic block label printing to check whether a block has a name
before printing a comment character and whitespace for it.

llvm-svn: 78830
2009-08-12 18:47:05 +00:00
Dan Gohman
83d1de03ca Use PadToColumn instead of tabs for aligning comments. Fix one place
that emitted unnecessary whitespace outside of VerboseAsm mode.

llvm-svn: 78828
2009-08-12 18:32:22 +00:00
Jim Grosbach
74c682dde4 Add catch block handling to SjLj exception handling.
llvm-svn: 78817
2009-08-12 17:38:44 +00:00
Chris Lattner
a74023896f Change the asmprinter to print the comment character before the
"inlineasmstart/end" strings so that the contents of the directive
are separate from the comment character.  This lets elf targets
get #APP/#NOAPP for free even if they don't use "#" as the comment
character.  This also allows hoisting the darwin stuff up to the
shared TAI class.

llvm-svn: 78737
2009-08-11 22:39:40 +00:00
Chris Lattner
0cb77e23a9 "TAI::JumpTableDirective" is always null for current arm targets, simplify
the code based on this and make it fall through better.

llvm-svn: 78708
2009-08-11 20:29:57 +00:00
Jim Grosbach
c9a1dd9291 SjLj based exception handling unwinding support. This patch is nasty, brutish
and short. Well, it's kinda short. Definitely nasty and brutish.

The front-end generates the register/unregister calls into the SjLj runtime,
call-site indices and landing pad dispatch. The back end fills in the LSDA
with the call-site information provided by the front end. Catch blocks are
not yet implemented.

Built on Darwin and verified no llvm-core "make check" regressions.

llvm-svn: 78625
2009-08-11 00:09:57 +00:00
David Greene
91e0e06670 Add support for printing loop structure information in asm comments.
This definitely slows down asm output so put it under an -asm-exuberant
flag.

This information is useful when doing static analysis of performance
issues.

llvm-svn: 78567
2009-08-10 16:38:07 +00:00
Chris Lattner
9e2c3aa666 sink the 'name' and 'isdirective' state out of MCSection into its derived classes.
This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-)

llvm-svn: 78517
2009-08-08 23:39:42 +00:00
Chris Lattner
2849883bd5 1. Make MCSection an abstract class.
2. Move section switch printing to MCSection virtual method which takes a
   TAI.  This eliminates textual formatting stuff from TLOF.
3. Eliminate SwitchToSectionDirective, getSectionFlagsAsString, and 
   TLOFELF::AtIsCommentChar.

llvm-svn: 78510
2009-08-08 22:41:53 +00:00
Chris Lattner
1c704ad33e eliminate TargetLoweringObjectFileSparc in favor of a TAI hook.
A TAI hook is appropriate in this case because this is just an
asm syntax issue, not a semantic difference. TLOF should model
the semantics of the section.

llvm-svn: 78498
2009-08-08 20:43:12 +00:00
Chris Lattner
03c663e1a3 code cleanup
llvm-svn: 78432
2009-08-07 23:42:01 +00:00
Chris Lattner
bdb5a03875 remove a bunch of now-dead crud from the asmprinter and TAI interfaces.
llvm-svn: 78428
2009-08-07 23:16:27 +00:00
Chris Lattner
7e328c8c9e tidy up
llvm-svn: 78416
2009-08-07 22:26:50 +00:00
David Greene
af3c172859 Fix some column padding bugs, reorganize things as suggested by Chris
and eliminate complexity.  Yay!

llvm-svn: 78243
2009-08-05 21:00:52 +00:00
Chris Lattner
8a74485e06 remove the 'DataSectionStartSuffix' and 'TextSectionStartSuffix' knobs.
llvm-svn: 78242
2009-08-05 20:49:52 +00:00
Chris Lattner
f7d482ff1e add a temporary hook to allow reuse of the asmprinter from the disassembler.
llvm-svn: 78154
2009-08-05 04:09:18 +00:00
Chris Lattner
87372c0978 rip out SectionEndDirectiveSuffix support, only uses by
the masm backend.  If anyone cares about masm in the future,
we'll have semantic sections it can hang off of.

llvm-svn: 78096
2009-08-04 20:09:41 +00:00
Chris Lattner
628047fd32 eliminate CurrentSection, rename CurrentSection_ -> CurrentSection, make it private,
eliminate IsInTextSection.

llvm-svn: 78017
2009-08-03 23:20:21 +00:00