Commit Graph

68825 Commits

Author SHA1 Message Date
Jim Grosbach 372e9a389b Start of revamping the register scavenging in PEI. ARM Thumb1 is the driving
interest for this, as it currently reserves a register rather than using
the scavenger for matierializing constants as needed.

Instead of scavenging registers on the fly while eliminating frame indices,
new virtual registers are created, and then a scavenged collectively in a
post-pass over the function. This isolates the bits that need to interact
with the scavenger, and sets the stage for more intelligent use, and reuse,
of scavenged registers.

For the time being, this is disabled by default. Once the bugs are worked out,
the current scavenging calls in replaceFrameIndices() will be removed and
the post-pass scavenging will be the default. Until then,
-enable-frame-index-scavenging enables the new code. Currently, only the
Thumb1 back end is set up to use it.

llvm-svn: 82734
2009-09-24 23:52:18 +00:00
Anders Carlsson 6d2b6f49ce Improve the record layout dumper.
llvm-svn: 82733
2009-09-24 23:50:42 +00:00
Douglas Gregor 5013a7e42d When entering the scope of a declarator, make sure that the scope is
complete (or, possibly causing template instantiation).

Test this via some explicit specializations of member functions.

llvm-svn: 82732
2009-09-24 23:39:01 +00:00
Dale Johannesen c594890a82 Reenable sqrt IR generation test.
llvm-svn: 82731
2009-09-24 23:37:40 +00:00
John McCall 90d1c2df56 Make it really, really easy to change the alignment of Type (and ExtQuals).
llvm-svn: 82730
2009-09-24 23:30:46 +00:00
Mike Stump 944fa25934 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
Douglas Gregor 3a923c2d37 WIP implementation of explicit function template specialization. This
first implementation recognizes when a function declaration is an
explicit function template specialization (based on the presence of a
template<> header), performs template argument deduction + ambiguity
resolution to determine which template is being specialized, and hooks

There are many caveats here:
  - We completely and totally drop any explicitly-specified template
  arguments on the floor
  - We don't diagnose any of the extra semantic things that we should
  diagnose. 
  - I haven't looked to see that we're getting the right linkage for
  explicit specializations

On a happy note, this silences a bunch of errors that show up in
libstdc++'s <iostream>, although Clang still can't get through the
entire header.

llvm-svn: 82728
2009-09-24 23:14:47 +00:00
Mike Stump d6f9a2f90b Fix spacing.
llvm-svn: 82727
2009-09-24 23:11:08 +00:00
Douglas Gregor 9fb4bf4d57 Clean up the CodeCompletion testsuite's use of FileCheck
llvm-svn: 82726
2009-09-24 22:57:42 +00:00
Mike Stump d2a3e61798 Fix 80-col violation.
llvm-svn: 82725
2009-09-24 22:31:14 +00:00
Fariborz Jahanian 7a95d72b10 Patch fixes a code gen. bug in generation of objc_assign_ivar
(objc GC's API).

llvm-svn: 82724
2009-09-24 22:25:38 +00:00
John McCall 86a69495a3 Update the PTH performance "script".
llvm-svn: 82718
2009-09-24 22:03:45 +00:00
Chris Lattner f08d2db928 add and document regex support for FileCheck. You can now do stuff like:
; CHECK: movl {{%e[a-z][xi]}}, %eax

or whatever.

llvm-svn: 82717
2009-09-24 21:47:32 +00:00
Chris Lattner abab11abb2 unconditionally request MMI
llvm-svn: 82716
2009-09-24 21:45:57 +00:00
Chris Lattner 688f991b38 wrap long lines.
llvm-svn: 82715
2009-09-24 21:44:20 +00:00
Chris Lattner a2f8fc5a72 Use CanonicalizeInputFile to canonicalize the entire buffer containing the
CHECK strings, instead of canonicalizing the patterns directly.  This allows
Pattern to just contain a StringRef instead of std::string.

llvm-svn: 82713
2009-09-24 20:45:07 +00:00
Chris Lattner 74d50731c1 change 'not' matching to use Pattern, move pattern parsing logic into
the Pattern class.

llvm-svn: 82712
2009-09-24 20:39:13 +00:00
Chris Lattner 3b40b44528 refactor out the match string into its own Pattern class.
llvm-svn: 82711
2009-09-24 20:25:55 +00:00
Bob Wilson 6cd4aee5e9 Convert to FileCheck.
llvm-svn: 82710
2009-09-24 20:23:02 +00:00
David Goodwin bf97147a7e Make the end-of-itinerary mark explicit. Some cleanup.
llvm-svn: 82709
2009-09-24 20:22:50 +00:00
Dan Gohman c0ecc6f4f9 Add nounwind to this test.
llvm-svn: 82708
2009-09-24 20:20:08 +00:00
Chris Lattner 1ce83629df tidy up, fix a memory leak in Regex::isValid
llvm-svn: 82707
2009-09-24 20:15:51 +00:00
Steve Naroff a7753c492e Add test for C-based indexing API, using FileCheck utility.
llvm-svn: 82706
2009-09-24 20:03:06 +00:00
John McCall 8ccfcb51ee Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy.  Demote 'volatile' to extended-qualifier status.  Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right;  many more remain.

llvm-svn: 82705
2009-09-24 19:53:00 +00:00
Chris Lattner 6d98ede7e8 wpa is an experiment, don't build it by default, it adds to build times due to everything it links in.
llvm-svn: 82704
2009-09-24 19:45:12 +00:00
Anders Carlsson d934010557 Add a -dump-record-layouts argument to clang-cc.
llvm-svn: 82703
2009-09-24 18:54:49 +00:00
Ted Kremenek 0868eea3f0 When building CFGs, no longer reverse the statements in the CFGBlock. Instead
have the iterators and operator[] handle the traversal of statements, as they
are stored in reverse order. Tests show this has no real performance impact, but
it does simply the CFG construction logic and will make it slightly easier to
change the allocation strategy for CFGBlocks (as we have fewer copies).

llvm-svn: 82702
2009-09-24 18:45:41 +00:00
Dale Johannesen 68f971b1d6 Clarify that llvm attaches C language semantics to
functions with names that match the C library.

llvm-svn: 82701
2009-09-24 18:38:21 +00:00
Torok Edwin 21bd8c9fc5 Constant propagating byval pointer is safe if function is readonly.
llvm-svn: 82700
2009-09-24 18:33:42 +00:00
Victor Hernandez 46cd467310 Auto-upgrade malloc instructions to malloc calls.
Reviewed by Devang Patel.

llvm-svn: 82694
2009-09-24 17:47:49 +00:00
Bob Wilson 5fe313d6e0 Fix a hypothetical problem for targets with StackGrowsUp and a non-zero
LocalAreaOffset.  (We don't have any of those right now.)
PEI::calculateFrameObjectOffsets includes the absolute value of the
LocalAreaOffset in the cumulative offset value used to calculate the
stack frame size.  It then adds the raw value of the LocalAreaOffset
to the stack size.  For a StackGrowsDown target, that raw value is negative
and has the effect of cancelling out the absolute value that was added
earlier, but that obviously won't work for a StackGrowsUp target.  Change
to subtract the absolute value of the LocalAreaOffset.

llvm-svn: 82693
2009-09-24 16:42:27 +00:00
Devang Patel 4e6f2e46e8 Move parent assertion check before metadata deletion.
llvm-svn: 82692
2009-09-24 16:19:11 +00:00
Torok Edwin f95a450ef9 Don't constant propagate byval pointers, since they are not really pointers, but
rather structs passed by value.
This fixes PR5038.

llvm-svn: 82689
2009-09-24 09:47:18 +00:00
Daniel Dunbar a5840dbcb5 cmake: Run tests with 'verbose' enabled by default, so that the failure is
visible in the log.

llvm-svn: 82688
2009-09-24 07:18:36 +00:00
Daniel Dunbar c437eb831b We no longer need anything from the llvm/test/Scripts dir.
llvm-svn: 82687
2009-09-24 06:31:08 +00:00
Ted Kremenek 1b40e5978f Fix crash in RegionStoreManager::Bind() by using 'getAs<PointerType>()' instead of 'cast<PointerType>()' (to handle pointer typedefs).
llvm-svn: 82686
2009-09-24 06:24:32 +00:00
Daniel Dunbar 00dd448cff Add count/not tools as executables.
- Apparently, I'm willing to do incredibly stupid things in the name of portability.

llvm-svn: 82685
2009-09-24 06:23:57 +00:00
Chris Lattner 87d8f2b9d5 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
Chris Lattner 4e37f877b5 reapply r82348 with a fix, thanks Jeffrey.
llvm-svn: 82683
2009-09-24 05:38:36 +00:00
Anders Carlsson bb66bc8e84 More improvements with laying out empty bases.
llvm-svn: 82682
2009-09-24 05:21:31 +00:00
Daniel Dunbar b3b1e53d33 Darwin/x86-32: Enumerated types and block pointer types in structures were not
handled correctly.
 - <rdar://problem/7247671> Function arguments incorrect when function returns a
   struct on i386 w/ llvm-g++ and clang

llvm-svn: 82681
2009-09-24 05:12:36 +00:00
Ted Kremenek 267e45adab Fix: <rdar://problem/7249340> [RegionStore] model stores to symbolic parameter regions
The issue was a discrepancy between how RegionStoreManager::Bind() and
RegionStoreManager::Retrieve() derived the "key" for the first element
of a symbolic region.

llvm-svn: 82680
2009-09-24 04:11:44 +00:00
Anders Carlsson f24b18fb06 More work on empty classes.
llvm-svn: 82679
2009-09-24 03:22:10 +00:00
Anders Carlsson 6522b05db7 Scaffolding for supporting empty bases/fields.
llvm-svn: 82678
2009-09-24 03:13:30 +00:00
Evan Cheng 26ea28eb5f Fix PR5024 with a big hammer: disable the double-def assertion in the scavenger.
LiveVariables add implicit kills to correctly track partial register kills. This works well enough and is fairly accurate. But coalescer can make it impossible to maintain these markers. e.g.

        BL <ga:sss1>, %R0<kill,undef>, %S0<kill>, %R0<imp-def>, %R1<imp-def,dead>, %R2<imp-def,dead>, %R3<imp-def,dead>, %R12<imp-def,dead>, %LR<imp-def,dead>, %D0<imp-def>, ...
...
	%reg1031<def> = FLDS <cp#1>, 0, 14, %reg0, Mem:LD4[ConstantPool]
...
   	%S0<def> = FCPYS %reg1031<kill>, 14, %reg0, %D0<imp-use,kill>

When reg1031 and S0 are coalesced, the copy (FCPYS) will be eliminated the the implicit-kill of D0 is lost. In this case it's possible to move the marker to the FLDS. But in many cases, this is not possible. Suppose

	%reg1031<def> = FOO <cp#1>, %D0<imp-def>
...
   	%S0<def> = FCPYS %reg1031<kill>, 14, %reg0, %D0<imp-use,kill>

When FCPYS goes away, the definition of S0 is the "FOO" instruction. However, transferring the D0 implicit-kill to FOO doesn't work since it is the def of D0 itself. We need to fix this in another time by introducing a "kill" pseudo instruction to track liveness.

Disabling the assertion is not ideal, but machine verifier is doing that job now. It's important to know double-def is not a miscomputation since it means a register should be free but it's not tracked as free. It's a performance issue instead.

llvm-svn: 82677
2009-09-24 02:27:09 +00:00
Evan Cheng a21aac3811 Clean up LiveVariables and change how it deals with partial updates and kills. This also eliminate the horrible check which scan forward to the end of the basic block. It should be faster and more accurate.
llvm-svn: 82676
2009-09-24 02:15:22 +00:00
Jeffrey Yasskin a75d6bf3a8 Roll back r82348, which introduced an infinite loop in ParseCStringVector() that
a trivial unittest would have caught.  This revision also adds the trivial
unittest.

llvm-svn: 82675
2009-09-24 01:14:07 +00:00
Ted Kremenek d9120d3575 Shorten the static analyzer diagnostic for 'use of garbage value'.
llvm-svn: 82672
2009-09-24 00:44:26 +00:00
Fariborz Jahanian 20327b0422 Use Doug's DeclLoc to pinpoint location of the declaration
in a reference initialization diagnostic.

llvm-svn: 82671
2009-09-24 00:42:43 +00:00
Douglas Gregor c809cc2efa Improve diagnostic location information when checking the initialization of a reference
llvm-svn: 82666
2009-09-23 23:04:10 +00:00