summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Remove further references to analyzer-ipa.Anna Zaks2013-01-301-2/+2
| | | | | | Thanks Jordan! llvm-svn: 173955
* Hoist retrieval of Expr* into caller. No functionality change.Ted Kremenek2013-01-301-6/+6
| | | | | | Just makes the code a little cleaner, and easier to reason about. llvm-svn: 173953
* [preprocessor] Don't warn about "disabled expansion of recursive macro"Argyrios Kyrtzidis2013-01-301-1/+4
| | | | | | | | | for "#define X X". This is a pattern that, for example, stdbool.h uses. rdar://12435773 llvm-svn: 173952
* [analyzer] Model trivial copy/move ctors with an aggregate bind.Jordan Rose2013-01-302-14/+75
| | | | | | | | | | | | | | | | | | | | | | This is faster for the analyzer to process than inlining the constructor and performing a member-wise copy, and it also solves the problem of warning when a partially-initialized POD struct is copied. Before: CGPoint p; p.x = 0; CGPoint p2 = p; <-- assigned value is garbage or undefined After: CGPoint p; p.x = 0; CGPoint p2 = p; // no-warning This matches our behavior in C, where we don't see a field-by-field copy. <rdar://problem/12305288> llvm-svn: 173951
* Comment parsing: resolve more named character referencesDmitri Gribenko2013-01-302-182/+23
| | | | | | | | | This reimplements r173850 with a better approach: (1) use a TableGen-generated matcher instead of doing a linear search; (2) avoid allocations for new strings by converting code points to string iterals with TableGen. llvm-svn: 173931
* Revert unintended changeDmitri Gribenko2013-01-301-1/+0
| | | | llvm-svn: 173927
* Move UTF conversion routines from clang/lib/Basic to llvm/lib/SupportDmitri Gribenko2013-01-3012-668/+25
| | | | | | This is required to use them in TableGen. llvm-svn: 173924
* Also promote fp16 types to double when they're anonymous variadic arguments.Tim Northover2013-01-301-4/+8
| | | | | | | | __fp16 isn't covered by the standard, but this resolves the oddity that float gets promoted when passed variadically, but not the smaller type. This is required by the AArch64 ABI, and a sane action elsewhere. llvm-svn: 173918
* Don't generate no-op replacements.Daniel Jasper2013-01-301-0/+5
| | | | | | No functional changes. llvm-svn: 173916
* Add "instancetype" as a code completion result for the return type ofDouglas Gregor2013-01-301-0/+5
| | | | | | an Objective-C method. Fixes <rdar://problem/13069990>. llvm-svn: 173905
* The instance methods of the root class of an Objective-C hieararchyDouglas Gregor2013-01-301-2/+6
| | | | | | | can be messaged via the metaclass. Provide code completions for this case. Fixes <rdar://problem/12560296>. llvm-svn: 173903
* C11: Provide the missing half of <stdalign.h>Richard Smith2013-01-301-0/+2
| | | | llvm-svn: 173900
* Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled asRichard Smith2013-01-303-8/+17
| | | | | | an attribute for consistency with our other noreturn mechanisms. llvm-svn: 173898
* Don't warn on fall-through from unreachable code.Alexander Kornienko2013-01-301-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A motivating example: class ClassWithDtor { public: ~ClassWithDtor() {} }; void fallthrough3(int n) { switch (n) { case 2: do { ClassWithDtor temp; return; } while (0); // This generates a chain of unreachable CFG blocks. case 3: break; } } Reviewers: rsmith, doug.gregor, alexfh Reviewed By: alexfh CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D330 llvm-svn: 173889
* Don't warn about Unicode characters in -E mode.Jordan Rose2013-01-303-21/+65
| | | | | | | | | | | | | | | People use the C preprocessor for things other than C files. Some of them have Unicode characters. We shouldn't warn about Unicode characters appearing outside of identifiers in this case. There's not currently a way for the preprocessor to tell if it's in -E mode, so I added a new flag, derived from the PreprocessorOutputOptions. This is only used by the Unicode warnings for now, but could conceivably be used by other warnings or even behavioral differences later. <rdar://problem/13107323> llvm-svn: 173881
* Provide a fixit for constexpr non-static data members.David Blaikie2013-01-303-7/+33
| | | | | | | | | | | | | | | | If the member has an initializer, assume it was probably intended to be static and suggest/recover with that. If the member doesn't have an initializer, assume it was probably intended to be const instead of constexpr and suggest that. (if the attempt to apply these changes fails, don't make any suggestion & produce the same diagnostic experience as before. The only case where this can come up that I know of is with a mutable constexpr with an initializer, since mutable is incompatible with static (but it's already incompatible with const anyway)) llvm-svn: 173873
* c: When checking on validity of sizeof passed as size ofFariborz Jahanian2013-01-301-1/+2
| | | | | | | | argument to be memset, check for its type to be complete before calling Context.getTypeSize(PointeeTy) to prevent crash. // rdar://13081751. llvm-svn: 173872
* [Frontend] Factor AddUnmappedPath() out of AddPath() and simplify.Daniel Dunbar2013-01-301-15/+33
| | | | llvm-svn: 173871
* [Frontend] Remove HeaderSearchOptions::Entry::IsInternal, which is unused.Daniel Dunbar2013-01-303-6/+2
| | | | llvm-svn: 173866
* [Frontend] Add an ExternCSystem include entry group.Daniel Dunbar2013-01-304-81/+77
| | | | | | | | - The only group where it makes sense for the "ExternC" bit is System, so this simplifies having to have the extra isCXXAware (or ImplicitExternC, depending on what code you talk to) bit caried around. llvm-svn: 173859
* Removed couple of html named character references inFariborz Jahanian2013-01-301-2/+0
| | | | | | my last patch. llvm-svn: 173856
* [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
OpenPOWER on IntegriCloud