| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
| |
llvm-svn: 179395
|
| |
|
|
|
|
| |
Also reflow code a bit, no change in functionality.
llvm-svn: 179382
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we'd only detect structural errors on the very first level.
This leads to incorrectly balanced braces not being discovered, and thus
incorrect indentation.
This change fixes the problem by:
- changing the parser to use an error state that can be detected
anywhere inside the productions, for example if we get an eof on
SOME_MACRO({ some block <eof>
- previously we'd never break lines when we discovered a structural
error; now we break even in the case of a structural error if there
are two unwrapped lines within the same line; thus,
void f() { while (true) { g(); y(); } }
will still be re-formatted, even if there's missing braces somewhere
in the file
- still exclude macro definitions from generating structural error;
macro definitions are inbalanced snippets
llvm-svn: 179379
|
| |
|
|
|
|
| |
By Adam Schnitzer!
llvm-svn: 179352
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
1. Calling 'foo'
2. Doing something interesting
3. Returning from 'foo'
4. Some kind of error here
After:
1. Calling 'foo'
2. Doing something interesting
3. Returning from 'foo'
4. Some kind of error here
The location of the note is already in the caller, not the callee, so this
just brings the "depth" attribute in line with that.
This only affects plist diagnostic consumers (i.e. Xcode). It's necessary
for Xcode to associate the control flow arrows with the right stack frame.
<rdar://problem/13634363>
llvm-svn: 179351
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this code
int getZero() {
return 0;
}
void test() {
int problem = 1 / getZero(); // expected-warning {{Division by zero}}
}
we generate these arrows:
+-----------------+
| v
int problem = 1 / getZero();
^ |
+---+
where the top one represents the control flow up to the first call, and the
bottom one represents the flow to the division.* It turns out, however, that
we were generating the top arrow twice, as if attempting to "set up context"
after we had already returned from the call. This resulted in poor
highlighting in Xcode.
* Arguably the best location for the division is the '/', but that's a
different problem.
<rdar://problem/13326040>
llvm-svn: 179350
|
| |
|
|
|
|
|
|
|
| |
This is a Darwin-SDK-specific hash criteria used to identify a
particular SDK without having to hash the contents of all of its
headers. If other platforms have such versioned files, we should add
those checks here.
llvm-svn: 179346
|
| |
|
|
|
|
|
|
|
|
|
|
| |
For struct-path aware TBAA, we used to use scalar type node as the scalar tag,
which has an incompatible format with the struct path tag. We now use the same
format: base type, access type and offset.
We also uniformize the scalar type node and the struct type node: name, a list
of pairs (offset + pointer to MDNode). For scalar type, we have a single pair.
These are to make implementaiton of aliasing rules easier.
llvm-svn: 179335
|
| |
|
|
|
|
| |
Patch by John Marino.
llvm-svn: 179334
|
| |
|
|
|
|
|
| |
This new option is the default, but it is useful to have a flag to override
-mno-implicit-float by putting -mimplicit-float later on the command line.
llvm-svn: 179309
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Handles all inheritance models for both data and function member
pointers.
Also implements isZeroInitializable() and refactors some of the null
member pointer code.
MSVC supports converting member pointers through virtual bases, which
clang does not (yet?) support. Implementing that extension is covered
by http://llvm.org/15713
Reviewers: rjmccall
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D613
llvm-svn: 179305
|
| |
|
|
| |
llvm-svn: 179299
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Function declarations are now broken with the following preferences:
1) break amongst arguments.
2) break after return type.
3) break after (.
4) break before after nested name specifiers.
Options #2 or #3 are preferred over #1 only if a substantial number of
lines can be saved by that.
llvm-svn: 179287
|
| |
|
|
|
|
| |
Before: SomeType &operator=(const SomeType & S);
After: SomeType &operator=(const SomeType &S);
llvm-svn: 179270
|
| |
|
|
| |
llvm-svn: 179261
|
| |
|
|
|
|
|
|
|
| |
It's a kind of implicit conversion, which we generally drop, but
more importantly it's got very specific placement requirements.
rdar://13617051
llvm-svn: 179254
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For this source:
const int &ref = someStruct.bitfield;
We used to generate this AST:
DeclStmt [...]
`-VarDecl [...] ref 'const int &'
`-MaterializeTemporaryExpr [...] 'const int' lvalue
`-ImplicitCastExpr [...] 'const int' lvalue <NoOp>
`-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
`-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'
Notice the lvalue inside the MaterializeTemporaryExpr, which is very
confusing (and caused an assertion to fire in the analyzer - PR15694).
We now generate this:
DeclStmt [...]
`-VarDecl [...] ref 'const int &'
`-MaterializeTemporaryExpr [...] 'const int' lvalue
`-ImplicitCastExpr [...] 'int' <LValueToRValue>
`-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
`-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'
Which makes a lot more sense. This allows us to remove code in both
CodeGen and AST that hacked around this special case.
The commit also makes Clang accept this (legal) C++11 code:
int &&ref = std::move(someStruct).bitfield
PR15694 / <rdar://problem/13600396>
llvm-svn: 179250
|
| |
|
|
|
|
| |
isTrackedByCurrentChecker
llvm-svn: 179242
|
| |
|
|
| |
llvm-svn: 179235
|
| |
|
|
| |
llvm-svn: 179234
|
| |
|
|
|
|
| |
Now the check is also applied to arguments for Objective-C method calls and to 'this' pointer.
llvm-svn: 179230
|
| |
|
|
|
|
| |
Fixes PR13476
llvm-svn: 179228
|
| |
|
|
|
|
|
|
|
| |
from init, step into init.
The heuristic here (proposed by Jordan) is that, usually, if a leak is due to an early exit from init, the allocation site will be
a call to alloc. Note that in other cases init resets self to [super init], which becomes the allocation site of the object.
llvm-svn: 179221
|
| |
|
|
|
|
| |
other functions.
llvm-svn: 179219
|
| |
|
|
|
|
| |
just assembling a file and have passed the option.
llvm-svn: 179218
|
| |
|
|
| |
llvm-svn: 179217
|
| |
|
|
|
|
|
| |
-fstrict-aliasing.
rdar://13622687
llvm-svn: 179216
|
| |
|
|
|
|
| |
Patch by Amin Shali.
llvm-svn: 179180
|
| |
|
|
|
|
|
| |
Before we would build huge unwrapped lines which take a long time
to optimze.
llvm-svn: 179168
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
class A {
public : // test
};
After:
class A {
public: // test
};
Also remove duplicate methods calculating properties of AnnotatedTokens
and make them members of AnnotatedTokens so that they are in a common
place.
llvm-svn: 179167
|
| |
|
|
|
|
|
|
| |
Yes, this came from actual code.
Fixes <rdar://problem/13557053>.
llvm-svn: 179155
|
| |
|
|
|
|
|
|
|
|
|
| |
constructor. This isn't quite perfect (as usual, we don't handle default
arguments correctly yet, and we don't deal with copy/move constructors for
arguments correctly either, but this will be fixed when we implement core issue
1351.
This completes our support for inheriting constructors.
llvm-svn: 179154
|
| |
|
|
|
|
|
|
|
| |
The original test case here was mangling a type name for TBAA,
but we can provoke this in C++11 easily enough.
rdar://13434937
llvm-svn: 179153
|
| |
|
|
| |
llvm-svn: 179151
|
| |
|
|
|
|
| |
operators during overload resolution.
llvm-svn: 179150
|
| |
|
|
|
|
| |
rdar://13610250
llvm-svn: 179145
|
| |
|
|
|
|
| |
part of rdar://13610250
llvm-svn: 179144
|
| |
|
|
|
|
| |
that indicates return from another file.
llvm-svn: 179143
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The GNU line marker directive was sharing code with the #line directive, but some of the warnings/errors were reporting as #line directive diagnostics in both cases.
Previously:
#line 11foo1 ==> "#line directive requires a simple digit sequence"
# 11foo1 ==> "#line directive requires a simple digit sequence"
Now, we get:
#line 11foo1 ==> "#line directive requires a simple digit sequence"
# 11foo1 ==> "GNU line marker directive requires a simple digit sequence"
llvm-svn: 179139
|
| |
|
|
|
|
|
|
|
|
|
| |
fact be defined and used in another TU.
Reshuffle some test cases because we suppress -Wunused-variable after we've
emitted an error.
This fixes PR15558.
llvm-svn: 179138
|
| |
|
|
|
|
|
|
|
|
|
| |
when result type of protocol property and getter method
differ by fixing a more serious problem. When a forward
protocol declaration comes between its definition and
its use in class protocol list, the forward protocol
ast was being used in building the protocol list.
// rdar://12522752
llvm-svn: 179108
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
switch (...) {
// a
// b
// c
case first:
break;
}
After:
switch (...) {
// a
// b
// c
case first:
break;
}
llvm-svn: 179107
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Some codebases use these kinds of macros in functions, e.g. Chromium's
IPC_BEGIN_MESSAGE_MAP, IPC_BEGIN_MESSAGE_HANDLER, etc.
Reviewers: djasper, klimek
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D645
llvm-svn: 179099
|
| |
|
|
|
|
| |
Credit goes to Timur Iskhodzhanov for finding the problem and solution.
llvm-svn: 179093
|
| |
|
|
|
|
| |
that force default PIC (like Darwin x86-64), otherwise specifying -fPIC will produce bogus unused argument warning
llvm-svn: 179092
|
| |
|
|
|
|
| |
-f(no-)sanitize-address-zero-base-shadow on Android
llvm-svn: 179089
|
| |
|
|
|
|
|
|
| |
when appropriate.
Differential Revision: http://llvm-reviews.chandlerc.com/D502
llvm-svn: 179082
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the analyzer used isIntegerType() everywhere, which uses the C
definition of "integer". The C++ predicate with the same behavior is
isIntegerOrUnscopedEnumerationType().
However, the analyzer is /really/ using this to ask if it's some sort of
"integrally representable" type, i.e. it should include C++11 scoped
enumerations as well. hasIntegerRepresentation() sounds like the right
predicate, but that includes vectors, which the analyzer represents by its
elements.
This commit audits all uses of isIntegerType() and replaces them with the
general isIntegerOrEnumerationType(), except in some specific cases where
it makes sense to exclude scoped enumerations, or any enumerations. These
cases now use isIntegerOrUnscopedEnumerationType() and getAs<BuiltinType>()
plus BuiltinType::isInteger().
isIntegerType() is hereby banned in the analyzer - lib/StaticAnalysis and
include/clang/StaticAnalysis. :-)
Fixes real assertion failures. PR15703 / <rdar://problem/12350701>
llvm-svn: 179081
|
| |
|
|
|
|
|
|
| |
expression, look through pseudo-object expressions.
rdar://13602832
llvm-svn: 179080
|
| |
|
|
|
|
| |
Fixes the bootstrap regression I introduced in r179067.
llvm-svn: 179079
|