summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Formatter: Don't insert a space before unary operators after selector names.Nico Weber2013-01-122-2/+4
| | | | | | | | | | Before: [color getRed: &r green: &g blue: &b alpha: &a]; Now: [color getRed:&r green:&g blue:&b alpha:&a]; llvm-svn: 172337
* Formatter: Add a test for @selector in an ObjC method expression, which ↵Nico Weber2013-01-121-0/+1
| | | | | | happens to work already. llvm-svn: 172335
* Formatter: Remove debugging junk I accidentally landed in r172333.Nico Weber2013-01-122-4/+1
| | | | llvm-svn: 172334
* Formatter: Prefer breaking before ObjC selector names over breaking at their ':'Nico Weber2013-01-122-5/+31
| | | | | | | | | | | | Before: if ((self = [super initWithContentRect:contentRect styleMask: styleMask backing:NSBackingStoreBuffered defer:YES])) { Now: if ((self = [super initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:YES])) { llvm-svn: 172333
* Add a comment to test to clarify the intention hereDmitri Gribenko2013-01-121-0/+3
| | | | | | Comment is taken from the commit message of r151080, by Jean-Daniel Dupas llvm-svn: 172332
* Prune an unused diagnostic, detected after improving the script in r172330Dmitri Gribenko2013-01-121-2/+0
| | | | llvm-svn: 172331
* Speed up find-unused-diagnostics. Now runs in less than a second instead of ↵Benjamin Kramer2013-01-121-11/+7
| | | | | | more than a minute. llvm-svn: 172330
* Remove unused diagnosticsDmitri Gribenko2013-01-121-4/+0
| | | | llvm-svn: 172326
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-12184-597/+577
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Fix spurious output in JSONCompilationDatabaseArnaud A. de Grandmaison2013-01-121-5/+1
| | | | llvm-svn: 172321
* Add missing includes and forward declarations so that headers don't depend onDmitri Gribenko2013-01-1216-5/+25
| | | | | | other headers included before them. llvm-svn: 172320
* commentRafael Espindola2013-01-121-0/+3
| | | | llvm-svn: 172317
* barRafael Espindola2013-01-122-0/+7
| | | | llvm-svn: 172316
* Remove unused private field.Rafael Espindola2013-01-121-7/+3
| | | | llvm-svn: 172314
* Fix incorrect comparison operator causing loooong formatting times.Daniel Jasper2013-01-122-1/+21
| | | | llvm-svn: 172308
* Formatter: Remove an always-false condition.Nico Weber2013-01-121-2/+1
| | | | | | | | canBreakBefore() does not allow breaking after ':' for LT_ObjCMethodDecl lines, so if Newline is true in addTokenToState() for ':' then LT_ObjCMethodDecl cannot be set. No functionality change. llvm-svn: 172307
* Formatter: Remove a redundant CurrentLineType check.Nico Weber2013-01-122-3/+2
| | | | | | The containing if checks for this already. No functionality change. llvm-svn: 172306
* Disable caching of visibility.Rafael Espindola2013-01-1211-87/+124
| | | | | | | | | | | | | | The testcase in pr14929 shows that this is extremely hard to do. If we choose to apply the attribute, that causes the visibility of some decls to change and that can happen really late (during codegen). Current gcc warns and ignores the attribute in this testcase with a warning. This suggest that the correct solution is to find a point in the compilation where we can compute the visibility and * assert it was never computed before * reject any attempts to compute it again in the future (with warnings). llvm-svn: 172305
* Formatter: Initial support for formatting Objective-C method expressions. ↵Nico Weber2013-01-122-6/+109
| | | | | | | | | | | | | | | | | | | | This follows the approach suggested by djasper in PR14911: When a '[' is seen that's at the start of a line, follows a binary operator, or follows one of : [ ( return throw, that '[' and its closing ']' are marked as TT_ObjCMethodExpr and every ':' in that range that isn't part of a ternary ?: is marked as TT_ObjCMethodExpr as well. Update the layout routines to not output spaces around ':' tokens that are marked TT_ObjCMethodExpr, and only allow breaking after such tokens, not before. Before: [self adjustButton : closeButton_ ofKind : NSWindowCloseButton]; Now: [self adjustButton:closeButton_ ofKind:NSWindowCloseButton]; llvm-svn: 172304
* Formatter: * and & are binary operators before ( and [.Nico Weber2013-01-122-0/+4
| | | | llvm-svn: 172303
* Formatter: * and & are binary operators after ) and ].Nico Weber2013-01-122-1/+4
| | | | llvm-svn: 172302
* Formatter: + and - after { are unary operators.Nico Weber2013-01-122-1/+4
| | | | llvm-svn: 172301
* clang/unittests: Fixup corresponding to r172290.NAKAMURA Takumi2013-01-124-0/+12
| | | | llvm-svn: 172295
* Fix a regression from 171193: main cannot be overloaded.Rafael Espindola2013-01-122-0/+8
| | | | | | Thanks Eli Friedman for noticing it. llvm-svn: 172292
* Provide Decl::getOwningModule(), which determines the (sub)module inDouglas Gregor2013-01-1215-28/+101
| | | | | | | | | | | | | which a particular declaration resides. Use this information to customize the "definition of 'blah' must be imported from another module" diagnostic with the module the user actually has to import. Additionally, recover by importing that module, so we don't complain about other names in that module. Still TODO: coming up with decent Fix-Its for these cases, and expand this recovery approach for other name lookup failures. llvm-svn: 172290
* Formatter: add a test for :? in []Nico Weber2013-01-121-0/+7
| | | | llvm-svn: 172289
* Only produce one -Wc++98-compat warning when initializing a reference from ↵Richard Smith2013-01-122-0/+8
| | | | | | an init list with multiple elements. llvm-svn: 172285
* Add a test from pr14898.Rafael Espindola2013-01-121-0/+23
| | | | llvm-svn: 172283
* Fix -Wunused-comparison for comparisons in arguments to function-like macros.Matt Beaumont-Gay2013-01-124-5/+26
| | | | | | | | | | | Previously, -Wunused-comparison ignored comparisons in both macro bodies and macro arguments, but we would still emit a -Wunused-value warning for either. Now we correctly emit -Wunused-comparison for expressions in macro arguments. Also, add isMacroBodyExpansion to SourceManager, to go along with isMacroArgExpansion. llvm-svn: 172279
* comment parsing: when property accessors don't have commentFariborz Jahanian2013-01-123-1/+77
| | | | | | | of their own (or are syntheszed), use prperty's comment. for them. // rdar://12791315 llvm-svn: 172278
* Refine analyzer's handling of unary '!' and floating types to not assert.Ted Kremenek2013-01-112-1/+10
| | | | | | Fixes PR 14634 and <rdar://problem/12903080>. llvm-svn: 172274
* Fixed a bug that caused the AST importer to erroneouslySean Callanan2013-01-111-1/+1
| | | | | | | import incomplete definitions for RecordDecls and then mark the resulting definition as complete. llvm-svn: 172273
* libclang: use C++ casts in CXString.cppDmitri Gribenko2013-01-111-4/+5
| | | | llvm-svn: 172272
* libclang: constness for CXStringDmitri Gribenko2013-01-112-4/+4
| | | | llvm-svn: 172270
* Correctly propagate uninitialized values within logical expressions.Ted Kremenek2013-01-112-14/+24
| | | | | | | Fixes assertion failure reported in PR 14635 and <rdar://problem/12902945> respectively. llvm-svn: 172263
* [PCH] Make the const_cast explicit to silence a compiler warning.Argyrios Kyrtzidis2013-01-111-1/+2
| | | | | | Patch by David Greene. llvm-svn: 172262
* [libclang] Add some constness in CXSourceLocation and CXSourceRange.Argyrios Kyrtzidis2013-01-112-3/+3
| | | | llvm-svn: 172261
* [libclang] In ASTUnit::getMainFileName() Invocation may be null because the ↵Argyrios Kyrtzidis2013-01-111-1/+15
| | | | | | | | ASTUnit came from loading a PCH/module. llvm-svn: 172259
* Set process return code of 1 in set-xcode-analyzer when Xcode needs to be ↵Ted Kremenek2013-01-111-1/+1
| | | | | | quit. Fixes <rdar://problem/12983031>. llvm-svn: 172256
* Formatter: Format ObjC static and instance methods consistently, add a test ↵Nico Weber2013-01-112-2/+7
| | | | | | for that. llvm-svn: 172254
* libclang: remove unneeded castsDmitri Gribenko2013-01-111-9/+9
| | | | llvm-svn: 172253
* libclang: change CXCursor to store 'const void *' pointers forDmitri Gribenko2013-01-117-94/+102
| | | | | | const-correctness, and update all users llvm-svn: 172252
* Constify parameter of clang::getCursorKindForDeclDmitri Gribenko2013-01-112-3/+3
| | | | llvm-svn: 172249
* Reject incompatible redeclarations of extern C symbols.Rafael Espindola2013-01-113-10/+32
| | | | | | | Before we were only checking if the new declaration itself was marked extern C. Fixes prpr14766. llvm-svn: 172243
* Improve diagnostic per Richard's suggestionFariborz Jahanian2013-01-112-3/+3
| | | | | | | (which may yet change if we move the diagnostic outside case value). llvm-svn: 172242
* libclang: use getCursorTU and getCursorASTUnit instead of explicit castsDmitri Gribenko2013-01-114-8/+5
| | | | llvm-svn: 172241
* Fix crashes in UnwrappedLineParser on missing parens.Manuel Klimek2013-01-112-3/+9
| | | | llvm-svn: 172239
* Fix single-line optimization for ObjC.Manuel Klimek2013-01-113-21/+51
| | | | | | | Puts blocks always into multiple lines when they start with an ObjC keyword or minus. llvm-svn: 172238
* Fix crash on invalid.Manuel Klimek2013-01-112-1/+6
| | | | | | | if { foo; } would previously crash clang-format. llvm-svn: 172232
* Fix parsing of initializer lists with elaborated type specifier.Manuel Klimek2013-01-113-3/+13
| | | | | | | | Now we correctly parse and format: verifyFormat("struct foo a = { bar }; int n; llvm-svn: 172229
OpenPOWER on IntegriCloud