summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Treat alignas and _Alignas as keyword attributes. This allows us toRichard Smith2013-01-291-10/+6
| | | | | | | pretty-print them properly (modulo the more general badness in alignment attribute printing). llvm-svn: 173752
* Actually remove the hack which was blocking the Borland-style attributes fromRichard Smith2013-01-291-7/+0
| | | | | | | working, and add the missing attribute spellings. This brings _pascal, _fastcall, _stdcall and _cdecl to life in -fborland-extensions mode. llvm-svn: 173749
* Don't crash while printing APValues that are lvalues casted to aDouglas Gregor2013-01-291-0/+2
| | | | | | decidedly non-reference, non-pointer type. Fixes <rdar://problem/13090123>. llvm-svn: 173747
* Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelledRichard Smith2013-01-293-17/+12
| | | | | | | | | as a keyword. Rationalize existing attributes to use it as appropriate, and to not lie about some __declspec attributes being GNU attributes. In passing, remove a gross hack which was discarding attributes which we could handle. This results in us actually respecting the __pascal keyword again. llvm-svn: 173746
* Abstract the behavior of when to use base-class tail padding.John McCall2013-01-291-8/+49
| | | | | | | For fun, I added a comedy "actually obey the C++11 POD rules" option which nobody is allowed to use. llvm-svn: 173744
* Finish semantic analysis for [[carries_dependency]] attribute.Richard Smith2013-01-287-15/+70
| | | | | | | | | | This required plumbing through a new flag to determine whether a ParmVarDecl is actually a parameter of a function declaration (as opposed to a function typedef etc, where the attribute is prohibited). Weirdly, this attribute (just like [[noreturn]]) cannot be applied to a function type, just to a function declaration (and its parameters). llvm-svn: 173726
* Undo my re-wording of the "ARC forbids Objective-C objects in ..."Douglas Gregor2013-01-281-1/+1
| | | | | | error. Jordan is right. llvm-svn: 173713
* Forbid the use of objects in unions in Objective-C++ ARC. FixesDouglas Gregor2013-01-281-32/+30
| | | | | | <rdar://problem/13098104>. llvm-svn: 173708
* Enable the global module index by default. Introduce theDouglas Gregor2013-01-281-1/+1
| | | | | | | | -fno-modules-global-index -cc1 option to allow one to disable the index for performance testing purposes, but with a 10% win in -fsyntax-only time, there is no reason a user would do this. llvm-svn: 173707
* ASTReader and profiling statistics indicate that implementing a methodDouglas Gregor2013-01-281-4/+0
| | | | | | | pool in the global module index is not worthwhile. Update comments to limit the scope of the global module index to identifiers. llvm-svn: 173705
* Add some more ASTReader statistics for global method pool lookups.Douglas Gregor2013-01-281-7/+23
| | | | llvm-svn: 173702
* PR15067 (again): Don't warn about UCNs in C90 if we're raw-lexing.Jordan Rose2013-01-281-1/+2
| | | | | | Fixes a crash. Thanks, Richard. llvm-svn: 173701
* Fix comment.Eric Christopher2013-01-281-1/+1
| | | | llvm-svn: 173700
* Fix a bug that would lead to bad line break decisions in for loops.Daniel Jasper2013-01-281-6/+6
| | | | | | | | | | | | | | Before: for (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaa = aaaaaaaaaaaaaaa .aaaaaaaaaaaaaaaa; aaaaaaaaaaa != aaaaaaaaaaaaaaaaaaa; ++aaaaaaaaaaa) {} After: for (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaa = aaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaa; aaaaaaaaaaa != aaaaaaaaaaaaaaaaaaa; ++aaaaaaaaaaa) {} llvm-svn: 173695
* Eliminate memory allocation from most invocations ofDouglas Gregor2013-01-281-13/+38
| | | | | | | | | | ModuleManager::visit() by keeping a free list of the two data structures used to store state (a preallocated stack and a visitation number vector). Improves -fsyntax-only performance for my modules test case by 2.8%. Modules has pulled ahead by almost 10% with the global module index. llvm-svn: 173692
* Don't put a function's return type on its own line in Google style.Daniel Jasper2013-01-281-1/+3
| | | | | | | | | | This would be against the style guide: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Function_Declarations_and_Definitions#Function_Declarations_and_Definitions Not sure what to do as a last resort if the function signature does not fit onto a single line in Google style .. llvm-svn: 173690
* Let clang-format break after a function's return type.Daniel Jasper2013-01-281-7/+33
| | | | | | | | | | | | | | | | Before: TypeSpecDecl *TypeSpecDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *II, Type *T) {} After: TypeSpecDecl * TypeSpecDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *II, Type *T) {} This fixes llvm.org/PR14717. llvm-svn: 173688
* Make continuations in constructor initializers consistent.Daniel Jasper2013-01-281-1/+2
| | | | | | | | | | | | | | Before: Constructor : LooooooooooooooooooooongVariable( LooooooooooooooooooooongValue) {} After: Constructor : LooooooooooooooooooooongVariable( LooooooooooooooooooooongValue) {} llvm-svn: 173685
* Initial support for formatting range-based for-loops.Daniel Jasper2013-01-281-3/+19
| | | | | | | | | | | | | | | | Before (in good cases): for (auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {} for (auto aaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa, aaaa)) {} After: for (auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {} for (auto aaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa, aaaa)) {} llvm-svn: 173684
* Improve formatting of conditional expressions.Daniel Jasper2013-01-281-10/+22
| | | | | | | | | | | | | | | | | | | Before we did not really systematically format those. Now, we format the different cases as: - 1 Line: a ? b : c; - 2 Lines: short ? loooooooooong : loooooooooong - 2 Lines: loooooooooooooooong ? short : short - 3 Lines: loooooooooooooooong ? loooooooooooooong : loooooooooooooong Not sure whether "?" and ":" should go on the new line, but it seems to be the most consistent approach. llvm-svn: 173683
* Several small changes in formatting decisions.Daniel Jasper2013-01-281-26/+15
| | | | | | | | | | | | | | | | | 1. Use a hanging ident for function calls nested in binary expressions. E.g.: int aaaaa = aaaaaaaaa && aaaaaaaaaa( aaaaaaaaaa); 2. Slightly improve heuristic for builder type expressions and reduce penalty for breaking before "." and "->" in those. 3. Remove mostly obsolete metric of decreasing indent level. This fixes: llvm.org/PR14931. Changes #1 and #2 were necessary to keep tests passing after #3. llvm-svn: 173680
* Improve indentation after breaking at nested name specifiers.Daniel Jasper2013-01-281-3/+4
| | | | | | | | | | | | | | These always represent a continuation and we should increase the ident. Before: aaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa:: aaaaaaaaaaaaaaaaaaaa); After: aaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa:: aaaaaaaaaaaaaaaaaaaa); llvm-svn: 173675
* Avoid confusing identations for multi-parameter functions.Daniel Jasper2013-01-281-3/+30
| | | | | | | | | | | | | | Before: aaaaaaaa(aaaaaaaaa( aaaaaaaaaa(), aaaaaaaaa); After: aaaaaaaa(aaaaaaaaa( aaaaaaaaaa(), aaaaaaaaa); llvm-svn: 173673
* Print warning instead of error if optional ASan features are enabled w/o ↵Alexey Samsonov2013-01-282-7/+10
| | | | | | specifying -fsanitize=address llvm-svn: 173670
* Fix the indentation of the first line of preprocessor outputHal Finkel2013-01-281-1/+5
| | | | | | | | | | The -E output from clang did not produce the correct indentation on the first line. This is because MoveToLine returned false, and when this happens, the regular process for producing initial indentation is skipped. Thanks to Eli for suggesting a way to simplify this to a one-line change. llvm-svn: 173657
* Since ObjCARC has been refactored into its own library with its own ↵Michael Gottesman2013-01-281-0/+1
| | | | | | declaration header, we need to include the declaration header alongside Scalar.h in BackendUtil. llvm-svn: 173648
* Tests and a minor bugfix for [dcl.attr.depend]p1 (C++11 [[carries_dependency]]Richard Smith2013-01-281-1/+1
| | | | | | attribute). llvm-svn: 173645
* Add a -pedantic warning: an anonymous union within an anonymous union is notRichard Smith2013-01-281-0/+6
| | | | | | | permitted in standard C++, despite being silently accepted by many (all?) major C++ implementations. llvm-svn: 173643
* Decl printer: fix CXXConstructExpr with implicit default argumentDmitri Gribenko2013-01-271-3/+7
| | | | | | Patch by Will Wilson. llvm-svn: 173630
* Comment parsing: attach any tag type's documentation to its typedef if latterDmitri Gribenko2013-01-271-4/+12
| | | | | | | | does not have one of its own. // rdar://13067629 Original patch (r173586 and r173587) by Fariborz Jahanian, modified by me. llvm-svn: 173626
* PR15067: Don't assert when a UCN appears in a C90 file.Jordan Rose2013-01-272-4/+7
| | | | | | | Unfortunately, we can't accept the UCN as an extension because we're required to treat it as two tokens for preprocessing purposes. llvm-svn: 173622
* Revert r173586 (and r173587) , "Attach any tag type's documentation to its ↵NAKAMURA Takumi2013-01-271-4/+4
| | | | | | | | typedef if" It caused unexpected warnings with @tparam. llvm-svn: 173614
* Use the AttributeSet instead of AttributeWithIndex.Bill Wendling2013-01-273-36/+23
| | | | | | | In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the internals of the AttributeSet to outside users, which isn't goodness. llvm-svn: 173605
* PR14566: Debug Info: avoid top level lexical blocks in functionsDavid Blaikie2013-01-264-8/+21
| | | | | | | | | | | | | | | One of the gotchas (see changes to CodeGenFunction) was due to the fix in r139416 (for PR10829). This only worked previously because the top level lexical block would set the location to the end of the function, the debug location would be updated (as per r139416), the location would be set to the end of the function again (but that would no-op, since it was the same as the previous location), then the return instruction would be emitted using the debug location. Once the top level lexical block was no longer emitted, the end-of-function location change was causing the debug loc to be updated, regressing that bug. llvm-svn: 173593
* Fix comment.Fariborz Jahanian2013-01-261-1/+1
| | | | llvm-svn: 173587
* Attach any tag type's documentation to its typedef ifFariborz Jahanian2013-01-261-3/+3
| | | | | | latter does not have one of its own. // rdar://13067629 llvm-svn: 173586
* Added ASTContext methods getIntPtrType and getUIntPtrType.Enea Zaffanella2013-01-261-0/+8
| | | | llvm-svn: 173581
* <limits.h> includes <linux/limits.h> on Linux, no need to special-case itDmitri Gribenko2013-01-263-9/+3
| | | | llvm-svn: 173578
* Constify some getters of DesignatedInitExprDmitri Gribenko2013-01-261-6/+9
| | | | llvm-svn: 173574
* [analyzer] C++ initializers may require cleanups; look through these.Jordan Rose2013-01-261-1/+1
| | | | | | | | | | | | | | When the analyzer sees an initializer, it checks if the initializer contains a CXXConstructExpr. If so, it trusts that the CXXConstructExpr does the necessary work to initialize the object, and performs no further initialization. This patch looks through any implicit wrapping expressions like ExprWithCleanups to find the CXXConstructExpr inside. Fixes PR15070. llvm-svn: 173557
* Give a more informative error message when the dot or arrow operator is usedRichard Trieu2013-01-261-3/+6
| | | | | | | on a type. Currently, it gives a generic "expected unqualified-id" error. The new error message is "cannot use (dot|arrow) operator on a type". llvm-svn: 173556
* Fix mismatch between pointer and pointee type when diagnosing an incorrectRichard Smith2013-01-261-3/+2
| | | | | | object argument type for a member call. llvm-svn: 173554
* Remove function that is newly dead as of r173538.Nick Lewycky2013-01-261-4/+0
| | | | llvm-svn: 173550
* Highlight various parts of the AST dump with color. Colors are controlled byRichard Trieu2013-01-261-36/+156
| | | | | | | -f(no-)color-diagnostics. In addition, dumpColor() function calls are added to force color printing. No structural changes to -ast-dump. llvm-svn: 173548
* [analyzer] Track null object lvalues back through C++ method calls.Jordan Rose2013-01-261-0/+2
| | | | | | | | | | The expression 'a->b.c()' contains a call to the 'c' method of 'a->b'. We emit an error if 'a' is NULL, but previously didn't actually track the null value back through the 'a->b' expression, which caused us to miss important false-positive-suppression cases, including <rdar://problem/12676053>. llvm-svn: 173547
* [analyzer] bugreporter::getDerefExpr now takes a Stmt, not an ExplodedNode.Jordan Rose2013-01-262-16/+12
| | | | | | | This allows it to be used in places where the interesting statement doesn't match up with the current node. No functionality change. llvm-svn: 173546
* [analyzer] Add 'prune-paths' config option to disable path pruning.Jordan Rose2013-01-262-1/+6
| | | | | | This should be used for testing only. Path pruning is still on by default. llvm-svn: 173545
* [analyzer] Rename PruneNullReturnPaths to SuppressNullReturnPaths.Jordan Rose2013-01-262-3/+3
| | | | | | | "Prune" is the term for eliminating pieces of a path that are not relevant to the user. "Suppress" means don't show that path at all. llvm-svn: 173544
* Since we're stuck with realpath for the header <-> module mapping,Douglas Gregor2013-01-263-44/+54
| | | | | | | | factor the realpath calls into FileManager::getCanonicalName() so we can cache the results of this epically slow operation. 5% speedup on my modules test, and realpath drops out of the profile. llvm-svn: 173542
* Revert r172285 (suppressing a 'redundant' -Wc++98-compat warning) and add aRichard Smith2013-01-261-1/+0
| | | | | | testcase for a situation it caused us to miss. llvm-svn: 173540
OpenPOWER on IntegriCloud