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