Commit Graph

131889 Commits

Author SHA1 Message Date
Jordan Rose 51bcb226a2 [analyzer] Try to devirtualize even if the static callee has no definition.
This mostly affects pure virtual methods, but would also affect parent
methods defined inline in the header when analyzing the child's source file.

llvm-svn: 161709
2012-08-10 22:26:43 +00:00
Jordan Rose 13937b1d7a [analyzer] Add clang_analyzer_checkInlined for debugging purposes.
This check is also accessible through the debug.ExprInspection checker.
Like clang_analyzer_eval, you can use it to test the analyzer engine's
current state; the argument should be true or false to indicate whether or
not you expect the function to be inlined.

When used in the positive case (clang_analyzer_checkInlined(true)), the
analyzer prints the message "TRUE" if the function is ever inlined. However,
clang_analyzer_checkInlined(false) should never print a message; this asserts
that there should be no paths on which the current function is inlined, but
then there are no paths on which to print a message! (If the assertion is
violated, the message "FALSE" will be printed.)

This asymmetry comes from the fact that the only other chance to print a
message is when the function is analyzed as a top-level function. However,
when we do that, we can't be sure it isn't also inlined elsewhere (such as
in a recursive function, or if we want to analyze in both general or
specialized cases). Rather than have all checkInlined calls have an appended,
meaningless "FALSE" or "TOP-LEVEL" case, there is just no message printed.

void clang_analyzer_checkInlined(int);

For debugging purposes only!

llvm-svn: 161708
2012-08-10 22:26:29 +00:00
Fariborz Jahanian 29622c1f0b objective-C: test for delayed parsing of K&R funcitons
inside objc class implementation. // rdar://10387088

llvm-svn: 161705
2012-08-10 22:01:36 +00:00
Jim Ingham e9ce62b663 Use the file completer for "process launch" arguments.
<rdar://problem/11274012>

llvm-svn: 161704
2012-08-10 21:48:41 +00:00
Chad Rosier baf53f9ff8 [ms-inline asm] Avoid extra allocations by making this an array of StringRefs.
llvm-svn: 161703
2012-08-10 21:36:25 +00:00
Manman Ren 804137fd75 Add comments for turning on byval
llvm-svn: 161702
2012-08-10 21:32:09 +00:00
Chad Rosier f32302a7d9 [ms-inline asm] PatchMSAsmString() doesn't correctly patch non-simple asm
statements.  Therefore, we can't pass the PatchedAsmString to the AsmParser
and expect things to work.

llvm-svn: 161701
2012-08-10 21:27:11 +00:00
Eli Friedman dc009da2a8 Don't emit an invoke whose normal destination is a landingpad. Fixes test
regression on test/CodeGenObjC/2008-10-3-EhValue.m on non-Darwin targets.

llvm-svn: 161700
2012-08-10 21:26:17 +00:00
Fariborz Jahanian f64b4722eb objective-C++: dalyed parsing of ctors with member
initializer list defined inside an objc class
implementation. wip

llvm-svn: 161699
2012-08-10 21:15:06 +00:00
Chad Rosier d6ef704fe4 [ms-inline asm] Fix a memory leak introduced in r161686.
llvm-svn: 161698
2012-08-10 21:06:19 +00:00
Eli Friedman 4c923b3b3f The normal edge of an invoke is not allowed to branch to a block with a
landingpad.  Enforce it in the verifier, and fix the regression tests to match.

llvm-svn: 161697
2012-08-10 20:55:20 +00:00
Jason Molenda 4210713491 Remove a little unuseful output from the UnwindPlan::Row::Dump and UnwindPlan::Dump methods.
llvm-svn: 161696
2012-08-10 20:52:59 +00:00
Ted Kremenek 5d858cb916 Fix horrible regression in control of warnings caused by introduction of -Wpedantic.
While -Wpedantic was reasonable, -Wno-pedantic would turn off a bunch of warnings that
are on by default.  This counters the intention of this warning flag.

To fix this, -Wpedantic now includes extentions that are not on by default.  The
remaining warnings will manifest anyway, and won't accidentally get turned off
by -Wno-pedantic.

Fixes <rdar://problem/12076105>

llvm-svn: 161695
2012-08-10 20:50:00 +00:00
Manman Ren d4badd7420 ARM: enable struct byval for AAPCS.
rdar://9877866
PR://13350

llvm-svn: 161694
2012-08-10 20:42:31 +00:00
Manman Ren e201e27eb1 ARM: enable struct byval for AAPCS.
This change is to be enabled in clang.

rdar://9877866
PR://13350

llvm-svn: 161693
2012-08-10 20:39:38 +00:00
Fariborz Jahanian 053227f808 objective-C++: delay parsing of ctor with try block
with member initializer list defined inside
an objc implementation block. wip.

llvm-svn: 161692
2012-08-10 20:34:17 +00:00
DeLesley Hutchins 0c90c2bc4b Thread-safety-analysis: adds existential quantification over lock
expressions.  The syntax &MyClass::mutex is interpreted as a
pattern that matches m->mutex for any object m of type MyClass.

llvm-svn: 161691
2012-08-10 20:29:46 +00:00
DeLesley Hutchins 9b1d72f3e3 Thread safety analysis: refactor to support more sophisticated handling
of expressions, and better error messages.

llvm-svn: 161690
2012-08-10 20:19:55 +00:00
Jakob Stoklund Olesen 0a99062cf6 Add getTPred() and getFPred() functions.
They identify the PHI predecessors in both diamonds and triangles.

llvm-svn: 161689
2012-08-10 20:19:17 +00:00
Jakob Stoklund Olesen 0954d4199a Include loop-carried dependencies when computing instr heights.
When a trace ends with a back-edge, include PHIs in the loop header in
the height computations. This makes the critical path through a loop
more accurate by including the latencies of the last instructions in the
loop.

llvm-svn: 161688
2012-08-10 20:11:38 +00:00
Michael Liao 5248e9913f add X86-specific DAG optimization to simplify boolean test
- if a boolean test (X86ISD::CMP or X86ISD:SUB) checks a boolean value
  generated from X86ISD::SETCC, try to simplify the boolean value
  generation and checking by reusing the original EFLAGS with proper
  condition code
- add hooks to X86 specific SETCC/BRCOND/CMOV, the major 3 places
  consuming EFLAGS

part of patches fixing PR12312

llvm-svn: 161687
2012-08-10 19:58:13 +00:00
Chad Rosier a7020aee00 [ms-inline asm] Add clobbers to AST representation.
llvm-svn: 161686
2012-08-10 19:13:14 +00:00
Dylan Noblesmith 8d48c8c675 Frontend: define _LP64 in a target-independent way
Instead of adding it to each individual subclass in
Targets.cpp, simply check the appropriate target
values.

Where before it was only on x86_64 and ppc64, it's now
also defined on mips64 and nvptx64.

Also add a bunch of negative tests to ensure it is *not*
defined on any other architectures while we're here.

llvm-svn: 161685
2012-08-10 19:12:37 +00:00
Johnny Chen 01c0d4ec1f Add command completion test case for 'watchpoint command'.
llvm-svn: 161684
2012-08-10 19:05:48 +00:00
Anna Zaks d4e65373f3 [analyzer] ObjC Inlining: add tests for ivars and properties.
TODO:
 - Handle @syncronized properties.
 - Always inline properties declared publicly (do not split the path).
This is tricky since there is no mapping from a Decl to the property in
the AST as far as I can tell.

llvm-svn: 161683
2012-08-10 18:56:01 +00:00
Anna Zaks 75f49a9c07 [analyzer] Track if a region can be a subclass in the dynamic type info.
When object is allocated with alloc or init, we assume it cannot be a
subclass (currently used only for bifurcation purposes).

llvm-svn: 161682
2012-08-10 18:55:58 +00:00
Anna Zaks 920af014c1 [analyzer] Optimize dynamic dispatch bifurcation by detecting the cases
when we don't need to split.

In some cases we know that a method cannot have a different
implementation in a subclass:
 - the class is declared in the main file (private)
 - all the method declarations (including the ones coming from super
classes) are in the main file.

This can be improved further, but might be enough for the heuristic.
(When we are too aggressive splitting the state, efficiency suffers.
When we fail to split the state coverage might suffer.)

llvm-svn: 161681
2012-08-10 18:55:53 +00:00
DeLesley Hutchins c9776faa4f Refactor thread safety analysis to use a different data structure
to track locksets.  This is in preparation for further changes.

llvm-svn: 161680
2012-08-10 18:39:05 +00:00
Sean Callanan d2a5a90148 Fixed a potential crash where we attempt to read
an invalid register.

<rdar://problem/12065366>

llvm-svn: 161679
2012-08-10 18:35:24 +00:00
Eli Bendersky c52863cd36 A couple of addition comment fixes
llvm-svn: 161678
2012-08-10 18:30:44 +00:00
Eli Bendersky 870d057ec8 Fix a couple of typos in comments
llvm-svn: 161677
2012-08-10 18:26:20 +00:00
Chad Rosier 3674ebaa6b [ms-inline asm] Use asserts as these calls are now guarded by identical checks.
llvm-svn: 161676
2012-08-10 18:20:12 +00:00
Fariborz Jahanian 8cecfe9fc9 objective-C++: delayed parsing of member function with
function-try-block occuring in objc's implementation
block. wip.

llvm-svn: 161675
2012-08-10 18:10:56 +00:00
Chad Rosier 02a8439730 Whitespace.
llvm-svn: 161673
2012-08-10 17:56:09 +00:00
Rafael Espindola 64e7b5703e Constify some basic blocks, no functionality change.
llvm-svn: 161668
2012-08-10 15:55:25 +00:00
Fariborz Jahanian 712bb81a6d objective-C++: Delayed parsing of most common
member functions defined inside an objc class
implementation. wip.

llvm-svn: 161667
2012-08-10 15:54:40 +00:00
Alexey Samsonov b93df94238 [ASan] share code executed at the beginning/end of printing error reports
llvm-svn: 161666
2012-08-10 15:13:05 +00:00
Alexey Samsonov fb844c7eff [ASan] CMake support for building ASan runtime as a universal binary on Mac
llvm-svn: 161665
2012-08-10 14:45:52 +00:00
Michael Liao ea7d906b0f remove tailing whitespaces and test commit
llvm-svn: 161664
2012-08-10 14:39:24 +00:00
Rafael Espindola 1187077f81 Move BasicBlockEdge to the cpp file. No functionality change.
llvm-svn: 161663
2012-08-10 14:05:55 +00:00
Alexander Potapenko 33c028fa05 Remove the setjmp.h dependency, fix the comment.
llvm-svn: 161662
2012-08-10 12:46:39 +00:00
Alexander Potapenko 2cdd4f165e Temporary fix for http://code.google.com/p/address-sanitizer/issues/detail?id=99:
when trying to free memory that actually belongs to the system purgeable zone, use malloc_zone_free(malloc_default_purgeable_zone(), ptr) instead of asan_free().

llvm-svn: 161661
2012-08-10 11:33:01 +00:00
Joerg Sonnenberger 42cf26883e Add missing cctype includes.
llvm-svn: 161660
2012-08-10 10:58:18 +00:00
Joerg Sonnenberger 8c02a241f4 Decrementing std::string::end is not portable, use array access instead.
llvm-svn: 161659
2012-08-10 10:57:52 +00:00
Joerg Sonnenberger c0697304c9 stdcxx's cstdio doesn't include stdio.h, but the code using PathV2.inc
includes both. Deal with feof and ferror potentially being macros.

llvm-svn: 161658
2012-08-10 10:56:09 +00:00
Joerg Sonnenberger aa2f801ca3 Add some missing includes for the build against stdcxx.
llvm-svn: 161657
2012-08-10 10:53:56 +00:00
Benjamin Kramer 3a913ed805 Fix a couple of pedantic gcc warnings.
llvm-svn: 161656
2012-08-10 10:06:13 +00:00
NAKAMURA Takumi 5c10810754 c-arcmt-test, c-index-test: Appease Cygwin, to link to libclang.a, not clang.dll.
llvm-svn: 161655
2012-08-10 06:10:58 +00:00
Pete Cooper 0deca6be79 Fix crash when when do lto on Bullet. Dynamic GEPs in SROA were incorrectly being applied to all accesses to an alloca, not just the ones which read from the GEP. Thanks to Evan for reducing the test. rdar://11861001
llvm-svn: 161654
2012-08-10 03:26:36 +00:00
Jakob Stoklund Olesen 8c28ac9ec9 Update edge weights correctly in replaceSuccessor().
When replacing Old with New, it can happen that New is already a
successor. Add the old and new edge weights instead of creating a
duplicate edge.

llvm-svn: 161653
2012-08-10 03:23:27 +00:00