Commit Graph

119496 Commits

Author SHA1 Message Date
Craig Topper 279c77b677 Implement VECTOR_SHUFFLE canonicalizations during DAG combine.
llvm-svn: 147525
2012-01-04 08:07:43 +00:00
Douglas Gregor 8d76cca3a2 Don't treat 'import' as a contextual keyword when we're in a caching lexer, or when modules are disabled.
llvm-svn: 147524
2012-01-04 06:20:15 +00:00
Rafael Espindola 2aa7acfadb Process attributes in explicit function template instantiations. Fixes part of
PR11690.

llvm-svn: 147523
2012-01-04 05:40:59 +00:00
Eli Friedman 36d129435e Add an explicit LambdaExprContext to Declarator, to parallel BlockLiteralContext. Use it to ensure semantic analysis of types isn't confused by the lack of a type specifier.
llvm-svn: 147522
2012-01-04 04:41:38 +00:00
NAKAMURA Takumi 91a3f886ef test/CodeGen/X86/jump_sign.ll: Add -mcpu=pentiumpro for non-x86 hosts. It uses "cmov".
llvm-svn: 147521
2012-01-04 03:52:23 +00:00
Akira Hatanaka f093f5be3e Have functions return structures smaller than 128-bit in registers if ABI
is either N32 or N64. 

llvm-svn: 147520
2012-01-04 03:34:42 +00:00
Akira Hatanaka 3b775b8cc3 Rename immLUiOpnd.
llvm-svn: 147519
2012-01-04 03:09:26 +00:00
Akira Hatanaka b89a4bfe41 - Define base classes for Jump-and-link instructions and make 32-bit and 64-bit
versions derive from them.
- JALR64 is not needed since N64 does not emit jal. 
- Add template parameter to BranchLink that sets the rt field. 
- Fix the set of temporary registers for O32 and N64.

llvm-svn: 147518
2012-01-04 03:02:47 +00:00
Eli Friedman 898caf8f26 Fix messed-up indentation in r147515.
llvm-svn: 147517
2012-01-04 02:46:53 +00:00
Akira Hatanaka c669d7a6db Have getRegForInlineAsmConstraint return the correct register class when target
is Mips64.

llvm-svn: 147516
2012-01-04 02:45:01 +00:00
Eli Friedman c7c97144af Stub out the Sema interface for lambda expressions, and change the parser to use it. Unconditionally error on lambda expressions because they don't work in any meaningful way yet.
llvm-svn: 147515
2012-01-04 02:40:39 +00:00
Kostya Serebryany cc1d7893d6 [asan] remove objdump-based tests in favour of much simpler LLVM-ish tests
llvm-svn: 147514
2012-01-04 02:08:46 +00:00
Evan Cheng 801d98b3f0 Fix more places which should be checking for iOS, not darwin.
llvm-svn: 147513
2012-01-04 01:55:04 +00:00
Evan Cheng 104dbb0fd1 For x86, canonicalize max
(x > y) ? x : y
=>
(x >= y) ? x : y

So for something like
(x - y) > 0 : (x - y) ? 0
It will be
(x - y) >= 0 : (x - y) ? 0

This makes is possible to test sign-bit and eliminate a comparison against
zero. e.g.
subl   %esi, %edi
testl  %edi, %edi
movl   $0, %eax
cmovgl %edi, %eax
=>
xorl   %eax, %eax
subl   %esi, $edi
cmovsl %eax, %edi

rdar://10633221

llvm-svn: 147512
2012-01-04 01:41:39 +00:00
Rafael Espindola f90b6d1580 Revert r147493. It broke test/CodeGenObjC/constant-strings.m.
llvm-svn: 147511
2012-01-04 01:32:19 +00:00
Kostya Serebryany 842ae27ae3 [asan] one more test for asan instrumentation: (*a)++ should be instrumented only once.
llvm-svn: 147509
2012-01-04 01:02:14 +00:00
Ted Kremenek 990464cb30 Teach the static analyzer to not treat XPC types as CF types.
llvm-svn: 147506
2012-01-04 00:35:48 +00:00
Ted Kremenek e8300e5eba Minor code formatting cleanups.
llvm-svn: 147505
2012-01-04 00:35:45 +00:00
Fariborz Jahanian 1fc1c6c307 In non-gc, non-arc mode, property of 'Class' type
variety is treated as a 'void *'. No need to issue
warning reserved for objc object properties.
// rdar://10565506

llvm-svn: 147504
2012-01-04 00:31:53 +00:00
Eli Friedman 90dc17510b Get rid of an unnecessary check; the AST for init-lists is the same independent of whether we're in C++11 mode.
llvm-svn: 147503
2012-01-03 23:54:05 +00:00
Chris Lattner 6b77a07f75 Turn a few more inline asm errors into "emitErrors" instead of fatal errors.
Before we'd get:

$ clang t.c 
fatal error: error in backend: Invalid operand for inline asm constraint 'i'!

Now we get:

$ clang t.c
t.c:16:5: error: invalid operand for inline asm constraint 'i'!
    "movq         (%4), %%mm0\n"
    ^

Which at least gets us the inline asm that is the problem.

llvm-svn: 147502
2012-01-03 23:51:01 +00:00
Chris Lattner e22e613128 generalize LLVMContext::emitError to take a twine instead of a StringRef.
llvm-svn: 147501
2012-01-03 23:47:05 +00:00
Ted Kremenek 134a83a799 Enhance UnixAPIChecker to also warn about zero-sized allocations to calloc() and realloc(). Patch by Cyril Roelandt!
llvm-svn: 147500
2012-01-03 23:43:13 +00:00
Douglas Gregor 6aeecf1791 Minor tweak to name lookup for C/Objective-C: after the first name, still consider whether this is a redeclaration lookup when determining whether to look for the visible declaration
llvm-svn: 147499
2012-01-03 23:34:23 +00:00
Douglas Gregor b59643baf6 Test "merging" of typedef types across distinct modules. At present,
the AST reader doesn't actually perform a merge, because name lookup
knows how to merge identical typedefs together.

As part of this, teach C/Objective-C name lookup to return multiple
results in all cases, rather than first digging through the attributes
to see if the value is overloadable. This way, we'll catch ambiguous
lookups in C/Objective-C.

llvm-svn: 147498
2012-01-03 23:26:26 +00:00
Marshall Clow f83663a9cd Don't allocate TLS storage when checking to see if an exception has been thrown - really
llvm-svn: 147497
2012-01-03 23:26:09 +00:00
Eli Friedman b9c7129012 Support constant evaluation for OpenCL nested vector literals. Patch by Anton Lokhmotov.
llvm-svn: 147496
2012-01-03 23:24:20 +00:00
Chad Rosier 6ca97df951 Fix 80-column violations.
llvm-svn: 147495
2012-01-03 23:19:12 +00:00
Ted Kremenek b3512d3a48 Add initial version of checker to check if virtual member functions are called transitively
from C++ constructors or destructors.  Checker by Lei Zhang with a few tweaks by Ted Kremenek.

llvm-svn: 147494
2012-01-03 23:18:57 +00:00
David Chisnall 31640e1606 Initialise constant Objective-C string isa pointers with a weak reference to the class, so that they are usable in +load methods if the string class has been compiled with clang - if it's been compiled with GCC, the ABI makes this impossible. (GNU runtimes)
llvm-svn: 147493
2012-01-03 23:18:17 +00:00
Marshall Clow 3e417e7a5c Don't allocate TLS storage when checking to see if an exception has been thrown
llvm-svn: 147492
2012-01-03 23:10:20 +00:00
Jakob Stoklund Olesen bd75a417f9 Don't use enums larger than 1 << 31 for target features.
Patch by Andy Zhang!

llvm-svn: 147491
2012-01-03 23:04:28 +00:00
Fariborz Jahanian 7249e36704 objc: diagnose misplacement of objc_suppress_autosynthesis
attribute.

llvm-svn: 147490
2012-01-03 22:52:32 +00:00
Chad Rosier 1ad2433690 Fixed by Chandler in r147434.
llvm-svn: 147489
2012-01-03 22:51:32 +00:00
Douglas Gregor 2009ceed82 Implement cross-module declaration merging for tag declarations, so
that if two modules A and B both contain a declaration of a tag such
as

  struct X;

and those two modules are unrelated, the two declarations of X will be
merged into a single redeclaration chain.

llvm-svn: 147488
2012-01-03 22:46:00 +00:00
Jakob Stoklund Olesen 1b7f2a7638 Revert r146997, "Heed spill slot alignment on ARM."
This patch caused a miscompilation of oggenc because a frame pointer was
suddenly needed halfway through register allocation.

<rdar://problem/10625436>

llvm-svn: 147487
2012-01-03 22:34:35 +00:00
Jakob Stoklund Olesen 4043d92872 Assert when reserved registers have been assigned.
This can only happen if the set of reserved registers changes during
register allocation.

<rdar://problem/10625436>

llvm-svn: 147486
2012-01-03 22:34:31 +00:00
Nadav Rotem 6d31bac85e Revert 147426 because it caused pr11696.
llvm-svn: 147485
2012-01-03 22:19:42 +00:00
Nadav Rotem 1e7dda13c8 Fix incorrect widening of the bitcast sdnode in case the incoming operand is integer-promoted.
llvm-svn: 147484
2012-01-03 22:12:28 +00:00
Ted Kremenek 950e534e60 Force set-xcode-analyzer to use the system version of Python installed on OS X.
llvm-svn: 147483
2012-01-03 22:05:57 +00:00
Douglas Gregor 173d499c25 Add __has_feature(objc_modules)
llvm-svn: 147482
2012-01-03 21:12:26 +00:00
Chad Rosier 493c1b3152 Enhance DAGCombine for transforming 128->256 casts into a vmovaps, rather
then a vxorps + vinsertf128 pair if the original vector came from a load.
rdar://10594409

llvm-svn: 147481
2012-01-03 21:05:52 +00:00
Douglas Gregor 26f9601698 Add a test for the driver-level -fmodules/-fno-modules flags.
llvm-svn: 147480
2012-01-03 21:04:31 +00:00
Ted Kremenek b74c909b3c Add test case for PR 9774, which got fixed along the way.
llvm-svn: 147479
2012-01-03 21:02:04 +00:00
Nick Lewycky 228f5b4ba3 Conform to the style guide; remove 'else' after 'return'. Also remove an extra
if-statement by turning it into an assert. No functionality change.

llvm-svn: 147474
2012-01-03 20:33:00 +00:00
Abramo Bagnara 9f3d1ac419 Added testcases for -Wdisabled-macro-expansion.
llvm-svn: 147473
2012-01-03 20:13:03 +00:00
Owen Anderson fcc041eabf Remove the restriction that target intrinsics can only involve legal types. Targets can perfects well support intrinsics on illegal types, as long as they are prepared to perform custom expansion during type legalization. For example, a target where i64 is illegal might still support the i64 intrinsic operation using pairs of i32's. ARM already does some expansions like this for non-intrinsic operations.
llvm-svn: 147472
2012-01-03 20:09:02 +00:00
Lang Hames c405ac4429 Clarified assert text.
llvm-svn: 147471
2012-01-03 20:05:57 +00:00
Stepan Dyatkovskiy e801459320 Fix for PR11652: assertion failures when Type.cpp is compiled with -Os
llvm-svn: 147470
2012-01-03 20:04:35 +00:00
Douglas Gregor 663b48f13b Re-uglify #public and #private to #__public_macro and #__private_macro.
llvm-svn: 147469
2012-01-03 19:48:16 +00:00