Commit Graph

119773 Commits

Author SHA1 Message Date
Sebastian Pop 99ab273a77 revert r147542 after comments from Joerg Sonnenberger
llvm-svn: 147608
2012-01-05 18:28:46 +00:00
Chris Lattner 8ff6bc924f allow clients of SmallSet to specify their own comparison function for the set.
Patch by Stepan Dyatkovskiy!

llvm-svn: 147607
2012-01-05 17:35:07 +00:00
Chandler Carruth eab5029964 Remove an unused variable.
llvm-svn: 147605
2012-01-05 11:25:47 +00:00
Chandler Carruth e041a30bb9 Prevent a DAGCombine from firing where there are two uses of
a combined-away node and the result of the combine isn't substantially
smaller than the input, it's just canonicalized. This is the first part
of a significant (7%) performance gain for Snappy's hot decompression
loop.

llvm-svn: 147604
2012-01-05 11:05:55 +00:00
Chandler Carruth 6bc151f5d4 Cleanup and FileCheck-ize a test.
llvm-svn: 147603
2012-01-05 11:05:47 +00:00
Craig Topper 29b0737452 Mark scalar FMA4 instructions as ignoring the VEX.L bit.
llvm-svn: 147602
2012-01-05 08:56:10 +00:00
Victor Umansky 9255b6d9fe Peephole optimization of ptest-conditioned branch in X86 arch. Performs instruction combining of sequences generated by ptestz/ptestc intrinsics to ptest+jcc pair for SSE and AVX.
Testing: passed 'make check' including LIT tests for all sequences being handled (both SSE and AVX)

Reviewers: Evan Cheng, David Blaikie, Bruno Lopes, Elena Demikhovsky, Chad Rosier, Anton Korobeynikov
llvm-svn: 147601
2012-01-05 08:46:19 +00:00
Eli Bendersky 88676cff61 test commit (verifyiing commit access)
llvm-svn: 147600
2012-01-05 08:18:41 +00:00
Richard Smith 69f90dce49 PR10828: Produce a warning when a no-arguments function is declared in block
scope, when no other indication is provided that the user intended to declare a
function rather than a variable.

Remove some false positives from the existing 'parentheses disambiguated as a
function' warning by suppressing it when the declaration is marked as 'typedef'
or 'extern'.

Add a new warning group -Wvexing-parse containing both of these warnings.

The new warning is enabled by default; despite a number of false positives (and
one bug) in clang's test-suite, I have only found genuine bugs with it when
running it over a significant quantity of real C++ code.

llvm-svn: 147599
2012-01-05 04:12:21 +00:00
Greg Clayton 0f6fb756a1 Bumped Xcode project versions for lldb-101 and debugserver-160.
llvm-svn: 147597
2012-01-05 04:00:49 +00:00
Greg Clayton e38a5edd9e Added code in the Host layer that can report system log messages
so that we don't have "fprintf (stderr, ...)" calls sprinkled everywhere.
Changed all needed locations over to using this.

For non-darwin, we log to stderr only. On darwin, we log to stderr _and_
to ASL (Apple System Log facility). This will allow GUI apps to have a place
for these error and warning messages to go, and also allows the command line
apps to log directly to the terminal.

llvm-svn: 147596
2012-01-05 03:57:59 +00:00
Eli Friedman 71c8055f8e More lambda work. Tweak the Sema interface slightly. Start adding the pieces to build the lambda class and its call operator. Create an actual scope for the lambda body.
llvm-svn: 147595
2012-01-05 03:35:19 +00:00
Andrew Trick 100af0adf7 Minor postra scheduler cleanup. It could result in more precise antidependence latency on ARM in exceedingly rare cases.
llvm-svn: 147594
2012-01-05 02:52:11 +00:00
Bill Wendling ac27f0c830 Replace the uint64_t -> double convertion algorithm with one that's more efficient.
This small bit of ASM code is sufficient to do what the old algorithm did:

     movq       %rax,  %xmm0
     punpckldq  (c0),  %xmm0  // c0: (uint4){ 0x43300000U, 0x45300000U, 0U, 0U }
     subpd      (c1),  %xmm0  // c1: (double2){ 0x1.0p52, 0x1.0p52 * 0x1.0p32 }
   #ifdef __SSE3__
     haddpd   %xmm0, %xmm0          
   #else
     pshufd   $0x4e, %xmm0, %xmm1 
     addpd    %xmm1, %xmm0
   #endif

It's arguably faster. One caveat, the 'haddpd' instruction isn't very fast on
all processors.
<rdar://problem/7719814>

llvm-svn: 147593
2012-01-05 02:13:20 +00:00
Sean Callanan c1b312a5c3 Fixed a potential hang while trying to execute
a function in the inferior.

llvm-svn: 147592
2012-01-05 02:00:14 +00:00
Chad Rosier 8fca6b268b [driver] Add support for passing -lazy_framework/-lazy_library to the linker.
rdar://10630328

llvm-svn: 147591
2012-01-05 01:56:11 +00:00
Johnny Chen cdc21d4c85 Add comment explaining the default constructor (ArchSpec) used in CreateTarget().
llvm-svn: 147590
2012-01-05 01:26:01 +00:00
Eli Friedman 918a6b05f4 Change casting slightly to avoid warnings about casting away const.
llvm-svn: 147589
2012-01-05 01:16:29 +00:00
Douglas Gregor 5c193c7ed6 When we're performing name lookup for a tag, we still allow ourselves
to see hidden declarations because every tag lookup is effectively a
redeclaration lookup. For example, image that

  struct foo;

is declared in a submodule that is known but hasn't been imported. If
someone later writes

  struct foo *foo_p;

then "struct foo" is either a reference or a redeclaration. To keep
the redeclaration chains sound, we treat it like a redeclaration for
name-lookup purposes.

llvm-svn: 147588
2012-01-05 01:11:47 +00:00
Sean Callanan 31a8d051dd Fixed a dangling pointer bug associated with the
result variable on a "finish" statement.  The
ownership of the result value was not being properly
assigned to the newly-created persistent result
variable; now it is.

llvm-svn: 147587
2012-01-05 01:11:09 +00:00
Kostya Serebryany 78d87d3b4b [asan] move {linux,mac}-specific code from asan_thread.cc to asan_{linux,mac}.cc; also add asan_procmaps.h which I forgot to add on previous commit.
llvm-svn: 147586
2012-01-05 01:07:27 +00:00
Andrew Trick 6feb3d6650 comment cleanup
llvm-svn: 147585
2012-01-05 01:01:01 +00:00
Devang Patel c5dbcbe4e6 Do not hard code asm variant number.
llvm-svn: 147583
2012-01-05 00:51:28 +00:00
Eli Friedman de958784d6 Minor cleanup; no functional change.
llvm-svn: 147582
2012-01-05 00:49:17 +00:00
Kostya Serebryany cd271f5440 [asan] implement our own /proc/self/maps reader and use it on linux instead of sysinfo.h
llvm-svn: 147581
2012-01-05 00:44:33 +00:00
Benjamin Kramer aca1885695 FileCheck hygiene.
llvm-svn: 147580
2012-01-05 00:43:34 +00:00
Jakob Stoklund Olesen d110e2a83f Reapply r146997, "Heed spill slot alignment on ARM."
Now that canRealignStack() understands frozen reserved registers, it is
safe to use it for aligned spill instructions.

It will only return true if the registers reserved at the beginning of
register allocation allow for dynamic stack realignment.

<rdar://problem/10625436>

llvm-svn: 147579
2012-01-05 00:26:57 +00:00
Jakob Stoklund Olesen 9cb477db25 Avoid reserving an ARM base pointer during register allocation.
Once register allocation has started the reserved registers are frozen.

Fix the ARM canRealignStack() hook to respect the frozen register state.
Now the hook returns false if register allocation was started with frame
pointer elimination enabled.

It also returns false if register allocation started without a reserved
base pointer, and stack realignment would require a base pointer.  This
bug was breaking oggenc on armv6.

No test case, an upcoming patch will use this functionality to realign
the stack for spill slots when possible.

llvm-svn: 147578
2012-01-05 00:26:52 +00:00
Jakob Stoklund Olesen d19d3cab09 Freeze reserved registers before starting register allocation.
The register allocators don't currently support adding reserved
registers while they are running.  Extend the MRI API to keep track of
the set of reserved registers when register allocation started.

Target hooks like hasFP() and needsStackRealignment() can look at this
set to avoid reserving more registers during register allocation.

llvm-svn: 147577
2012-01-05 00:26:49 +00:00
Argyrios Kyrtzidis e6e9d8f6a7 Sanity checks in SourceManager::getFileEntryForID() and SourceManager::getFileEntryForSLocEntry()
to make sure we do not crash. rdar://10594186

llvm-svn: 147576
2012-01-05 00:19:03 +00:00
John McCall a59dc2f8f0 The value of a const weak variable is not an integer constant.
llvm-svn: 147575
2012-01-05 00:13:19 +00:00
Douglas Gregor fcc54a3b91 If we already have a definition for a top-level module that we deserialized from a module file, don't bother parsing a new definition
llvm-svn: 147574
2012-01-05 00:12:00 +00:00
Fariborz Jahanian 088f1bc295 Fixes a code gen bug for setter code for a property of
c++ object reference type with trivial copy constructor.
This causes an assert crash and bad code gen. when assert 
is off. // rdar://6137845

llvm-svn: 147573
2012-01-05 00:10:16 +00:00
Douglas Gregor d2a8fe187d When generating includes for all of the headers we found in an
umbrella directory, skip includes for any headers that are part of an
unavailable module.

llvm-svn: 147572
2012-01-05 00:04:05 +00:00
Nick Kledzik 7735a7d1a0 Support more Atom attributes. Add more test cases to lld-core
llvm-svn: 147571
2012-01-04 23:58:17 +00:00
Anna Zaks e04dadc248 [analyzer] Add another tests to taint tester.
llvm-svn: 147570
2012-01-04 23:54:04 +00:00
Anna Zaks 8158ef0dec [analyzer] Be less pessimistic about invalidation of global variables
as a result of a call.

Problem:
Global variables, which come in from system libraries should not be
invalidated by all calls. Also, non-system globals should not be
invalidated by system calls.

Solution:
The following solution to invalidation of globals seems flexible enough
for taint (does not invalidate stdin) and should not lead to too
many false positives. We split globals into 3 classes:

* immutable - values are preserved by calls (unless the specific
global is passed in as a parameter):
     A :  Most system globals and const scalars

* invalidated by functions defined in system headers:
     B: errno

* invalidated by all other functions (note, these functions may in
turn contain system calls):
     B: errno
     C: all other globals (which are not in A nor B)

llvm-svn: 147569
2012-01-04 23:54:01 +00:00
Anna Zaks 5acd9603da [analyzer] Correct the error message in the testing infrastructure.
llvm-svn: 147568
2012-01-04 23:53:50 +00:00
Ted Kremenek dec9d12fc4 Rename attribute 'objc_suppress_autosynthesis' to 'objc_disable_automatic_synthesis'.
llvm-svn: 147567
2012-01-04 23:51:09 +00:00
Ted Kremenek 778d2bb8d4 Fix 80 col violations.
llvm-svn: 147566
2012-01-04 23:48:37 +00:00
Eli Friedman 50c9d08fa5 Fix test on Release builds.
llvm-svn: 147565
2012-01-04 23:41:09 +00:00
Douglas Gregor eb90e83085 Store the submodules of a module in source order, as they are stored
in the module map. This provides a bit more predictability for the
user, as well as eliminating the need to sort the submodules when
serializing them.

llvm-svn: 147564
2012-01-04 23:32:19 +00:00
Fariborz Jahanian f716839580 Test case for my previous patch.
llvm-svn: 147563
2012-01-04 23:16:48 +00:00
Fariborz Jahanian 783ffde6d3 objc: When issuing warning for missing synthesis for
properties in classes declared with objc_suppress_autosynthesis
attribute, pinpoint location of the said class in a note.

llvm-svn: 147562
2012-01-04 23:16:13 +00:00
Eli Friedman fd5e54da2d Add an APValue representation for the difference between two address-of-label expressions. Add support to Evaluate and CGExprConstant for generating/handling them. Remove the special-case for such differences in Expr::isConstantInitializer.
With that done, remove a bunch of buggy code from CGExprConstant for handling scalar expressions which is no longer necessary.

Fixes PR11705.

llvm-svn: 147561
2012-01-04 23:13:47 +00:00
Dan Gohman 7ac046a261 Generalize isSafeToSpeculativelyExecute to work on arbitrary
Values, rather than just Instructions, since it's interesting
for ConstantExprs too.

llvm-svn: 147560
2012-01-04 23:01:09 +00:00
Greg Clayton 96c09687bc <rdar://problem/10507811>
Be better at detecting when DWARF changes and handle this more
gracefully than asserting and exiting.

Also fixed up a bunch of system calls that weren't properly checking
for EINTR.

llvm-svn: 147559
2012-01-04 22:56:43 +00:00
Chris Lattner 3ad9042456 fix test on -Asserts builds.
llvm-svn: 147558
2012-01-04 22:51:21 +00:00
Chris Lattner 36bc4f41bc implement rdar://10639962 by keeping track of increased alignment
information even in subscripting operations.

llvm-svn: 147557
2012-01-04 22:35:55 +00:00
Ted Kremenek cc0cf90953 Add missing #endif in documentation.
llvm-svn: 147556
2012-01-04 22:35:02 +00:00