Commit Graph

32665 Commits

Author SHA1 Message Date
Richard Trieu 993f3ab07b Fix two comments from warn to emit error to match the actual diagnostic used.
llvm-svn: 139510
2011-09-12 18:08:02 +00:00
Anna Zaks 79301b16f3 [analyzer] Fix a failure encountered while analyzing bind (radar://10105448).
llvm-svn: 139509
2011-09-12 18:07:30 +00:00
Anna Zaks 6e05e32e12 Doxygen comments.
llvm-svn: 139508
2011-09-12 17:57:20 +00:00
Anna Zaks 295208d744 [analyzer] Fix a new failure encountered while building Adium exposed as a result of r138196(radar://10087620). ObjectiveC property of type int has a value of type ObjCPropRef, which is a Loc.
llvm-svn: 139507
2011-09-12 17:56:08 +00:00
Anna Zaks 964c186ffe [analyzer] Test for -analyze-function on ObjectiveC to accompany r139439.
llvm-svn: 139506
2011-09-12 17:48:08 +00:00
Devang Patel 98ca8aeca6 Fix debug info encodings for char16_t and char32_t.
llvm-svn: 139502
2011-09-12 17:11:58 +00:00
Douglas Gregor 3baa6702ab Allow __module_private__ on fields
llvm-svn: 139499
2011-09-12 16:11:24 +00:00
Douglas Gregor fc33bcfc4a Remove the restriction on module-private friends. Since the friend
declaration may be the first declaration, we want the ability to that
declaration to be marked module-private.

llvm-svn: 139497
2011-09-12 15:48:15 +00:00
Douglas Gregor b63ab9477c Only predefine the __EXCEPTIONS macro if C++ exceptions are turned on.
Only predefine the OBJC_ZEROCOST_EXCEPTIONS macro if Objective-C
exceptions are turned on. Fixes PR10910.

llvm-svn: 139496
2011-09-12 15:17:19 +00:00
Hans Wennborg be207b3c74 Silence ?: precendence warning when parenthesis are present.
Fixes PR10898. The warning should be silent when there are parenthesis
around the condition expression.

llvm-svn: 139492
2011-09-12 12:07:30 +00:00
Benjamin Kramer 8a8051f2cd Silence "end of non-void function" warnings with llvm_unreachable and add an assert.
llvm-svn: 139474
2011-09-10 21:52:04 +00:00
Fariborz Jahanian 9f0bc5757c objc rewriter - more fixes to support compiling the rewritten
test case having instancetype. Fix in rewriter is unrelated to
using of instancetype. Test case uses other feature not yet
supported in the rewriter. There is more work to do, but this
is an ongoing task and not urgent at this time.

llvm-svn: 139473
2011-09-10 17:01:56 +00:00
Chris Lattner d2cd41c5bf remove pedantic ;
llvm-svn: 139472
2011-09-10 16:13:42 +00:00
John McCall 6acaef9fe8 Modernize and comment; no functionality change.
llvm-svn: 139470
2011-09-10 09:30:49 +00:00
John McCall 7f16c42b9e Simplify the generation of Objective-C setters, at least a little.
Use a more portable heuristic for deciding when to emit a single
atomic store;  it's possible that I've lost information here, but
I'm not sure how much of the logic before was intentionally arch-specific
and how much was just not quite consistent.

llvm-svn: 139468
2011-09-10 09:17:20 +00:00
John McCall 2d637d2e79 Rename the ARC cast kinds to start with "ARC".
llvm-svn: 139466
2011-09-10 06:18:15 +00:00
David Blaikie f1e2924b6b Correctly referring to the null pointer as 'null' not the macro 'NULL' in the boolean conversion diagnostic message.
llvm-svn: 139465
2011-09-10 05:47:59 +00:00
Julien Lerouge d25ed06c63 Make this test portable on Win32.
llvm-svn: 139464
2011-09-10 05:46:15 +00:00
David Blaikie e5f9a9e603 Show either a location or a fixit note, not both, for uninitialized variable warnings.
llvm-svn: 139463
2011-09-10 05:35:08 +00:00
John McCall 5dc5c1ea47 Missed a %local use; hopefully this clears this test up.
llvm-svn: 139462
2011-09-10 05:31:57 +00:00
Richard Trieu 7fde916498 Fix a broken assert in AST/DeclCXX.cpp.
llvm-svn: 139461
2011-09-10 02:16:48 +00:00
Eli Friedman 5c917278fd clang part of r139458; un-XFAIL testcase.
llvm-svn: 139460
2011-09-10 02:03:28 +00:00
Richard Trieu c41773ab6a Revision 139454 fixed a broken assert in LLVM, which causes
a test failure in CodeGen/palignr.c, which has been marked
XFAIL for the time being.  A bug has been filed at PR10901
for this issue.

llvm-svn: 139457
2011-09-10 01:56:32 +00:00
John McCall e5e7e6bc84 Make this test not depend on unnecessary details and IR variable names.
llvm-svn: 139455
2011-09-10 01:37:23 +00:00
John McCall cd78e805e9 When converting a block pointer to an Objective-C pointer type, extend
the lifetime of the block by copying it to the heap, or else we'll get
a dangling reference because the code working with the non-block-typed
object will not know it needs to copy.

There is some danger here, e.g. with assigning a block literal to an
unsafe variable, but, well, it's an unsafe variable.

llvm-svn: 139451
2011-09-10 01:16:55 +00:00
Douglas Gregor 97e3590a6e Fix a diagnostics crasher with -Wmissing-noreturn in Objective-C
methods, and improve the diagnostic slightly along the way. Fixes
<rdar://problem/10098695>.

llvm-svn: 139446
2011-09-10 00:56:20 +00:00
Chandler Carruth 73fddfe1b0 Fix a -Wreturn-type warning due to this field not explicitly having the
enumeration type.

llvm-svn: 139445
2011-09-10 00:51:24 +00:00
Devang Patel 964d758d17 Emit debug info for wchar_t.
llvm-svn: 139443
2011-09-10 00:44:49 +00:00
Douglas Gregor abc5fbe9d6 Don't crash when we fail to load a module. It's unbecoming of a
well-bred compiler like Clang.

llvm-svn: 139442
2011-09-10 00:30:18 +00:00
Douglas Gregor 87d8124b0e Clean up our handling of Objective-C definitions in AST files. Rather
than having CodeGen check whether a declaration comes from an AST file
(which it shouldn't know or care about), make sure that the AST writer and
reader pass along "interesting" declarations that CodeGen needs to
know about.

llvm-svn: 139441
2011-09-10 00:22:34 +00:00
Anna Zaks dfbea6b244 [analyzer] -analyze-function for ObjectiveC should check if any of the methods match the name (not only the first one).
llvm-svn: 139439
2011-09-10 00:12:23 +00:00
Douglas Gregor 98c05b286c Kill of the Decl::PCHLevel field entirely. We now only need to know
whether a Decl was deserialized from an AST file (any AST file).

llvm-svn: 139438
2011-09-10 00:09:20 +00:00
Chandler Carruth a626d645d5 Extend the Stmt AST to make it easier to look through label, default,
and case statements. Use this to make the logic in the CFG builder more
robust at finding the actual statements within a compound statement,
even when there are many layers of labels obscuring it.

Also extend the test cases for a large chunk of PR10063. Still more work
to do here though.

llvm-svn: 139437
2011-09-10 00:02:34 +00:00
Douglas Gregor 1bbf030b8e The translation unit is never deserialized
llvm-svn: 139436
2011-09-09 23:34:14 +00:00
Douglas Gregor dd57400c06 Eliminate all but one caller of Decl::getPCHLevel()
llvm-svn: 139430
2011-09-09 23:07:59 +00:00
Douglas Gregor b3722e2223 Introduce a new predicate Decl::isFromASTFile() to determine whether a
declaration was deserialized from an AST file. Use this instead of
Decl::getPCHLevel() wherever possible. This is a simple step toward
killing off Decl::getPCHLevel().

llvm-svn: 139427
2011-09-09 23:01:35 +00:00
Caitlin Sadowski 82e2de512e Thread safety: removing unnecessary import and reordering import list
llvm-svn: 139426
2011-09-09 23:00:59 +00:00
Caitlin Sadowski 0bef2279fb Thread safety: removing unnecessary import
llvm-svn: 139425
2011-09-09 22:49:12 +00:00
Julien Lerouge e0d5fad37b Remove trailing } in comment.
llvm-svn: 139424
2011-09-09 22:46:39 +00:00
Julien Lerouge 5a6b6987dc Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: can
annotate global, local variables, struct fields, or arbitrary statements (using
the __builtin_annotation), rdar://8037476.

llvm-svn: 139423
2011-09-09 22:41:49 +00:00
Douglas Gregor 51825b49f3 In the ASTReader, replace the never-NULL Preprocessor pointer with a
Preprocessor reference. Simplify some code along the way, so there is
no separate "initialize the preprocessor" step.

llvm-svn: 139418
2011-09-09 22:02:16 +00:00
Kaelyn Uhrain 45e9370a24 Add smarter sorting of overload candidates that failed template deduction.
llvm-svn: 139417
2011-09-09 21:58:49 +00:00
Eric Christopher 65c5c9132f Carry the debug information from single exit unified return block
along with the new insert point.

Fixes PR10829

llvm-svn: 139416
2011-09-09 21:53:04 +00:00
Douglas Gregor 4163aca7db In ASTReader, replace the never-NULL ASTContext pointer with an
ASTContext reference. Remove all of the extra checking and logic that
was used to cope with a NULL ASTContext. No effective functionality
change.

llvm-svn: 139413
2011-09-09 21:34:22 +00:00
Douglas Gregor 6422642a1d Friends cannot be declared module-private
llvm-svn: 139411
2011-09-09 21:14:29 +00:00
Douglas Gregor 32ed0d204d Mark the translation unit as having lexical/visible storage only when we actually have data for that lexical or visible storage
llvm-svn: 139409
2011-09-09 21:09:37 +00:00
Douglas Gregor faf2adb6e4 Back out r139358 "[PCH] When loading the decls linked to an
identifier, also make them visible in the translation unit," which
isn't needed now that John's eliminated the AST dependency in blocks
CodeGen.

llvm-svn: 139408
2011-09-09 21:05:56 +00:00
Douglas Gregor 3c7cd6a0c4 Specializations cannot be module-hidden. Diagnose attempts to do so.
llvm-svn: 139406
2011-09-09 20:53:38 +00:00
John McCall 7959fee258 Treat the weak export of block runtime symbols as a deployment-target
feature akin to the ARC runtime checks.  Removes a terrible hack where
IR gen needed to find the declarations of those symbols in the translation
unit.

llvm-svn: 139404
2011-09-09 20:41:01 +00:00
Fariborz Jahanian e1378a4313 objc rewriter - Add rewriter test for new instancetype
along with minor rewriter fix to handle that. This
test is still incomplete due to rewriter issues
unrelated to instancetype.

llvm-svn: 139403
2011-09-09 20:35:22 +00:00
Douglas Gregor 64910ca9d5 Don't produce 'instancetype' as the type of a message send expression. Map it down to 'id'.
llvm-svn: 139394
2011-09-09 20:05:21 +00:00
Douglas Gregor 2820e6923a __module_private__ is inherited by redeclarations of an entity, and
must also be present of the first declaration of that entity.

llvm-svn: 139384
2011-09-09 19:05:14 +00:00
Anna Zaks 45ce1bf091 [analyzer] When running scan-build with -plist on ./configure, delete the plist files.
(scan-build does not set the $HtmlDir when running against configure. Previously, this implied that the plist files would appear in the current directory, with this patch they will get deleted.)

llvm-svn: 139382
2011-09-09 18:43:53 +00:00
Douglas Gregor ef15bdbe1a Propagate __module_private__ from previous declarations to later
declarations.

llvm-svn: 139380
2011-09-09 18:32:39 +00:00
Douglas Gregor 6b3bcf29f5 When type-checking a call to an overloaded, builtin atomic operation,
construct a new DeclRefExpr rather than re-using the existing
DeclRefExpr. Patch by Likai Liu, fixes PR8345.

llvm-svn: 139373
2011-09-09 16:51:10 +00:00
Caitlin Sadowski ff2f3f8105 Thread safety: This patch deals with previously unhandled cases when building lock expressions. We now resolve this expressions, avoid crashing when encountering cast expressions, and have a diagnostic for unresolved lock expressions
llvm-svn: 139370
2011-09-09 16:21:55 +00:00
Caitlin Sadowski 33208340bd Thread Safety: Moving the analysis to a new file
llvm-svn: 139369
2011-09-09 16:11:56 +00:00
Caitlin Sadowski a2fd6e0473 Thread safety: refactoring test cases
llvm-svn: 139368
2011-09-09 16:07:55 +00:00
Caitlin Sadowski 0b3501c5e2 Thread safety: refactoring to use an error handler
llvm-svn: 139367
2011-09-09 16:04:02 +00:00
Francois Pichet 2731b7ded3 Update comment because JumpDiagnostics.cpp is not just about VLA scope.
llvm-svn: 139364
2011-09-09 11:02:57 +00:00
John McCall b46f287e48 Clean up the sentinel-attribute checking code a lot. Document
what 'nullPos' is supposed to mean, at least at this one site.
Use closed forms for the arithmetic.  Rip out some clever but
ultimately pointless code that was trying to use 0 or 0L depending
the size of a pointer vs. the size of int;  first, it didn't work
on LLP64 systems, and second, the sentinel checking code requires
a pointer-typed value anyway, so this fixit would not have actually
removed the warning.

llvm-svn: 139361
2011-09-09 07:56:05 +00:00
Argyrios Kyrtzidis 2169a75a0a Do a lookup for the blocks runtime globals to see if they were declared,
instead of codegen waiting to consume such a declaration, which won't
happen if that decls are coming from a PCH.

Fixes rdar://10028656.

llvm-svn: 139359
2011-09-09 06:44:21 +00:00
Argyrios Kyrtzidis e74bc0ef4c [PCH] When loading the decls linked to an identifier, also make them visible
in the translation unit.

llvm-svn: 139358
2011-09-09 06:44:17 +00:00
Argyrios Kyrtzidis 94d3f9dcd0 Use ArrayRef in ExternalASTSource::SetExternalVisibleDeclsForName.
llvm-svn: 139357
2011-09-09 06:44:14 +00:00
John McCall 9c3467e26c Code formatting; no functionality change.
llvm-svn: 139355
2011-09-09 06:12:06 +00:00
John McCall fec112d50e Contextually converting to 'id' is not a useful operation. Contextually
converting to an arbitrary Objective-C pointer type is.  Without
significantly re-implementing anything, change the API to reflect this,
and as a minor optimization, strip the pointer conversion off before
potentially building it.

Mostly, this removes a really bizarre-looking bit of code from
BuildInstanceMessage.

llvm-svn: 139354
2011-09-09 06:11:02 +00:00
John McCall 9320b87cff Give conversions of block pointers to ObjC pointers a different cast kind
than conversions of C pointers to ObjC pointers.  In order to ensure that
we've caught every case, add asserts to CastExpr that strictly determine
which cast kind is used for which kind of bit cast.

llvm-svn: 139352
2011-09-09 05:25:32 +00:00
Richard Trieu 10162ab7ed Clean up the RebuildUnknownAnyExpr visitor in SemaExpr.cpp. Mainly swapped around variable names so that this visitor be more like other visitors in clang.
llvm-svn: 139351
2011-09-09 03:59:41 +00:00
Richard Trieu 9becef691d Changed references of BaseTy, MemInitTy, CXXScopeTy, TemplateParamsTy to CXXBaseSpecifier, CXXCtorInitializer, NestedNameSpecifier, TemplateParameterList and removed their typedefs.
llvm-svn: 139350
2011-09-09 03:18:59 +00:00
Richard Trieu 3481fcd869 Change references to StmtTy to Stmt and removed typedefs of StmtTy. Also removed typedef of AttrTy since it is not used.
llvm-svn: 139349
2011-09-09 02:16:15 +00:00
Douglas Gregor 26701a4371 Modules: introduce the __module_private__ declaration specifier, which
indicates that a declaration is only visible within the module it is
declared in.

llvm-svn: 139348
2011-09-09 02:06:17 +00:00
Richard Trieu 2bd0401b04 Change all references of type ExprTy to Expr and get rid of the typedefs.
llvm-svn: 139347
2011-09-09 02:00:50 +00:00
Richard Trieu ba63ce6b7b Capitialize paramater names in SemaExpr.cpp and resolve any parameter name conflicts between declarations and definitions from this and previous refactorings.
llvm-svn: 139346
2011-09-09 01:45:06 +00:00
Douglas Gregor 3168dcf134 The integer type of an enumeration type isn't always canonical
llvm-svn: 139334
2011-09-08 23:29:05 +00:00
Eric Christopher 22164ed943 Rearrange comment slightly for Bill.
llvm-svn: 139333
2011-09-08 23:28:19 +00:00
Eric Christopher bd202c0496 Remove WCHAR_MIN and WCHAR_MAX from limits.h. According to posix and c99
these should be in stdint.h - and they already are.

Fixes rdar://10097036.

llvm-svn: 139332
2011-09-08 23:25:25 +00:00
Caitlin Sadowski b4d24a9054 Thread safety: small edit to unused variation on warning left in by accident from earlier commit
llvm-svn: 139331
2011-09-08 23:17:03 +00:00
Douglas Gregor 8d9c56bb59 Add some delay between PCH creation and modifying one of the headers it depends on, which will---hopefully make this test predictably pass on Windows
llvm-svn: 139327
2011-09-08 22:32:33 +00:00
Matt Beaumont-Gay 042ce8e9d8 Extend -Wliteral-conversion to catch "int i = -1.234"
llvm-svn: 139326
2011-09-08 22:30:47 +00:00
Caitlin Sadowski ee5db8b5c4 Thread Safety: In C++0x Mutexes are the objects that control access to shared variables, while Locks are the objects that acquire and release Mutexes. We switch to this new terminology.
llvm-svn: 139321
2011-09-08 21:52:50 +00:00
Jakob Stoklund Olesen ed2a360fd1 The frexp, modf, and remquo builtins are not 'const'.
These functions return a second value by writing to a pointer argument,
so they cannot be marked 'readnone' which implies that they don't access
memory.

<rdar://problem/10070234>

llvm-svn: 139319
2011-09-08 21:18:03 +00:00
Caitlin Sadowski 2d3f70ac1c Thread Safety: adding basic no thread safety analysis option
llvm-svn: 139310
2011-09-08 18:35:21 +00:00
Caitlin Sadowski 69b367af17 Thread safety: Adding basic support for locks required and excluded attributes
llvm-svn: 139308
2011-09-08 18:27:31 +00:00
Caitlin Sadowski 46b057681a Thread safety: shared vs. exclusive locks
llvm-svn: 139307
2011-09-08 18:19:38 +00:00
Caitlin Sadowski bc1f11162a Thread safety: small formatting change in test comments
llvm-svn: 139306
2011-09-08 18:07:26 +00:00
Douglas Gregor 6a40b088e9 Look through SubstNonTypeTemplateParmExpr nodes in the various
Expr::Ignore* methods that also look through implicit casts.

llvm-svn: 139303
2011-09-08 17:56:33 +00:00
Caitlin Sadowski 990d571226 Thread safety: added support for function scopes in attribute arguments.
This patch was written by DeLesley Hutchins.

llvm-svn: 139302
2011-09-08 17:42:31 +00:00
Caitlin Sadowski 9385dd7415 Thread Safety: Patch to implement delayed parsing of attributes within a
class scope.

This patch was also written by DeLesley Hutchins.

llvm-svn: 139301
2011-09-08 17:42:22 +00:00
Douglas Gregor dc28ba12e1 Document __has_feature(objc_instancetype).
llvm-svn: 139299
2011-09-08 17:19:31 +00:00
Argyrios Kyrtzidis 80f78b961a [libclang] Fix annotation and getting a "macro expansion" cursor
for a builtin macro expansion.

llvm-svn: 139298
2011-09-08 17:18:41 +00:00
Douglas Gregor 8b7d403684 Allow C++0x enumerations with a fixed underlying type in
Objective-C. The @encode'ing of such an enumeration type is the same
as its underlying type. <rdar://problem/5276348>.

llvm-svn: 139297
2011-09-08 17:18:35 +00:00
Eric Christopher d98e424716 Formatting.
llvm-svn: 139296
2011-09-08 17:15:04 +00:00
Eric Christopher d0e4955b14 Add a block comment explaining how the different source locations work
including some source examples.

llvm-svn: 139295
2011-09-08 17:15:01 +00:00
Abramo Bagnara 41bfb66e76 Added missing initialization.
llvm-svn: 139291
2011-09-08 14:20:25 +00:00
David Blaikie d937bf13d4 Adding FixIts to static/inline main declaration diagnostics.
llvm-svn: 139282
2011-09-08 06:33:04 +00:00
Douglas Gregor bab8a96f2f Implement the Objective-C 'instancetype' type, which is an alias of
'id' that can be used (only!) via a contextual keyword as the result
type of an Objective-C message send. 'instancetype' then gives the
method a related result type, which we have already been inferring for
a variety of methods (new, alloc, init, self, retain). Addresses
<rdar://problem/9267640>.

llvm-svn: 139275
2011-09-08 01:46:34 +00:00
Chad Rosier c31e48d7e4 [driver] i386 kext preprocessor jobs also need their unsupported options
filtered.  This happenis when -save-temps is specified. 
<rdar://problem/10088387>

llvm-svn: 139269
2011-09-08 00:38:00 +00:00
Douglas Gregor af5c48490e Optimize the preprocessor's handling of the __import_module__
keyword. We now handle this keyword in HandleIdentifier, making a note
for ourselves when we've seen the __import_module__ keyword so that
the next lexed token can trigger a module import (if needed). This
greatly simplifies Preprocessor::Lex(), and completely erases the 5.5%
-Eonly slowdown Argiris noted when I originally implemented
__import_module__. Big thanks to Argiris for noting that horrible
regression!

llvm-svn: 139265
2011-09-07 23:11:54 +00:00
Argyrios Kyrtzidis 37ad0091c3 [arcmt] Try fixing the windows buildbot.
llvm-svn: 139262
2011-09-07 21:50:18 +00:00
Argyrios Kyrtzidis 933725c59e Revert r139222, operator->() in PreprocessingRecord::iterator. It is useful
to meet the requirements of the InputIterator concept.

llvm-svn: 139261
2011-09-07 21:50:10 +00:00
Richard Trieu 5f376f6d34 Change diagnoseAddressOfInvalidType() to use an enum to determine what error message to display. Also, move the function call into on location instead of having it spread among many places in the if/else statements.
llvm-svn: 139260
2011-09-07 21:46:33 +00:00
Douglas Gregor 5ca153f112 When parsing a function-try-block that does not have a
ctor-initializer, remember to call the Sema action to generate default
ctor-initializers. What a delightful little miscompile. Fixes PR10578
/ <rdar://problem/9877267>.

llvm-svn: 139253
2011-09-07 20:36:12 +00:00
Kaelyn Uhrain 5a43b461fc Fix Sema::CorrectTypo to ignore found but unresolved symbols
llvm-svn: 139252
2011-09-07 20:25:59 +00:00
Peter Collingbourne 2d7f219caf More missing dependencies picked up by Ninja.
llvm-svn: 139248
2011-09-07 19:12:36 +00:00
James Molloy 98f3e18f25 Fix up MCInstPrinter creation to take the new SubtargetInfo parameter (see LLVM r139237)
llvm-svn: 139238
2011-09-07 17:25:30 +00:00
Fariborz Jahanian eebdb67420 objc-gc: More sema work for properties declared 'weak'
in GC mode. // rdar://10073896

llvm-svn: 139235
2011-09-07 16:24:21 +00:00
Chandler Carruth 3d45b23dfc Extract the emission of the diagnostic's location into a separate
function. This is really the beginning of the second phase of
refactorings here. The end goal is to have (roughly) three interfaces:

1) Base class to format a single diagnostic suitable for display on the
   console.
2) Extension of the base class which also displays a caret diagnostic
   suitable for display on the console.
3) An adaptor that implements the DiagnosticClient by delegating to #1
   and/or #2 as appropriate.

Once we have these, things like libclang's formatDiagnostic can use #1
and #2 to provide really well formatted (and consistently formatted!)
textual formatting of diagnostics.

Getting there is going to be quite a bit of shuffling. I'm basically
sketching out where the interface boundaries can be drawn for #1 and #2
within the existing classes. That lets me shuffle with a minimum of fuss
and delta. Once that's done, and any of the related interfaces that need
to change are updated, I'll hoist these into separate headers and
re-implement libclang in terms of their interfaces. Long WIP, but
comments at each step welcome. =D

llvm-svn: 139228
2011-09-07 08:05:58 +00:00
Chandler Carruth 9779830513 Move the HilightRange method from TextDiagnosticPrinter down to
CaretDiagnostic. It's completely generic, with nothing to do with the
diagnostic client or info APIs.

llvm-svn: 139227
2011-09-07 07:02:31 +00:00
Chandler Carruth e79ddf8c67 Hoist the tab expansion into a helper function.
llvm-svn: 139226
2011-09-07 05:36:50 +00:00
Chandler Carruth 0f1006a95a Don't compute the same line number in two places, once inside a loop.
llvm-svn: 139225
2011-09-07 05:01:10 +00:00
Eli Friedman ce3e2c85b1 Make sure the FunctionDecl's created by "#pragma weak" have correct ParmVarDecl's. PR10878.
llvm-svn: 139224
2011-09-07 04:05:06 +00:00
Argyrios Kyrtzidis 9d4fac0f9f [arcmt] Remove xfail on test for windows, Takumi reported that it passes mingw and msvc.
llvm-svn: 139223
2011-09-07 03:43:41 +00:00
Argyrios Kyrtzidis 7d500b3457 operator->() in PreprocessingRecord::iterator is useless since we
are returning a pointer to pointer.

llvm-svn: 139222
2011-09-07 03:43:39 +00:00
Richard Trieu f9bd0f5d99 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
DiagnoseLogicalAndInLogicalOrLHS()
DiagnoseBinOpPrecedence()
ActOnBinOp()
BuildBinOp()

llvm-svn: 139219
2011-09-07 02:02:10 +00:00
Richard Trieu 4a287fb926 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CreateBuiltinBinOp()
DiagnoseBitwisePrecedence()

llvm-svn: 139218
2011-09-07 01:49:20 +00:00
Chandler Carruth 773757a962 Switch the CharSourceRange array to a small vector. The array was
a stack array of a magical size with an assert() that we never
overflowed it. That seems incredibly risky. We also have a very nice API
for bundling up a vector we expect to usually have a small size without
loss of functionality or security if the size is excessive.

The fallout is to remove the last pointer+size parameter pair that are
traced through the recursive caret diagnostic emission.

llvm-svn: 139217
2011-09-07 01:47:09 +00:00
Eli Friedman e9f8113ec4 Switch clang over to using fence/atomicrmw/cmpxchg instead of the intrinsics (which will go away). LLVM CodeGen does almost exactly the same thing with these and the old intrinsics, so I'm reasonably confident this will not break anything.
There are still a few issues which need to be resolved with code generation for atomic load and store, so I'm not converting the places which need those for now.

I'm not entirely sure what to do about __builtin_llvm_memory_barrier: the fence instruction doesn't expose all the possibilities which can be expressed by __builtin_llvm_memory_barrier.  I would appreciate hearing from anyone who is using this intrinsic.

llvm-svn: 139216
2011-09-07 01:41:24 +00:00
Richard Trieu da4f43a609 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckAssignmentOperands()
DiagnoseSelfAssignment()
checkArithmeticNull()

llvm-svn: 139215
2011-09-07 01:33:52 +00:00
Richard Trieu bcce2f7189 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckVectorCompareOperands()
CheckBitwiseOperands()
CheckLogicalOperands()

llvm-svn: 139214
2011-09-07 01:19:57 +00:00
Richard Trieu aa5e256c20 Change the self-reference visitor (which gives the warning for self-reference oninitalization warning of -Wuninitialized) to exclude member variables that can decay into pointers. This will cause it to no longer warn on this code:
struct foo { char a[100], *e; } bar = { .e = bar.a };

llvm-svn: 139213
2011-09-07 00:58:53 +00:00
Fariborz Jahanian 5f2b703651 objc-gc: Don't force a __strong type'd property
to be 'weak'. This prevents a crash and should 
probably be flagged as error - later to come.

llvm-svn: 139211
2011-09-07 00:38:49 +00:00
Francois Pichet bcf6471010 In Microsoft mode, if we are inside a template class member function and we can't resolve a function call then create a type-dependent CallExpr even if the function has no type dependent arguments. The goal is to postpone name lookup to instantiation time to be able to search into type dependent base classes.
With this patch in, clang will generate only 37 errors (down from 212) when parsing a typical MFC source file.

llvm-svn: 139210
2011-09-07 00:14:57 +00:00
Chad Rosier e75ef40843 [driver] When clang crashes, don't try to generate diagnostics (i.e.,
preprocessor output) with multiple -arch options.

llvm-svn: 139207
2011-09-06 23:52:36 +00:00
Fariborz Jahanian 6dd3f39dae objc-gc: Adds support for "weak" property attribute under GC.
// rdar://10073896

llvm-svn: 139203
2011-09-06 23:32:40 +00:00
Chandler Carruth cf57ebfd4c Remove the doxyment for this now defunct parameter.
llvm-svn: 139197
2011-09-06 22:34:36 +00:00
Chandler Carruth 935574de2f Don't recompute the presumed loc twice in 5 lines of code... Spotted by
inspection.

llvm-svn: 139196
2011-09-06 22:34:33 +00:00
Chandler Carruth 1f28e6c7e3 Use ArrayRef for the fixit hint array rather than a pointer and a size.
Clean up loops over the hints to use the more idiomatic iterator form in
LLVM and Clang.

llvm-svn: 139195
2011-09-06 22:31:44 +00:00
Chandler Carruth 20bfaa0f68 Hoist the construction of the FixItHint line into a member function with
a defined interface. This isn't as nice as the previous one, but should
get better as I push through better data types in all these functions.

Also, I'm hoping to pull some aspects of this out into a common routine
(such as tab expansion).

Again, WIP, comments welcome as I'm going through.

llvm-svn: 139190
2011-09-06 22:01:04 +00:00
Richard Trieu b80728fe9a Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckCompareOperands()

llvm-svn: 139187
2011-09-06 21:43:51 +00:00
Douglas Gregor e0e9630e07 When extracting the callee declaration from a call expression, be sure
to look through SubstNonTypeTemplateParmExprs. Then, update the IR
generation of CallExprs to actually use CallExpr::getCalleeDecl()
rather than attempting to mimick its behavior (badly).

Fixes <rdar://problem/10063539>.

llvm-svn: 139185
2011-09-06 21:41:04 +00:00
Richard Trieu 1762d7cc35 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
checkEnumComparison()
diagnoseDistinctPointerComparison()
convertPointersToCompositeType()
diagnoseFunctionPointerToVoidComparison()

llvm-svn: 139184
2011-09-06 21:27:33 +00:00
Richard Trieu e4a19fbd0c Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
DiagnoseBadShiftValues()
CheckShiftOperands()

llvm-svn: 139183
2011-09-06 21:21:28 +00:00
Richard Trieu 4ae7e97667 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
diagnoseArithmeticOnTwoVoidPointers()
checkArithmeticBinOpPointerOperands()
diagnosePointerIncompatibility()
CheckAdditionOperands()
CheckSubtractionOperands()

llvm-svn: 139182
2011-09-06 21:13:51 +00:00
Richard Trieu 859d23fa5e Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckVectorOperands()
CheckMultiplyDivideOperands()
CheckRemainderOperands()

llvm-svn: 139181
2011-09-06 21:01:04 +00:00
Ted Kremenek 99c0966fc4 Place 'equality comparison with extraneous parentheses...' into a subgroup of -Wparentheses called -Wparentheses-equality.
llvm-svn: 139180
2011-09-06 20:58:32 +00:00
Douglas Gregor 49695f078e Implement the Named Return Value Optimization (NRVO) for blocks.
llvm-svn: 139178
2011-09-06 20:46:03 +00:00
Richard Trieu eb29914c5d Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckTransparentUnionArgumentConstraints()
CheckSingleAssignmentConstraints()
InvalidOperands()

llvm-svn: 139176
2011-09-06 20:40:12 +00:00
Douglas Gregor e3f3ea08a8 Implement the Named Return Value Optimization (NRVO) for Objective-C++
methods. Fixes PR10835 / <rdar://problem/10050178>.

llvm-svn: 139175
2011-09-06 20:33:37 +00:00
Richard Trieu de4958fb28 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckAssignmentConstraints()

llvm-svn: 139173
2011-09-06 20:30:53 +00:00
Richard Trieu a871b97da5 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
checkPointerTypesForAssignment()
checkBlockPointerTypesForAssignment()
checkObjCPointerTypesForAssignment()
CheckAssignmentConstraints()

llvm-svn: 139170
2011-09-06 20:21:22 +00:00
Richard Trieu d33e46e943 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
DiagnoseConditionalForNull()
CheckConditionalOperands()
IsArithmeticBinaryExpr()
DiagnoseConditionalPrecedence()

llvm-svn: 139167
2011-09-06 20:06:39 +00:00
Benjamin Kramer 499c68b5f6 Spelling.
llvm-svn: 139165
2011-09-06 19:57:14 +00:00
Richard Trieu 9a52fbb2d0 Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
handleIntegerConversion()
UsualArithmeticConversions()

llvm-svn: 139164
2011-09-06 19:52:52 +00:00
Ted Kremenek fed48af3de Don't emit -Wpadded warnings without a valid SourceLocation. This can happen when RecordLayoutBuilder is used by Codegen, not Sema.
llvm-svn: 139162
2011-09-06 19:40:45 +00:00
Eli Friedman cf9b1f6524 Rearrange code so that we pass the right pointer to delete[] when an exception is thrown constructing the array elements in an array new expression. Fixes PR10870.
llvm-svn: 139158
2011-09-06 18:53:03 +00:00
Richard Trieu cfe3f21cec Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
handleFloatConversion()
handleComplexIntConvsersion()

llvm-svn: 139153
2011-09-06 18:38:41 +00:00
Richard Trieu 5065cdd0ea Rename variables in SemaExpr.cpp to give a more consistant naming scheme.
ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
handleComplexFloatToComplexFloatConverstion()
handleComplexFloatConversion()

llvm-svn: 139151
2011-09-06 18:25:09 +00:00
Richard Smith a8a5c402bb Advertise support for cxx_range_for as an extension in C++98 mode. Patch by Jean-Daniel Dupas!
Also provide a modicum of test coverage for ranged for in C++98.

llvm-svn: 139149
2011-09-06 18:03:41 +00:00
Douglas Gregor cd0d826001 Finish implementing (de-)serialization of the CXXDefinitionData bits
needed for implicit move constructors and move assignment
operators. Fixes PR10847.

llvm-svn: 139144
2011-09-06 16:38:46 +00:00
Douglas Gregor 146b8e9a58 When performing a derived-to-base cast on the right-hand side of the
synthesized move assignment within an implicitly-defined move
assignment operator, be sure to treat the derived-to-base cast as an
xvalue (rather than an lvalue). Otherwise, we'll end up getting the
wrong constructor.

Optimize a direct call to a trivial move assignment operator to an
aggregate copy, as we do for trivial copy assignment operators, and
update the the assertion in CodeGenFunction::EmitAggregateCopy() to
cope with this optimization.

Fixes PR10860.

llvm-svn: 139143
2011-09-06 16:26:56 +00:00
Richard Smith 3ab15558d7 PR10867: Work around a bug in lit. Multiple RUN: lines are joined with &&, so:
RUN: foo
  RUN: bar || true

is equivalent to:

  RUN: foo && bar || true

which is equivalent to:

  RUN: (foo && bar) || true

This resulted in several of the fixit tests not really testing anything.

llvm-svn: 139132
2011-09-06 03:01:15 +00:00
Peter Collingbourne 2e8201422d Add missing dependency
Spotted by Ninja.

llvm-svn: 139129
2011-09-06 02:08:40 +00:00
Peter Collingbourne 15a26dacbc Fix typo
llvm-svn: 139128
2011-09-06 02:08:36 +00:00
Peter Collingbourne fa9771ffec Add the resource directory to the search path for Driver::GetFilePath,
as well as the search path printed by -print-search-dirs.

The main purpose of this change is to cause -print-file-name=include
to print the path to the include directory under Clang's resource
directory, instead of the system compiler's include directory, whose
header files Clang may not be able to parse.  Some build scripts will
do something like:
  $(CC) -nostdinc -I`$(CC) -print-file-name=include`
to exclude all header paths except the compiler's.

llvm-svn: 139127
2011-09-06 02:08:31 +00:00
Benjamin Kramer 17ff23c708 Speed up BCPL comment lexing by looking aggressively for newlines and then scannig backwards to see if the newline is escaped.
3% speedup in preprocessing all of clang with -Eonly. Also includes a small testcase for coverage.

llvm-svn: 139116
2011-09-05 07:19:39 +00:00
Benjamin Kramer dbfb18a0a9 Use the Lexer's definition of whitespace here.
llvm-svn: 139115
2011-09-05 07:19:35 +00:00
Benjamin Kramer e007e80fc0 Stop cluttering the test directory with temporary files.
llvm-svn: 139114
2011-09-05 07:19:32 +00:00
Chandler Carruth 58b3749d6c Enable -Wdangling-fields by default in Clang. I've run this warning over
a very large chunk of code and found zero false positives. I've only
found a few bugs, but that likely is because bugs of this nature
actually do manifest. We've also identified several bugs that were
caught by Valgrind, but would have been caught faster and more easily
with this warning.

If anyone has concerns, or this causes fallout on any build bots, lemme
know. I'm happy to just put it under -Wmost.

llvm-svn: 139112
2011-09-05 05:47:35 +00:00
Richard Smith a528507418 Implement the suggested resolution of WG21 N3307 issue 19: When determining whether a class is an aggregate in C++0x, treat all functions which are neither deleted nor defaulted as user-provided, not just special member functions. The wording of the standard only defines the term "user-provided" for special member functions, but the intent seems to be that any function can be user-provided.
llvm-svn: 139111
2011-09-05 02:13:09 +00:00
Richard Smith 3f9211d322 PR10506: Extend test for temporary cleanups in range-based for loop to cover the dependent case.
llvm-svn: 139109
2011-09-04 23:52:03 +00:00
Francois Pichet 4391c7529a Pass 0 instead of a empty TemplateArgumentListInfo when creating a CXXDependentScopeMemberExpr to handle a "this->" fixit (lookup into dependent bases of class template)
Otherwise the fixit doesn't really work for subsequent lookup.

llvm-svn: 139105
2011-09-04 23:00:48 +00:00
Benjamin Kramer 60053cf547 Use const_cast to avoid warnings.
llvm-svn: 139104
2011-09-04 20:26:28 +00:00
Richard Smith 5065864151 PR10458: Last part of providing 'auto' type specifier as an extension in C++98: permit it within type-ids.
llvm-svn: 139103
2011-09-04 20:24:20 +00:00
Richard Smith 58c7433709 PR10458: Finesse behaviour of C++0x features when in pre-0x mode. Accept for-range and auto with an ExtWarn, and produce a -Wc++0x-compat warning in C++98 mode when auto is used as a storage class.
llvm-svn: 139102
2011-09-04 19:54:14 +00:00
Sebastian Redl e9c4e84f8e Add test case for defaulted copy and move structure validation.
Fix bug this uncovered.
Address minor comments from Doug.
Enable cxx_implicit_moves feature.

llvm-svn: 139101
2011-09-04 18:14:28 +00:00
Argyrios Kyrtzidis b914e3bc5c Handle a code-completion token being passed to the macro stringify operator.
Fixes http://llvm.org/PR10826.

llvm-svn: 139087
2011-09-04 03:32:19 +00:00
Argyrios Kyrtzidis 5cec2aea3f Support code-completion for C++ inline methods and ObjC buffering methods.
Previously we would cut off the source file buffer at the code-completion
point; this impeded code-completion inside C++ inline methods and,
recently, with buffering ObjC methods.

Have the code-completion inserted into the source buffer so that it can
be buffered along with a method body. When we actually hit the code-completion
point the cut-off lexing or parsing.

Fixes rdar://10056932&8319466

llvm-svn: 139086
2011-09-04 03:32:15 +00:00
Argyrios Kyrtzidis a3deaeeb52 Fix Lexer::ComputePreamble when MaxLines parameter is non-zero.
The function was only counting lines that included tokens and not empty lines,
but MaxLines (mainly initiated to the line where the code-completion point resides)
is a count of overall lines (even empty ones).

llvm-svn: 139085
2011-09-04 03:32:04 +00:00
Benjamin Kramer a66aaa93ee More unused variable removal.
llvm-svn: 139080
2011-09-03 08:46:20 +00:00
Benjamin Kramer 2667afa980 Make helpers static, remove unused variables.
llvm-svn: 139078
2011-09-03 03:30:59 +00:00
Chandler Carruth d551d4e1da Teach -Wdangling-field to warn about temporaries bound to references as
well.

Also, clean up the flow of the code a bit, and factor things more
nicely.

Finally, add the test case that was missing from my previous
commit (sorry), with new tests added to cover temporaries and other fun
cases.

llvm-svn: 139077
2011-09-03 02:21:57 +00:00
Chandler Carruth 599deef379 Add a simple new warning to catch blatantly dangling pointer and
reference members of classes. We've had several bugs reported because of
this, and there's no reason not to flag it right away in the compiler.

Comments especially welcome on the strategy for implementing this
warning (IE, what should trigger this?) and on the text of the warning
itself.

I'm going to extend this to cover obvious cases with temporaries and
beef up the test cases some in subsequent patches. I'll then run it over
a large codebase and make sure its not misbehaving before I add it to
-Wall or turn it on by default. I think this one might be a good
candidate for on by default.

llvm-svn: 139075
2011-09-03 01:14:15 +00:00
Fariborz Jahanian 4efb6b35f6 Revise test and see if it passes with a release-built clang.
llvm-svn: 139043
2011-09-02 21:47:51 +00:00
Richard Trieu 48277e5710 Fix some indenting issues in SemaExpr.cpp
llvm-svn: 139042
2011-09-02 21:44:27 +00:00
Fariborz Jahanian 2bb8270e6f blocks: Support capturing complex variable in block.
// rdar://10033896

llvm-svn: 139041
2011-09-02 21:33:44 +00:00
Richard Trieu 7aa58f1eea Refactor UsualArithmeticConversions() in SemaExpr.cpp into several functions.
llvm-svn: 139033
2011-09-02 20:58:51 +00:00
Fariborz Jahanian b74711df52 revert patch in r139020
llvm-svn: 139029
2011-09-02 20:03:16 +00:00
Ted Kremenek aed4677a1c -Wuninitialized: fix insidious bug resulting from interplay of blocks and dead code. Fixes <rdar://problem/10060250>.
llvm-svn: 139027
2011-09-02 19:39:26 +00:00
Fariborz Jahanian f30bc00103 blocks: Support capturing complex variable in block.
// rdar://10033896

llvm-svn: 139020
2011-09-02 18:39:40 +00:00
Eli Friedman 29538899ef Make StmtDumper::VisitCXXFunctionalCastExpr dump the attached cast kind. Fix the cast kind for a cast from floating-point to enum type. (The difference isn't actually visible, but that's just because IRGen is overly forgiving.) Per report by Enea Zaffanella on cfe-dev.
llvm-svn: 139011
2011-09-02 17:38:59 +00:00
Jordy Rose 087611ed81 [analyzer] Remove TransferFuncs.h, then deal with the fallout.
And with that, TransferFuncs is gone!

llvm-svn: 139003
2011-09-02 08:02:59 +00:00
Jordy Rose 75e680eae3 [analyzer] Move RetainReleaseChecker to the Checkers library and rename it to RetainCountChecker...and clean up the file while I'm at it.
llvm-svn: 139002
2011-09-02 06:44:22 +00:00
Chandler Carruth d3e83677b4 Hoist the emission of parseable fixits into a helper method, simplifying
and reducing indentation through the clever use of early exits. ;]

llvm-svn: 139001
2011-09-02 06:30:30 +00:00
Jordy Rose dd7a654b1a [analyzer] Remove lingering CFRefCount creation, which would have resulted in a leak. There's room for improvement here...
llvm-svn: 139000
2011-09-02 06:29:27 +00:00
Jordy Rose a87a2775fa [analyzer] Fix member initialization order. No functionality change.
llvm-svn: 138999
2011-09-02 06:21:26 +00:00
Jordy Rose c49ec53e29 [analyzer] Move the knowledge of whether or not GC is enabled for the current analysis from CFRefCount to ExprEngine.
Remove TransferFuncs from ExprEngine and AnalysisConsumer.

Demote RetainReleaseChecker to a regular checker, and give it the name osx.cocoa.RetainCount (class name change coming shortly). Update tests accordingly.

llvm-svn: 138998
2011-09-02 05:55:19 +00:00
Richard Trieu eea56f785e Move the warning for different enum comparisons and the warning for using NULL as a non-pointer in a binary operation into separate functions.
llvm-svn: 138995
2011-09-02 03:48:46 +00:00
Richard Trieu dd82a5c5d7 Reduce code duplication for pointer comparisons in CheckCompareOperands().
llvm-svn: 138994
2011-09-02 02:55:45 +00:00
Richard Trieu aba2280573 Pull out incomplete pointer type checking code, used from arithmetic checking functions, into its own function.
llvm-svn: 138993
2011-09-02 02:15:37 +00:00
Richard Trieu 27ae4cb7c4 Refactor CheckConditionalOperands() by moving chunks of code to helper functions making a slimmer function.
llvm-svn: 138992
2011-09-02 01:51:02 +00:00
Richard Trieu 3fd7bb8224 Refactor CheckAddressOfOperand() by pulling out redundant code and moving hard coding strings from SemaExpr.cpp to DiagnosticSemaKinds.td.
llvm-svn: 138987
2011-09-02 00:47:55 +00:00
Douglas Gregor 8835e03cee Always construct an ASTReader with a non-NULL ASTContext and
Preprocessor, eliminating the constructor that was used by ASTUnit
(which didn't provide an ASTContext or Prepreprocessor). Ensuring that
both objects are non-NULL will simplify module loading (but none of
that is done yet).

llvm-svn: 138986
2011-09-02 00:26:20 +00:00
Douglas Gregor e8bbc12152 Extend the ASTContext constructor to delay the initialization of
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).

llvm-svn: 138985
2011-09-02 00:18:52 +00:00
Douglas Gregor 83297dfc7e Allow the preprocessor to be constructed without performing target-
and language-specific initialization. Use this to allow ASTUnit to
create a preprocessor object *before* loading the AST file. No actual
functionality change.

llvm-svn: 138983
2011-09-01 23:39:15 +00:00
Richard Trieu b10c631f53 Refactor CheckAdditionOperands(), CheckSubtractionOperands(), and CheckIncrementDecrementOperand() in SemaExpr.cpp to move reused code to separate functions.
llvm-svn: 138975
2011-09-01 22:53:23 +00:00
Argyrios Kyrtzidis 43ea78b48d Don't try keeping a 'LeadingEmptyMacroLoc' in NullStmt. This fails
in the face of buffering C++/ObjC method bodies.

llvm-svn: 138972
2011-09-01 21:53:45 +00:00
Argyrios Kyrtzidis 48d7798de1 [arcmt] Clear out temporary dirs in the tests or we may get failures because of leftovers.
llvm-svn: 138971
2011-09-01 21:53:39 +00:00
Nick Lewycky 0112b11f5c Don't try to emit unsupported templated friend declarations. They're unsupported
and may very well be dependent-types, triggering an assertion in debug info
codegen.

llvm-svn: 138970
2011-09-01 21:49:51 +00:00
Richard Trieu a04ad1a1b9 Extend the self-reference warning to catch when a constructor references itself upon initialization, such as using itself within its own copy constructor.
struct S {};
S s(s);

llvm-svn: 138969
2011-09-01 21:44:13 +00:00
Argyrios Kyrtzidis cbbc0141f6 [arcmt] Fix test/ARCMT/remove-statements.m regression due to
Objective-C method buffering(rdar://10056942)

Turned out the same issue existed for C++ inline methods.

llvm-svn: 138960
2011-09-01 20:53:18 +00:00
Douglas Gregor 7018d5bcfb Teach ASTContext and Preprocessor to hold on to references to the same
LangOptions, rather than making distinct copies of
LangOptions. Granted, LangOptions doesn't actually get modified, but
this will eventually make it easier to construct ASTContext and
Preprocessor before we know all of the LangOptions.

llvm-svn: 138959
2011-09-01 20:23:19 +00:00
Fariborz Jahanian 415e47dd6e default property synthesis is off by default
for now.

llvm-svn: 138958
2011-09-01 20:23:17 +00:00
Douglas Gregor 6ac0b717b4 Make test slightly trickier
llvm-svn: 138957
2011-09-01 19:02:18 +00:00
Fariborz Jahanian f7a3d4ad15 objective-c: Make auto synthesis of properties the default.
This concludes //rdar://8843851

llvm-svn: 138947
2011-09-01 17:50:05 +00:00
Douglas Gregor 4a69c2e6c5 Modules hide macro definitions by default, so that silly things like
include guards don't show up as macro definitions in every translation
unit that imports a module. Macro definitions can, however, be
exported with the intentionally-ugly #__export_macro__
directive. Implement this feature by not even bothering to serialize
non-exported macros to a module, because clients of that module need
not (should not) know that these macros even exist.

llvm-svn: 138943
2011-09-01 17:04:32 +00:00
Francois Pichet 0274487d97 Enable -fdelayed-template-parsing by default on Win32.
I had to force -fno-delayed-template-parsing on some Index tests because delayed template parsing will change the output of some tests.

llvm-svn: 138942
2011-09-01 16:38:08 +00:00
Rafael Espindola 5f344fff08 Fix PR10744 by adding the toolchain path to the regular program path
and doing a simple search. Before we would manually check for the linker
before the -B options were searched.

llvm-svn: 138941
2011-09-01 16:25:49 +00:00
Hans Wennborg ecc25a2812 Add 4.4.6 to GccVersions[] in lib/Driver/ToolChains.cpp.
llvm-svn: 138940
2011-09-01 14:41:39 +00:00
Zhongxing Xu bfb8e2fe6e If size was equal to 0, either NULL or a pointer suitable to be passed to
free() is returned by realloc(). Most code expect NULL.

And we only need to transfer one final ProgramState.

llvm-svn: 138937
2011-09-01 04:53:59 +00:00
Argyrios Kyrtzidis 019f3c2444 Fix "multi-line comment" compiler error.
llvm-svn: 138936
2011-09-01 03:07:11 +00:00
Douglas Gregor 528499bb44 When defining the implicit move assignment operator, don't perform
semantic analysis when taking the address of an xvalue. Instead, just
build the unary operator directly, since it's safe to do so (from the
IRgen and AST perspectives) for any glvalue. Fixes PR10822.

llvm-svn: 138935
2011-09-01 02:09:07 +00:00
Argyrios Kyrtzidis 7d847c9fd8 Support importing of ObjC categories from modules.
The initial incentive was to fix a crash when PCH chaining categories
to an interface, but the fix was done in the "modules way" that I hear
is popular with the kids these days.

Each module stores the local chain of categories and we combine them
when the interface is loaded. We also warn if non-dependent modules
introduce duplicate named categories.

llvm-svn: 138926
2011-09-01 00:58:55 +00:00
Chandler Carruth eef47ba664 Create a CaretDiagnostic class to hold the logic for emitting
(unsurprisingly) caret diagnostics. This is designed to bring some
organization to the monstrous EmitCaretDiagnostic function, and allow
factoring it more easily and with less mindless parameter passing.

Currently this just lifts the existing function into a method, and
splits off the obviously invariant arguments to be class members. No
functionality is changed, and there are still lots of warts to let
existing code continue functioning as-is. Definitely WIP, more cleanups
to follow.

llvm-svn: 138921
2011-08-31 23:59:23 +00:00
Chandler Carruth 153a7bb35e Sink all of the include stack printing logic into its member function.
llvm-svn: 138920
2011-08-31 23:59:19 +00:00
Anna Zaks 5efad63f57 [analyzer] Revert a regression introduced in r133104(The ARC Migration Tool..) due to a merge error.
llvm-svn: 138919
2011-08-31 23:53:24 +00:00
Fariborz Jahanian b93cd18a82 Test for default property synthesis.
llvm-svn: 138917
2011-08-31 23:32:48 +00:00
Fariborz Jahanian 97d744bea4 objective-c: this patch (re)introduces objective-c's default property
synthesis. This new feature is currently placed under 
-fobjc-default-synthesize-properties option
and is off by default pending further testing.
It will become the default feature soon. 
// rdar://8843851

llvm-svn: 138913
2011-08-31 22:24:06 +00:00
Douglas Gregor dd8a2fe0be Switch the "no module found" default-fatal warning to a default-fatal error.
llvm-svn: 138909
2011-08-31 21:52:21 +00:00
John McCall fa6f5d6ab8 Don't assert when diagnosing a missing cast of an unknown-anytype
message send to an unknown method.

rdar://problem/9416370, redux.

llvm-svn: 138893
2011-08-31 20:57:36 +00:00
Chad Rosier 64707fee22 [driver] If no -miphoneos-version-min is specified on the command line *and*
IPHONEOS_DEPLOYMENT_TARGET if undefined, set -miphoneos-version-min based on 
isysroot.

llvm-svn: 138892
2011-08-31 20:56:25 +00:00
Eli Friedman 874844123f Make sure to initialize field. Hopefully this will fix some test failures on Windows.
llvm-svn: 138880
2011-08-31 18:45:31 +00:00
Chandler Carruth f38e760777 Don't verify the name of the driver executable. It's not really relevent
to this test, and doesn't always start with 'clang' when fully resolved
on some build systems.

llvm-svn: 138878
2011-08-31 18:39:20 +00:00
Jordy Rose 973a8886f6 [analyzer] Fix varargs helper to only use POD types even for named arguments. Thanks, Joerg.
llvm-svn: 138875
2011-08-31 18:33:45 +00:00
Douglas Gregor ca97589f7d Switch __import__ over to __import_module__, so we don't conflict with
existing practice with Python extension modules. Not that Python
extension modules should be using a double-underscored identifier
anyway, but...

llvm-svn: 138870
2011-08-31 18:19:09 +00:00
Fariborz Jahanian bd0642fede objective-c - This patch buffers method implementations
and does the Sema on their body after the entire 
class/category @implementation is seen. This change allows messaging 
of forward private methods, as well as, access to 
synthesized ivars of properties with foward synthesize
declarations; among others. In effect, this patch removes
several restrictions placed on objective-c due to in-place
semantics processing of methods.
This is part of // rdar://8843851.

llvm-svn: 138865
2011-08-31 17:37:55 +00:00
Chandler Carruth 4aa01ef19c Update libclang to have APIs corresponding to the new 'expansion' naming
system for macro-backed source locations. The old APIs are preserved for
legacy users.

This was intended to land with the main work of instantiation ->
expansion, but despite running it by Doug over a month ago, I forgot to
commit it. Very sorry for that...

llvm-svn: 138860
2011-08-31 16:53:37 +00:00
Sebastian Redl b74486312b Serialize the new bits in CXXRecordDecl::DefinitionData.
llvm-svn: 138855
2011-08-31 13:59:56 +00:00
Chandler Carruth c841b6e598 Improve the diagnostic text for -Wmissing-noreturn to include the name
of the function in question when applicable (that is, not for blocks).
Patch by Joerg Sonnenberger with some stylistic tweaks by me.

When discussing this weth Joerg, streaming the decl directly into the
diagnostic didn't work because we have a pointer-to-const, and the
overload doesn't accept such. In order to make my style tweaks to the
patch, I first changed the overload to accept a pointer-to-const, and
then changed the diagnostic printing layer to also use
a pointer-to-const, cleaning up a gross line of code along the way.

llvm-svn: 138854
2011-08-31 09:01:53 +00:00
Eli Friedman 3781a36238 Change err_pp_file_not_found back to an Error; when it's a Warning, we suppress it in system headers. And it is not a good idea to suppress it in system headers. (This was originally changed in r134996 to implement -MG.)
Fixes <rdar://10041960>.  And also brings down the number of warnings without a flag by one :)

llvm-svn: 138842
2011-08-30 23:07:51 +00:00
Douglas Gregor 86325ad2b5 Allow C99 hexfloats in C++0x mode. This change resolves the standards
collision between C99 hexfloats and C++0x user-defined literals by
giving C99 hexfloats precedence. Also, warning about user-defined
literals that conflict with hexfloats and those that have names that
are reserved by the implementation. Fixes <rdar://problem/9940194>.

llvm-svn: 138839
2011-08-30 22:40:35 +00:00
Jeffrey Yasskin 924255875e Fix PR10694: Boolean conversions can be from pointers, and those conversions
aren't considered narrowing conversions.

llvm-svn: 138838
2011-08-30 22:25:41 +00:00
Douglas Gregor 05ef93158d When writing out the entries in a lookup table for a DeclContext, make
sure that all of the CXXConversionDecls go into the same
bucket. Otherwise, name lookup might not find them all. Fixes
<rdar://problem/10041960>.

llvm-svn: 138824
2011-08-30 20:49:19 +00:00
Sebastian Redl 22653bac1a Declare and define implicit move constructor and assignment operator.
This makes the code duplication of implicit special member handling even worse,
but the cleanup will have to come later. For now, this works.
Follow-up with tests for explicit defaulting and enabling the __has_feature
flag to come.

llvm-svn: 138821
2011-08-30 19:58:05 +00:00
Argyrios Kyrtzidis 3a5094b18c Remove a few mutating ObjCCategoryDecl methods.
Remove
  -setClassInterface
  -setNextClassCategory
  -insertNextClassCategory

and combine them in the Create function.

llvm-svn: 138817
2011-08-30 19:43:26 +00:00
Argyrios Kyrtzidis d3497db59b In ASTWriter::WriteDeclContextVisibleBlock, don't write empty lookups.
Empty lookups can occur in the DeclContext map when we are chaining PCHs, where
the empty lookup indicates that we already looked in ExternalASTSource.

llvm-svn: 138816
2011-08-30 19:43:23 +00:00
Argyrios Kyrtzidis 342e08fbf1 Remove a couple of unnecessary objc method lookups.
llvm-svn: 138815
2011-08-30 19:43:21 +00:00
Argyrios Kyrtzidis 6b0cf7e5fc [libclang] Rename some functions and make sure we don't iterate past the tokens array.
llvm-svn: 138813
2011-08-30 19:43:19 +00:00
Fariborz Jahanian 59b75285f6 objc - fixes a regression in declaring c decls nested in
objective-c containers due to recent changes to objc decl 
contexts. // rdar://10041908

llvm-svn: 138803
2011-08-30 17:10:52 +00:00
Jordy Rose b7abce9f8b Remove obsolete ObjCInferRelatedReturnType from LangOptions...the correct option is ObjCInferRelatedResultType.
llvm-svn: 138793
2011-08-30 01:51:13 +00:00
John McCall 3480ef24d1 The size of struct UnwindException varies by platform with no
apparent general rule.  Just special-case it as appropriate.
PR10789.

llvm-svn: 138792
2011-08-30 01:42:09 +00:00
John McCall 154a2fd3cb Be sure to emit lvalue-to-rvalue casts for loads from x-values.
Doing this happens to disrupt the pattern that ARC was looking for
for move optimizations, so we need to fix that simultaneously.

llvm-svn: 138789
2011-08-30 00:57:29 +00:00
Douglas Gregor cd267f7e0d Update mingw-w64 part of the user manual, from Ruben Van Boxem!
llvm-svn: 138788
2011-08-30 00:40:12 +00:00
Douglas Gregor 9f05ed53fd Fix a typo when determining whether to strip cv-qualifiers during template argument deduction
llvm-svn: 138787
2011-08-30 00:37:54 +00:00
Douglas Gregor 506d34a0df Update python testcase for GNU old-style field designator warning,
from Anders Waldenborg!

llvm-svn: 138786
2011-08-30 00:16:30 +00:00
Douglas Gregor 7c7c068251 Add support for Cursor.displayname in python bindings, from Anders Waldenborg!
llvm-svn: 138785
2011-08-30 00:15:34 +00:00
John McCall 0562caaad6 Update the comment on the default-argument conversion fix; thanks to
Johannes Schaub for talking me around to sense.

llvm-svn: 138784
2011-08-29 23:55:37 +00:00
Caitlin Sadowski ccdceb5aac Thread safety: Adding a name to the thread safety diagnostic group to prevent typos
llvm-svn: 138783
2011-08-29 23:33:18 +00:00
Nico Weber f926a45df5 Do not warn about [super finalize] in arc mode.
llvm-svn: 138776
2011-08-29 22:59:14 +00:00
Ivan Krasin 69a990badb Clang/PNaCl: Improve test coverage for PNaClTargetInfo (type aligns), fixes nits:
- wrong alignment for double (it was 4, but 8 is desired),
- added checks for _REENTRANT define,
- fixed the issue that defines were not tested (because the check for inside #ifdef).

llvm-svn: 138775
2011-08-29 22:39:12 +00:00
Caitlin Sadowski dd5fd87a6d Thread safety: added basic handling for pt_guarded_by/var and guarded_by/var annotations. We identify situations where we are accessing (reading or writing) guarded variables, and report an error if the appropriate locks are not held.
llvm-svn: 138774
2011-08-29 22:27:51 +00:00
Fariborz Jahanian abc11aa3bc Fix a rewriter bug caused by recent changes in objc's
group decls.

llvm-svn: 138772
2011-08-29 22:21:46 +00:00
Eli Friedman f8cb480528 Add missing function _mm_ucomige_sd to emmintrin.h. PR10803.
llvm-svn: 138769
2011-08-29 21:26:24 +00:00
Anna Zaks 50dd696339 [analyzer] MacOSKeychainAPIChecker: Simplify getSymbolForRegion by using existing API. Thanks Jordy.
llvm-svn: 138765
2011-08-29 21:10:00 +00:00
Anna Zaks 814adf7752 Fix: Bug 10798 - [analyzer] Crash when analyzing ICU. (A slight improvement on the previous commit.)
llvm-svn: 138762
2011-08-29 20:43:37 +00:00
Anna Zaks cda129eb1c Fix bug 10797: Crash: "cast<Ty>() argument of incompatible type!" assert when analyzing ICU.
Patch by Jean-Daniel Dupas. Thanks for spotting and fixing!

llvm-svn: 138757
2011-08-29 20:05:54 +00:00
Eli Friedman d62d51c84d Some minor updates to the Linux search path handling for Slackware. Patch by Will Dietz. PR10692.
llvm-svn: 138753
2011-08-29 18:56:43 +00:00
Fariborz Jahanian 4327b32654 Minor clean up of objc's decl context stuff.
No change in functionality.

llvm-svn: 138742
2011-08-29 17:33:12 +00:00
Douglas Gregor 26858b7e10 Add and document __has_feature values for the remaining C++0x
features, so clients can check for the availability of these features
even before we get around to implementing them.

llvm-svn: 138741
2011-08-29 17:28:38 +00:00
Caitlin Sadowski 293d24a5ba Thread safety: various minor bugfixes, with test cases
This patch is by DeLesley Hutchins.

llvm-svn: 138738
2011-08-29 17:12:27 +00:00
Matt Beaumont-Gay d6238f4717 Fix type mismatch in initialization (caught by -Wliteral-conversion)
llvm-svn: 138736
2011-08-29 16:37:29 +00:00
Jeffrey Yasskin 74231381a3 Print 'int' instead of 'const int' in the narrowing conversion error, since the
qualification of a type doesn't affect whether a conversion is a narrowing
conversion.
This doesn't work in template cases because SubstTemplateTypeParmType gets in
the way.

llvm-svn: 138735
2011-08-29 15:59:37 +00:00
Nico Weber 1fb82667dd Warn on missing [super finalize] calls.
This matches gcc's logic. Second half of PR10661.

llvm-svn: 138730
2011-08-28 22:35:17 +00:00
Jordy Rose 7881affdbf [analyzer] Header cleanup to decrease coupling (and recompilation). No functionality change.
llvm-svn: 138729
2011-08-28 19:45:32 +00:00
Jordy Rose 58a20d31b7 [analyzer] Introduce a new callback for checkers, printState, to be used for debug-printing the contents of a ProgramState.
Unlike the other callbacks, this one is a simple virtual method, since it is only to be used for debugging.

This new callback replaces the old ProgramState::Printer interface, and allows us to move the printing of refcount bindings from CFRefCount to RetainReleaseChecker.

llvm-svn: 138728
2011-08-28 19:11:56 +00:00
Nico Weber 5d8f912f50 [analyzer] update bug report url
llvm-svn: 138721
2011-08-28 11:50:56 +00:00
Jordy Rose e9ff97b850 [analyzer] Remove the ProgramState argument from ExprEngine::evalBind; we were ignoring it anyway. No functionality change.
llvm-svn: 138720
2011-08-28 06:02:28 +00:00
Jordy Rose d26e9e7f7c [analyzer] Eliminate almost all uses of TransferFuncs from ExprEngine.
llvm-svn: 138719
2011-08-28 05:54:23 +00:00
Jordy Rose d188d66e69 [analyzer] Migrate argument invalidation from CFRefCount to ExprEngine.
This is a common path for function and C++ method calls, Objective-C messages and property accesses, and C++ construct-exprs.

As support, add message receiver accessors to ObjCMessage and CallOrObjCMessage.

llvm-svn: 138718
2011-08-28 05:16:28 +00:00
Jordy Rose 1fad663126 [analyzer] Change the check::RegionChanges callback to include the regions explicitly requested for invalidation.
Also, allow CallOrObjCMessage to wrap a CXXConstructExpr as well.

Finally, this allows us to remove the clunky whitelisting system from CFRefCount/RetainReleaseChecker. Slight regression due to CXXNewExprs not yet being handled in post-statement callbacks (PR forthcoming).

llvm-svn: 138716
2011-08-27 22:51:26 +00:00
John McCall 4bb057d321 Disable the l-value to r-value conversion on C++ class types passed
to varargs functions in unevaluated contexts.  AFAICT, there is no
standards justification for this, but it matches what other compilers do
and therefore preserves compatibility with certain template metaprogramming
idioms.

Should fix self-host.

llvm-svn: 138715
2011-08-27 22:06:17 +00:00
Fariborz Jahanian 83aa8ab3ae objective-c - Make warning on unimplemented protocols point
to class implementation where it is supposed to be
implemented. // rdar://10009982.

llvm-svn: 138714
2011-08-27 21:55:47 +00:00
Ted Kremenek 996bfab499 [analyzer] Rename current PathDiagnosticClient::HandlePathDiagnostic() to HandlePathDiagnosticImpl(), and slot in new HandlePathDiagnostic() for potentially handling concurrent access to PathDiagnosticClients (in the future).
llvm-svn: 138713
2011-08-27 21:39:14 +00:00
Ted Kremenek 60120fb1b1 [analyzer] Pull body of loop in AnalysisConsumer::HandleDeclContext() into its own method. No real functionality change.
llvm-svn: 138712
2011-08-27 21:28:09 +00:00
Ted Kremenek 6eb83cfacd [analyzer] Add test case for handling of __bridge_transfer that previously resulted in a 'stack address' warning (that was fixed in r138616). Fixes <rdar://problem/10018376>.
llvm-svn: 138710
2011-08-27 21:15:48 +00:00
Fariborz Jahanian 3a039e339f objective-c: Treat top-level objective-c declarations
, such as list of forward @class decls, in a DeclGroup
node. Deal with its consequence throught clang. This
is in preparation for more Sema work ahead. // rdar://8843851.
Feel free to reverse if it breaks something important
and I am unavailable.

llvm-svn: 138709
2011-08-27 20:50:59 +00:00
Benjamin Kramer 1174675c7b Remove unused variables noticed by GCC.
llvm-svn: 138707
2011-08-27 17:54:32 +00:00
Douglas Gregor d90c3c92d5 Take an entirely different approach to handling the "parsing" of
__import__ within the preprocessor, since the prior one foolishly
assumed that Preprocessor::Lex() was re-entrant. We now handle
__import__ at the top level (only), after macro expansion. This should
fix the buildbot failures.

llvm-svn: 138704
2011-08-27 06:37:51 +00:00
Argyrios Kyrtzidis bd0a6019a2 [arcmt] Xfail the test for windows.
llvm-svn: 138696
2011-08-27 03:38:05 +00:00
John McCall 29ad95b232 The lvalue-to-rvalue on structs in C++ is actually part
of default argument promotion and needs to happen unconditionally.
This is particularly semantically important in C++0x.

llvm-svn: 138691
2011-08-27 01:09:30 +00:00
Benjamin Kramer 79cfba180a Twinify.
llvm-svn: 138689
2011-08-27 00:34:29 +00:00
Douglas Gregor e89397ac1e XFAIL one of the module tests on win32, until we figure out what's happening
llvm-svn: 138688
2011-08-27 00:29:32 +00:00
Douglas Gregor 472f85d86b In C++0x mode, suggest nullptr as the initializer for an uninitialized
pointer variable. Patch by David Blaikie!

llvm-svn: 138687
2011-08-27 00:18:50 +00:00
Ted Kremenek 183875f671 Control 'invalid conversion specifier' warnings under a subflag (-Wformat-invalid-specifier) of -Wformat. Fixes <rdar://problem/10031930>.
llvm-svn: 138686
2011-08-27 00:16:45 +00:00
Douglas Gregor afeabec7e1 Improve caret location for the GNU old-style field designator warning, from David Blaikie
llvm-svn: 138684
2011-08-27 00:13:16 +00:00
Douglas Gregor be861783d2 Silence a GCC warning
llvm-svn: 138683
2011-08-27 00:10:53 +00:00
Douglas Gregor c67bcd5b65 Remove the -import-module option. It's no longer useful
llvm-svn: 138681
2011-08-27 00:03:05 +00:00
Douglas Gregor 5be7a1c818 Try to unbreak the build on systems where uint64_t isn't something that StringRef::getAsInteger can handle as its second argument
llvm-svn: 138680
2011-08-26 23:57:29 +00:00
Douglas Gregor 081425343b Introduce support for a simple module import declaration, which
loads the named module. The syntax itself is intentionally hideous and
will be replaced at some later point with something more
palatable. For now, we're focusing on the semantics:
  - Module imports are handled first by the preprocessor (to get macro
  definitions) and then the same tokens are also handled by the parser
  (to get declarations). If both happen (as in normal compilation),
  the second one is redundant, because we currently have no way to
  hide macros or declarations when loading a module. Chris gets credit
  for this mad-but-workable scheme.
  - The Preprocessor now holds on to a reference to a module loader,
  which is responsible for loading named modules. CompilerInstance is
  the only important module loader: it now knows how to create and
  wire up an AST reader on demand to actually perform the module load.
  - We search for modules in the include path, using the module name
  with the suffix ".pcm" (precompiled module) for the file name. This
  is a temporary hack; we hope to improve the situation in the
  future.

llvm-svn: 138679
2011-08-26 23:56:07 +00:00
Argyrios Kyrtzidis 1045430525 [arcmt] Add a test case for r138671 and improve the loop.
llvm-svn: 138674
2011-08-26 23:20:23 +00:00
Andrew Trick 3df2824c59 FreeBSD (apparently) does not support crash-recovery tests.
These tests have been failing since the beginning of buildbot time:
crash-recovery-code-complete.c
crash-recovery-reparse.c
crash-recovery.c

llvm-svn: 138672
2011-08-26 22:46:31 +00:00
Argyrios Kyrtzidis 3da6bc16bb [arcmt] Fix horrible bug where migrating files if there is a space in the paths
of the migrated files. rdar://10022801

llvm-svn: 138671
2011-08-26 22:40:55 +00:00
Chad Rosier 97c373793b Cleanup r138662 per Ben and David's suggestions, thanks.
llvm-svn: 138670
2011-08-26 22:27:02 +00:00
Douglas Gregor 4e4c83e995 Teach the ASTReader how to avoid cycles when loading declarations that
are lexically within a particular DeclContext. Test forthcoming.

llvm-svn: 138668
2011-08-26 22:04:51 +00:00
Chad Rosier f0be551d68 Make sure the std::string isn't deallocated prior to use. Many thanks to Eli
for catching this.

llvm-svn: 138666
2011-08-26 21:47:20 +00:00
Chad Rosier 39ab743e59 [driver] When generating temporary files allow a prefix to be added. In many
cases we want the prefix to be the original file name less the suffix.  For an
input such as test.c to named temporary would be something like test-3O4Clq.o
Part of <rdar://problem/8314451>

llvm-svn: 138662
2011-08-26 21:28:44 +00:00
Douglas Gregor f337ae9477 When we're deserializing declarations lexically stored in a RecordDecl
after having already deserialized the fields, clear out the fields
first. This makes sure that we keep all of the declarations in the
lexical context (including those implicitly added by later
type-checking) within the same list. A test case for this behavior is
coming as part of another commit; testing for this problem in
isolation is a nightmare.

llvm-svn: 138661
2011-08-26 21:23:06 +00:00
Fariborz Jahanian 97b6ac5407 objc-arc: Mention property's attribute by name when
finding life-time conflict with its declared ivar.
// rdar://10007230

llvm-svn: 138659
2011-08-26 21:21:19 +00:00
John McCall 17054bd670 Slight optimization enabled by the previous assert:
emit all gl-value arguments as reference bindings.

llvm-svn: 138655
2011-08-26 21:08:13 +00:00
Jordy Rose 256a6dd13b [analyzer] Remove a couple of unnecessary returns after llvm_unreachables.
llvm-svn: 138649
2011-08-26 20:32:01 +00:00
Eli Friedman 755c0c996a Don't assert on taking the address of a non-type template parameter. Fixes PR10766.
llvm-svn: 138648
2011-08-26 20:28:17 +00:00