| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
It is okay to declare a block without an argument list: ^ {} or ^void {}.
In these cases, the BlockDecl's signature-as-written will just contain
the return type, rather than the entire function type. It is unclear if
this is intentional, but the analyzer shouldn't crash because of it.
<rdar://problem/14018351>
llvm-svn: 182948
|
| |
|
|
|
|
|
|
| |
autorelease code to be emitted between store and return instructions. This is analoguous to what we do for lexical scope cleanups.
rdar://problem/13977888
llvm-svn: 182947
|
| |
|
|
| |
llvm-svn: 182946
|
| |
|
|
| |
llvm-svn: 182940
|
| |
|
|
|
|
|
| |
references. What's more, they use this language extension in their
ATL header files (which come as part of MFC and the Win32 SDK). This patch implements support for the Microsoft extension, and addresses PR13737.
llvm-svn: 182936
|
| |
|
|
|
|
|
|
|
|
| |
This fixes:
/*
*
* something long going over the column limit.
*/
llvm-svn: 182932
|
| |
|
|
| |
llvm-svn: 182916
|
| |
|
|
|
|
|
|
|
| |
Smallest reproduction:
/*
**
*/
llvm-svn: 182913
|
| |
|
|
|
|
| |
called for which there is no valid declaration. This fallback only happens in Microsoft compatibility mode. This patch addresses PR13164, and improves support for the WDK.
llvm-svn: 182905
|
| |
|
|
|
|
|
|
|
|
|
| |
Most loop notes (like "entering loop body") are attached to the condition
expression guarding a loop or its equivalent. For loops may not have a
condition expression, though. Rather than crashing, just use the entire
ForStmt as the location. This is probably the best we can do.
<rdar://problem/14016063>
llvm-svn: 182904
|
| |
|
|
|
|
|
|
| |
When trying to fall back to search from the end onwards, we
would still find leading whitespace if the leading whitespace
went on after the end of the line.
llvm-svn: 182886
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
-Wint-to-void-pointer-cast.
This change is motivated from user feedback that some APIs use
void* as an opaque "context" object that may not really be a pointer.
Such users want an ability to turn off the warning for casts
to void* while preserving the warning for other cases.
Implements <rdar://problem/14016721>.
llvm-svn: 182884
|
| |
|
|
|
|
| |
users can disable those. Just like in autoconf generated makefiles.
llvm-svn: 182881
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In C, 'void' is treated like any other incomplete type, and though it is
never completed, you can cast the address of a void-typed variable to do
something useful. (In C++ it's illegal to declare a variable with void type.)
Previously we asserted on this code; now we just treat it like any other
incomplete type.
And speaking of incomplete types, we don't know their extent. Actually
check that in TypedValueRegion::getExtent, though that's not being used
by any checkers that are on by default.
llvm-svn: 182880
|
| |
|
|
| |
llvm-svn: 182874
|
| |
|
|
|
|
| |
CXCursor_ModuleImportDecl cursor instead of CXCursor_NotImplemented.
llvm-svn: 182871
|
| |
|
|
|
|
|
|
|
|
|
|
| |
While we can't yet emit vbtables, this allows us to find virtual bases
of objects constructed in other TUs.
This make iostream hello world work, since basic_ostream virtually
inherits from basic_ios.
Differential Revision: http://llvm-reviews.chandlerc.com/D795
llvm-svn: 182870
|
| |
|
|
|
|
|
|
|
|
|
| |
MSVC's class data is always comdat, so clang's should always be
linkonce_odr in LLVM IR.
Reviewers: pcc
Differential Revision: http://llvm-reviews.chandlerc.com/D838
llvm-svn: 182865
|
| |
|
|
|
|
|
|
|
| |
Now that the TokenAnnotator does not require stack space anymore,
reconstructing the lines has become the limiting factor. This patch
fixes that problem, allowing large files with multiple megabytes of
single unwrapped lines to be formatted.
llvm-svn: 182861
|
| |
|
|
|
|
|
|
|
|
| |
Gets rid of AnnotatedToken, putting everything into FormatToken.
FormatTokens are created once, and only referenced by pointer. This
enables multiple future features, like having tokens shared between
multiple UnwrappedLines (while there's still work to do to fully enable
that).
llvm-svn: 182859
|
| |
|
|
| |
llvm-svn: 182856
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If an identifier is on its own line and it is all upper case, it is highly
likely that this is a macro that is meant to stand on a line by itself.
Before:
class A : public QObject {
Q_OBJECT A() {}
};
Ater:
class A : public QObject {
Q_OBJECT
A() {}
};
llvm-svn: 182855
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
With option enabled (e.g. in Google-style):
template <typename T>
void f() {}
With option disabled:
template <typename T> void f() {}
Enabling this for Google-style and Chromium-style, not sure which other
styles would prefer that.
llvm-svn: 182849
|
| |
|
|
|
|
|
| |
This brings the number of linkage computations in "clang -cc1" in SemaExpr.ii
from 58426 to 43134. With -emit-llvm the number goes from 161045 to 145461.
llvm-svn: 182823
|
| |
|
|
| |
llvm-svn: 182821
|
| |
|
|
|
|
|
| |
C++ and C differ with respect to the handling of extern void
declarations. Enforce the C++ behavior in C++ mode.
llvm-svn: 182814
|
| |
|
|
|
|
|
|
|
| |
ArrayToPointer decay evaluation
This gives slightly better precision, specifically, in cases where a non-typed region represents the array
or when the type is a non-array type, which can happen when an array is a result of a reinterpret_cast.
llvm-svn: 182810
|
| |
|
|
|
|
|
|
|
| |
It’s important for us to reason about the cast as it is used in std::addressof. The reason we did not
handle the cast previously was a crash on a test case (see commit r157478). The crash was in
processing array to pointer decay when the region type was not an array. Address the issue, by
just returning an unknown in that case.
llvm-svn: 182808
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this patch the linkage cache was only used by the entry level function
(getLinkage). The function that does the actual computation (getLVForDecl),
never looked at it.
This means that we would not reuse an entry in the cache when getLVForDecl did
a recursive call. This patch fixes that by adding another computation enum
value for when we don't care about the linkage at all and having getLVForDecl
check the cache in that case.
When running "clang -cc1" over SemaExpr.ii this brings the number of linkage
computations from 93749 to 58426. When running "clang -cc1 -emit-llvm -O3" it
goes from 198708 to 161444.
For SemaExpr.ii at least linkage computation is a small enough percentage of
the work that the time difference was in the noise.
When asserts are enabled this patch also causes clang to check the linkage
cache even on recursive calls.
llvm-svn: 182799
|
| |
|
|
|
|
| |
Differential Revision: http://llvm-reviews.chandlerc.com/D745
llvm-svn: 182798
|
| |
|
|
| |
llvm-svn: 182796
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This made it necessary to remove an error detection which would let us
bail out of braced lists in certain situations of missing "}". However,
as we always entirely escape from the braced list on finding ";", this
should not be a big problem.
With this, we can no format braced lists with uniformat inits:
return { arg1, SomeType { parameter } };
llvm-svn: 182788
|
| |
|
|
|
|
|
| |
does not support large load/store of atomic objects.
// rdar://13973577
llvm-svn: 182781
|
| |
|
|
|
|
|
|
|
| |
operators on MemRegions
In addition to enabling more code reuse, this suppresses some false positives by allowing us to
compare an element region to its base. See the ptr-arith.cpp test cases for an example.
llvm-svn: 182780
|
| |
|
|
|
|
|
|
|
| |
Before: f( (*PointerToArray)[10]);
After: f((*PointerToArray)[10]);
This fixes llvm.org/PR16163
llvm-svn: 182777
|
| |
|
|
| |
llvm-svn: 182773
|
| |
|
|
|
|
| |
The FormatToken is now not copyable any more.
llvm-svn: 182772
|
| |
|
|
|
|
|
|
|
|
|
| |
With this patch, we create all tokens in one go before parsing and pass
an ArrayRef<FormatToken*> to the UnwrappedLineParser. The
UnwrappedLineParser is switched to use pointer-to-token internally.
The UnwrappedLineParser still copies the tokens into the UnwrappedLines.
This will be fixed in an upcoming patch.
llvm-svn: 182768
|
| |
|
|
| |
llvm-svn: 182767
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To fully support this, we also need to expand tabs in the text before
the block comment. This patch breaks indentation when there was a
non-standard mixture of spaces and tabs used for indentation, but
fixes a regression in the simple case:
{
/*
* Comment.
*/
int i;
}
Is now formatted correctly, if there were tabs used for indentation
before.
llvm-svn: 182760
|
| |
|
|
|
|
|
|
|
|
|
| |
Block comment indentation of empty lines regressed, as we did not
have a test for it.
/* Comment with...
*
* empty line. */
is now formatted correctly again.
llvm-svn: 182757
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Before:
int (*func)(void*);
void f() { int(*func)(void*); }
After (consistent space after "int"):
int (*func)(void*);
void f() { int (*func)(void*); }
llvm-svn: 182756
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This gets turned into two ">" operators at the beginning in order to
simplify template parameter handling. Thus, we need a special case to
handle those two binary operators correctly.
With this patch, clang-format can now correctly handle cases like:
aaaaaa = aaaaaaa(aaaaaaa, // break
aaaaaa) >>
bbbbbb;
llvm-svn: 182754
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The coercion type serves two purposes:
1. Pad structs to a multiple of 64 bits, so they are passed
'left-aligned' in registers.
2. Expose aligned floating point elements as first-level elements, so
the code generator knows to pass them in floating point registers.
We also compute the InReg flag which indicates that the struct contains
aligned 32-bit floats. This flag is used by the code generator to pick
the right registers.
llvm-svn: 182753
|
| |
|
|
|
|
| |
Fixes PR16114.
llvm-svn: 182750
|
| |
|
|
|
|
| |
No intended functionality change.
llvm-svn: 182749
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- All integer arguments smaller than 64 bits are extended.
- Large structs are passed indirectly, not using 'byval'.
- Structs up to 32 bytes in size are returned in registers.
Some things are not implemented yet:
- EmitVAArg can be implemented in terms of the va_arg instruction.
- When structs are passed in registers, float members require special
handling because they are passed in the floating point registers.
- Structs are left-aligned when passed in registers. This may require
padding.
llvm-svn: 182745
|
| |
|
|
|
|
|
|
|
| |
This option is used to select a dynamic loader prefix to be used
at runtime. Currently this is implemented for the Linux toolchain.
Differential Revision: http://llvm-reviews.chandlerc.com/D851
llvm-svn: 182744
|
| |
|
|
| |
llvm-svn: 182742
|
| |
|
|
|
|
|
|
|
| |
Before: A < int&& > a;
After: A<int &&> a;
Also remove obsolete FIXMEs.
llvm-svn: 182741
|