Commit Graph

130238 Commits

Author SHA1 Message Date
Greg Clayton 53eb7ad2f7 <rdar://problem/11852100>
The "stop-line-count-after" and "stop-line-count-before" settings are broken. This fixes them.

llvm-svn: 160071
2012-07-11 20:33:48 +00:00
Jordan Rose 1fa2acaed4 Start testing some commented-out cases of badly-formed __has_include.
Filed PR13334 for the cases that cause the compiler to crash, and
PR13335 for the cases where we should be recovering more gracefully.

llvm-svn: 160070
2012-07-11 20:12:19 +00:00
Chad Rosier 8446ede023 [x86 fast-isel] Per discussion with Eric, add all cases to switch with verbose
comments.

llvm-svn: 160069
2012-07-11 19:58:38 +00:00
Jordan Rose b13eb8dca5 Allow -verify directives to be filtered by preprocessing.
This is accomplished by making VerifyDiagnosticsConsumer a CommentHandler,
which then only reads the -verify directives that are actually in live
blocks of code. It also makes it simpler to handle -verify directives that
appear in header files, though we still have to manually reparse some files
depending on how they are generated.

This requires some test changes. In particular, all PCH tests now have their
-verify directives outside the "header" portion of the file, using the @line
syntax added in r159978. Other tests have been modified mostly to make it
clear what is being tested, and to prevent polluting the expected output with
the directives themselves.

Patch by Andy Gibbs! (with slight modifications)

The new Frontend/verify-* tests exercise the functionality of this commit,
as well as r159978, r159979, and r160053 (Andy's other -verify enhancements).

llvm-svn: 160068
2012-07-11 19:58:23 +00:00
Akira Hatanaka 20dced4dbb Test case for r160036.
llvm-svn: 160067
2012-07-11 19:50:46 +00:00
Manman Ren 1553ce0e81 X86: Update to peephole optimization to move Movr0 before (Sub, Cmp) pair.
When Movr0 is between sub and cmp, we move Movr0 before sub if it enables
removal of Cmp.

llvm-svn: 160066
2012-07-11 19:35:12 +00:00
Akira Hatanaka 24cf4e36e5 Implement MipsTargetLowering::LowerSELECT_CC to custom lower SELECT_CC.
llvm-svn: 160064
2012-07-11 19:32:27 +00:00
Daniel Jasper 30cd116039 Move CompileAssert into namespace clang::ast_matchers:: to avoid naming
collisions until it is properly integrated in llvm/Support.

llvm-svn: 160063
2012-07-11 19:22:37 +00:00
Nick Kledzik 35293305b7 <rdar://problem/11668446> Add .subsections_via_symbols to Darwin assembly files
llvm-svn: 160062
2012-07-11 19:21:39 +00:00
Daniel Jasper bb89ae9392 Add a hook to supply a custom CompilationDatabase. To add a custom CompilationDatabase, make it implement findCompilationDatabaseForDirectory in CustomCompilationDatabase.h and set USE_COSTUM_COMPILATION_DATABASE.
Differential Revision: http://llvm-reviews.chandlerc.com/D4

llvm-svn: 160061
2012-07-11 19:13:13 +00:00
Chad Rosier 4dce73af05 [driver] Fix so that clang can find correct path prefix for libc object files
from GNU binutils supporting multi-arch folder for ARM target.
Patch by Jiangning Liu <jiangning.liu@arm.com>.

llvm-svn: 160060
2012-07-11 19:08:21 +00:00
Evan Cheng b17122859b InstrEmitter::EmitSubregNode() optimize extract_subreg in this case:
r1025 = s/zext r1024, 4
r1026 = extract_subreg r1025, 4

to a copy:
r1026 = copy r1024

This is correct. However it uses TII->isCoalescableExtInstr() which can return
true for instructions which essentially does a sext_in_reg so this can end up
with an illegal copy where the source and destination register classes do not
match. Add a check to avoid it. Sorry, no test case possible at this time.

rdar://11849816

llvm-svn: 160059
2012-07-11 18:55:07 +00:00
Benjamin Kramer 3aab6a86a2 PR13326: Fix a subtle edge case in the udiv -> magic multiply generator.
This caused 6 of 65k possible 8 bit udivs to be wrong.

llvm-svn: 160058
2012-07-11 18:31:59 +00:00
Rafael Espindola 1fa9fade38 Handle #pragma visibility in explicit specializations and enums.
llvm-svn: 160057
2012-07-11 18:14:09 +00:00
Tom Stellard 73daa0f740 test commit
llvm-svn: 160056
2012-07-11 17:34:12 +00:00
Chad Rosier 43218c59c3 [x86 fast-isel] Rather then call llvm_unreachable() have fast-isel fall back
to Selection DAG isel.  Patch by Andrew Kaylor <andrew.kaylor@intel.com>.

llvm-svn: 160055
2012-07-11 17:23:17 +00:00
Nico Weber 50661442a9 Mention -fms-compatibility and -fdelayed-template-parsing in UsersManual.
Also mention that -std=c++11 is now on by default on windows.

llvm-svn: 160054
2012-07-11 16:56:28 +00:00
Jordan Rose 6f524ac9f0 Emit -verify diagnostics even when we have a fatal error.
Previously we'd halt at the fatal error as expected, but not actually emit
any -verify-related diagnostics. This lets us catch cases that emit a
/different/ fatal error from the one we expected.

This is implemented by adding a "force emit" mode to DiagnosticBuilder, which
will cause diagnostics to immediately be emitted regardless of current
suppression. Needless to say this should probably be used /very/ sparingly.

Patch by Andy Gibbs! Tests for all of Andy's -verify patches coming soon.

llvm-svn: 160053
2012-07-11 16:50:36 +00:00
Nico Weber cc19aec7ae Default to -std=c++11 on Windows.
llvm-svn: 160052
2012-07-11 16:46:17 +00:00
Nico Weber 6320b5213e Remove unused override of CompilerInvocation::setLangDefaults().
llvm-svn: 160051
2012-07-11 16:15:04 +00:00
Justin Holewinski 5fafdd9d1d Fix handling of curly braces in NVPTX inline asm
Fixes bug 13322

Patch by Dmitry Mikushin

llvm-svn: 160050
2012-07-11 15:34:55 +00:00
Eric Christopher f8b9809fab Temporarily revert this to see if it brings the gdb bot back.
llvm-svn: 160049
2012-07-11 15:32:13 +00:00
Daniel Jasper 1808bbedaf Fix usage instructions for clang-check.
llvm-svn: 160048
2012-07-11 15:05:24 +00:00
Alexander Kornienko 442b55fc28 How to set up clang tools for llvm
Summary: How to guide for setting up clang tooling for llvm repo.

Test Plan: this is untested

Reviewers: klimek, djasper

Reviewed By: klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D3

llvm-svn: 160047
2012-07-11 14:27:44 +00:00
Nadav Rotem d2bdcebb14 When ext-loading and trunc-storing vectors to memory, on x86 32bit systems, allow loads/stores of 64bit values from xmm registers.
llvm-svn: 160044
2012-07-11 13:27:05 +00:00
NAKAMURA Takumi b59973e6cd clang/test/Misc/diag-template-diffing-color.cpp: Introduce the feature 'ansi-escape-sequences'.
llvm-svn: 160043
2012-07-11 11:44:00 +00:00
Nadav Rotem 2a148668b6 Rename many of the Tmp1, Tmp2, Tmp3 variables to names such as Chain, Value, Ptr, etc.
No functionality change.

llvm-svn: 160042
2012-07-11 11:02:16 +00:00
Axel Naumann 23c1676dee LLVM_ON_WIN32 case: use the proper key in the UniqueFiles map.
llvm-svn: 160041
2012-07-11 09:41:34 +00:00
Benjamin Kramer 9488100d46 Remove unused variable.
llvm-svn: 160040
2012-07-11 09:39:04 +00:00
Richard Smith 4c50ea27bf Add missing #include <stdlib.h> into test which uses ::exit.
llvm-svn: 160039
2012-07-11 09:37:56 +00:00
Richard Smith ceefe51364 Teach libc++ to check for libc++abi and use its features if they're available.
llvm-svn: 160038
2012-07-11 09:35:47 +00:00
Nadav Rotem de6fd282ef Refactor the DAG Legalizer by extracting the legalization of
Load and Store nodes into their own functions.
No functional change.

llvm-svn: 160037
2012-07-11 08:52:09 +00:00
Owen Anderson b8844d6744 Only apply the SETCC+SITOFP -> SELECTCC optimization when the SETCC returns an MVT::i1, i.e. before type legalization.
This is a speculative fix for a problem on Mips reported by Akira Hatanaka.

llvm-svn: 160036
2012-07-11 06:38:55 +00:00
Rafael Espindola 5f0a1b89d7 Don't process #pragma visibility during instantiation. The visibility of the
instantiation depends on the template, its arguments and parameters, but not
where it is instantiated.

llvm-svn: 160034
2012-07-11 02:15:51 +00:00
Eric Christopher 2977378974 The end of a block doesn't necessarily need a line table entry unless
there's something going on there. Remove the unconditional line entry
and only add one if we're emitting cleanups (any other statements
would be handled normally).

Fixes rdar://9199234

llvm-svn: 160033
2012-07-11 01:49:26 +00:00
Eric Christopher 296a710b5b FileCheck-ize.
llvm-svn: 160032
2012-07-11 01:49:24 +00:00
Akira Hatanaka 878ad8b28d Lower RETURNADDR node in Mips backend.
Patch by Sasa Stankovic.

llvm-svn: 160031
2012-07-11 00:53:32 +00:00
Jordan Rose 8889cf008d [analyzer] Add debug.DumpCalls, which prints out any CallEvents it sees.
This is probably not so useful yet because it is not path-sensitive, though
it does try to show inlining with indentation.

This also adds a dump() method to CallEvent, which should be useful for
debugging.

llvm-svn: 160030
2012-07-10 23:56:23 +00:00
Jordan Rose 6cd16c5152 [analyzer] Guard against C++ member functions that look like system functions.
C++ method calls and C function calls both appear as CallExprs in the AST.
This was causing crashes for an object that had a 'free' method.

<rdar://problem/11822244>

llvm-svn: 160029
2012-07-10 23:13:01 +00:00
Jack Carter e8cb2fc616 Mips specific inline asm operand modifier 'L'.
Low order register of a double word register operand. Operands 
   are defined by the name of the variable they are marked with in
   the inline assembler code. This is a way to specify that the 
   operand just refers to the low order register for that variable.
   
   It is the opposite of modifier 'D' which specifies the high order
   register.
   
   Example:
   
 main()
{

    long long ll_input = 0x1111222233334444LL;
    long long ll_val = 3;
    int i_result = 0;

    __asm__ __volatile__( 
		   "or	%0, %L1, %2"
	     : "=r" (i_result) 
	     : "r" (ll_input), "r" (ll_val)); 
}

   Which results in:
   
   	lui	$2, %hi(_gp_disp)
	addiu	$2, $2, %lo(_gp_disp)
	addiu	$sp, $sp, -8
	addu	$2, $2, $25
	sw	$2, 0($sp)
	lui	$2, 13107
	ori	$3, $2, 17476     <-- Low 32 bits of ll_input
	lui	$2, 4369
	ori	$4, $2, 8738      <-- High 32 bits of ll_input
	addiu	$5, $zero, 3  <-- Low 32 bits of ll_val
	addiu	$2, $zero, 0  <-- High 32 bits of ll_val
	#APP
	or	$3, $4, $5        <-- or i_result, high 32 ll_input, low 32 of ll_val
	#NO_APP
	addiu	$sp, $sp, 8
	jr	$ra

If not direction is done for the long long for 32 bit variables results
in using the low 32 bits as ll_val shows.

There is an existing bug if 'L' or 'D' is used for the destination register
for 32 bit long longs in that the target value will be updated incorrectly
for the non-specified part unless explicitly set within the inline asm code.

llvm-svn: 160028
2012-07-10 22:41:20 +00:00
Jakob Stoklund Olesen bc90a4ea82 Require and preserve LoopInfo for early if-conversion.
It will surely be needed by heuristics.

llvm-svn: 160027
2012-07-10 22:39:56 +00:00
Chandler Carruth 2207f76cd4 Teach the LiveInterval::join function to use the fast merge algorithm,
generalizing its implementation sufficiently to support this value
number scenario as well.

This cuts out another significant performance hit in large functions
(over 10k basic blocks, etc), especially those with "natural" CFG
structures.

llvm-svn: 160026
2012-07-10 22:25:21 +00:00
Jakob Stoklund Olesen 02638392c1 Run early if-conversion in domtree post-order.
This ordering allows nested if-conversion without using a work list, and
it makes it possible to update the dominator tree on the fly as well.

Any erased basic blocks will always be dominated by the current
post-order position, so the domtree can be pruned without invalidating
the iterator.

llvm-svn: 160025
2012-07-10 22:18:23 +00:00
Richard Smith 9fce7bc721 Fix crash when constant-evaluating a CXXConstructExpr representing
value-initialization for an array of class type with a trivial default
constructor.

llvm-svn: 160024
2012-07-10 22:12:55 +00:00
Jordan Rose eab627b951 [analyzer] Construct stack variables directly in their VarDecl.
Also contains a number of tweaks to inlining that are necessary
for constructors and destructors. (I have this enabled on a private
branch, but it is very much unstable.)

llvm-svn: 160023
2012-07-10 22:08:01 +00:00
Jordan Rose d1d54aa131 [analyzer] Use CallEvent for building inlined stack frames.
In order to accomplish this, we now build the callee's stack frame
as part of the CallEnter node, rather than the subsequent BlockEdge node.
This should not have any effect on perceived behavior or diagnostics.

This makes it safe to re-enable inlining of member overloaded operators.

llvm-svn: 160022
2012-07-10 22:07:57 +00:00
Jordan Rose fbe6dba15a [analyzer] Make CallEnter, CallExitBegin, and CallExitEnd not be StmtPoints
These ProgramPoints are used in inlining calls,
and not all calls have associated statements anymore.

llvm-svn: 160021
2012-07-10 22:07:52 +00:00
Jordan Rose 4ee71b8a18 [analyzer] Add a CXXDestructorCall CallEvent.
While this work is still fairly tentative (destructors are still left out of
the CFG by default), we now handle destructors in the same way as any other
calls, instead of just automatically trying to inline them.

llvm-svn: 160020
2012-07-10 22:07:47 +00:00
Jordan Rose 681cce9908 [analyzer] Add new PreImplicitCall and PostImplicitCall ProgramPoints.
These are currently unused, but are intended to be used in lieu of PreStmt
and PostStmt when the call is implicit (e.g. an automatic object destructor).

This also modifies the Data1 field of ProgramPoints to allow storing any
pointer-sized value, as opposed to only aligned pointers. This is necessary
to store SourceLocations.

There is currently no BugReporter support for these; they should be skipped
over in any diagnostic output.

This commit also tags checkers that currently rely on function calls only
occurring at StmtPoints.

llvm-svn: 160019
2012-07-10 22:07:42 +00:00
DeLesley Hutchins 868830f727 Thread safety analysis: impove handling of trylock expressions.
llvm-svn: 160018
2012-07-10 21:47:55 +00:00