Commit Graph

52887 Commits

Author SHA1 Message Date
Chris Lattner 77527f5812 Remove uses of uint32_t in favor of 'unsigned' for better
compatibility with cygwin.  Patch by Jay Foad!

llvm-svn: 62695
2009-01-21 18:09:24 +00:00
Daniel Dunbar f2e3d81cb4 ccc: Add appropriate file search prefixes when on x86_64 Darwin, and
look for crt3.o appropriately.

llvm-svn: 62694
2009-01-21 17:18:19 +00:00
Dan Gohman 7e6b932f18 Simplify ReduceLoadWidth's logic: it doesn't need several different
special cases after producing the new reduced-width load, because the
new load already has the needed adjustments built into it. This fixes
several bugs due to the special cases, including PR3317.

llvm-svn: 62692
2009-01-21 15:17:51 +00:00
Dan Gohman b43c8996f2 Fix a recent regression. ClrOpcode is not set for i8; for i8, if
we want to clear %ah to zero before a division, just use a
zero-extending mov to %al. This fixes PR3366.

llvm-svn: 62691
2009-01-21 14:50:16 +00:00
Mikhail Glushenkov 6a4f729dc9 Mimic gcc behaviour with regard to response files.
llvm-svn: 62688
2009-01-21 13:14:02 +00:00
Mikhail Glushenkov 1a0c083748 Fix 'llvm-config --libs' output.
Change the naming scheme for llvmc plugins so that they do not appear in
'llvm-config --libs' output.

llvm-svn: 62687
2009-01-21 13:05:00 +00:00
Mikhail Glushenkov fbc89cecad Change the hook API back to prevent memory leaks.
llvm-svn: 62686
2009-01-21 13:04:33 +00:00
Mikhail Glushenkov bf9716e15d Allow hooks with arguments.
llvm-svn: 62685
2009-01-21 13:04:00 +00:00
Duncan Sands d56cf3025f This was causing invalid memory accesses when
generating debug info in the compiler.

llvm-svn: 62684
2009-01-21 11:51:17 +00:00
Duncan Sands 1de451d0d0 Let's try to have our cake and eat it to: move
this test into FrontendC to ensure that llvm-gcc
is available; assemble using "llvm-gcc -xassembler"
rather than "as".

llvm-svn: 62683
2009-01-21 11:37:31 +00:00
Duncan Sands 696f4a8598 Don't rely on grep -w working.
llvm-svn: 62682
2009-01-21 09:41:42 +00:00
Sanjiv Gupta 335ea6cf2a Fixed build warnings. Restoring changes done in 62600, they were lost in 62655.
llvm-svn: 62681
2009-01-21 09:02:46 +00:00
Duncan Sands be7e41481b Cleanup whitespace and comments, and tweak some
prototypes, in operand type legalization.  No
functionality change.

llvm-svn: 62680
2009-01-21 09:00:29 +00:00
Owen Anderson fe48dfa0f2 I accidentally removed this check in an earlier commit, which cause breakage in the pre alloc splitter.
llvm-svn: 62678
2009-01-21 08:18:03 +00:00
Chris Lattner 3029b35faa merge two checks for identifiers in the pth loop into one.
llvm-svn: 62677
2009-01-21 07:50:06 +00:00
Chris Lattner 8256b970a3 a trivial micro optimization to save a load.
llvm-svn: 62676
2009-01-21 07:45:14 +00:00
Chris Lattner ad89ec013f Add a bit to IdentifierInfo that acts as a simple predicate which
tells us whether Preprocessor::HandleIdentifier needs to be called.
Because this method is only rarely needed, this saves a call and a
bunch of random checks.  This drops the time in HandleIdentifier 
from 3.52ms to .98ms on cocoa.h on my machine.

llvm-svn: 62675
2009-01-21 07:43:11 +00:00
Chris Lattner 66c6562e24 silence a couple unused variable 'result' warnings.
llvm-svn: 62674
2009-01-21 07:35:26 +00:00
Ted Kremenek 8d6c828728 Don't crash on empty PTH files. This fixes <rdar://problem/6512714>.
llvm-svn: 62673
2009-01-21 07:34:28 +00:00
Chris Lattner c950296006 really we only need on Read24!
llvm-svn: 62672
2009-01-21 07:28:57 +00:00
Chris Lattner 47def9787e revert my previous patch, it assumed endianness.
llvm-svn: 62671
2009-01-21 07:21:56 +00:00
Ted Kremenek ff6990d43b This test now passes using -analyzer-store-region.
llvm-svn: 62670
2009-01-21 07:13:46 +00:00
Ted Kremenek 8973cbfb21 This test now passes using -analyzer-store-region.
llvm-svn: 62669
2009-01-21 07:10:01 +00:00
Chris Lattner a74f7cbb9d minor cleanups: now that tokens are 4-byte aligned in a PTH
file, just load them directly as ints.

llvm-svn: 62668
2009-01-21 07:06:08 +00:00
Ted Kremenek fe32cc0ba6 Get RegionStore to work with the retain/release checker and its test cases.
Because the RegionStore can reason about values beyond the reasoning power of BasicStore, this patch splits some of the test cases for the retain/release checker to have versions that are handled by RegionStore (more warnings) and BasicStore (less warnings).

llvm-svn: 62667
2009-01-21 06:57:53 +00:00
Anders Carlsson dc6ceca4ba Fix an inline asm sema bug that I introduced.
llvm-svn: 62666
2009-01-21 06:27:20 +00:00
Sanjiv Gupta f737337707 Implement LowerOperationWrapper for legalizer.
Also a few signed comparison fixes.

llvm-svn: 62665
2009-01-21 05:44:05 +00:00
Scott Michel ed7d79fce4 CellSPU:
- Ensure that (operation) legalization emits proper FDIV libcall when needed.
- Fix various bugs encountered during llvm-spu-gcc build, along with various
  cleanups.
- Start supporting double precision comparisons for remaining libgcc2 build.
  Discovered interesting DAGCombiner feature, which is currently solved via
  custom lowering (64-bit constants are not legal on CellSPU, but DAGCombiner
  insists on inserting one anyway.)
- Update README.

llvm-svn: 62664
2009-01-21 04:58:48 +00:00
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