Commit Graph

14383 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 6fe744cc38 When resolving default template arguments, it should be done in the declaration context
of the template what we are going to instantiate.

Fixes various crashes of rdar://11242625 & http://llvm.org/PR11421.

llvm-svn: 155576
2012-04-25 18:39:17 +00:00
Richard Smith 1ad04d95bc PR12625: Cope with classes which have incomplete base or member types:
Don't try to query whether an incomplete type has a trivial copy constructor
when determining whether a move constructor should be declared.

llvm-svn: 155575
2012-04-25 18:28:49 +00:00
Fariborz Jahanian 78731c7098 improve a modern objc translator test.
llvm-svn: 155569
2012-04-25 18:11:57 +00:00
Fariborz Jahanian e49a42cae9 modern objc rewriter: fixes a bug writing
a const qualified static c-function. 
// rdar://11314329

llvm-svn: 155564
2012-04-25 17:56:48 +00:00
Evgeniy Stepanov 0a0655affa Make asan-ld test windows-safe.
llvm-svn: 155543
2012-04-25 09:28:10 +00:00
Manuel Klimek 3778a435d1 Fixes the header search logic for tools:
The driver needs to get the correct path to the executable to deduce
the header search path.

llvm-svn: 155542
2012-04-25 09:25:41 +00:00
Evgeniy Stepanov 7786671b5a Clang driver support for linking on Android.
llvm-svn: 155541
2012-04-25 08:59:22 +00:00
Evgeniy Stepanov 78eaa2cd1b Fix default cpu for -march=armv5e.
llvm-svn: 155540
2012-04-25 08:35:56 +00:00
Chad Rosier 155005c071 Add atan, atan2, exp, and log to the builtin math library functions.
With -fno-math-errno (the default for Darwin) or -ffast-math these library 
function can be marked readnone enabling more opportunities for CSE and other
optimizations.
rdar://11251464

llvm-svn: 155498
2012-04-24 22:40:01 +00:00
Nico Weber 1d725ecf93 Let NULL and MSVC headers coexist better.
Fixes the two issues mentioned in PR12146.

llvm-svn: 155490
2012-04-24 21:27:01 +00:00
Fariborz Jahanian 847713a998 modern objc translator: Allow writing of multiple
declaration of __block variables on same lines
with initializers. // rdsr://7547630

llvm-svn: 155473
2012-04-24 19:38:45 +00:00
Fariborz Jahanian 32af25ea05 objc modern rewriter: allow translation of
multiple declaration of block variables
(with no initializer) on the same line.

llvm-svn: 155462
2012-04-24 18:16:20 +00:00
Evgeniy Stepanov 582911a089 Only pass -mcpu, -march, -mfpu to linux-as on ARM.
llvm-svn: 155431
2012-04-24 09:05:31 +00:00
Kostya Serebryany 5dd2cfc81e enable TBAA when -fthread-sanitizer is given, even with -O0 or -relaxed-aliasing
llvm-svn: 155430
2012-04-24 06:57:01 +00:00
Richard Smith 2cc2b46683 Don't try to delay parsing the exception specification for a data member of a
class; we would never actually parse it and attach it to the type.

llvm-svn: 155426
2012-04-24 05:48:42 +00:00
Chandler Carruth 3dfb6d84c6 Introduce an initial sketch of a MSVC compatible 'intrin.h' builtin
header, along with a stub test to make sure it compiles in the
appropriate modes.

Thanks to Aaron Ballman for working with me to figure out the initial
strategy here, and to Nico for reviewing and pestering me to actually
commit it.

llvm-svn: 155425
2012-04-24 05:23:54 +00:00
Richard Smith 4e42bc8365 PR12629: Cope with parenthesized function types when attaching a delayed
exception specification to a function.

llvm-svn: 155424
2012-04-24 05:06:35 +00:00
NAKAMURA Takumi 8701d38c93 clang/test/Rewriter/objc-modern-boxing.mm: Mark as XFAIL:mingw for now, due to predefined __declspec similar to r155278.
llvm-svn: 155417
2012-04-24 01:19:04 +00:00
DeLesley Hutchins 8e9fc0592b Thread safety analysis: refactor test cases so that the style is
consistent.

llvm-svn: 155388
2012-04-23 20:41:57 +00:00
Fariborz Jahanian 08a1eb77c5 with -Wdeprecated, include a note to its deprecated declaration
location. // rdar://10893232

llvm-svn: 155385
2012-04-23 20:30:52 +00:00
Eric Christopher 3cc207bbcc Forward declarations should take a context. This helps the debugger
find forward declarations in the context that the actual definition
will occur.

rdar://11291658

llvm-svn: 155381
2012-04-23 19:00:24 +00:00
DeLesley Hutchins e09be231fa Thread safety analysis: support the use of pt_guarded_by attributes
on smart pointers.  Also adds test case for previous commit.

llvm-svn: 155379
2012-04-23 18:39:55 +00:00
Rafael Espindola b522a5f246 Fix visibility when we have two types with explicit visibility in a template
argument list.

llvm-svn: 155368
2012-04-23 17:51:55 +00:00
DeLesley Hutchins 70b5e8eefc Thread-safety analysis: support new "pointer to member" syntax for
existentially quantified lock expressions.

llvm-svn: 155357
2012-04-23 16:45:01 +00:00
Douglas Gregor 39f39ff4b7 Teach RequireCompleteType about multi-dimensional arrays. Fixes
<rdar://problem/11284902>.

llvm-svn: 155356
2012-04-23 16:42:52 +00:00
Bob Wilson 16c4a4f471 Add a test for svn r155263.
llvm-svn: 155353
2012-04-23 16:22:22 +00:00
Rafael Espindola 23fd21d4ee Add another testcase that was not being covered.
llvm-svn: 155351
2012-04-23 14:02:53 +00:00
Anton Korobeynikov df32b6f2de Do not use stdint.h, driver might provide invalid location for it. Instead, provide the types directly.
This should fix PR12628

llvm-svn: 155342
2012-04-23 09:02:13 +00:00
Rafael Espindola cba4879534 Add a testcase that we already get right but was not being tested. Found
by a chrome build on OS X. Thanks to Nico Weber for testing a patch and
providing the .ii file.

llvm-svn: 155326
2012-04-22 22:31:25 +00:00
Rafael Espindola 1e762442c7 Cleanup testcase.
llvm-svn: 155317
2012-04-22 16:03:00 +00:00
Rafael Espindola bbc5cbc410 An attribute in a explicit template installation should take precedence over
the tempale arguments in deciding the visibility.

This agrees with gcc 4.7.

Found by trying to build chrome with component=shared_library with 155314
reverted.

llvm-svn: 155316
2012-04-22 15:31:59 +00:00
Rafael Espindola 6b6e879221 Revert 155102 but add a fixme while I debug what is wrong with chrome's
components build.

llvm-svn: 155314
2012-04-22 12:37:27 +00:00
Richard Smith f3c37e89a1 PR12571: Objects of type clang::ConstantArrayType aren't always emitted with
type llvm::ArrayType -- sometimes we emit them as packed structs. Don't assert
if such a global array has an element type with a non-trivial destructor.

llvm-svn: 155305
2012-04-22 05:51:36 +00:00
Rafael Espindola fae3f908d8 Add another missing testcase.
llvm-svn: 155304
2012-04-22 02:41:22 +00:00
Richard Smith e85e176600 PR12585: When processing a friend template inside a class template, don't
pretend there was no previous declaration -- that can lead us to injecting
a class template (with no access specifier) into a class scope. Instead,
just avoid the problematic checks.

llvm-svn: 155303
2012-04-22 02:13:50 +00:00
Rafael Espindola 4304101fb2 Add a testcase we were already getting right, but were not testing for.
llvm-svn: 155302
2012-04-22 01:22:25 +00:00
Rafael Espindola 8add48ec9e Fix handling of template parameters. Found by inspection. GCC 4.7 agrees
with this testcase.

llvm-svn: 155301
2012-04-22 00:43:48 +00:00
Richard Smith 84973e56e3 Fix regression in r154844. If necessary, defer computing adjusted destructor
exception specifications in C++11 until after we've parsed the exception
specifications for nested classes.

llvm-svn: 155293
2012-04-21 18:42:51 +00:00
Richard Smith 8b987a9976 Fix serialization of uninstantiated exception specifications. Patch by Li Kan,
test by me.

llvm-svn: 155289
2012-04-21 17:47:47 +00:00
NAKAMURA Takumi c6fbdf027f clang/test/Rewriter/rewrite-modern-extern-c-func-decl.mm: Mark as XFAIL:mingw for now, due to predefined __declspec.
It could be tweaked to add -triple i686-win32, though.

llvm-svn: 155278
2012-04-21 09:39:58 +00:00
Richard Smith 9f2a7b2e08 Fix test failure.
llvm-svn: 155271
2012-04-21 01:51:32 +00:00
Richard Smith 6483d22f1b When declaring a template, check that the context doesn't already contain a
declaration of the same name. r155187 caused us to miss this if the prior
declaration did not declare a type.

llvm-svn: 155269
2012-04-21 01:27:54 +00:00
Matt Beaumont-Gay d9f244afbb Fix a QoI bug reported by a user.
Set the source location for the "member reference base type ... is not a
structure or union" diag to point at the operator rather than the member name.
If we're giving this diagnostic because of a typo'd '.' in place of a ';' at
the end of a line, the caret previously pointed at the identifier on the
following line, which isn't as helpful as it could be. Pointing the caret at
the '.' makes it more obvious what the problem is.

llvm-svn: 155267
2012-04-21 01:12:48 +00:00
Fariborz Jahanian 344d65c248 objective-c arc: With currnt documentation,
objc_returns_inner_pointer attribute can be applied to
methods only. Diagnsose otherwise, instead of
crashing. // rdar://11253688

llvm-svn: 155245
2012-04-20 22:00:46 +00:00
Anna Zaks 7e53bd6fb0 [analyzer] Run remove dead bindings right before leaving a function.
This is needed to ensure that we always report issues in the correct
function. For example, leaks are identified when we call remove dead
bindings. In order to make sure we report a callee's leak in the callee,
we have to run the operation in the callee's context.

This change required quite a bit of infrastructure work since:
 - We used to only run remove dead bindings before a given statement;
here we need to run it after the last statement in the function. For
this, we added additional Program Point and special mode in the
SymbolReaper to remove all symbols in context lower than the current
one.
 - The call exit operation turned into a sequence of nodes, which are
now guarded by CallExitBegin and CallExitEnd nodes for clarity and
convenience.

(Sorry for the long diff.)

llvm-svn: 155244
2012-04-20 21:59:08 +00:00
Richard Smith 83c478d389 Fix bug where a class's (deleted) copy constructor would be implicitly given a
non-const reference parameter type if the class had any subobjects with deleted
copy constructors. This causes a rejects-valid if the class's copy constructor
is explicitly defaulted (as happens for some implementations of std::pair etc).

llvm-svn: 155218
2012-04-20 18:46:14 +00:00
Fariborz Jahanian 440b524b46 minor improvement to couple of tests.
llvm-svn: 155204
2012-04-20 17:07:07 +00:00
Evgeniy Stepanov ed943f66d6 Pass -mfloat-abi= to linuxtools assembler.
llvm-svn: 155191
2012-04-20 09:03:40 +00:00
Timur Iskhodzhanov f32a377a7c Fix bug 12574 - Avoid infinite recursion in constructors and destructors when using Microsoft C++ ABI
llvm-svn: 155189
2012-04-20 08:05:00 +00:00
Richard Smith 61e582f6bc Replace r155185 with a better fix, which also addresses PR12557. When looking
up an elaborated type specifier in a friend declaration, only look for type
declarations, per [basic.lookup.elab]p2. If we know that the redeclaration
lookup for a friend class template in a dependent context finds a non-template,
don't delay the diagnostic to instantiation time.

llvm-svn: 155187
2012-04-20 07:12:26 +00:00