| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
Thanks Jordan!
llvm-svn: 173955
|
|
|
|
|
|
| |
Just makes the code a little cleaner, and easier to reason about.
llvm-svn: 173953
|
|
|
|
|
|
|
|
|
| |
for "#define X X".
This is a pattern that, for example, stdbool.h uses.
rdar://12435773
llvm-svn: 173952
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 173927
|
|
|
|
|
|
| |
This is required to use them in TableGen.
llvm-svn: 173924
|
|
|
|
|
|
|
|
| |
__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
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 173916
|
|
|
|
|
|
| |
an Objective-C method. Fixes <rdar://problem/13069990>.
llvm-svn: 173905
|
|
|
|
|
|
|
| |
can be messaged via the metaclass. Provide code completions for this
case. Fixes <rdar://problem/12560296>.
llvm-svn: 173903
|
|
|
|
| |
llvm-svn: 173900
|
|
|
|
|
|
| |
an attribute for consistency with our other noreturn mechanisms.
llvm-svn: 173898
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
argument to be memset, check for its type to be complete
before calling Context.getTypeSize(PointeeTy) to prevent
crash. // rdar://13081751.
llvm-svn: 173872
|
|
|
|
| |
llvm-svn: 173871
|
|
|
|
| |
llvm-svn: 173866
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
| |
my last patch.
llvm-svn: 173856
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
| |
llvm-svn: 173854
|
|
|
|
| |
llvm-svn: 173853
|
|
|
|
|
|
| |
minor cleanup.
llvm-svn: 173852
|
|
|
|
|
|
|
| |
references to their UTIF-8 encoding. Reviewed offline by Doug.
// rdar://12392215
llvm-svn: 173850
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 173841
|
|
|
|
|
|
|
| |
Fix to change r173414 that lead to Clang changing const to constexpr even under
-Wno-static-float-init.
llvm-svn: 173835
|
|
|
|
|
|
|
| |
No functional changes. Also removed experimental-warning from all of
clang-format's files, as it is no longer accurate.
llvm-svn: 173830
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
The style guide only forbids this for function declarations. So,
now
someFunction(
aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa, aaaaaaaaaaaa);
Is allowed in Chromium mode.
llvm-svn: 173806
|
|
|
|
|
|
| |
It needs to be compatible with C++03.
llvm-svn: 173805
|
|
|
|
| |
llvm-svn: 173803
|
|
|
|
| |
llvm-svn: 173802
|
|
|
|
|
|
|
|
|
|
| |
This is
a) More efficient.
b) Important as we move forward with further metrics for penalty.
No functional changes intended.
llvm-svn: 173801
|
|
|
|
|
|
| |
Not all changes might be ideal, but IMO all are acceptable.
llvm-svn: 173793
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
SomeType aaaaaaaaaaaaaaaaa = aaaaaa->aaaaaaaaaaaaaaaaa(),
aaaaaaaaaaa = aaaaaa->aaaaaaaaaaa();
After:
SomeType aaaaaaaaaaaaaaaaa = aaaaaa->aaaaaaaaaaaaaaaaa(),
aaaaaaaaaaa = aaaaaa->aaaaaaaaaaa();
llvm-svn: 173792
|
|
|
|
|
|
| |
Also refactor the surrounding code a little.
llvm-svn: 173791
|
|
|
|
|
|
| |
C++11 allows that.
llvm-svn: 173789
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This needs some more thinking, e.g. for namespaces, chains of if-else
if, ...
llvm-svn: 173787
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Those empty lines waste vertical whitespace and almost never
increase readability.
Before:
void f() {
DoSomething();
}
After:
void f() {
DoSomething();
}
llvm-svn: 173785
|
|
|
|
| |
llvm-svn: 173779
|
|
|
|
|
|
| |
instantiation.
llvm-svn: 173768
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
forms of 'main' which we accept as an extension.
llvm-svn: 173758
|