Commit Graph

138614 Commits

Author SHA1 Message Date
Bill Wendling 3495f9b6dd s/getLowerBoundDefault/getDefaultLowerBound/ for consistency. Also put the more natural check first in the if-then statement.
llvm-svn: 169486
2012-12-06 07:55:19 +00:00
Bill Wendling f9528843d2 Remove unused variable.
llvm-svn: 169485
2012-12-06 07:43:17 +00:00
Bill Wendling 28fe9e7a36 Handle non-default array bounds.
Some languages, e.g. Ada and Pascal, allow you to specify that the array bounds
are different from the default (1 in these cases). If we have a lower bound
that's non-default, then we emit the lower bound. We also calculate the correct
upper bound in those cases.

llvm-svn: 169484
2012-12-06 07:38:10 +00:00
Craig Topper 216bcd522b Remove intrinsic specific instructions for (V)MOVQUmr with patterns pointing to the normal instructions.
llvm-svn: 169482
2012-12-06 07:31:16 +00:00
Ted Kremenek 3e871d8cf6 Use the BlockDecl captures list to infer the direct captures for a BlockDataRegion. Fixes <rdar://problem/12415065>.
We still need to do a recursive walk to determine all static/global variables
referenced by a block, which is needed for region invalidation.

llvm-svn: 169481
2012-12-06 07:17:26 +00:00
Ted Kremenek bcf905326c Only provide explicit getCapturedRegion() and getOriginalRegion() from referenced_vars_iterator.
This is a nice conceptual cleanup.

llvm-svn: 169480
2012-12-06 07:17:20 +00:00
Ted Kremenek ff989016c1 Pull logic to map from VarDecl* to captured region using a helper function. WIP.
llvm-svn: 169479
2012-12-06 07:17:13 +00:00
Ted Kremenek 8c2bbfceb7 Use 'getOriginalRegion()' rather than going through the logic to recreate it.
llvm-svn: 169478
2012-12-06 07:17:04 +00:00
Craig Topper 922f10aec4 Mark MOVDQ(A/U)rm as ReMaterializable. Mark all MOVDQ(A/U) instructions as neverHasSideEffects.
llvm-svn: 169477
2012-12-06 06:49:16 +00:00
Richard Smith 16b65394ee Fix http://stackoverflow.com/questions/13521163
Don't require that, during template deduction, a template specialization type
as a function parameter has at least as many template arguments as one used in
a function argument (not even if the argument has been resolved to an exact
type); the additional parameters might be provided by default template
arguments in the template. We don't need this check, since we now implement
[temp.deduct.call]p4 with an additional check after deduction.

llvm-svn: 169475
2012-12-06 06:44:44 +00:00
Kostya Serebryany 1e3d387459 [tsan] add MmapAlignedOrDie
llvm-svn: 169474
2012-12-06 06:10:31 +00:00
Richard Smith 7808c6aa7e Don't use dyn_cast on a Type* which might not be canonical. Fixes an extremely obscure record layout bug.
llvm-svn: 169467
2012-12-06 03:04:50 +00:00
Jason Molenda 7964ab5e49 Fix ABIMacOSX_i386::RegisterIsVolatile to return the negated value of
RegisterIsCalleeSaved.  Add ebp back to the list of registers that
are callee saved.
<rdar://problem/12817918> 

llvm-svn: 169466
2012-12-06 02:49:20 +00:00
Greg Clayton 4ef877f5e9 <rdar://problem/12560257>
Fixed zero sized arrays to work correctly. This will only happen once we get a clang that emits correct debug info for zero sized arrays. For now I have marked the TestStructTypes.py as an expected failure.

llvm-svn: 169465
2012-12-06 02:33:54 +00:00
Evan Cheng 16846051db Properly fix the tes.
llvm-svn: 169464
2012-12-06 02:29:29 +00:00
NAKAMURA Takumi 1eccd286fd llvm/test/CodeGen/ARM/extload-knownzero.ll: Try to unbreak, to add -O0. I guess Chad expects fastisel here.
llvm-svn: 169463
2012-12-06 02:22:58 +00:00
NAKAMURA Takumi d985d76040 Revert r169456, "change MCContext to work on the doInitialization/doFinalization model"
It broke many builders.

llvm-svn: 169462
2012-12-06 02:00:13 +00:00
Sean Callanan eab6cc98d7 The expression parser will now check the validity
of the "self"/"this" pointer for the current stack
frame before wrapping expressions in C++ or
Objective-C methods.  This works around bad debug
info where the compiler emits a "this" or "self"
but doesn't give any way to find its location.

<rdar://problem/12809985>

llvm-svn: 169461
2012-12-06 01:35:38 +00:00
Chad Rosier 9f5c68af4c [arm fast-isel] Make the fast-isel implementation of memcpy respect alignment.
rdar://12821569

llvm-svn: 169460
2012-12-06 01:34:31 +00:00
Evan Cheng 5213139f48 Let targets provide hooks that compute known zero and ones for any_extend
and extload's. If they are implemented as zero-extend, or implicitly
zero-extend, then this can enable more demanded bits optimizations. e.g.

define void @foo(i16* %ptr, i32 %a) nounwind {
entry:
  %tmp1 = icmp ult i32 %a, 100
  br i1 %tmp1, label %bb1, label %bb2
bb1:
  %tmp2 = load i16* %ptr, align 2
  br label %bb2
bb2:
  %tmp3 = phi i16 [ 0, %entry ], [ %tmp2, %bb1 ]
  %cmp = icmp ult i16 %tmp3, 24
  br i1 %cmp, label %bb3, label %exit
bb3:
  call void @bar() nounwind
  br label %exit
exit:
  ret void
}

This compiles to the followings before:
        push    {lr}
        mov     r2, #0
        cmp     r1, #99
        bhi     LBB0_2
@ BB#1:                                 @ %bb1
        ldrh    r2, [r0]
LBB0_2:                                 @ %bb2
        uxth    r0, r2
        cmp     r0, #23
        bhi     LBB0_4
@ BB#3:                                 @ %bb3
        bl      _bar
LBB0_4:                                 @ %exit
        pop     {lr}
        bx      lr

The uxth is not needed since ldrh implicitly zero-extend the high bits. With
this change it's eliminated.

rdar://12771555

llvm-svn: 169459
2012-12-06 01:28:01 +00:00
NAKAMURA Takumi 5c9f577c7f Disable clang/test/Preprocessor/macro-multiline.c for now, while investigating lit.ShUtil.parser.
llvm-svn: 169458
2012-12-06 01:09:31 +00:00
Fariborz Jahanian b42b6f2674 more test of template declarations in a
<declaration> XML tag. // rdar://12378714

llvm-svn: 169457
2012-12-06 00:57:28 +00:00
Pedro Artigas bf7d3bab26 change MCContext to work on the doInitialization/doFinalization model
reviewed by Evan Cheng <evan.cheng@apple.com>

llvm-svn: 169456
2012-12-06 00:50:55 +00:00
Bill Wendling ab417b644c Set the 'MadeChange' variable if we are deleting blocks.
llvm-svn: 169455
2012-12-06 00:30:20 +00:00
Daniel Malea ad75f07274 Move isprint8() into lldb_private as per post-commit review from Stefanus
llvm-svn: 169454
2012-12-06 00:10:37 +00:00
Fariborz Jahanian 3ec39215f9 More C++ testing of declarations embedded in
<declaration> tag of Comment XML  and fixing 
DeclPrint of templates along the way - wip. 
//rdar://12378714

llvm-svn: 169453
2012-12-06 00:09:40 +00:00
Michael Ilseman 0f12837be0 Have CannotBeNegativeZero() be aware of the nsz fast-math flag
llvm-svn: 169452
2012-12-06 00:07:09 +00:00
Sean Callanan faa0bb3fa1 Rewrote the bitfield logic. Major changes include:
- Removed the BitfieldMap class because it is unnecessary.
  We now just track the most recently added field.

- Moved the code that calculates bitfield widths so it
  can also be used to determine whether it's necessary
  to insert anonymous fields.

- Simplified the anonymous field calculation code into
  three cases (two of which are resolved identically).

- Beefed up the bitfield testcase.

llvm-svn: 169449
2012-12-05 23:37:14 +00:00
Chad Rosier 95cd27265e [driver, ms-inline asm] -fms-compatibility enables -fms-extensions, so this should enable
the AsmBlocks language extension as well.
rdar://12808010

llvm-svn: 169448
2012-12-05 23:35:10 +00:00
Andrew Trick 44d1f2fedd Taking ownership of indvars/lsr.
Evan nominated me for this a while back, and no one has offered to
save me from it.

llvm-svn: 169447
2012-12-05 23:32:44 +00:00
Richard Smith 0ab6c5d9d8 PR10867: Analogue of r169441 for when using external 'sh'. And actually run the test!
llvm-svn: 169446
2012-12-05 23:15:33 +00:00
Chad Rosier 636386753a [driver, ms-inline asm] Have -fms-extensions enable the AsmBlocks language
option.  MS-style inline asm can now be enabled by either -fasm-blocks or
-fms-extensions.
rdar://12808010

llvm-svn: 169445
2012-12-05 23:08:09 +00:00
Jason Molenda 727e392a45 Adding missing log->Printf instead of printf in Target::SetArchitecture
for target logging.

llvm-svn: 169444
2012-12-05 23:07:34 +00:00
Andrew Trick d3226eee03 RegPressureTracker::dump(): Remove unnecessary argument.
llvm-svn: 169443
2012-12-05 23:05:22 +00:00
Richard Smith b958980cec Looks like lit on Windows can't cope with parens here, and in any case, we shouldn't need them after r169441.
llvm-svn: 169442
2012-12-05 22:59:28 +00:00
Richard Smith 69c87b0914 PR10867. lit would interpret
RUN: a
  RUN: b || true

as "a && (b || true)" in Tcl mode, and as "(a && b) || true" in sh mode.
Everyone seems to (quite reasonably) write tests assuming the Tcl behavior,
so use that in sh mode too.

llvm-svn: 169441
2012-12-05 22:54:26 +00:00
Fariborz Jahanian de872af437 In DeclPrint add printing of '= default'
in constructors.

llvm-svn: 169440
2012-12-05 22:53:06 +00:00
Akira Hatanaka 4b11df0d0b Do not run tests MappedMemoryTest.BasicWrite and MultipleWrite unless both
MF_READ and MF_WRITE are set.

llvm-svn: 169439
2012-12-05 22:43:07 +00:00
Michael J. Spencer 6fa518c51e Quick build fix for c++03 clang. This needs a proper solution. Note that these offsets are guaranteed to be correct by Endian.h.
llvm-svn: 169438
2012-12-05 22:38:01 +00:00
Richard Smith 48f244ac2c More workarounds for PR10867.
llvm-svn: 169437
2012-12-05 22:33:14 +00:00
Fariborz Jahanian 69c403c5c9 In DeclPrint add printing of 'explicit'
constructors.

llvm-svn: 169435
2012-12-05 22:19:06 +00:00
Richard Smith c524ec4411 Fix an egregiously broken test. This pattern doesn't work:
RUN: a
RUN: b || true

lit expands it to a && b || true, and the || true applies to both commands (thus ignoring failures in 'a')! This is PR10867 again.

llvm-svn: 169434
2012-12-05 22:18:04 +00:00
Eli Bendersky 02631c4e31 Change std::vector to SmallVector<4> and remove some unused methods.
This is more consistent with other vectors in this code. In addition, I ran some
tests compiling a large program and >96% of fragments have 4 or less fixups, so
SmallVector<4> is a good optimization.

llvm-svn: 169433
2012-12-05 22:11:02 +00:00
Jyotsna Verma d3746e6895 Define new-value store instructions with base+immediate addressing mode
using multiclass.

llvm-svn: 169432
2012-12-05 22:02:56 +00:00
Greg Clayton e6a07793e0 <rdar://problem/12560257>
Fixed arrays with a size of 1 to correctly have 1 member when DW_AT_upper_bound was set to zero and no other attributes were set.

llvm-svn: 169431
2012-12-05 21:59:39 +00:00
Argyrios Kyrtzidis f75d498a3c [c-index-test] Introduce '-index-compile-db' which accepts a compilation database file
and does an '-index-file' for all compile commands in the database.

llvm-svn: 169430
2012-12-05 21:53:37 +00:00
Bill Wendling 0edf38167f Fix name. The array is unboundED.
llvm-svn: 169429
2012-12-05 21:43:37 +00:00
Bill Wendling fcf6a22b01 Fix name. The array is unboundED.
llvm-svn: 169428
2012-12-05 21:43:30 +00:00
Andrew Trick fda7a8832d RegisterPressureTracker: fix findUseBetween to handle DebugValue
llvm-svn: 169427
2012-12-05 21:37:50 +00:00
Andrew Trick 7bbcad7bcd RegisterPressureTracker: unify virtual registers and physical regunits.
Now that live register units are tracked individually, the code can be simplified.

llvm-svn: 169426
2012-12-05 21:37:47 +00:00