summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Implements pulling simple blocks into a single line.Manuel Klimek2013-01-113-83/+134
| | | | | | | | void f() { return 42; } The final change that implements the feature. llvm-svn: 172225
* Add -std=c++98 to the test and minor improvment in addition.Fariborz Jahanian2013-01-111-2/+2
| | | | llvm-svn: 172221
* Allow RefactoringTool to write to memory instead of always to diskEdwin Vane2013-01-114-47/+70
| | | | | | | | | | | | | | | RefactoringTool::run() always writes the result of rewrites to disk. Instead, make this optional and provide a method for getting the refactoring results in a memory buffer instead. Also made ClangTool polymorphic so RefactoringTool could inherit from it to properly express the IS-A relationship. This change also provides access to ClangTool's public interface, e.g. mapVirtualFile() which is important once refactored buffers start living in memory instead of on disk. Reviewers: klimek llvm-svn: 172219
* Correct spacing around new and delete.Daniel Jasper2013-01-112-1/+9
| | | | | | | | This fixes llvm.org/PR14913. Before: A *a = new(placement) A; After: A *a = new (placement) A; llvm-svn: 172212
* clang-format: a bit nicer error message.Alexander Kornienko2013-01-111-1/+1
| | | | llvm-svn: 172211
* Enable the new (more C++-like, less broken) EH model when targeting the GNUstepDavid Chisnall2013-01-113-0/+20
| | | | | | Objective-C runtime 1.7 or greater. llvm-svn: 172207
* Fixed an assertion failure triggered by invalid code.Enea Zaffanella2013-01-114-8/+17
| | | | | | | | Set invalid type of declarator after emitting error diagnostics, so that it won't be later considered when instantiating the template. Added test5_inst in test/SemaCXX/condition.cpp for non-regression. llvm-svn: 172201
* Improve handling of trailing declaration annotations.Daniel Jasper2013-01-112-13/+16
| | | | | | | | | | | | | | Before: void aaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) GUARDED_BY( aaaaaaaaaaaaa); After: void aaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) GUARDED_BY(aaaaaaaaaaaaa); Also did some formatting cleanups with clang-format on the way. llvm-svn: 172200
* Improved formatting of constructor initializersDaniel Jasper2013-01-113-32/+68
| | | | | | | | | Added option to put each constructor initializer on its own line if not all initializers fit on a single line. Enabling this for Google style now as the style guide (arguable) suggests it. Not sure whether we also want it for LLVM. llvm-svn: 172196
* Test commit.Enea Zaffanella2013-01-111-1/+1
| | | | llvm-svn: 172195
* Refactor IndentState into two classes.Daniel Jasper2013-01-111-80/+73
| | | | | | | | As we keep adding more stuff to it, this structure is easier to maintain. At one point we might think about making it an actual class with specific accessors, etc. llvm-svn: 172188
* Pass false instead of 0 since isStar parameter of getArray has type bool. No ↵Nikola Smiljanic2013-01-111-1/+1
| | | | | | functionality change. llvm-svn: 172185
* Fix spelling error and remove the part about CMake having experimental Ninja ↵Nikola Smiljanic2013-01-111-16/+4
| | | | | | support since 2.8.9 has been released some time ago. llvm-svn: 172182
* Revert the line ending mess I made.Nikola Smiljanic2013-01-111-199/+211
| | | | llvm-svn: 172179
* Fix spelling error and remove the part about CMake having experimental Ninja ↵Nikola Smiljanic2013-01-111-211/+199
| | | | | | support since 2.8.9 has been released some time ago. llvm-svn: 172177
* [analyzer] Rename the warning: state the issue before the hint of how itAnna Zaks2013-01-112-10/+9
| | | | | | can be fixed llvm-svn: 172170
* [analyzer]Recognize ivar invalidation protocol even if it was redeclaredAnna Zaks2013-01-112-2/+5
| | | | | | This will get rid of some false positives as well as false negatives. llvm-svn: 172169
* [analyzer] Ivar invalidation: track ivars declared in categories.Anna Zaks2013-01-112-7/+24
| | | | llvm-svn: 172168
* Revert "tg-fixits.td: fixup for Linux"Jordan Rose2013-01-111-6/+1
| | | | | | | | | | It's better to show no caret/ranges/fixits than to show them misaligned. (It scares me a bit that Clang is going to show them misaligned on systems without a proper llvm::sys::locale::columnWidth.) See PR14910. This reverts commit a03cc72bedd015b7eb76e9ac650992f58a48549d. llvm-svn: 172163
* Replace more usages of __func__ with LLVM_FUNCTION_NAMEDmitri Gribenko2013-01-112-2/+4
| | | | llvm-svn: 172161
* libclang logging: fixup for MSVC, which does not have __func__Dmitri Gribenko2013-01-111-1/+2
| | | | llvm-svn: 172158
* Improve on my last test for patch for // rdar://12897704Fariborz Jahanian2013-01-111-0/+3
| | | | llvm-svn: 172154
* tg-fixits.td: fixup for Linux, which does not have a correct implementation ofDmitri Gribenko2013-01-111-1/+6
| | | | | | llvm::sys::locale::columnWidth() llvm-svn: 172152
* Truth in advertising: LocallyScopedExternalDecls actually only containsRichard Smith2013-01-109-57/+57
| | | | | | external declarations with C language linkage. llvm-svn: 172150
* [analyzer] Allow IvarInvalidation checker to suppress warnings viaAnna Zaks2013-01-102-7/+35
| | | | | | | | | | | | assertions. To ensure that custom assertions/conditional would also be supported, just check if the ivar that needs to be invalidated or set to nil is compared against 0. Unfortunately, this will not work for code containing 'assert(IvarName)' llvm-svn: 172147
* c++ IRGen. In trivial cases that object is going into staticFariborz Jahanian2013-01-102-0/+35
| | | | | | | | | | storage and thus is implicitly zero-initialized, no need to do C++11 memory model. This patch unconditionally detects such condition and zeroinitializer's the variable. Patch has been commented on and OKed by Doug off-line. // rdar://12897704 llvm-svn: 172144
* Formatter: Remove a fixme, Jordy says @synthesize is good as is.Nico Weber2013-01-101-3/+0
| | | | llvm-svn: 172141
* Formatter: Put spaces in ObjC method decls in the right place for Google style.Nico Weber2013-01-103-14/+38
| | | | | | | | | | | | | | | | | | | | | | | Objective-C method declarations look like this: - (returntype)name:(type)argname anothername:(type)arg2name; In google style, there's no space after the leading '-' but one after "(returntype)" instead (but none after the argument types), see http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml#Method_Declarations_and_Definitions Not inserting the space after '-' is easy, but to insert the space after the return type, the formatter needs to know that a closing parenthesis ends the return type. To do this, I tweaked the code in parse() to check for this, which in turn required moving detection of TT_ObjCMethodSpecifier from annotate() to parse(), because parse() runs before annotate(). (To keep things interesting, the return type is optional, but it's almost always there in practice.) http://llvm-reviews.chandlerc.com/D280 llvm-svn: 172140
* [analyzer] Fix non-determinizm introduced in r172104.Anna Zaks2013-01-102-19/+31
| | | | | | | | In some cases, we just pick any ivar that needs invalidation and attach the warning to it. Picking the first from DenseMap of pointer keys was triggering non-deterministic output. llvm-svn: 172134
* ToolChains: Minor touchup to use correct type, avoid truncation.Will Dietz2013-01-101-1/+1
| | | | | | | | | Truncation happens regularly when find_first_not_of returns npos, strings long enough to trigger bug here are implausible. No functionality change intended (ignoring absurd string lengths). llvm-svn: 172127
* Declare +new instead of -new in test.Fariborz Jahanian2013-01-101-1/+1
| | | | llvm-svn: 172126
* [ms-inline asm] Add test case for r172121. Chad Rosier2013-01-101-0/+7
| | | | | | Part of rdar://12991541 llvm-svn: 172122
* [ms-inline asm] Extend the inline asm Sema lookup interface to determine if theChad Rosier2013-01-102-7/+11
| | | | | | | Decl is a VarDecl. Part of rdar://12991541 llvm-svn: 172120
* Formatter: No spaces around '=' in @property lines.Nico Weber2013-01-102-3/+19
| | | | | | | | | | | | | Before: @property(assign, getter = isEditable) BOOL editable; Now: @property(assign, getter=isEditable) BOOL editable; It'd be nice if some Apple person could let me know if spaces are preferred around '=' in @synthesize lines (see FIXME in the test). llvm-svn: 172110
* [analyzer] Add more checks to the ObjC Ivar Invalidation checker.Anna Zaks2013-01-102-57/+158
| | | | | | | | | | | | | | Restructured the checker so that it could easily find two new classes of issues: - when a class contains an invalidatable ivar, but no declaration of an invalidation method - when a class contains an invalidatable ivar, but no definition of an invalidation method in the @implementation. The second case might trigger some false positives, for example, when the method is defined in a category. llvm-svn: 172104
* In my last patch use InGroup<Switch> (per Dmitri's comment).Fariborz Jahanian2013-01-101-1/+1
| | | | llvm-svn: 172103
* Provide a better warning when case value overflows.Fariborz Jahanian2013-01-103-4/+7
| | | | | | // rdar://11577384 llvm-svn: 172102
* Formatter: Land header change I forgot to land in r172099.Nico Weber2013-01-101-0/+4
| | | | llvm-svn: 172101
* Formatter: Add test for template and protocol parameters in ObjC method ↵Nico Weber2013-01-101-0/+6
| | | | | | declarations. llvm-svn: 172100
* Formatting: In @implementation etc lines, put a space before protocol lists.Nico Weber2013-01-103-10/+24
| | | | | | | | | | | | Don't do this in Google style though: http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml#Protocols Most other places (function declarations, variable declarations) still get this wrong, and since this looks very similiar to template instantiations to the lexer (`id <MyProtocol> a = ...`), it's going to be hard to fix in some places. llvm-svn: 172099
* Refactoring the outermost structure of the formatter.Manuel Klimek2013-01-101-37/+45
| | | | | | | This is the last step of pure shuffling stuff around, the next step will be the actual feature. llvm-svn: 172098
* [libclang] Address some coding style issues pointed out by Dmitri.Argyrios Kyrtzidis2013-01-101-2/+3
| | | | llvm-svn: 172096
* Formatter: Don't put a space in ObjC number literals like @+50Nico Weber2013-01-102-5/+6
| | | | | | | | | | Before: @ -4.5 Now: @-4.5 llvm-svn: 172095
* ccc-analyzer: Forward -msse* options to the compiler.Ted Kremenek2013-01-101-0/+4
| | | | llvm-svn: 172094
* Formatter: Add space before '(' in @implemenation, @interface, @protocol linesNico Weber2013-01-103-14/+26
| | | | | | | | The first token in @implementation, @interface, and @protocol lines is now marked TT_ObjCDecl, and lines starting with a TT_ObjCDecl token are now marked LT_ObjCMethodDecl. llvm-svn: 172093
* Pull calculation whether a line fits one level up.Manuel Klimek2013-01-101-29/+36
| | | | | | | This is the next step towards being able to configure multiple unwrapped lines into one. llvm-svn: 172092
* objectiveC++: When throwing c++ exception of Fariborz Jahanian2013-01-105-11/+49
| | | | | | | an objectiveC object, use objc_exception_throw to raise the exception. // rdar://12605907 llvm-svn: 172091
* [libclang] Add missing header fileArgyrios Kyrtzidis2013-01-101-0/+95
| | | | llvm-svn: 172090
* [libclang] Enhance logging capabilities of libclang.Argyrios Kyrtzidis2013-01-105-37/+176
| | | | | | | | | -provide a "raw_ostream'ish" class to make it convenient to output logging info. -use macros to automate a bit the logging functionality inside libclang functions -when logging, print a stack trace if "LIBCLANG_LOGGING=2" environment is set. -add logging to more functions. llvm-svn: 172089
* Diagnostics: name all implicit groups used more than once.Jordan Rose2013-01-105-54/+71
| | | | | | | | | | | | | | | | | This will be a new style requirement going forwards: a diagnostic can only use the implicit InGroup<DiagGroup<"foo">> syntax if "foo" is not used by any other diagnostics; as soon as it is, it needs an explicit group. This also brings some stray "conversion" diagnostics into the "Value Conversion Issue" category, instead of the more generic "Semantic Issue" category. I consider this an improvement! - warn_impcast_complex_scalar - warn_impcast_float_integer - warn_impcast_float_precision - warn_impcast_integer_precision - warn_impcast_vector_scalar llvm-svn: 172088
OpenPOWER on IntegriCloud