Commit Graph

1224 Commits

Author SHA1 Message Date
Devang Patel e755966913 Simplify.
llvm-svn: 118027
2010-11-02 17:37:00 +00:00
Devang Patel 6e0d58968d Ignore empty blocks.
llvm-svn: 117615
2010-10-28 22:11:59 +00:00
Devang Patel 1c75865037 Do not work too hard to find type's file info. There is a special field to record file info.
llvm-svn: 117588
2010-10-28 19:50:08 +00:00
Devang Patel c4b69051b7 Technically DIFile scope should also be handled here.
llvm-svn: 117563
2010-10-28 17:30:52 +00:00
Devang Patel b5694e702c s/beginScope/beginInstruction/g
s/endScope/endInstruction/g

llvm-svn: 117376
2010-10-26 17:49:02 +00:00
Nick Lewycky 90b2ac2696 For statistics that are only used in functions declared in !NDEBUG, wrap the
declarations in !NDEBUG to avoid -Wunused-variable warnings. Patch by
Matt Beaumont-Gay!

llvm-svn: 117345
2010-10-26 00:51:57 +00:00
Devang Patel a86114b961 Add simple counter to count no. of basic blocks without any line number information. At -O0, these basic block coule cause less than optimial debugging experience.
llvm-svn: 117307
2010-10-25 20:45:32 +00:00
Devang Patel dd1c289a6a Line number 0 indicates there is no source line/file name info available for this construct.
llvm-svn: 116061
2010-10-08 17:18:54 +00:00
Devang Patel 3a24f9230a Provie a clearner interface so that FE can decide whether a function has prototype or not.
llvm-svn: 115988
2010-10-07 22:03:01 +00:00
Devang Patel 9a33ec24eb Add support for DW_TAG_unspecified_parameters.
llvm-svn: 115833
2010-10-06 20:50:40 +00:00
Devang Patel e1c714647c Add support to let FE mark explict methods as explict in debug info.
llvm-svn: 115378
2010-10-01 23:31:40 +00:00
Jim Grosbach 0091535361 Nuke trailing whitespace.
llvm-svn: 115377
2010-10-01 23:29:12 +00:00
Devang Patel bea08d1c85 Let FE mark a variable as artificial variable.
llvm-svn: 115102
2010-09-29 23:07:21 +00:00
Devang Patel cb03b14089 Add support to let FE encode method access specifier.
llvm-svn: 115089
2010-09-29 21:44:16 +00:00
Devang Patel a1bd5a1fad Assign DW_ACCESS_public accessibility attribute to members by default.
llvm-svn: 115067
2010-09-29 19:08:08 +00:00
Oscar Fuentes b4b12535e8 Removed a bunch of unnecessary target_link_libraries.
llvm-svn: 114999
2010-09-28 22:39:14 +00:00
Devang Patel 7a55481fa4 Provide an interface to let FEs anchor debug info for types.
llvm-svn: 114969
2010-09-28 18:08:20 +00:00
Devang Patel 185051cb8e Remove dead argument.
llvm-svn: 114920
2010-09-27 23:15:27 +00:00
Chris Lattner 9f06f911d1 the latest assembler that runs on powerpc 10.4 machines doesn't
support aligned comm.  Detect when compiling for 10.4 and don't
emit an alignment for comm.  THis will hopefully fix PR8198.

llvm-svn: 114817
2010-09-27 06:44:54 +00:00
Devang Patel 804fcd4794 Use DW_OP_fbreg when offset is based on frame register.
llvm-svn: 114585
2010-09-22 21:10:38 +00:00
Devang Patel 871d0b1b1c If FE forgot to provide a file name (usually it uses "stdin" as name in such situation) then make one up to ensure that debug info is not malformed.
llvm-svn: 114119
2010-09-16 20:57:49 +00:00
Michael J. Spencer 93c9b2ea93 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

llvm-svn: 113819
2010-09-13 23:59:48 +00:00
Benjamin Kramer 65550d7cea Fix linux/msvc build, move include.
llvm-svn: 113776
2010-09-13 20:04:49 +00:00
Michael J. Spencer dc38d36ccb CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
llvm-svn: 113632
2010-09-10 21:14:25 +00:00
Chris Lattner 419d0aa0ed add a comment about where this should eventually move.
llvm-svn: 113117
2010-09-05 20:33:40 +00:00
Devang Patel 854ad26ae2 There is no need to use .set here.
Thanks Chris!

llvm-svn: 112900
2010-09-02 23:01:10 +00:00
Devang Patel da3ef85460 Fix .debug_range for linux. Patch by Krister Wombell.
llvm-svn: 112830
2010-09-02 16:43:44 +00:00
Devang Patel ea63639da5 Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.
This patch was developed on top of original patch by Artur Pietrek.

llvm-svn: 112678
2010-08-31 23:50:19 +00:00
Devang Patel 86ec8b3a3f Reapply r112623. Included additional check for unused byval argument.
llvm-svn: 112659
2010-08-31 22:22:42 +00:00
Devang Patel 529f248eb4 Revert r112623. It is causing self host build failures.
llvm-svn: 112631
2010-08-31 19:41:03 +00:00
Devang Patel 8559932d36 Remember byval argument's frame index during argument lowering and use this info to emit debug info.
Fixes Radar 8367011.

llvm-svn: 112623
2010-08-31 18:50:09 +00:00
Devang Patel 2cfc3af181 Simplify.
llvm-svn: 112583
2010-08-31 06:11:28 +00:00
Chris Lattner 13ee795c42 remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.

llvm-svn: 112356
2010-08-28 04:09:24 +00:00
Devang Patel 4a213870db Revert r107202. It is not adding any value.
llvm-svn: 111870
2010-08-24 00:06:12 +00:00
Devang Patel a8652674e0 Handle qualified constants that are directly folded by FE.
PR 7920.

llvm-svn: 111820
2010-08-23 18:25:56 +00:00
Bill Wendling 578ee4070c Create the new linker type "linker_private_weak_def_auto".
It's similar to "linker_private_weak", but it's known that the address of the
object is not taken. For instance, functions that had an inline definition, but
the compiler decided not to inline it. Note, unlike linker_private and
linker_private_weak, linker_private_weak_def_auto may have only default
visibility.  The symbols are removed by the linker from the final linked image
(executable or dynamic library).

llvm-svn: 111684
2010-08-20 22:05:50 +00:00
Bill Wendling 0d323aef46 Improve whitespace.
llvm-svn: 111384
2010-08-18 18:41:13 +00:00
Eli Friedman 7e2f4ce439 Until uleb/sleb are MC-ized, add a hack to make them work with ELF object
emission.

llvm-svn: 111177
2010-08-16 20:08:40 +00:00
Devang Patel 8e06a5eb47 Do not forget debug info for enums. Use named mdnode to keep track of these types.
llvm-svn: 110712
2010-08-10 20:01:20 +00:00
Devang Patel b219746c80 Handle TAG_constant for integers.
llvm-svn: 110656
2010-08-10 07:11:13 +00:00
Devang Patel 18ba0b4ac3 Simplify.
llvm-svn: 110653
2010-08-10 04:12:17 +00:00
Devang Patel b1e07b3f2a Drop "const". It does not add value here.
llvm-svn: 110652
2010-08-10 04:09:06 +00:00
Devang Patel 469c12d254 Do not include file static variable in pubnames list.
Refactor and simplify code to avoid redundant checks.

llvm-svn: 110642
2010-08-10 01:37:23 +00:00
Devang Patel 394a69ed52 Undo accidental commit.
llvm-svn: 110623
2010-08-09 23:28:52 +00:00
Devang Patel 4eda9abddb Simplify. Avoid redundant checks.
llvm-svn: 110621
2010-08-09 23:26:06 +00:00
Devang Patel c7cf14f5f6 Refactor.
llvm-svn: 110607
2010-08-09 21:39:24 +00:00
Devang Patel 6d9f9feb2b Refactoring. Update DbgVarible to handle queries itself.
llvm-svn: 110600
2010-08-09 21:01:39 +00:00
Devang Patel b6511a36b4 It is ok, and convenient, to pass descriptors by value.
llvm-svn: 110590
2010-08-09 20:20:05 +00:00
Devang Patel 406798a17d Rename a method.
llvm-svn: 110586
2010-08-09 18:51:29 +00:00
Owen Anderson a7aed18624 Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson bda59bd247 Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson 755aceb5d0 Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Devang Patel 6c378ac473 Use location entry only of the location described by DBG_VALUE is valid.
llvm-svn: 110255
2010-08-04 22:07:27 +00:00
Devang Patel 6d21f61b3f Fix typo in comment.
llvm-svn: 110244
2010-08-04 20:32:36 +00:00
Dan Gohman 2392287306 Change this llvm_unreachable to report_fatal_error, since it can
be triggered by valid, if dubious, IR.

llvm-svn: 110240
2010-08-04 18:51:09 +00:00
Devang Patel 0e60e67efb If a variable is spilled by code generator then use DW_OP_fbreg to describe its location on stack.
llvm-svn: 110234
2010-08-04 18:40:52 +00:00
Devang Patel d070128de5 Free DbgScope created for dead functions.
llvm-svn: 110045
2010-08-02 17:32:15 +00:00
Bill Wendling d9900542a6 Reference the personalities. Don't copy them into a new vector.
llvm-svn: 109966
2010-08-01 01:34:21 +00:00
Devang Patel 84a74779a1 It is FE's responsibility to emit proper directory name.
llvm-svn: 109538
2010-07-27 20:51:15 +00:00
Devang Patel 498877d055 Use current working directory when Dirname is empty. This only happens when absolute source file path is used on compiler command line.
llvm-svn: 109302
2010-07-24 00:53:22 +00:00
Devang Patel 28499f76c9 Revert r109262.
llvm-svn: 109285
2010-07-23 23:04:41 +00:00
Devang Patel 3032354bbe IF directory name is empty then try to extract one using absolute file name.
llvm-svn: 109262
2010-07-23 20:36:13 +00:00
Jim Grosbach 965a73a28c For ARM/Darwin, add a dwarf entry indicating whether a function is arm or thumb
rdar://8202967

llvm-svn: 109057
2010-07-21 23:03:52 +00:00
Jim Grosbach a8683bb033 80 column and trailing whitespace cleanup
llvm-svn: 109037
2010-07-21 21:21:52 +00:00
Dan Gohman 093cb79d4b Disallow null as a named metadata operand.
Make MDNode::destroy private.
Fix the one thing that used MDNode::destroy, outside of MDNode itself.

One should never delete or destroy an MDNode explicitly. MDNodes
implicitly go away when there are no references to them (implementation
details aside).

llvm-svn: 109028
2010-07-21 18:54:18 +00:00
Stuart Hastings 61475c5c3c Correct line info for declarations/definitions. Radar 8063111.
llvm-svn: 108784
2010-07-19 23:56:30 +00:00
Devang Patel 18efced1a2 Fix PR 7662.
Do not try to insert local variable info to a DIE used for function declaration.

llvm-svn: 108731
2010-07-19 17:53:55 +00:00
Daniel Dunbar 419197cc4d Target: Give the TargetAsmParser access to the TargetMachine.
- Unfortunate, but necessary for now to handle subtarget instruction matching. Eventually we should factor out the lower level target machine information so we don't need to do this.

llvm-svn: 108664
2010-07-19 00:33:49 +00:00
Daniel Dunbar 7f5bf5ae2a MC: Move several clients to using AsmParser constructor function.
llvm-svn: 108645
2010-07-18 18:31:33 +00:00
Bill Wendling ac67e99d53 Use isPrologLabel() instead of checking the opcode directly.
llvm-svn: 108628
2010-07-17 19:18:44 +00:00
Bill Wendling bf8370ff36 Consider this function:
void foo() { __builtin_unreachable(); }

It will output the following on Darwin X86:

_func1:
Leh_func_begin0:
        pushq %rbp
Ltmp0:
        movq %rsp, %rbp
Ltmp1:
Leh_func_end0:

This prolog adds a new Call Frame Information (CFI) row to the FDE with an
address that is not within the address range of the code it describes -- part is
equal to the end of the function -- and therefore results in an invalid EH
frame. If we emit a nop in this situation, then the CFI row is now within the
address range.

llvm-svn: 108568
2010-07-16 22:51:10 +00:00
Bill Wendling 499f797cdd Rename DBG_LABEL PROLOG_LABEL, because it's only used during prolog emission and
thus is a much more meaningful name.

llvm-svn: 108563
2010-07-16 22:20:36 +00:00
Jakob Stoklund Olesen 37c42a3d02 Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.
TII::isMoveInstr is going tobe completely removed.

llvm-svn: 108507
2010-07-16 04:45:42 +00:00
Chris Lattner 28fd6785bc a more graceful fix for test/Other/inline-asm-newline-terminator.ll,
follow on to r103765

llvm-svn: 108390
2010-07-15 00:37:34 +00:00
Stuart Hastings d08fb75aaa Reverting r107918 and r107919. Radar 8063111.
llvm-svn: 107930
2010-07-08 23:25:39 +00:00
Devang Patel 4c6bd6612f Relax assertion. In optimized code, it is possible that first instruction is coming from a inlined function.
This fixes PR7596 .

llvm-svn: 107923
2010-07-08 22:39:20 +00:00
Stuart Hastings 43d226deea Fix decl/def debug info for template functions. Radar 8063111.
llvm-svn: 107919
2010-07-08 22:28:59 +00:00
Devang Patel 9c160e1213 Reuse DIEInteger for 1. This is frequently used while emitting an attribute using dwarf::DW_FORM_flag form.
llvm-svn: 107903
2010-07-08 20:10:35 +00:00
Devang Patel a37a95ea2f One MDNode may be used to create regular DIE as well as abstract DIE.
Keep track of abstract subprogram DIEs. 

llvm-svn: 107822
2010-07-07 22:20:57 +00:00
Devang Patel 9a0339fc1f Rename couple of maps.
llvm-svn: 107810
2010-07-07 20:49:57 +00:00
Devang Patel 30265c4f8b 80 cols.
llvm-svn: 107807
2010-07-07 20:12:52 +00:00
Dale Johannesen 4d887f7ca7 Propagate the AlignStack bit in InlineAsm's to the
PrologEpilog code, and use it to determine whether
the asm forces stack alignment or not.  gcc consistently
does not do this for GCC-style asms; Apple gcc inconsistently
sometimes does it for asm blocks.  There is no
convenient place to put a bit in either the SDNode or
the MachineInstr form, so I've added an extra operand
to each; unlovely, but it does allow for expansion for
more bits, should we need it.  PR 5125.  Some
existing testcases are affected.
The operand lists of the SDNode and MachineInstr forms
are indexed with awesome mnemonics, like "2"; I may
fix this someday, but not now.  I'm not making it any
worse.  If anyone is inspired I think you can find all
the right places from this patch.

llvm-svn: 107506
2010-07-02 20:16:09 +00:00
Bill Wendling 504055ce9e Make the "linker_private" linkage type emit a non-weak symbol to the file. It
will still be stripped by the linker when it generates the final image.

llvm-svn: 107440
2010-07-01 22:38:24 +00:00
Bill Wendling 03bcd6ecc8 Implement the "linker_private_weak" linkage type. This will be used for
Objective-C metadata types which should be marked as "weak", but which the
linker will remove upon final linkage. However, this linkage isn't specific to
Objective-C.

For example, the "objc_msgSend_fixup_alloc" symbol is defined like this:

      .globl l_objc_msgSend_fixup_alloc
      .weak_definition l_objc_msgSend_fixup_alloc
      .section __DATA, __objc_msgrefs, coalesced
      .align 3
l_objc_msgSend_fixup_alloc:
       .quad   _objc_msgSend_fixup
       .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

Currently only supported on Darwin platforms.

llvm-svn: 107433
2010-07-01 21:55:59 +00:00
Devang Patel 429397529a Do not require line number entry for undefined local variable.
This is a regression caused by r106792 and caught by gdb testsuite.

llvm-svn: 107430
2010-07-01 21:38:08 +00:00
Daniel Dunbar 02877d6e85 MC: Pass the target instance to the AsmParser constructor.
llvm-svn: 107426
2010-07-01 20:41:56 +00:00
Mikhail Glushenkov 4721ad855e Trailing whitespace.
llvm-svn: 107360
2010-07-01 01:00:22 +00:00
Devang Patel c5b3109bec Do not construct DIE for already processed MDNode.
llvm-svn: 107237
2010-06-30 01:40:11 +00:00
Devang Patel 648df7bf64 Add variables into a scope before constructing scope DIE otherwise variables won't be included DIE tree.
llvm-svn: 107228
2010-06-30 00:11:08 +00:00
Bill Wendling 3632171750 Revert r107205 and r107207.
llvm-svn: 107215
2010-06-29 22:34:52 +00:00
Devang Patel be30551600 Print InlinedAt location.
llvm-svn: 107214
2010-06-29 22:29:15 +00:00
Bill Wendling 1767723dbe Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:

       .globl l_objc_msgSend_fixup_alloc
       .weak_definition l_objc_msgSend_fixup_alloc
       .section __DATA, __objc_msgrefs, coalesced
       .align 3
l_objc_msgSend_fixup_alloc:
        .quad   _objc_msgSend_fixup
        .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

llvm-svn: 107205
2010-06-29 21:24:00 +00:00
Devang Patel 24bc1b5b2f Do not hardcode DW_AT_stmt_list value.
Inspired by Artur Pietrek.

llvm-svn: 107202
2010-06-29 20:17:53 +00:00
Devang Patel 1de21ec498 Use DW_FORM_addr for DW_AT_entry_pc.
llvm-svn: 107085
2010-06-28 22:22:47 +00:00
Devang Patel d10b2af260 Include inlined function in list of processed subprograms.
llvm-svn: 107065
2010-06-28 20:53:04 +00:00
Devang Patel f3b2db68c6 Preserve deleted function's local variables' debug info.
Radar 8122864.

llvm-svn: 107027
2010-06-28 18:25:03 +00:00
Devang Patel fb6f22f010 Remove dead code.
llvm-svn: 106990
2010-06-28 05:59:13 +00:00
Devang Patel 5c0f85c7dd Collect debug info for optimized variables of inlined functions.
llvm-svn: 106895
2010-06-25 22:07:34 +00:00
Devang Patel c657c621b7 DBG_VALUE machine instruction pointing to undefined register for a variable justify a separate scope if the variable is inlined function's argument.
Radar 8122864.

llvm-svn: 106792
2010-06-24 21:51:19 +00:00
Devang Patel b6e058da18 Use single interface, using twine, to get named metadata.
getNamedMetadata().

llvm-svn: 106518
2010-06-22 01:19:38 +00:00