Commit Graph

52809 Commits

Author SHA1 Message Date
Sanjiv Gupta a70798cc9a Allow targets to legalize operations (with illegal operands) that produces multiple values. For example, a load with an illegal operand (a load produces two values, a value and chain).
llvm-svn: 62663
2009-01-21 04:48:39 +00:00
Chris Lattner d9773516e7 Don't look up decls with no name (such as parameters and unnamed tagged types),
this removes 4266 calls to LookupDecl.

llvm-svn: 62662
2009-01-21 02:38:50 +00:00
Evan Cheng 201501995f Favors generating "not" over "xor -1". For example.
unsigned test(unsigned a) {
  return ~a;
}
llvm used to generate:
movl    $4294967295, %eax
xorl    4(%esp), %eax

Now it generates:
movl      4(%esp), %eax
notl      %eax

It's 3 bytes shorter.

llvm-svn: 62661
2009-01-21 02:09:05 +00:00
Dale Johannesen 287b4bc44e Disable on x86_64 until I figure out what's wrong.
llvm-svn: 62660
2009-01-21 02:08:30 +00:00
Daniel Dunbar a184754570 ccc: Implement file & path searching.
- Toolchain is responsible for providing list of prefixes to search.

 - Implement -print-file-name=xxx and -print-prog-name=xxx driver options.

llvm-svn: 62659
2009-01-21 02:03:52 +00:00
Anders Carlsson 43c2bab6d3 Fix more bugs I discovered
llvm-svn: 62656
2009-01-21 01:49:39 +00:00
Ted Kremenek b46aead702 Updated checker build.
llvm-svn: 62655
2009-01-21 01:41:30 +00:00
Daniel Dunbar 309052a84c ccc: Add --analyze test case.
llvm-svn: 62654
2009-01-21 01:22:37 +00:00
Daniel Dunbar 989ab477d2 ccc: Add --analyze driver mode (for running static analyzer).
- For now forces generation of plist files, need to think about the
   right interface.

 - Changed -fsyntax-only mode to be its own phase (more consistent).

 - Add -WA, for passing options verbatim to analyzer.

llvm-svn: 62649
2009-01-21 01:07:49 +00:00
Ted Kremenek 13747167ca Static Analyzer: When generating plists for errors reports, generate one plist file per translation unit that contains all of the diagnostics.
llvm-svn: 62647
2009-01-21 00:42:24 +00:00
Fariborz Jahanian 4b4c826999 Commented objective-c's metadata types. Minor clean up.
No change in functionality.

llvm-svn: 62646
2009-01-21 00:39:53 +00:00
Dale Johannesen b5721632ee Make special cases (0 inf nan) work for frem.
Besides APFloat, this involved removing code
from two places that thought they knew the
result of frem(0., x) but were wrong.

llvm-svn: 62645
2009-01-21 00:35:19 +00:00
Steve Naroff f6009ed969 Convert expressions over to Sebastian's spiffy ASTContext::new() operator.
No functionality change.

llvm-svn: 62640
2009-01-21 00:14:39 +00:00
Owen Anderson be7a29de0b Be more aggressive about renumbering vregs after splitting them.
llvm-svn: 62639
2009-01-21 00:13:28 +00:00
Devang Patel 19f2dd794e Encode member accessibility.
llvm-svn: 62638
2009-01-21 00:08:04 +00:00
Daniel Dunbar 47d16e53fe ccc: Unbreak -pipe handling broken in previous refactoring.
llvm-svn: 62637
2009-01-21 00:05:15 +00:00
Ted Kremenek 52f73cad4a Fix: <rdar://problem/6510344> [pth] PTH slows down regular lexer considerably (when it has substantial work)
Changes to IdentifierTable:
- High-level summary: StringMap never owns IdentifierInfos.  It just
references them.
- The string map now has StringMapEntry<IdentifierInfo*> instead of
  StringMapEntry<IdentifierInfo>.  The IdentifierInfo object is
  allocated using the same bump pointer allocator as used by the
  StringMap.

Changes to IdentifierInfo:
- Added an extra pointer to point to the
  StringMapEntry<IdentifierInfo*> in the string map.  This pointer
  will be null if the IdentifierInfo* is *only* used by the PTHLexer
  (that is it isn't in the StringMap).

Algorithmic changes:
- Non-PTH case:
   IdentifierInfo::get() will always consult the StringMap first to
   see if we have an IdentifierInfo object.  If that StringMapEntry
   references a null pointer, we allocate a new one from the BumpPtrAllocator
   and update the reference in the StringMapEntry.
- PTH case:
   We do the same lookup as with the non-PTH case, but if we don't get
   a hit in the StringMap we do a secondary lookup in the PTHManager for
   the IdentifierInfo.  If we don't find an IdentifierInfo we create a
   new one as in the non-PTH case.  If we do find and IdentifierInfo
   in the PTHManager, we update the StringMapEntry to refer to it so
   that the IdentifierInfo will be found on the next StringMap lookup.
   This way we only do a binary search in the PTH file at most once
   for a given IdentifierInfo.  This greatly speeds things up for source
   files containing a non-trivial amount of code.

Performance impact:
   While these changes do add some extra indirection in
   IdentifierTable to access an IdentifierInfo*, I saw speedups even
   in the non-PTH case as well.

   Non-PTH: For -fsyntax-only on Cocoa.h, we see a 6% speedup.
   PTH (with Cocoa.h in token cache): 11% speedup.

   I also did an experiment where we did -fsyntax-only on a source file
   including a large header and Cocoa.h, but the token cache did not
   contain the larger header.  For this file, we were seeing a performance
   *regression* when using PTH of 3% over non-PTH.  Now we are seeing
   a performance improvement of 9%!

Tests:
   The serialization tests are now failing.  I looked at this extensively,
   and I my belief is that this change is unmasking a bug rather than
   introducing a new one.  I have disabled the serialization tests for now.

llvm-svn: 62636
2009-01-20 23:28:34 +00:00
Daniel Dunbar 34fc92fdc2 Add -analyze action to run static analyzer, instead of inferring from
individual checker options.

llvm-svn: 62634
2009-01-20 23:17:32 +00:00
Devang Patel 6bbacbe372 Appropriately mark fowrad decls.
llvm-svn: 62625
2009-01-20 22:27:02 +00:00
Devang Patel 6fbec1c230 Need compile unit to find location.
llvm-svn: 62624
2009-01-20 22:26:11 +00:00
Sebastian Redl 20614a7c14 Provide a placement new taking an ASTContext argument.
This allows more concise syntax when allocating an object using the ASTContext's allocator.
Convert a few allocations to this operator to for test purposes.

llvm-svn: 62623
2009-01-20 22:23:13 +00:00
Dale Johannesen e75fdb0510 Calls to fmod, it turns out, are constant-folded by
invoking the host fmod, not by lowering to frem and
constant-folding that.  Fix this so it tests what I
want to test.

llvm-svn: 62622
2009-01-20 21:58:13 +00:00
Mike Stump c1b44ce610 Fix ccclib building when building in a separate build tree.
llvm-svn: 62621
2009-01-20 21:54:36 +00:00
Anders Carlsson 7322ea25a5 Fix some errors I noticed
llvm-svn: 62620
2009-01-20 21:51:44 +00:00
Chris Lattner f8a8c13c1e Don't bother running the assembler, we don't know that it will be configured
for whatever llc defaults to.  This fixes PR3363

llvm-svn: 62619
2009-01-20 21:41:53 +00:00
Daniel Dunbar de46097847 ccc: Allow downstream tools to be aware of final output name.
- This is a hack to allow the Darwin linker to get -final_output when
   doing universal builds; the mechanism should be generalized.

 - Handle multiple redundant -arch arguments correctly.

 - Forward -arch_multiple and -final_output to gcc when necessary.

 - Simplified implementation of derived gcc tools.

llvm-svn: 62618
2009-01-20 21:29:14 +00:00
Evan Cheng f1e873a221 Fix PR3243: a LiveVariables bug. When HandlePhysRegKill is checking whether the last reference is also the last def (i.e. dead def), it should also check if last reference is the current machine instruction being processed. This can happen when it is processing a physical register use and setting the current machine instruction as sub-register's last ref.
llvm-svn: 62617
2009-01-20 21:25:12 +00:00
Duncan Sands 363501d09b Fix typo. Patch by Alexei Svitkine.
llvm-svn: 62616
2009-01-20 21:20:23 +00:00
Bill Wendling 2395916c87 Use "SINT_TO_FP" instead of "UINT_TO_FP" when getting the exponent. This was
causing the limited precision stuff to produce the wrong result for values in
the range [0, 1).

llvm-svn: 62615
2009-01-20 21:17:57 +00:00
Mike Stump c9268d8eff Fix make test when configuring for a seperate build directory.
llvm-svn: 62614
2009-01-20 21:10:41 +00:00
Chris Lattner 5742c1edc4 Fix a crash Anders' was seeing due to free'ing an invalid pointer
caused by my previous commit.

llvm-svn: 62613
2009-01-20 21:06:38 +00:00
Steve Naroff e5564628b4 Convert more exprs to use ASTContext's Allocator.
When using a BumpPtrAllocator, this reduces malloc overhead from 2.2->1.9% (for Cocoa.h).

At this point, malloc() has dropped the fourth most expensive routine (behind Preprocessor::HandleIdentifier()).

llvm-svn: 62612
2009-01-20 21:06:31 +00:00
Douglas Gregor 82c1fe1cfc Use the ASTContext's allocator for FunctionTypeNoProto and TypeOfExpr
llvm-svn: 62611
2009-01-20 21:02:13 +00:00
Devang Patel bd7743d772 Fix struct member's debug info.
llvm-svn: 62610
2009-01-20 21:02:02 +00:00
Anders Carlsson 224fca8982 Improvements to Sema of asm statements. Fixes <rdar://problem/6156893>
llvm-svn: 62609
2009-01-20 20:49:22 +00:00
Fariborz Jahanian 2f85a6450a Detailed documentation for encoding of properties and a test
case.

llvm-svn: 62607
2009-01-20 20:04:12 +00:00
Steve Naroff 5faaef7692 Allocate expresssions through ASTContext (still more work to do).
Add debug hook to DeclContext.

llvm-svn: 62605
2009-01-20 19:53:53 +00:00
Evan Cheng 4022b7c3f4 Add test case for PR3154.
llvm-svn: 62604
2009-01-20 19:29:54 +00:00
Devang Patel bf7c6a90f5 indentation...
llvm-svn: 62603
2009-01-20 19:23:29 +00:00
Devang Patel 2333409d06 Need only one set of debug info versions enum.
llvm-svn: 62602
2009-01-20 19:22:03 +00:00
Fariborz Jahanian 218c630171 Improving on encoding of objective-c's property types. More to come.
llvm-svn: 62601
2009-01-20 19:14:18 +00:00
Evan Cheng c544cb0eca Change TargetInstrInfo::isMoveInstr to return source and destination sub-register indices as well.
llvm-svn: 62600
2009-01-20 19:12:24 +00:00
Chris Lattner 1ce41edd8d Optimize Declarator to avoid malloc/free traffic for the argument list of a
function DeclaratorChunk in common cases.  This uses a fixed array in 
Declarator when it is small enough for the first function declarator chunk
in a declarator.

This eliminates all malloc/free traffic from DeclaratorChunk::getFunction
when running on Cocoa.h except for five functions: signal/bsd_signal/sigset,
which have multiple Function DeclChunk's, and 
CFUUIDCreateWithBytes/CFUUIDGetConstantUUIDWithBytes, which take more than
16 arguments.

This patch was pair programmed with Steve.

llvm-svn: 62599
2009-01-20 19:11:22 +00:00
Devang Patel 72854c3811 zap white spaces.
llvm-svn: 62598
2009-01-20 19:08:39 +00:00
Devang Patel 6befc4d34e Fix global variable's address in a DIE.
llvm-svn: 62596
2009-01-20 18:55:39 +00:00
Devang Patel f0dae1aae3 Enable debug info for enums.
llvm-svn: 62594
2009-01-20 18:35:14 +00:00
Dale Johannesen fe750179ff Add an IEEE remainder function, which is not
fully implemented yet and not used.  This is
mainly to clarify that APFloat::mod implements
C fmod, not remainder.

llvm-svn: 62593
2009-01-20 18:35:05 +00:00
Chris Lattner 17844c7a88 improve compatibility with various versions of graphviz, patch by
Patrick Boettcher!

llvm-svn: 62592
2009-01-20 18:25:03 +00:00
Chris Lattner ca4881aeca eliminate use of uint32_t to improve compatibility with cygwin
llvm-svn: 62591
2009-01-20 18:23:14 +00:00
Chris Lattner 4612ae1f8e Eliminate use of uint32_t to improve compatibility with cygwin
llvm-svn: 62590
2009-01-20 18:22:57 +00:00