1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

1311 Commits

Author SHA1 Message Date
Devang Patel
f600d9f0ed Add support to let FE encode method access specifier.
llvm-svn: 115089
2010-09-29 21:44:16 +00:00
Devang Patel
fd6665e8aa Assign DW_ACCESS_public accessibility attribute to members by default.
llvm-svn: 115067
2010-09-29 19:08:08 +00:00
Oscar Fuentes
eb27a44982 Removed a bunch of unnecessary target_link_libraries.
llvm-svn: 114999
2010-09-28 22:39:14 +00:00
Devang Patel
e1f502ee26 Provide an interface to let FEs anchor debug info for types.
llvm-svn: 114969
2010-09-28 18:08:20 +00:00
Devang Patel
0a414c918a Remove dead argument.
llvm-svn: 114920
2010-09-27 23:15:27 +00:00
Chris Lattner
0ebcc18dec 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
8914755c40 Use DW_OP_fbreg when offset is based on frame register.
llvm-svn: 114585
2010-09-22 21:10:38 +00:00
Devang Patel
99777d1d07 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
90f807fda5 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
9859d9eee4 Fix linux/msvc build, move include.
llvm-svn: 113776
2010-09-13 20:04:49 +00:00
Michael J. Spencer
98ad3f2ea7 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
llvm-svn: 113632
2010-09-10 21:14:25 +00:00
Chris Lattner
6c08c3b321 add a comment about where this should eventually move.
llvm-svn: 113117
2010-09-05 20:33:40 +00:00
Devang Patel
e431686861 There is no need to use .set here.
Thanks Chris!

llvm-svn: 112900
2010-09-02 23:01:10 +00:00
Devang Patel
bbbd35d042 Fix .debug_range for linux. Patch by Krister Wombell.
llvm-svn: 112830
2010-09-02 16:43:44 +00:00
Devang Patel
9e8ee9242f 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
46570e6783 Reapply r112623. Included additional check for unused byval argument.
llvm-svn: 112659
2010-08-31 22:22:42 +00:00
Devang Patel
b94251aea0 Revert r112623. It is causing self host build failures.
llvm-svn: 112631
2010-08-31 19:41:03 +00:00
Devang Patel
414cbc940a 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
2eeab37306 Simplify.
llvm-svn: 112583
2010-08-31 06:11:28 +00:00
Chris Lattner
ecf276b787 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
9024c19242 Revert r107202. It is not adding any value.
llvm-svn: 111870
2010-08-24 00:06:12 +00:00
Devang Patel
cf6c6b4038 Handle qualified constants that are directly folded by FE.
PR 7920.

llvm-svn: 111820
2010-08-23 18:25:56 +00:00
Bill Wendling
163660135e 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
a055bae65f Improve whitespace.
llvm-svn: 111384
2010-08-18 18:41:13 +00:00
Eli Friedman
fb8b05726f 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
9b12559c4f 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
84f48b5483 Handle TAG_constant for integers.
llvm-svn: 110656
2010-08-10 07:11:13 +00:00
Devang Patel
8edc7575a4 Simplify.
llvm-svn: 110653
2010-08-10 04:12:17 +00:00
Devang Patel
191ed4c41d Drop "const". It does not add value here.
llvm-svn: 110652
2010-08-10 04:09:06 +00:00
Devang Patel
ef61383343 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
c5f885e228 Undo accidental commit.
llvm-svn: 110623
2010-08-09 23:28:52 +00:00
Devang Patel
4ccbd73f20 Simplify. Avoid redundant checks.
llvm-svn: 110621
2010-08-09 23:26:06 +00:00
Devang Patel
8d0c79694e Refactor.
llvm-svn: 110607
2010-08-09 21:39:24 +00:00
Devang Patel
2d9b975304 Refactoring. Update DbgVarible to handle queries itself.
llvm-svn: 110600
2010-08-09 21:01:39 +00:00
Devang Patel
9110ec63bc It is ok, and convenient, to pass descriptors by value.
llvm-svn: 110590
2010-08-09 20:20:05 +00:00
Devang Patel
409f683e17 Rename a method.
llvm-svn: 110586
2010-08-09 18:51:29 +00:00
Owen Anderson
f2fea95f2f Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb 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
4c36d66bde 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
35e3dd45c0 Fix typo in comment.
llvm-svn: 110244
2010-08-04 20:32:36 +00:00
Dan Gohman
670b397ecc 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
eb7cff69c8 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
8a18e29b50 Free DbgScope created for dead functions.
llvm-svn: 110045
2010-08-02 17:32:15 +00:00
Bill Wendling
36376df573 Reference the personalities. Don't copy them into a new vector.
llvm-svn: 109966
2010-08-01 01:34:21 +00:00
Devang Patel
38a7221118 It is FE's responsibility to emit proper directory name.
llvm-svn: 109538
2010-07-27 20:51:15 +00:00
Devang Patel
df9f5bf991 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
7049c83125 Revert r109262.
llvm-svn: 109285
2010-07-23 23:04:41 +00:00
Devang Patel
01d5937192 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
489d758ea8 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
6b4f9f4c14 80 column and trailing whitespace cleanup
llvm-svn: 109037
2010-07-21 21:21:52 +00:00
Dan Gohman
fc3ee085a0 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
587ed4918c Correct line info for declarations/definitions. Radar 8063111.
llvm-svn: 108784
2010-07-19 23:56:30 +00:00
Devang Patel
e401bfe168 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
150021561c 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
4dc7255379 MC: Move several clients to using AsmParser constructor function.
llvm-svn: 108645
2010-07-18 18:31:33 +00:00
Bill Wendling
72c0967ce7 Use isPrologLabel() instead of checking the opcode directly.
llvm-svn: 108628
2010-07-17 19:18:44 +00:00
Bill Wendling
85d6ed81b7 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
e2833a21c2 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
bcee53a2b8 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
01c2381bd7 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
a3999081cf Reverting r107918 and r107919. Radar 8063111.
llvm-svn: 107930
2010-07-08 23:25:39 +00:00
Devang Patel
2abdcdfb40 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
b70d4e06e3 Fix decl/def debug info for template functions. Radar 8063111.
llvm-svn: 107919
2010-07-08 22:28:59 +00:00
Devang Patel
69b391b5b1 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
3d7c71dbbb 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
3e07e4eb8b Rename couple of maps.
llvm-svn: 107810
2010-07-07 20:49:57 +00:00
Devang Patel
6aef3e8bb3 80 cols.
llvm-svn: 107807
2010-07-07 20:12:52 +00:00
Dale Johannesen
df6db93a4d 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
f21e2fe2b9 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
90b6422f2f 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
606a8f3fbf 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
37b4089fbf MC: Pass the target instance to the AsmParser constructor.
llvm-svn: 107426
2010-07-01 20:41:56 +00:00
Mikhail Glushenkov
0163e1e289 Trailing whitespace.
llvm-svn: 107360
2010-07-01 01:00:22 +00:00
Devang Patel
00ee7ba38c Do not construct DIE for already processed MDNode.
llvm-svn: 107237
2010-06-30 01:40:11 +00:00
Devang Patel
93e5e9bd19 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
59ef9bcc6d Revert r107205 and r107207.
llvm-svn: 107215
2010-06-29 22:34:52 +00:00
Devang Patel
6d7cc07644 Print InlinedAt location.
llvm-svn: 107214
2010-06-29 22:29:15 +00:00
Bill Wendling
05a4c0b1f2 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
8052c941ca 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
2c43f47ccc Use DW_FORM_addr for DW_AT_entry_pc.
llvm-svn: 107085
2010-06-28 22:22:47 +00:00
Devang Patel
229053c609 Include inlined function in list of processed subprograms.
llvm-svn: 107065
2010-06-28 20:53:04 +00:00
Devang Patel
dffbf36af7 Preserve deleted function's local variables' debug info.
Radar 8122864.

llvm-svn: 107027
2010-06-28 18:25:03 +00:00
Devang Patel
1929457a0f Remove dead code.
llvm-svn: 106990
2010-06-28 05:59:13 +00:00
Devang Patel
b5b193fb87 Collect debug info for optimized variables of inlined functions.
llvm-svn: 106895
2010-06-25 22:07:34 +00:00
Devang Patel
af1d4eede5 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
f50b6147ad Use single interface, using twine, to get named metadata.
getNamedMetadata().

llvm-svn: 106518
2010-06-22 01:19:38 +00:00
Devang Patel
38d9ee4e35 Discard special LLVM prefix from linkage name.
llvm-svn: 106516
2010-06-22 01:06:05 +00:00
Devang Patel
dee41b010a Do not rely on Twine temporaries to survive.
llvm-svn: 106515
2010-06-22 01:01:58 +00:00
Dan Gohman
6c6e9a45ff Give NamedRegionTimer an Enabled flag, allowing all its clients to
switch from this:

  if (TimePassesIsEnabled) {
    NamedRegionTimer T(Name, GroupName);
    do_something();
  } else {
    do_something(); // duplicate the code, this time without a timer!
  }

to this:

  {
    NamedRegionTimer T(Name, GroupName, TimePassesIsEnabled);
    do_something();
  }

llvm-svn: 106285
2010-06-18 15:56:31 +00:00
Devang Patel
3282324020 Use separate named MDNode to hold each function's local variable info.
This speeds up local variable handling in DwarfDebug.

llvm-svn: 106075
2010-06-16 00:53:55 +00:00
Eric Christopher
db2cef56c9 Don't emit the linkage for initializer label for mach-o tls.
llvm-svn: 106073
2010-06-16 00:27:30 +00:00
Stuart Hastings
5dd588e7d9 Added a comment.
llvm-svn: 106063
2010-06-15 23:06:30 +00:00
Stuart Hastings
f9ef9ff3d6 Support for nested functions/classes in debug output. (Again.) Radar 7424645.
llvm-svn: 105828
2010-06-11 20:08:44 +00:00
Stuart Hastings
37ed2a9663 Revert 105492 & 105493 due to a testcase regression. Radar 7424645.
llvm-svn: 105511
2010-06-05 00:39:29 +00:00
Stuart Hastings
eb78f8db98 Support for nested functions/classes in debug output. Radar 7424645.
llvm-svn: 105492
2010-06-04 22:36:03 +00:00
Eric Christopher
00f399e90a One underscore, not two.
llvm-svn: 105379
2010-06-03 04:02:59 +00:00
Devang Patel
5fb0590e9c Skip identical instruction while calculating DBG_VALUE range.
llvm-svn: 105340
2010-06-02 19:05:13 +00:00
Devang Patel
a5f4e6f4d9 Use local small vector.
llvm-svn: 105332
2010-06-02 16:42:51 +00:00
Devang Patel
345874624f Ignore line number of debug value in undefined register.
llvm-svn: 105292
2010-06-01 21:43:09 +00:00
Stuart Hastings
369d3391d8 Revert 104841, 104842, 104876 due to buildbot failures. Radar 7424645.
llvm-svn: 104953
2010-05-28 16:41:07 +00:00
Devang Patel
8d4eb26f24 Do not drop location info for inlined function args.
llvm-svn: 104884
2010-05-27 20:25:04 +00:00
Devang Patel
747f1a373b inlined function's arguments need a label to mark the start point because they are not directly attached to current function.
llvm-svn: 104848
2010-05-27 16:47:30 +00:00
Stuart Hastings
60d799e343 Support for nested functions/classes in debug output. Radar 7424645.
llvm-svn: 104841
2010-05-27 16:16:54 +00:00
Devang Patel
bdda547db4 Simplify. Eliminate unneeded debug_loc entry.
llvm-svn: 104785
2010-05-26 23:55:23 +00:00
Devang Patel
2bbe13a797 There is no need to force an line number entry (using previous location) for a temp label at unknown location.
llvm-svn: 104740
2010-05-26 21:23:46 +00:00
Devang Patel
c24a269116 Identify instructions, that needs a label to mark debug info entity, in advance. This simplifies beginScope().
llvm-svn: 104720
2010-05-26 19:37:24 +00:00
Devang Patel
6f08a37562 Remove dead code.
llvm-svn: 104706
2010-05-26 17:42:50 +00:00
Devang Patel
691615151f Do not construct location list backword!
llvm-svn: 104705
2010-05-26 17:29:32 +00:00
Devang Patel
d7ad8ac4c0 First cut at supporting .debug_loc section.
This is used to track variable information.

llvm-svn: 104649
2010-05-25 23:40:22 +00:00
Eric Christopher
f6d55e86e7 Move the verbose asm output up a bit so it can be used in the special cases
as well.

llvm-svn: 104642
2010-05-25 21:49:43 +00:00
Eric Christopher
5c5a5be829 Add support for initialized global data for darwin tls. Update comments
and testcases accordingly.

llvm-svn: 104635
2010-05-25 21:28:50 +00:00
Devang Patel
345bc8667e Do not emit line number entries for unknown debug values.
This fixes recent regression in store.exp from gdb testsuite.

llvm-svn: 104524
2010-05-24 18:26:49 +00:00
Nicolas Geoffray
803f2761ec Encode the Caml frametable by following what the comment says: the number of descriptors
is first emitted, and StackOffsets are emitted in 16 bits.

llvm-svn: 104488
2010-05-24 12:24:11 +00:00
Eric Christopher
165bcdf8a8 Add full bss data support for darwin tls variables.
llvm-svn: 104414
2010-05-22 00:10:22 +00:00
Devang Patel
e611375617 Collect variable information during endFunction() instead of beginFunction().
llvm-svn: 104412
2010-05-22 00:04:14 +00:00
Devang Patel
e8f686625e Simplify
llvm-svn: 104338
2010-05-21 18:49:09 +00:00
Devang Patel
765d605934 Simplify.
llvm-svn: 104302
2010-05-21 00:10:20 +00:00
Devang Patel
32a1ce3b3a Refactor.
llvm-svn: 104265
2010-05-20 19:57:06 +00:00
Devang Patel
f90f78669f Split DbgVariable. Eventually, variable info will be communicated through frame index, or DBG_VALUE instruction, or collection of DBG_VALUE instructions. Plus each DbgVariable may not need a label.
llvm-svn: 104233
2010-05-20 16:36:41 +00:00
Eric Christopher
1a7bc06b28 Partial code for emitting thread local bss data.
llvm-svn: 104197
2010-05-20 00:49:07 +00:00
Devang Patel
069568c287 Revert r104165.
llvm-svn: 104172
2010-05-19 21:58:28 +00:00
Devang Patel
d0b5830f72 There is no need to maintain InsnsBeginScopeSet separately.
llvm-svn: 104165
2010-05-19 21:26:53 +00:00
Devang Patel
e54dbcd4bf Do not forget to mark prcessed arguments.
llvm-svn: 103822
2010-05-14 21:55:50 +00:00
Bill Wendling
e346a38ed4 Rename "HasCalls" in MachineFrameInfo to "AdjustsStack" to better describe what
the variable actually tracks.

N.B., several back-ends are using "HasCalls" as being synonymous for something
that adjusts the stack. This isn't 100% correct and should be looked into.

llvm-svn: 103802
2010-05-14 21:14:32 +00:00
Devang Patel
2b99c27e47 Add support to preserve type info for the variables that are removed by the optimizer.
llvm-svn: 103798
2010-05-14 21:01:35 +00:00
Daniel Dunbar
26fa01eb86 Inline Asm: Ensure buffer is newline terminated to match how the text is printed.
- This is a hack, but I can't decide the best place to handle this. Chris?

llvm-svn: 103765
2010-05-14 04:31:50 +00:00
Duncan Sands
bd83ac415f Remove unused variable. Tweak a comment while there.
llvm-svn: 103586
2010-05-12 07:11:33 +00:00
Nathan Jeffords
9952bcf9f6 updated support for the COFF .linkonce
Now, the .linkonce directive is emitted as part of MCSectionCOFF::PrintSwitchToSection instead of AsmPrinter::EmitLinkage since it is an attribute of the section the symbol was placed into not the symbol itself.

llvm-svn: 103568
2010-05-12 04:26:09 +00:00
Devang Patel
23f7323e7f Enable multiple Compile Units in one module.
This means now 'llvm-ld a.bc b.bc' will preserve debug info appropriately.

llvm-svn: 103439
2010-05-10 22:49:55 +00:00
Devang Patel
eed188e776 Instead of just verifying compile unit, verify entire type, variable, namespace etc..
llvm-svn: 103327
2010-05-07 23:33:41 +00:00
Devang Patel
14f07a8625 Remove DIGlobal.
llvm-svn: 103325
2010-05-07 23:19:07 +00:00
Devang Patel
e7333c8318 Verify entire type descriptor not just tag.
llvm-svn: 103303
2010-05-07 21:45:47 +00:00
Devang Patel
0638b539bb Wrap const MDNode * inside DIDescriptor.
llvm-svn: 103295
2010-05-07 20:54:48 +00:00
Devang Patel
02bb578ffd Avoid DIDescriptor::getNode(). Use overloaded operators instead.
llvm-svn: 103272
2010-05-07 18:11:54 +00:00
Dan Gohman
f863ad3dc5 Disable the new unknown-location code for now. It causes a major
increase in the debug line info section, and it's causing
regressions in a gdb testsuite.

llvm-svn: 103226
2010-05-07 01:08:53 +00:00
Dan Gohman
365b0e0f0f Update LabelsBeforeInsn also, when creating unknown-position labels.
llvm-svn: 103145
2010-05-06 00:29:41 +00:00
Chris Lattner
014a954e3d Fix PR7054 - Assertion `Symbol->isUndefined() && "Cannot define a symbol twice!"' failed.
Users can write broken code that emits the same label twice with asm renaming,
detect this and emit a fatal backend error instead of aborting.

llvm-svn: 103140
2010-05-06 00:05:37 +00:00
Dan Gohman
2f1182c0ac Emit debug info for MachineInstrs with unknown debug locations, instead
of just letting them inherit the debug locations of adjacent instructions.

Debug info should aim to be either accurate or absent.

llvm-svn: 103135
2010-05-05 23:41:32 +00:00
Devang Patel
ee7c7143dc Set DW_AT_APPLE_omit_frame_ptr in endFunction() where MachineFunction is available all the time.
llvm-svn: 103001
2010-05-04 06:15:30 +00:00
Dale Johannesen
a8f83a5f1b Don't count debug info as instructions. This was
preventing the emission of the NOP on Darwin for a
function with no actual code.  From timberwolfmc
with TEST=optllcdbg.

llvm-svn: 102843
2010-05-01 16:41:11 +00:00
Devang Patel
52c2d4d378 Attach AT_APPLE_optimized attribute to optimized function's debug info.
llvm-svn: 102743
2010-04-30 19:38:23 +00:00
Devang Patel
c34efcfee7 Print variable scope name in DEBUG_VALUE comment. Useful in some cases. e.g.
##DEBUG_VALUE: runOnMachineFunction:this <- RDI+0
	##DEBUG_VALUE: runOnMachineFunction:fn <- RSI+0
	##DEBUG_VALUE: DeadDefs <- undef ## SimpleRegisterCoalescing.cpp:2706
	##DEBUG_VALUE: getRegInfo:this <- [%rsp+$56]+$0
	##DEBUG_VALUE: getTarget:this <- [%rsp+$56]+$0

llvm-svn: 102655
2010-04-29 18:52:10 +00:00
Chris Lattner
9867c1a075 Rework global alignment computation again. Now we do round up
alignment of globals to the preferred alignment, but only when
there is no section specified on the global (by far the common
case).

llvm-svn: 102515
2010-04-28 19:58:07 +00:00
Devang Patel
570e9d53a7 Emit debug info for byval parameters.
llvm-svn: 102486
2010-04-28 01:39:28 +00:00
Chris Lattner
19715b76b7 further simplify EmitAlignment by eliminating the
ForcedAlignBits argument, tweaking the single client of it.

llvm-svn: 102484
2010-04-28 01:08:40 +00:00
Chris Lattner
d14f04d0f7 remove a dead argument to EmitAlignment.
llvm-svn: 102483
2010-04-28 01:06:02 +00:00
Chris Lattner
d3cfa7f3eb remove some default arguments to EmitAlignment.
llvm-svn: 102482
2010-04-28 01:05:45 +00:00
Devang Patel
d848109a46 Refactor.
llvm-svn: 102481
2010-04-28 01:03:09 +00:00
Devang Patel
06f4482831 Use isReg(), isImm() and isFPImm().
llvm-svn: 102470
2010-04-27 22:04:41 +00:00
Devang Patel
5d20a6c621 Check operand type first.
llvm-svn: 102468
2010-04-27 21:49:04 +00:00
Devang Patel
8b3c1ffb8b Ignore DBG_VALUE instructions that points to undef values.
llvm-svn: 102463
2010-04-27 20:54:45 +00:00
Devang Patel
4698fffbb8 Identify when a lexical scope is split in to multiple instruction ranges. Emit such ranges using DW_AT_ranges.
This patch fixes bug (PR6894) introduced by previous version of this patch.

llvm-svn: 102454
2010-04-27 19:46:33 +00:00
Evan Cheng
2aaefc6167 Do not count kill, implicit_def instructions as printed instructions.
llvm-svn: 102453
2010-04-27 19:38:45 +00:00
Chris Lattner
a9c1328501 round zero-byte .zerofill directives up to 1 byte. This
should fix some "g++.dg-struct-layout-1" failures, 
rdar://7886017

llvm-svn: 102421
2010-04-27 07:41:44 +00:00
Chris Lattner
df345f8909 add a comment in verbose-asm mode indicating why a noop is being generated.
llvm-svn: 102401
2010-04-26 23:41:43 +00:00
Chris Lattner
9292bad5f5 on darwin empty functions need to codegen into something of non-zero length,
otherwise labels get incorrectly merged.  We handled this by emitting a 
".byte 0", but this isn't correct on thumb/arm targets where the text segment
needs to be a multiple of 2/4 bytes.  Handle this by emitting a noop.  This
is more gross than it should be because arm/ppc are not fully mc'ized yet.

This fixes rdar://7908505

llvm-svn: 102400
2010-04-26 23:37:21 +00:00
Devang Patel
ac2c76f813 Use DW_AT_entry_pc instead of DW_AT_low_pc/DW_AT_high_pc pair. This simplifies debug range entries.
llvm-svn: 102394
2010-04-26 22:54:28 +00:00
Chris Lattner
4854eab087 fix PR6921 a different way. Intead of increasing the
alignment of globals with a specified alignment, we fix
common variables to obey their alignment.  Add a comment
explaining why this behavior is important.

llvm-svn: 102365
2010-04-26 18:46:46 +00:00
Chris Lattner
a8cd2ac893 Revert r102300/102301, which serious broke objc apps.
llvm-svn: 102359
2010-04-26 18:30:45 +00:00
Chris Lattner
e4a25eb35a Fix PR6921: globals were not getting correctly rounded up to their
preferred alignment unless they were common or some other special
case.

llvm-svn: 102300
2010-04-25 05:30:43 +00:00
Dan Gohman
8b1e26715e Revert 102135, 102129, 102127, 102106, 102104, 102102, 102012, 102004,
because 102004 causes codegen to emit invalid assembly on at least
x86_64-unknown-gnu-linux.

llvm-svn: 102155
2010-04-23 01:18:53 +00:00
Devang Patel
ce6eb17106 Add comment.
llvm-svn: 102129
2010-04-22 20:56:35 +00:00
Devang Patel
cf9bece3dd Adjust debug range offsets for isWeakForLinker() functions.
llvm-svn: 102127
2010-04-22 20:52:00 +00:00
Devang Patel
c58366a423 Rename InsnAfterLabelMap and InsnBeforeLabelMap.
llvm-svn: 102106
2010-04-22 18:43:35 +00:00
Devang Patel
bae79885a8 Keep track of MCSymbol used to mark beginning of a function.
llvm-svn: 102104
2010-04-22 18:39:21 +00:00
Devang Patel
4160348891 At this point Start and End are not null.
llvm-svn: 102102
2010-04-22 18:28:58 +00:00
Devang Patel
293567822a Add command line option to disable debug info printing in .s file. This option does not impact debug info generation and preservation through earlier compile starges.
llvm-svn: 102012
2010-04-21 19:08:53 +00:00
Devang Patel
158b496cd1 Identify when a lexical scope is split in to multiple instruction ranges. Emit such ranges using DW_AT_ranges.
llvm-svn: 102004
2010-04-21 16:32:19 +00:00
Evan Cheng
dbfb7dc438 Implement -disable-non-leaf-fp-elim which disable frame pointer elimination
optimization for non-leaf functions. This will be hooked up to gcc's
-momit-leaf-frame-pointer option. rdar://7886181

llvm-svn: 101984
2010-04-21 03:18:23 +00:00
Chris Lattner
b66b0c36cd Bill's change in r95336 broke empty aggregates embedded
in other types.  fix this by only bumping zero-byte globals
up to a single byte if the *entire global* is zero size,
fixing PR6340.

This also fixes empty arrays etc to be handled correctly,
and only does this on subsection-via-symbols targets (aka
darwin) which is the only place where this matters.

llvm-svn: 101879
2010-04-20 06:20:21 +00:00
Dan Gohman
c64745ba43 Remove MachineFunction's DefaultDebugLoc member, and make DwarfDebug.cpp
responsible for figuring out what that's supposed to be on its own.

llvm-svn: 101844
2010-04-20 00:37:27 +00:00
Devang Patel
06123c1012 Add DW_AT_APPLE_omit_frame_ptr to encode -fomit-frame-pointer flag.
llvm-svn: 101805
2010-04-19 19:14:02 +00:00
Dan Gohman
3dde4fe35f Add const qualifiers to TargetLoweringObjectFile usage.
llvm-svn: 101640
2010-04-17 16:44:48 +00:00
Dan Gohman
b5109cda0e Use const_cast instead of a C-style cast to cast away const.
llvm-svn: 101639
2010-04-17 16:43:55 +00:00
Devang Patel
1929d78e71 Add support to emit dwarf ranges.
llvm-svn: 101575
2010-04-16 23:33:45 +00:00
Dan Gohman
d48633d340 Fix a bunch of namespace polution.
llvm-svn: 101376
2010-04-15 17:08:50 +00:00
Dan Gohman
0e0b8cf9fd Add const qualifiers to CodeGen's use of LLVM IR constructs.
llvm-svn: 101334
2010-04-15 01:51:59 +00:00
Devang Patel
1b457aa5cd Add comment.
llvm-svn: 101317
2010-04-15 00:02:49 +00:00
Devang Patel
2374ea6452 There is no need to track compile unit offsets if there is only one compile unit.
llvm-svn: 101315
2010-04-14 23:56:24 +00:00
Devang Patel
321a86f14b Remove dead code.
llvm-svn: 101314
2010-04-14 23:54:13 +00:00
Devang Patel
4cc398507f Clear MachineInstr->MCSymbol maps at the end of a function.
llvm-svn: 101202
2010-04-14 01:18:28 +00:00
Devang Patel
7c2bc9dbfe Do not include types without any definition in pubtypes list.
llvm-svn: 101171
2010-04-13 20:35:04 +00:00
Devang Patel
55172d3571 Clear InsnsBeginScopeSet and InsnsEndScopeSet at the end of function.
llvm-svn: 100867
2010-04-09 16:04:20 +00:00
Chandler Carruth
362be7d46d Add a missing dependency to this library when building with CMake.
llvm-svn: 100852
2010-04-09 05:55:25 +00:00
Chris Lattner
1cf4bded13 move elf section uniquing to MCContext. Along the way
merge XCore's section into MCSectionELF

llvm-svn: 100812
2010-04-08 21:26:26 +00:00
Devang Patel
17b5b1dd88 Rename a function.
llvm-svn: 100797
2010-04-08 18:43:56 +00:00
Chris Lattner
f6e9c0c4bd implicit defs get added to the end of machine instrs sometimes. Scan the whole instruction for the metadata operand instead of assuming it will be at the end of the instruction.
llvm-svn: 100792
2010-04-08 18:20:52 +00:00
Devang Patel
89756fdbfc One instruction may start (or end) multiple lexical scopes.
There is no need to remember labels identifying regions marked by such instructions in each scope.

llvm-svn: 100781
2010-04-08 16:50:29 +00:00
Devang Patel
3cc4a24666 Remove dead code.
llvm-svn: 100771
2010-04-08 15:48:02 +00:00
Devang Patel
b9f9a00513 Delete out of date comment.
llvm-svn: 100769
2010-04-08 15:41:13 +00:00
Devang Patel
9ada7b28a2 Refactor.
llvm-svn: 100768
2010-04-08 15:37:09 +00:00
Benjamin Kramer
0fb23008bb Use twines to simplify calls to report_fatal_error. For code size and readability.
llvm-svn: 100756
2010-04-08 10:44:28 +00:00
Chris Lattner
393ea6fc22 introduce a new recoverable error handling API to LLVMContext
and use it in one place in inline asm handling stuff.  Before
we'd generate this for an invalid modifier letter:

$ clang asm.c -c -o t.o
fatal error: error in backend: Invalid operand found in inline asm: 'abc incl    ${0:Z}'
INLINEASM <es:abc incl    ${0:Z}>, 10, %EAX<def>, 2147483657, %EAX, 14, %EFLAGS<earlyclobber,def,dead>, <!-1>


Now we generate this:

$ clang asm.c -c -o t.o
error: invalid operand in inline asm: 'incl    ${0:Z}'
asm.c:3:12: note: generated from here
  __asm__ ("incl    %Z0" : "+r" (X));
           ^
1 error generated.

This is much better but still admittedly not great ("why" is the operand 
invalid??), codegen should try harder with its diagnostics :)

llvm-svn: 100723
2010-04-07 23:40:44 +00:00
Chris Lattner
80b41881bc rename llvm::llvm_report_error -> llvm::report_fatal_error
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
Chris Lattner
cc827ee016 tidy up
llvm-svn: 100700
2010-04-07 22:29:10 +00:00
Chris Lattner
7816ae8fd0 add a comment line that got dropped
llvm-svn: 100638
2010-04-07 18:10:38 +00:00
Benjamin Kramer
389c863692 Remove unused method.
llvm-svn: 100620
2010-04-07 11:23:46 +00:00
Torok Edwin
9028487b8b Workaround the breakage in r100616 by guarding all timers with
TimePassesIsEnabled. This should allow make check to pass.

llvm-svn: 100618
2010-04-07 10:44:46 +00:00
Bill Wendling
8282504a14 Use the "NamedGroupTimer" class to categorize DWARF emission better.
llvm-svn: 100616
2010-04-07 09:28:04 +00:00