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
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
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
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
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
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
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
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
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
Kaelyn Uhrain
5a43b461fc
Fix Sema::CorrectTypo to ignore found but unresolved symbols
...
llvm-svn: 139252
2011-09-07 20:25:59 +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
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
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
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
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
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
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
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
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