summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [Frontend] Make the include dir group independent from the "use sysroot" bit.Daniel Dunbar2013-01-292-8/+6
| | | | | | | | | - This slightly decouples the path handling, since before the group sometimes dominated the "use sysroot" bit, but it was still passed in via the API. - No functionality change. llvm-svn: 173855
* [Frontend] Rename a member variable to clarify its intent.Daniel Dunbar2013-01-291-5/+6
| | | | llvm-svn: 173854
* [Frontend] Factor out helper function, for clarity.Daniel Dunbar2013-01-291-9/+10
| | | | llvm-svn: 173853
* [driver] Clear the FailureResultFiles when initializing clang diagnostics. Also,Chad Rosier2013-01-292-6/+7
| | | | | | minor cleanup. llvm-svn: 173852
* [Doc parsing] Patch to parse Doxygen-supported HTML character Fariborz Jahanian2013-01-291-18/+181
| | | | | | | references to their UTIF-8 encoding. Reviewed offline by Doug. // rdar://12392215 llvm-svn: 173850
* [ubsan] Implement the -fcatch-undefined-behavior flag using a trappingChad Rosier2013-01-296-8/+57
| | | | | | | | | | | implementation; this is much more inline with the original implementation (i.e., pre-ubsan) and does not require run-time library support. The trapping implementation can be invoked using either '-fcatch-undefined-behavior' or '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error', with the latter being preferred. Eventually, the -fcatch-undefined-behavior' flag will be removed. llvm-svn: 173848
* Move -Wstatic-float-init fixit into a note & don't recover as if constexprDavid Blaikie2013-01-291-9/+6
| | | | llvm-svn: 173841
* Don't fixit/recover from -Wstatic-float-init when it's not an error.David Blaikie2013-01-291-5/+9
| | | | | | | Fix to change r173414 that lead to Clang changing const to constexpr even under -Wno-static-float-init. llvm-svn: 173835
* Move the token annotator into separate files.Daniel Jasper2013-01-296-1036/+1105
| | | | | | | No functional changes. Also removed experimental-warning from all of clang-format's files, as it is no longer accurate. llvm-svn: 173830
* [Preprocessor] When checking if we can concatenate two tokens, checkArgyrios Kyrtzidis2013-01-291-3/+4
| | | | | | | | | | | | if they were already concatenated in source using the spelling locations even if they came from a macro expansion. This fixes an issue where a GUID passed as macro argument ends up malformed after preprocessing because we added spaces inside it. rdar://13016645 llvm-svn: 173826
* [driver] Refactor the driver so that a failing commands doesn't preventChad Rosier2013-01-292-42/+49
| | | | | | | | | | | subsequent commands from being executed. The diagnostics generation isn't designed for this use case, so add a note to fix this in the very near future. For now, just generated the diagnostics for the first failing command. Part of rdar://12984531 llvm-svn: 173825
* Improve formatting of code with comments.Daniel Jasper2013-01-291-6/+5
| | | | | | | | | | | | | | | | | | | | Before: aaaaaaa(aaaaaa( // comment aaaaaaa)); <big mess> After: aaaaaaa(aaaaaa( // comment aaaaaaaa)); function(/* parameter 1 */ aaaaaaa, /* parameter 2 */ aaaaaaa, /* parameter 3 */ aaaaaaa, /* parameter 4 */ aaaaaaa); (the latter example was only wrong in the one-arg-per-line mode, e.g. in Google style). llvm-svn: 173821
* Mark a struct definition in an objc container with the ↵Argyrios Kyrtzidis2013-01-291-1/+5
| | | | | | | | | | | TopLevelDeclInObjCContainer bit. Fixes accurately getting a cursor inside an objc container containing a struct definition, from a PCH/preamble file. rdar://12584613 llvm-svn: 173811
* Allow all parameters on next line for function calls in Chrome.Daniel Jasper2013-01-291-5/+6
| | | | | | | | | | | | The style guide only forbids this for function declarations. So, now someFunction( aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa, aaaaaaaaaaaa); Is allowed in Chromium mode. llvm-svn: 173806
* Split ">>" in "A<B<C> >" in Chromium style.Daniel Jasper2013-01-291-0/+1
| | | | | | It needs to be compatible with C++03. llvm-svn: 173805
* Fix uninitialized error caused by r173801.Daniel Jasper2013-01-291-2/+3
| | | | llvm-svn: 173803
* Fix a crash in OpenCL code by using the proper (RHS) bit-width.Joey Gouly2013-01-291-2/+2
| | | | llvm-svn: 173802
* Calculate the split penalty upfront.Daniel Jasper2013-01-291-55/+60
| | | | | | | | | | This is a) More efficient. b) Important as we move forward with further metrics for penalty. No functional changes intended. llvm-svn: 173801
* Fix a comment and reformat clang-format with clang-formatDaniel Jasper2013-01-291-43/+44
| | | | | | Not all changes might be ideal, but IMO all are acceptable. llvm-svn: 173793
* Initial support for multiple variable declarations.Daniel Jasper2013-01-291-15/+15
| | | | | | | | | | | Before: SomeType aaaaaaaaaaaaaaaaa = aaaaaa->aaaaaaaaaaaaaaaaa(), aaaaaaaaaaa = aaaaaa->aaaaaaaaaaa(); After: SomeType aaaaaaaaaaaaaaaaa = aaaaaa->aaaaaaaaaaaaaaaaa(), aaaaaaaaaaa = aaaaaa->aaaaaaaaaaa(); llvm-svn: 173792
* Add a diagnostic for an OpenCL kernel with a pointer pointer argument.Joey Gouly2013-01-291-7/+16
| | | | | | Also refactor the surrounding code a little. llvm-svn: 173791
* Produce a diagnostic if alignas is applied to an expression. Neither C11 norRichard Smith2013-01-291-3/+6
| | | | | | C++11 allows that. llvm-svn: 173789
* Downgrade 'attribute ignored when parsing type' from error to warning, to matchRichard Smith2013-01-294-7/+17
| | | | | | | | | the diagnostic's warn_ name. Switch some places (notably C++11 attributes) which really wanted an error over to a different diagnostic. Finally, suppress the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing diagnostics in important system headers. llvm-svn: 173788
* Reverting changes from r173785 (removing empty lines before "}").Daniel Jasper2013-01-291-2/+0
| | | | | | | This needs some more thinking, e.g. for namespaces, chains of if-else if, ... llvm-svn: 173787
* Remove empty lines before "}".Daniel Jasper2013-01-291-0/+2
| | | | | | | | | | | | | | | | | | Those empty lines waste vertical whitespace and almost never increase readability. Before: void f() { DoSomething(); } After: void f() { DoSomething(); } llvm-svn: 173785
* Implement C++11 [dcl.align]p1 and C11 6.7.5/2 rules for alignas and _Alignas.Richard Smith2013-01-293-10/+56
| | | | llvm-svn: 173779
* Propagate the spelling list index for an attribute across template ↵Richard Smith2013-01-292-5/+7
| | | | | | instantiation. llvm-svn: 173768
* PR15017: A '>' can appear after a type-specifier in a template-argument-list.Richard Smith2013-01-291-0/+3
| | | | | | | It turns out that there's no correctness bug here (because we can't have a type definition in this location), but there was a diagnostic bug. llvm-svn: 173766
* PR15100: look through type sugar when determining whether we have one of theRichard Smith2013-01-291-1/+2
| | | | | | forms of 'main' which we accept as an extension. llvm-svn: 173758
* 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
OpenPOWER on IntegriCloud