summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't put spaces around ##.Daniel Jasper2013-01-081-2/+4
| | | | | | | | | | | | | | | | | In Clang/LLVM this seems to be the more common formatting for ##s. There might still be case that we miss, but we'll fix those as we go along. Before: #define A(X) void function ## X(); After: #define A(X) void function##X(); llvm-svn: 171862
* Clear the LV cache when setting the instantiated from link.Rafael Espindola2013-01-081-0/+1
| | | | | | Fixes pr14835. llvm-svn: 171857
* Change the data structure used in clang-format.Daniel Jasper2013-01-083-298/+315
| | | | | | | | | | | | This is a first step towards supporting more complex structures such as #ifs inside unwrapped lines. This patch mostly converts the array-based UnwrappedLine into a linked-list-based UnwrappedLine. Future changes will allow multiple children for each Token turning the UnwrappedLine into a tree. No functional changes intended. llvm-svn: 171856
* Clear the LV cache when merging the availability attribute.Rafael Espindola2013-01-081-2/+6
| | | | | | | The availability implies default visibility, so it can change the computed visibility. llvm-svn: 171840
* Don't warn about undefined varargs argument behavior in unreachable code.Ted Kremenek2013-01-081-5/+5
| | | | | | Fixes <rdar://problem/12322000>. llvm-svn: 171831
* [arcmt] Follow-up for r171484; make sure when adding brackets enclosing case ↵Argyrios Kyrtzidis2013-01-081-58/+136
| | | | | | | | | statements, that the case does not "contain" a declaration that is referenced "outside" of it, otherwise we will emit un-compilable code. llvm-svn: 171828
* Move ref qualifiers from Type bitfields into FunctionProtoType, stealing twoRichard Smith2013-01-081-2/+5
| | | | | | | bits from the number of parameters. This brings the bitfields down from 33 bits to 32 bits, reducing the size of Types by 4 bytes on 32-bit systems. llvm-svn: 171827
* [analyzer] Include the bug uniqueing location in the issue_hash.Anna Zaks2013-01-085-34/+63
| | | | | | | | | | | | | | | The issue here is that if we have 2 leaks reported at the same line for which we cannot print the corresponding region info, they will get treated as the same by issue_hash+description. We need to AUGMENT the issue_hash with the allocation info to differentiate the two issues. Add the "hash" (offset from the beginning of a function) representing allocation site to solve the issue. We might want to generalize solution in the future when we decide to track more than just the 2 locations from the diagnostics. llvm-svn: 171825
* [analyzer] Plist: change the type of issue_hash from int to string.Anna Zaks2013-01-081-2/+2
| | | | | | This gives more flexibility to what could be stored as issue_hash. llvm-svn: 171824
* PR14838: When a member reference is bound to a temporary, don't forget toRichard Smith2013-01-081-2/+2
| | | | | | | perform the semantic checks associated with the destruction of that temporary. It'll be destroyed at the end of the constructor. llvm-svn: 171818
* Back out my no-op change from r171783.Douglas Gregor2013-01-081-8/+2
| | | | llvm-svn: 171817
* Extract the instance-method case for debug info out into a separate function.David Blaikie2013-01-072-10/+12
| | | | | | | | | | This is in preparation for using this to construct the function type for pointers to member functions to include the implicit/artificial 'this' parameter in that case as well. (feedback from GDB indicates that this might be all that's necessary to get it to behave well with Clang's pointer-to-member function debug output) llvm-svn: 171809
* [ubsan] Use correct type for compound assignment ops.Will Dietz2013-01-071-2/+2
| | | | llvm-svn: 171801
* Simplify computing debug info type for static member functions.David Blaikie2013-01-071-26/+27
| | | | | | No (intended) functional change. llvm-svn: 171800
* Minor refactoring of my last patchFariborz Jahanian2013-01-071-13/+12
| | | | | | related to // rdar://12958878 llvm-svn: 171792
* Use the C++11 POD definition in C++11 mode to determine whether oneDouglas Gregor2013-01-071-2/+8
| | | | | | can create a VLA of class type. Fixes <rdar://problem/12151822>. llvm-svn: 171783
* Use getter. Fixes the build from a bad merge.Rafael Espindola2013-01-071-1/+1
| | | | llvm-svn: 171782
* Add support for attribute((mode(unwind_word))).Rafael Espindola2013-01-071-0/+4
| | | | | | Patch by Nick Lewycky. Fixes pr8703. llvm-svn: 171781
* objective-C: when searching for declarations in protocolFariborz Jahanian2013-01-072-4/+13
| | | | | | | list of classes, etc., make sure to look into protocol definitions. // rdar://12958878 llvm-svn: 171777
* [PCH] (De)serialize the end location of MacroInfo.Argyrios Kyrtzidis2013-01-072-0/+2
| | | | llvm-svn: 171772
* Pull the bulk of Lexer::MeasureTokenLength() out into a new function,Argyrios Kyrtzidis2013-01-071-5/+15
| | | | | | | | Lexer::getRawToken(). No functionality change. llvm-svn: 171771
* [analyzer] Fix a false positive in Secure Keychain API checker.Anna Zaks2013-01-072-8/+10
| | | | | | | | | Better handle the blacklisting of known bad deallocators when symbol escapes through a call to CFStringCreateWithBytesNoCopy. Addresses radar://12702952. llvm-svn: 171770
* [analyzer] Fix a false positive in the ivar invalidation checker.Anna Zaks2013-01-071-1/+3
| | | | | | | | | When a property is "inherited" through both a parent class and directly through a protocol, we should not require the child to invalidate it since the backing ivar belongs to the parent class. (Fixes radar://12913734) llvm-svn: 171769
* Formatter: Support @public/@protected/@package/@private.Nico Weber2013-01-072-2/+25
| | | | | | @package is an Objective-C 2 feature, so turn on ObjC2 as well. llvm-svn: 171766
* Fix parsing of variable declarations directly after a class / struct.Manuel Klimek2013-01-072-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previous indent: class A { } a; void f() { }; With this patch: class A { } a; void f() { } ; The patch introduces a production for classes and structs, and parses the rest of the line to the semicolon after the class scope. This allowed us to remove a long-standing wart in the parser that would just much the semicolon after any block. Due to this suboptimal formating some tests were broken. Some unrelated formatting tests broke; those hit a bug in the ast printing, and need to be fixed separately. llvm-svn: 171761
* Implement Attr dumping for -ast-dump.Alexander Kornienko2013-01-072-0/+29
| | | | | | | | http://llvm-reviews.chandlerc.com/D234 Patch by Philip Craig! llvm-svn: 171760
* Add fixit hints for misplaced C++11 attributes around class specifiers.Michael Han2013-01-071-8/+45
| | | | | | | | | | Following r168626, in class declaration or definition, there are a combination of syntactic locations where C++11 attributes could appear, and among those the only valid location permitted by standard is between class-key and class-name. So for those attributes appear at wrong locations, fixit is used to move them to expected location and we recover by applying them to the class specifier. llvm-svn: 171757
* updateOutOfDateIdentifier() can cause the identifier table to beDouglas Gregor2013-01-071-2/+10
| | | | | | | | rehashed, invaliding the iterator walking through the identifier table. Separate out the identification of out-of-date identifiers from updating them. llvm-svn: 171756
* Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to beDavid Tweed2013-01-073-17/+41
| | | | | | | | | | with respect to the lower "left-hand-side bitwidth" bits, even when negative); see OpenCL spec 6.3j. This patch both implements this behaviour in the code generator and "constant folding" bits of Sema, and also prevents tests to detect undefinedness in terms of the weaker C99 or C++ specifications from being applied. llvm-svn: 171755
* Formatter: Add tests for try/catch. Let 'throw' start an expression.Nico Weber2013-01-071-3/+2
| | | | | | | | | | Before: throw a *b; Now: throw a * b; llvm-svn: 171754
* Formatter: Don't put spaces betwen @ and objc keywords.Nico Weber2013-01-071-0/+2
| | | | llvm-svn: 171753
* Small refactoring of the formatter code.Daniel Jasper2013-01-071-82/+84
| | | | | | | | This should make it slightly more readable as it more clearly separates what happens where. No intended functional changes. More of this to come.. llvm-svn: 171748
* Fix typo.Nico Weber2013-01-071-1/+1
| | | | llvm-svn: 171740
* s/parseStatement/parseStructuralElement/g in the UnwrappedLineParser.Manuel Klimek2013-01-072-9/+9
| | | | llvm-svn: 171737
* Reformat clang-formats source code.Daniel Jasper2013-01-073-23/+23
| | | | | | All changes done by clang-format itself. No functional changes. llvm-svn: 171732
* Prefer not to break after assignments.Daniel Jasper2013-01-071-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | This addresses llvm.org/PR14830. Before: unsigned Cost = TTI.getMemoryOpCost(I->getOpcode(), VectorTy, SI->getAlignment(), SI->getPointerAddressSpace()); CharSourceRange LineRange = CharSourceRange::getTokenRange(TheLine.Tokens.front().Tok.getLocation(), TheLine.Tokens.back().Tok.getLocation()); After: unsigned Cost = TTI.getMemoryOpCost(I->getOpcode(), VectorTy, SI->getAlignment(), SI->getPointerAddressSpace()); CharSourceRange LineRange = CharSourceRange::getTokenRange( TheLine.Tokens.front().Tok.getLocation(), TheLine.Tokens.back().Tok.getLocation()); This required rudimentary changes to static initializer lists, but we are not yet formatting them in a reasonable way. That will be done in a subsequent patch. llvm-svn: 171731
* Add style option for number of spaces before trailing comments.Daniel Jasper2013-01-071-1/+3
| | | | | | | In LLVM style, a single space should be enough. In Google style, two spaces are required. llvm-svn: 171725
* Do not break before "0" in pure virtual function declarations.Daniel Jasper2013-01-071-108/+138
| | | | | | | | | | | | | | | | | | | Before: virtual void write(ELFWriter *writer, OwningPtr<FileOutputBuffer> &buffer) = 0 After: virtual void write(ELFWriter *writerrr, OwningPtr<FileOutputBuffer> &buffer) = 0; This addresses llvm.org/PR14815. To implement this I introduced a line type during parsing and moved the definition of TokenType out of the struct for increased readability. Should have done the latter in a separate patch, but it would be hard to pull apart now. llvm-svn: 171724
* Fix incorrect FIXME.Manuel Klimek2013-01-071-2/+3
| | | | | | | | The case that we wanted to write a test for cannot happen, as the UnwrappedLineParser already protects against it. Added an assert to prevent regressions of that assumption. llvm-svn: 171720
* 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
OpenPOWER on IntegriCloud