summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* CFG.cpp: Fix wrapping logic when printing block preds/succs.Will Dietz2013-01-071-2/+2
| | | | | | | | | First check only wrapped with i==8, second wrapped at i==2,8,18,28,... This fix restores the intended behavior: i==8,18,28,... Found with -fsanitize=integer. llvm-svn: 171718
* Remove outdated FIXME and add explanation for error handling strategyManuel Klimek2013-01-071-2/+6
| | | | | | while parsing #define's. llvm-svn: 171717
* Remove outdated fixme.Manuel Klimek2013-01-071-3/+0
| | | | llvm-svn: 171716
* Do not ever allow using the full line in preprocessor directives.Manuel Klimek2013-01-071-1/+1
| | | | | | | | | | | | | | | | We would format: #define A \ int f(a); int i; as #define A \ int f(a);\ int i The fix will break up macro definitions that could fit a line, but hit the last column; fixing that is more involved, though, as it requires looking at the following line. llvm-svn: 171715
* Fix layouting of single-line-comments preceded by an escaped newline.Manuel Klimek2013-01-071-7/+7
| | | | | | | | | | | | | Previously, we'd format int i;\ // comment as int i; // comment The problem is that the escaped newline is part of the next token, and thus the raw token text of the comment doesn't start with "//". llvm-svn: 171713
* Fix layouting of tokens with a leading escaped newline.Manuel Klimek2013-01-072-8/+22
| | | | | | | | | | | If a token follows directly on an escaped newline, the escaped newline is stored with the token. Since we re-layout escaped newlines, we need to treat them just like normal whitespace - thus, we need to increase the whitespace-length of the token, while decreasing the token length (otherwise the token length contains the length of the escaped newline and we double-count it while indenting). llvm-svn: 171706
* Put a higher penalty on breaking before "." or "->".Daniel Jasper2013-01-071-2/+2
| | | | | | | | | | | | | | This fixes llvm.org/PR14823. Before: local_state->SetString(prefs::kApplicationLocale, parent_local_state ->GetString(prefs::kApplicationLocale)); After: local_state->SetString( prefs::kApplicationLocale, parent_local_state->GetString(prefs::kApplicationLocale)); llvm-svn: 171705
* PR14759: Improve/correct support for debug info for C++ member pointers.David Blaikie2013-01-071-32/+2
| | | | | | | | | | Using added LLVM functionality in r171698. This works in GDB for member variable pointers but not member function pointers. See the LLVM commit and GDB bug 14998 for details. Un-xfailing cases in the GDB 7.5 test suite will follow. llvm-svn: 171699
* Switch to asking the target machine to add any relevant analysis passsesChandler Carruth2013-01-071-19/+8
| | | | | | rather than doing it ourselves. This reflects the API changes in r171681. llvm-svn: 171683
* Fixes handling of unbalances braces.Manuel Klimek2013-01-062-6/+13
| | | | | | | | | | | | | If we find an unexpected closing brace, we must not stop parsing, as we'd otherwise not layout anything beyond that point. If we find a structural error on the highest level we'll not re-indent anyway, but we'll still want to format within unwrapped lines. Needed to introduce a differentiation between an expected and unexpected closing brace. llvm-svn: 171666
* Prepare for the upcoming version of Debian (jessie)Sylvestre Ledru2013-01-061-2/+5
| | | | llvm-svn: 171655
* use early returns to simplify and de-nestSean Silva2013-01-061-11/+9
| | | | llvm-svn: 171654
* Fixes parsing of hash tokens in the middle of a line.Manuel Klimek2013-01-053-7/+15
| | | | | | | | | | | To parse # correctly, we need to know whether it is the first token in a line - we can deduct this either from the whitespace or seeing that the token is the first in the file - we already calculate this information. This patch moves the identification of the first token into the getNextToken method and stores it inside the FormatToken, so the UnwrappedLineParser can stay independent of the SourceManager. llvm-svn: 171640
* Fixes PR14801 - preprocessor directives shouldn't be indentedManuel Klimek2013-01-052-3/+7
| | | | | | | Uses indent 0 for macros for now and resets the indent state to the level prior to the preprocessor directive. llvm-svn: 171639
* Fixes a breakage in dejagnu++ test suite where it includedFariborz Jahanian2013-01-051-0/+1
| | | | | | | | <objc/Protocol.h>. Caused by my recent changes for various builtin declarations of objc_msgSendSuper variety. // rdar://12489098 llvm-svn: 171638
* Fixes PR14811: Crash when formatting some macrosManuel Klimek2013-01-051-1/+1
| | | | | | A preprocessor directive cannot be started while we're parsing one. llvm-svn: 171635
* PR14573: Unnamed parameters in debug info, Part 2David Blaikie2013-01-051-2/+2
| | | | | | | | Catch some cases I'd missed in r171605 related to unnamed parameters of record type. This resolves all remaining cases of PR14573 suppression in the GDB 7.5 test suite. Fix to the test suite to follow. llvm-svn: 171633
* Companion patch to r171621 which changed the interface for creating TTIChandler Carruth2013-01-051-14/+10
| | | | | | passes to a create-pass function instead of a direct constructor call. llvm-svn: 171622
* Emit debug info for unnamed parameters.David Blaikie2013-01-051-17/+15
| | | | | | LLVM ignores this data for now - patch for that to follow. llvm-svn: 171605
* [mips] Fix data layout string. Add 64 to the list of native integer widthsAkira Hatanaka2013-01-051-6/+6
| | | | | | and add stack alignment information. llvm-svn: 171588
* Assert that redeclarations have the same linkage.Rafael Espindola2013-01-051-3/+28
| | | | | | | It is somewhat hard to test linkage, so I decided to try to add an assert. This already found some interesting cases where there were different. llvm-svn: 171585
* In my last patch initialize the destination to null (with a simple store) ↵Fariborz Jahanian2013-01-051-0/+2
| | | | | | | | before doing a storeStrong to it. // rdar://12530881 llvm-svn: 171572
* Various fixes to clang-format's macro handling.Manuel Klimek2013-01-043-30/+148
| | | | | | | | | | | | | | | | | | | Some of this is still pretty rough (note the load of FIXMEs), but it is strictly an improvement and fixes various bugs that were related to macro processing but are also imporant in non-macro use cases. Specific fixes: - correctly puts espaced newlines at the end of the line - fixes counting of white space before a token when escaped newlines are present - fixes parsing of "trailing" tokens when eof() is hit - puts macro parsing orthogonal to parsing other structure - general support for parsing of macro definitions Due to the fix to format trailing tokens, this change also includes a bunch of fixes to the c-index tests. llvm-svn: 171556
* objective-C arc: in copy helper function for Fariborz Jahanian2013-01-041-0/+5
| | | | | | | | | __strong __block variables, perform objc_storeStrong on source and destination instead of direct move. This is done with -O0 and to improve some analysis. // rdar://12530881 llvm-svn: 171555
* Fix indent and remove parameter with a matching default value.Chad Rosier2013-01-042-94/+74
| | | | llvm-svn: 171545
* Style fix: We don't use lowercase-and-underscored template parameter names.Rafael Espindola2013-01-041-3/+3
| | | | | | Thanks for dgregor for noticing it. llvm-svn: 171532
* Correctly format dereference and address of in array parameters.Daniel Jasper2013-01-041-2/+3
| | | | | | | | | Before: InvalidRegions[ &R] = 0; After: InvalidRegions[&R] = 0; This fixes llvm.org/PR14793 llvm-svn: 171522
* Fix typo. Thanks to dgregor for noticing it.Rafael Espindola2013-01-041-1/+1
| | | | llvm-svn: 171521
* realpath'ify the mapping from header includes to module imports.Douglas Gregor2013-01-041-0/+13
| | | | llvm-svn: 171516
* Update CMakeLists.txtTed Kremenek2013-01-041-2/+2
| | | | llvm-svn: 171505
* Add __has_feature support to detect if clang supports the explicit "atomic" ↵Ted Kremenek2013-01-041-0/+1
| | | | | | | | keyword for ObjC properties. Fixes <rdar://problem/12953378>. llvm-svn: 171504
* NSErrorChecker: remove quoting the parameter name in the diagnostic until we ↵Ted Kremenek2013-01-041-11/+8
| | | | | | | | | | actually include it's name. This is a possible regression of moving to using ImplicitNullDerefEvent. Fixing this for real (including the parameter name) requires more plumbing in ImplicitNullDerefEvent. This is just a stop gap fix. llvm-svn: 171502
* Tighten code. No functionality change.Ted Kremenek2013-01-041-7/+7
| | | | llvm-svn: 171501
* Add the module name to the 'incomplete umbrella header' warning.Douglas Gregor2013-01-041-1/+1
| | | | llvm-svn: 171497
* Let the formatter ignore UnwrappedLines containing errors.Daniel Jasper2013-01-041-17/+35
| | | | | | | | | | | | | | This prevents code like: namespace { class Foo { Foo( }; } // comment from causing segfaults (see llvm.org/PR14774). llvm-svn: 171495
* Add file added in r171484 to CMakelists.txt.Filipe Cabecinhas2013-01-041-0/+1
| | | | llvm-svn: 171494
* Debug Info: fix the line location for cleanup code of a block functionManman Ren2013-01-041-0/+3
| | | | | | | | | | The line information was changed when emitting debug information for all the DeclRefExprs and we should change it back to get ready for PopClenupBlocks called from FinishFunction. rdar://11562117 llvm-svn: 171493
* Fix up various builtin declaration of objc_msgSend familiesFariborz Jahanian2013-01-042-1/+36
| | | | | | | to match those foung in objc.h an avoid spurious warnings. // rdar://12489098 llvm-svn: 171492
* [arcmt] Allow removing an -autorelease of a variable initialized in the ↵Argyrios Kyrtzidis2013-01-043-16/+58
| | | | | | | | previous statement. rdar://11074996 llvm-svn: 171485
* [arcmt] Adds brackets in case statements that "contain" initialization of ↵Argyrios Kyrtzidis2013-01-045-5/+135
| | | | | | | | | | retaining variable, thus emitting the "switch case is in protected scope" error. rdar://12952016 llvm-svn: 171484
* Move the common source locations of CastStmt & DefaultStmt into their base ↵Argyrios Kyrtzidis2013-01-042-8/+4
| | | | | | class, SwitchCase. llvm-svn: 171483
* [arcmt] Don't error if an autoreleased variable is returned after the ↵Argyrios Kyrtzidis2013-01-041-18/+70
| | | | | | | | -autorelease. rdar://12952025 llvm-svn: 171482
* Remove -Wmodule-build; it was a dumb idea anyway. <rdar://problem/12957525>Douglas Gregor2013-01-041-2/+0
| | | | llvm-svn: 171478
* Fix fieldNo usage for lambdas. No behavior change since theEric Christopher2013-01-041-2/+2
| | | | | | field number was 0 anyhow. llvm-svn: 171472
* Warn on unused auto variables.Rafael Espindola2013-01-031-2/+3
| | | | | | | | To do so we have to wait until we know that the type of a variable has been deduced. Sema::FinalizeDeclaration is the first callback that is used for decl with or without initializers. llvm-svn: 171458
* Use early returns to reduce indentation.Rafael Espindola2013-01-031-31/+34
| | | | llvm-svn: 171457
* [arcmt] Rewrite uses of Block_copy/Block_release macros.Argyrios Kyrtzidis2013-01-031-9/+88
| | | | | | | | | | | | c = Block_copy(b); Block_release(c); ----> c = [b copy]; <removed> rdar://9408211 llvm-svn: 171454
* Make MallocChecker debug output useful.Ted Kremenek2013-01-031-2/+22
| | | | llvm-svn: 171439
* Don't assert/crash on reference variables in lambdas bound to aEli Friedman2013-01-032-9/+2
| | | | | | static local variable from the parent scope. PR14773. llvm-svn: 171433
* [analyzer] Rename callback EndPath -> EndFunctionAnna Zaks2013-01-036-25/+25
| | | | | | | This better reflects when callback is called and what the checkers are relying on. (Both names meant the same pre-IPA.) llvm-svn: 171432
OpenPOWER on IntegriCloud