summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* More missing dependencies picked up by Ninja.Peter Collingbourne2011-09-071-0/+4
| | | | llvm-svn: 139248
* objc-gc: More sema work for properties declared 'weak'Fariborz Jahanian2011-09-071-6/+13
| | | | | | in GC mode. // rdar://10073896 llvm-svn: 139235
* Extract the emission of the diagnostic's location into a separateChandler Carruth2011-09-071-103/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move the HilightRange method from TextDiagnosticPrinter down toChandler Carruth2011-09-071-81/+79
| | | | | | | CaretDiagnostic. It's completely generic, with nothing to do with the diagnostic client or info APIs. llvm-svn: 139227
* Hoist the tab expansion into a helper function.Chandler Carruth2011-09-071-21/+25
| | | | llvm-svn: 139226
* Don't compute the same line number in two places, once inside a loop.Chandler Carruth2011-09-071-12/+8
| | | | llvm-svn: 139225
* Make sure the FunctionDecl's created by "#pragma weak" have correct ↵Eli Friedman2011-09-071-8/+31
| | | | | | ParmVarDecl's. PR10878. llvm-svn: 139224
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-071-26/+28
| | | | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: DiagnoseLogicalAndInLogicalOrLHS() DiagnoseBinOpPrecedence() ActOnBinOp() BuildBinOp() llvm-svn: 139219
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-071-73/+75
| | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: CreateBuiltinBinOp() DiagnoseBitwisePrecedence() llvm-svn: 139218
* Switch the CharSourceRange array to a small vector. The array wasChandler Carruth2011-09-071-39/+34
| | | | | | | | | | | | 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
* Switch clang over to using fence/atomicrmw/cmpxchg instead of the intrinsics ↵Eli Friedman2011-09-071-65/+40
| | | | | | | | | | (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
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-071-43/+43
| | | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: CheckAssignmentOperands() DiagnoseSelfAssignment() checkArithmeticNull() llvm-svn: 139215
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-071-53/+53
| | | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: CheckVectorCompareOperands() CheckBitwiseOperands() CheckLogicalOperands() llvm-svn: 139214
* Change the self-reference visitor (which gives the warning for ↵Richard Trieu2011-09-071-0/+1
| | | | | | | | 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
* objc-gc: Don't force a __strong type'd propertyFariborz Jahanian2011-09-071-1/+1
| | | | | | | to be 'weak'. This prevents a crash and should probably be flagged as error - later to come. llvm-svn: 139211
* In Microsoft mode, if we are inside a template class member function and we ↵Francois Pichet2011-09-072-1/+16
| | | | | | | | 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
* [driver] When clang crashes, don't try to generate diagnostics (i.e., Chad Rosier2011-09-061-0/+17
| | | | | | preprocessor output) with multiple -arch options. llvm-svn: 139207
* objc-gc: Adds support for "weak" property attribute under GC.Fariborz Jahanian2011-09-061-0/+6
| | | | | | // rdar://10073896 llvm-svn: 139203
* Remove the doxyment for this now defunct parameter.Chandler Carruth2011-09-061-1/+0
| | | | llvm-svn: 139197
* Don't recompute the presumed loc twice in 5 lines of code... Spotted byChandler Carruth2011-09-061-1/+1
| | | | | | inspection. llvm-svn: 139196
* Use ArrayRef for the fixit hint array rather than a pointer and a size.Chandler Carruth2011-09-061-35/+34
| | | | | | | Clean up loops over the hints to use the more idiomatic iterator form in LLVM and Clang. llvm-svn: 139195
* Hoist the construction of the FixItHint line into a member function withChandler Carruth2011-09-061-64/+79
| | | | | | | | | | | | 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
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-99/+101
| | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: CheckCompareOperands() llvm-svn: 139187
* When extracting the callee declaration from a call expression, be sureDouglas Gregor2011-09-062-8/+10
| | | | | | | | | | 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
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-23/+23
| | | | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: checkEnumComparison() diagnoseDistinctPointerComparison() convertPointersToCompositeType() diagnoseFunctionPointerToVoidComparison() llvm-svn: 139184
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-36/+36
| | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: DiagnoseBadShiftValues() CheckShiftOperands() llvm-svn: 139183
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-55/+57
| | | | | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: diagnoseArithmeticOnTwoVoidPointers() checkArithmeticBinOpPointerOperands() diagnosePointerIncompatibility() CheckAdditionOperands() CheckSubtractionOperands() llvm-svn: 139182
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-64/+64
| | | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: CheckVectorOperands() CheckMultiplyDivideOperands() CheckRemainderOperands() llvm-svn: 139181
* Implement the Named Return Value Optimization (NRVO) for blocks.Douglas Gregor2011-09-062-3/+5
| | | | llvm-svn: 139178
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-36/+36
| | | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: CheckTransparentUnionArgumentConstraints() CheckSingleAssignmentConstraints() InvalidOperands() llvm-svn: 139176
* Implement the Named Return Value Optimization (NRVO) for Objective-C++Douglas Gregor2011-09-061-0/+3
| | | | | | methods. Fixes PR10835 / <rdar://problem/10050178>. llvm-svn: 139175
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-57/+57
| | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: CheckAssignmentConstraints() llvm-svn: 139173
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-32/+30
| | | | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: checkPointerTypesForAssignment() checkBlockPointerTypesForAssignment() checkObjCPointerTypesForAssignment() CheckAssignmentConstraints() llvm-svn: 139170
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-20/+21
| | | | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: DiagnoseConditionalForNull() CheckConditionalOperands() IsArithmeticBinaryExpr() DiagnoseConditionalPrecedence() llvm-svn: 139167
* Spelling.Benjamin Kramer2011-09-061-7/+7
| | | | llvm-svn: 139165
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-56/+55
| | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: handleIntegerConversion() UsualArithmeticConversions() llvm-svn: 139164
* Don't emit -Wpadded warnings without a valid SourceLocation. This can ↵Ted Kremenek2011-09-061-0/+5
| | | | | | happen when RecordLayoutBuilder is used by Codegen, not Sema. llvm-svn: 139162
* Rearrange code so that we pass the right pointer to delete[] when an ↵Eli Friedman2011-09-061-9/+9
| | | | | | exception is thrown constructing the array elements in an array new expression. Fixes PR10870. llvm-svn: 139158
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-35/+32
| | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: handleFloatConversion() handleComplexIntConvsersion() llvm-svn: 139153
* Rename variables in SemaExpr.cpp to give a more consistant naming scheme.Richard Trieu2011-09-061-23/+24
| | | | | | | | | | | | ExprResult LHS, RHS, Expr *LHSExpr, *RHSExpr QualType LHSType, RHSType Functions changed: handleComplexFloatToComplexFloatConverstion() handleComplexFloatConversion() llvm-svn: 139151
* Advertise support for cxx_range_for as an extension in C++98 mode. Patch by ↵Richard Smith2011-09-061-0/+1
| | | | | | | | Jean-Daniel Dupas! Also provide a modicum of test coverage for ranged for in C++98. llvm-svn: 139149
* Finish implementing (de-)serialization of the CXXDefinitionData bitsDouglas Gregor2011-09-062-0/+8
| | | | | | | needed for implicit move constructors and move assignment operators. Fixes PR10847. llvm-svn: 139144
* When performing a derived-to-base cast on the right-hand side of theDouglas Gregor2011-09-063-12/+10
| | | | | | | | | | | | | | | | 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
* Add missing dependencyPeter Collingbourne2011-09-061-0/+1
| | | | | | Spotted by Ninja. llvm-svn: 139129
* Add the resource directory to the search path for Driver::GetFilePath,Peter Collingbourne2011-09-061-3/+8
| | | | | | | | | | | | | | 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
* Speed up BCPL comment lexing by looking aggressively for newlines and then ↵Benjamin Kramer2011-09-051-9/+24
| | | | | | | | 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
* Use the Lexer's definition of whitespace here.Benjamin Kramer2011-09-051-3/+2
| | | | llvm-svn: 139115
* Implement the suggested resolution of WG21 N3307 issue 19: When determining ↵Richard Smith2011-09-051-11/+7
| | | | | | 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
* Pass 0 instead of a empty TemplateArgumentListInfo when creating a ↵Francois Pichet2011-09-041-1/+2
| | | | | | | | 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
* Use const_cast to avoid warnings.Benjamin Kramer2011-09-041-1/+1
| | | | llvm-svn: 139104
OpenPOWER on IntegriCloud