Commit Graph

107173 Commits

Author SHA1 Message Date
Jakub Staszak 12a43bdde5 Introduce MachineBranchProbabilityInfo class, which has similar API to
BranchProbabilityInfo (expect setEdgeWeight which is not available here).
Branch Weights are kept in MachineBasicBlocks. To turn off this analysis
set -use-mbpi=false.

llvm-svn: 133184
2011-06-16 20:22:37 +00:00
Argyrios Kyrtzidis ec7c965c2e [arcmt] Fix test for MSVC build.
llvm-svn: 133183
2011-06-16 20:19:55 +00:00
Fariborz Jahanian 8feee2d169 Move computation of __private_extern__ visibilty to
getLVForNamespaceScopeDecl(). // rdar://9609649

llvm-svn: 133182
2011-06-16 20:14:50 +00:00
Evan Cheng d863adb201 Stylistic fix: move virtual keyword before return type.
llvm-svn: 133181
2011-06-16 19:13:15 +00:00
Douglas Gregor 3e85c9c561 Allow comparison between block pointers and NULL pointer
constants. Fixes PR10145.

llvm-svn: 133179
2011-06-16 18:52:05 +00:00
Owen Anderson 5fc8b77f83 Change the REG_SEQUENCE SDNode to take an explict register class ID as its first operand. This operand is lowered away by the time we reach MachineInstrs, so the actual register-allocation handling of them doesn't need to change.
This is intended to support using REG_SEQUENCE SDNode's with type MVT::untyped, and is part of the long road to eliminating some of the hacks we currently use to support register pairs and other strange constraints, particularly on ARM NEON.

llvm-svn: 133178
2011-06-16 18:17:13 +00:00
Jakob Stoklund Olesen 89a7e5ad45 Switch linear scan to using RegisterClassInfo.
This avoids the manual filtering of reserved registers and removes the
dependency on allocation_order_begin().

Palliative care...

llvm-svn: 133177
2011-06-16 18:17:00 +00:00
Galina Kistanova 8684a03c7e Move test for appropriate directory.
llvm-svn: 133176
2011-06-16 18:13:57 +00:00
Bruno Cardoso Lopes d66ab9ead1 Mark ldrexd/strexd w/ volatile memory by default
llvm-svn: 133175
2011-06-16 18:11:32 +00:00
Jakub Staszak feadd435c1 Test commit.
llvm-svn: 133174
2011-06-16 18:01:17 +00:00
Douglas Gregor 18739c343c Teach the warning about non-POD memset/memcpy/memmove to deal with the
__builtin_ versions of these functions as well as the normal function
versions, so that it works on platforms where memset/memcpy/memmove
are macros that map down to the builtins (e.g., Darwin). Fixes
<rdar://problem/9372688>.

llvm-svn: 133173
2011-06-16 17:56:04 +00:00
Justin Holewinski 7f191b2a3b PTX: Finish new calling convention implementation
llvm-svn: 133172
2011-06-16 17:50:00 +00:00
Justin Holewinski 6b356c1f3f PTX: Rename register classes for readability and combine int and fp registers
llvm-svn: 133171
2011-06-16 17:49:58 +00:00
Jakob Stoklund Olesen 1f641d577e Add TargetRegisterInfo::getRawAllocationOrder().
This virtual function will replace allocation_order_begin/end as the one
to override when implementing custom allocation orders. It is simpler to
have one function return an ArrayRef than having two virtual functions
computing different ends of the same array.

Use getRawAllocationOrder() in place of allocation_order_begin() where
it makes sense, but leave some clients that look like they really want
the filtered allocation orders from RegisterClassInfo.

llvm-svn: 133170
2011-06-16 17:42:25 +00:00
Fariborz Jahanian 62c72d06ff arc: diagnose dereferencing a __weak pointer which may be
null at any time. // rdar://9612030

llvm-svn: 133168
2011-06-16 17:29:56 +00:00
Argyrios Kyrtzidis 2798ded9de [arcmt] Fix the test when running in Lion.
llvm-svn: 133167
2011-06-16 17:28:31 +00:00
Nick Lewycky 1d643efabc Add testcase for r133050 which added support for printing and parsing escaped
names for named metadata nodes.

llvm-svn: 133166
2011-06-16 17:14:38 +00:00
John McCall b29f52727c Give arcmt-test an explicit triple for this test.
llvm-svn: 133165
2011-06-16 17:13:30 +00:00
Owen Anderson f5a0ca46b6 Fix formatting.
llvm-svn: 133164
2011-06-16 16:52:24 +00:00
Douglas Gregor e65aacb9e9 Implement the consistency checking for C++ [temp.deduct.call]p3, which
checks that the deduced argument type for a function call matches the
actual argument type provided. The only place we've found where the
consistency checking should actually cause template argument deduction
failure is due to qualifier differences that don't fall into the realm
of qualification conversions (which are *not* checked when we
initially perform deduction). However, we're performing the full
checking as specified in the standard to ensure that no other cases
exist.

Fixes PR9233 / <rdar://problem/9039590>.

llvm-svn: 133163
2011-06-16 16:50:48 +00:00
Caroline Tice d61c10bc79 Add 'batch_mode' to CommandInterpreter. Modify InputReaders to
not write output (prompts, instructions,etc.) if the CommandInterpreter
is in batch_mode.

Also, finish updating InputReaders to write to the asynchronous stream,
rather than using the Debugger's output file directly.

llvm-svn: 133162
2011-06-16 16:27:19 +00:00
Chandler Carruth b570351059 Raise the ARCMT functionality in Clang into proper FrontendActions.
These are somewhat special in that they wrap any other FrontendAction,
running various ARC transformations or checks prior to the standard
action's run. To implement them easily, this extends FrontendAction to
have a WrapperFrontendAction utility class which forwards all calls by
default to an inner action setup at construction time. This is then
subclassed to override the specific behavior needed by the different
ARCMT tools.

Finally, FrontendTool is taught how to create these wrapper actions from
the existing flags and options structures.

The result is that clangFrontend no longer depends on clangARCMigrate.
This is very important, as clangARCMigrate *heavily* depends on
clangFrontend. Fundamentally ARCMigrate is at the same layer as
a library like Rewrite, sitting firmly on top of the Frontend, but tied
together with the FrontendTool when building the clang binary itself.

llvm-svn: 133161
2011-06-16 16:17:05 +00:00
Dan Gohman 8bd11f1834 Document nonlazybind.
llvm-svn: 133160
2011-06-16 16:03:13 +00:00
Dan Gohman 8eb36ef497 Add a comment describing why transforming (shl x, 1) to (add x, x) is to be
considered safe enough in this context.

llvm-svn: 133159
2011-06-16 15:55:48 +00:00
Justin Holewinski 5ccf812b1d PTX: Fix whitespace errors
llvm-svn: 133158
2011-06-16 15:17:11 +00:00
Fariborz Jahanian a27070db0c Set the visibility to 'hidden' when previous
declaration of global var is __private_extern__.
// rdar://9609649

llvm-svn: 133157
2011-06-16 14:49:42 +00:00
NAKAMURA Takumi 0df100e1aa Be aware of (x86_64-redhat-linux6E-)g++44 on RHEL5.
AFAIK, RHEL5 (and its clones) provides g++44 as the package "gcc44-c++".
By default, g++-4.1.1 is available, though, its libstdc++ would not be suitable to clang++.

llvm-svn: 133156
2011-06-16 12:43:57 +00:00
Chandler Carruth 8b9e5a72cb Rework the warning for 'memset(p, 0, sizeof(p))' where 'p' is a pointer
and the programmer intended to write 'sizeof(*p)'. There are several
elements to the new version:

1) The actual expressions are compared in order to more accurately flag
   the case where the pattern that works for an array has been used, or
   a '*' has been omitted.
2) Only do a loose type-based check for record types. This prevents us
   from warning when we happen to be copying around chunks of data the
   size of a pointer and the pointer types for the sizeof and
   source/dest match.
3) Move all the diagnostics behind the runtime diagnostic filter. Not
   sure this is really important for this particular diagnostic, but
   almost everything else in SemaChecking.cpp does so.
4) Make the wording of the diagnostic more precise and informative. At
   least to my eyes.
5) Provide highlighting for the two expressions which had the unexpected
   similarity.
6) Place this diagnostic under a flag: -Wsizeof-pointer-memaccess

This uses the Stmt::Profile system for computing #1. Because of the
potential cost, this is guarded by the warning flag. I'd be interested
in feedback on how bad this is in practice; I would expect it to be
quite cheap in practice. Ideas for a cheaper / better way to do this are
also welcome.

The diagnostic wording could likely use some further wordsmithing.
Suggestions welcome here. The goals I had were to: clarify that its the
interaction of 'memset' and 'sizeof' and give more reasonable
suggestions for a resolution.

An open question is whether these diagnostics should have the note
attached for silencing by casting the dest/source pointer to void*.

llvm-svn: 133155
2011-06-16 09:09:40 +00:00
Jordy Rose c026370858 [analyzer] Clean up modeling of strcmp, including cases where a string literal has an embedded null character, and where both arguments are the same buffer. Also use nested ifs rather than early returns; in this case early returns will lose any assumptions we've made earlier in the function.
llvm-svn: 133154
2011-06-16 07:13:34 +00:00
Bruno Cardoso Lopes bbf2ab990f Add AVX suport for fpextend.
Original patch by Syoyo Fujita with more comments by me.

llvm-svn: 133153
2011-06-16 07:03:21 +00:00
Chandler Carruth 631abd9365 Make the Stmt::Profile method const, and the StmtProfile visitor
a ConstStmtVisitor. This also required adding some const iteration
support for designated initializers and making some of the getters on
the designators const.

It also made the formatting of StmtProfile.cpp rather awkward. I'm happy
to adjust any of the formatting if folks have suggestions. I've at least
fitted it all within 80 columns.

llvm-svn: 133152
2011-06-16 06:47:06 +00:00
Jordy Rose 0585a61821 [analyzer] Fix trivial errors in previous commit.
I will not commit without building first.
I will not commit without building first.
I will not commit without building first...

llvm-svn: 133150
2011-06-16 05:56:50 +00:00
Jordy Rose 455bd58d4e [analyzer] Cleanup: mainly 80-char violations and preferring SValBuilder::getComparisonType() to just referencing IntTy.
llvm-svn: 133149
2011-06-16 05:51:02 +00:00
John McCall 1d78d75a58 This random unit test also depends on ARCMigrate.
llvm-svn: 133148
2011-06-16 05:35:43 +00:00
John McCall 32e02a431b c-index-test also depends on ARCMigrate, oh boy
llvm-svn: 133147
2011-06-16 05:29:03 +00:00
John McCall 2af9866fc9 ARCMigrate depends on libAnalysis, and on unhelpful linkers must appear
before it on the link line.

llvm-svn: 133145
2011-06-16 04:30:11 +00:00
John McCall 1553b19067 Restore correct use of GC barriers.
llvm-svn: 133144
2011-06-16 04:16:24 +00:00
Chandler Carruth 30f3210242 Fix my test case from r133136 so that it actually represents the code
pattern found in the wild where this warning was firing.

llvm-svn: 133143
2011-06-16 04:13:47 +00:00
Jakob Stoklund Olesen 72f4b85119 Prempt some obnoxious compiler from complaing about signed/unsigned
compares.

2^30 is actually the limit on the number of physical registers per
TargetRegisterInfo.h.

llvm-svn: 133142
2011-06-16 03:07:40 +00:00
Jakob Stoklund Olesen e3ebb40ff1 Make sure to pass an unsigned to a printf format that is always %u.
This should unbreak the native ARM testers.

llvm-svn: 133141
2011-06-16 02:55:56 +00:00
Argyrios Kyrtzidis bdf3ca9186 [arcmt] Fix tests in non-darwin.
llvm-svn: 133140
2011-06-16 02:41:46 +00:00
Eli Friedman 9b3d779537 FileCheck-ize test, and make it work on EABI hosts, like clang-native-arm-cortex-a9.
llvm-svn: 133139
2011-06-16 02:36:32 +00:00
Chandler Carruth 55b42d5ad4 Add another dependency to the clang-test CMake target, this time to support lit.
llvm-svn: 133138
2011-06-16 02:21:11 +00:00
Chandler Carruth d8bc97c644 Add the new arcmt-test tool to the clang-test dependencies with
c-index-test and friends. This brings the failures on CMake clang tests
from 23 to 2 on Linux.

llvm-svn: 133137
2011-06-16 02:01:48 +00:00
Chandler Carruth a05e09ba48 Skip both character pointers and void pointers when diagnosing bad
argument types for mem{set,cpy,move}. Character pointers, much like void
pointers, often point to generic "memory", so trying to check whether
they match the type of the argument to 'sizeof' (or other checks) is
unproductive and often results in false positives.

Nico, please review; does this miss any of the bugs you were trying to
find with this warning? The array test case you had should be caught by
the array-specific sizeof warning I think.

llvm-svn: 133136
2011-06-16 02:00:04 +00:00
Eli Friedman 575d0163bb Force a triple here so this test doesn't fail on EABI hosts (like clang-native-arm-cortex-a9).
llvm-svn: 133134
2011-06-16 01:49:31 +00:00
Nick Lewycky 27d604cbf3 Commit the right set of tests for r133124. Sorry 'bout that!
llvm-svn: 133133
2011-06-16 01:35:45 +00:00
Andrew Trick 41369d5e8a Reenabling this test with REQUIRES: Asserts
llvm-svn: 133132
2011-06-16 01:34:41 +00:00
Andrew Trick 6132fb5127 Add support to lit for build mode requirements. e.g.
REQUIRES: Asserts
REQUIRES: Debug

This required chaining test configuration properties. It seems like a
generally good thing to do.

llvm-svn: 133131
2011-06-16 01:33:35 +00:00
Andrew Trick f008c3e518 Update clang's lit.site.cfg.in in preparation for adding config.llvm_build_modes.
llvm-svn: 133130
2011-06-16 01:32:21 +00:00