| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
llvm-svn: 190075
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Closure classes for C++ lambdas are always compiler-generated. This one-line change calls setImplicit(true) on them at creation time, such that a default RecursiveASTVisitor (or any for which shouldVisitImplicitCode returns false) will skip them.
Reviewers: rsmith, dblaikie
Reviewed By: dblaikie
CC: klimek, revane, cfe-commits, jordan_rose
Differential Revision: http://llvm-reviews.chandlerc.com/D1593
llvm-svn: 190073
|
|
|
|
|
|
|
| |
code to work for bit 32bit and 64bit APIs.
// rdar://14913632
llvm-svn: 190072
|
|
|
|
|
|
|
|
| |
We already use .obj as extension when the user provides a stem file
name (via /Fo), but were failing in the most basic case when the file
name is based on the input file.
llvm-svn: 190071
|
|
|
|
|
|
| |
builds.
llvm-svn: 190061
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
enum X : int { A, B, C };
After:
enum X : int {
A,
B,
C
};
llvm-svn: 190054
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Count column width instead of the number of code points. This also
includes correct handling of tabs inside string literals and comments (with an
exception of multiline string literals/comments, where tabs are present before
the first escaped newline).
Reviewers: djasper, klimek
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1601
llvm-svn: 190052
|
|
|
|
| |
llvm-svn: 190051
|
|
|
|
|
|
|
|
|
| |
As a result, Clang doesn't define the pre-processor macros that are expected
on this platform.
Thanks to Robert Millan for the patch
llvm-svn: 190048
|
|
|
|
|
|
|
|
|
|
| |
Before:
constexpr char hello [] { "hello" };
After:
constexpr char hello[]{ "hello" };
llvm-svn: 190046
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
getRealTypeByWidth and getIntTypeByWidth
for ASTContext names are almost same(invokes new methods from TargetInfo):
getIntTypeForBitwidth and getRealTypeForBitwidth.
As first commit for PR16752 fix: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth virtual methods. By default current behaviour could be implemented here.
2. Fix handleModeAttr according to new methods in TargetInfo.
This approach is implemented in the patch attached to this post.
Fixes:
1st Commit (Current): Add new methods for TargetInfo:
getRealTypeByWidth and getIntTypeByWidth
for ASTContext names are almost same(invokes new methods from TargetInfo):
getIntTypeForBitwidth and getRealTypeForBitwidth
2nd Commit (Next): Fix SemaDeclAttr, handleModeAttr function.
llvm-svn: 190044
|
|
|
|
|
|
| |
Mostly additional comments :-).
llvm-svn: 190042
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
void f() {
other(x.begin(), x.end(), //
[&](int, int) { return 1; });
}
After:
void f() {
other(x.begin(), x.end(), //
[&](int, int) { return 1; });
}
llvm-svn: 190039
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Among other things, this enables (better) formatting lambdas and
constructs like:
MACRO({
long_statement();
long_statement_2();
},
{
long_statement();
long_statement_2();
},
{ short_statement(); }, "");
This fixes llvm.org/PR15381.
llvm-svn: 190038
|
|
|
|
|
|
|
|
| |
is at the end of the line, point to the location after the double colon instead
of at the next token. There is more context to be given this way. In addition,
the next token can be several lines later.
llvm-svn: 190029
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an AST file is built based on another AST file, it can use a decl from
the fist file, and therefore mark the "isUsed" bit. We need to note this in
the AST file so that the bit is set correctly when the second AST file is
loaded.
This patch introduces the distinction between setIsUsed() and markUsed() so
that we don't call into the ASTMutationListener callback when it wouldn't
be appropriate.
Fixes PR16635.
llvm-svn: 190016
|
|
|
|
|
|
| |
representation. Don't emit comparisons on them as 'icmp ult'!
llvm-svn: 190010
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
current GCCs:
* In C, as before, if the "warning flag" is enabled, warnings are produced by
forcing string literals to have const-qualified types (the produced warnings
are *not* -Wwrite-strings warnings). However, more recent GCCs (at least 4.4
onwards) now take -w into account here, so we now do the same.
* In C++, this flag is entirely sane: it behaves just like any other warning
flag. Stop triggering -fconst-strings here. This is a bit cleaner, but there's
no real functionality change except in the case where -Xclang -fno-const-strings
is also specified.
llvm-svn: 190006
|
|
|
|
|
|
| |
to Method/functions returning ObjC objects. wip.
llvm-svn: 190005
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and tested (in r189996)
Debug info emission was tripping over an IRGen bug (fixed in r189996)
that was resulting in duplicate emission of static data members of class
templates in namespaces.
We could add more test coverage to debug info for this issue
specifically, but I think the underlying IRGen test is more targeted and
sufficient for the issue.
llvm-svn: 190001
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
inside namespaces
A quirk of AST representation leads to class template static data member
definitions being visited twice during Clang IRGen resulting in
duplicate (benign) initializers.
Discovered while investigating a possibly-related debug info bug tickled
by the duplicate emission of these members & their associated debug
info.
With thanks to Richard Smith for help investigating, understanding, and
helping with the fix.
llvm-svn: 189996
|
|
|
|
|
|
|
|
| |
* It was redundant with -flto.
* It was confusing since -uAnythingElse is a different option.
* GCC uses -fuse-linker-plugin, so it was not even a compatibility option.
llvm-svn: 189976
|
|
|
|
|
|
| |
annotations. (was r189892).
llvm-svn: 189956
|
|
|
|
|
|
|
|
|
|
| |
Summary: I added the display of the VarDecl contained in the statement.
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1596
llvm-svn: 189941
|
|
|
|
|
|
|
| |
consistency of serialized form with the actual enum member names without
a prefix.
llvm-svn: 189936
|
|
|
|
| |
llvm-svn: 189933
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes sure we produce the right number of unwrapped lines,
a follow-up patch will make the whitespace formatting consistent.
Before:
void f() {
int i = {[operation setCompletionBlock : ^{ [self onOperationDone];
}]
}
;
}
After:
void f() {
int i = {[operation setCompletionBlock : ^{
[self onOperationDone];
}] };
}
llvm-svn: 189932
|
|
|
|
|
|
|
|
|
|
| |
instructions:
sshr,ushr,ssra,usra,srshr,urshr,srsra,ursra,sri,shl,sli,sqshlu,sqshl,uqshl,shrn,sqrshr$
and 4 convert instructions:
scvtf,ucvtf,fcvtzs,fcvtzu
llvm-svn: 189926
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
int c = [ &, &a, a]{
[ =, c, &d]{
return b++;
}();
}();
After:
int c = [&, &a, a] {
[=, c, &d] {
return b++;
}();
}();
llvm-svn: 189924
|
|
|
|
|
|
|
| |
If source code is invalid, error recovery can lead to name lookup in a set containing invalid declaration. The lookup is stopped once found such declaration, but LookupResult object could remain in inconsistent state. Its destructor triggered a check, which caused assert violation.
This patch fixes PR16964 and PR12791.
llvm-svn: 189916
|
|
|
|
|
|
|
|
|
|
|
| |
we have a more principled approach (the 'requires complete type' callback)"
This reverts commit r189013.
This is causing a segfault crash in a test case I have. Reverting while
I investigate the issue.
llvm-svn: 189906
|
|
|
|
|
|
|
|
| |
I tried to implement this properly in r189051, but I didn't have enough
test coverage. Richard kindly provided more test cases than I could
possibly imagine and now we should have the correct condition.
llvm-svn: 189898
|
|
|
|
|
|
|
| |
ObjectiveC methods. Apply specific annotations for them
instead as determined by the static analyzer.
llvm-svn: 189892
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Transform the token sequence for:
typename typedef T U;
to:
typename T typedef U;
Raise a diagnostic when this happens but only if we succeeded handling
the typename.
Reviewers: rsmith, rnk
Reviewed By: rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1433
llvm-svn: 189867
|
|
|
|
|
|
| |
Patch by Nico Rieck!
llvm-svn: 189860
|
|
|
|
|
|
| |
Found by Chris Wailes
llvm-svn: 189859
|
|
|
|
| |
llvm-svn: 189857
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes pr13124.
From the discussion at
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-June/022606.html
we know that we cannot make funcions in a weak_odr vtable also weak_odr. They
should remain linkonce_odr.
The side effect is that we cannot emit a available_externally vtable unless we
also emit a copy of the function. This also has an issue: If codegen is going
to output a function, sema has to mark it used. Given llvm.org/pr9114, it looks
like sema cannot be more aggressive at marking functions used because
of vtables.
This leaves us with a few unpleasant options:
* Marking functions in vtables used if possible. This sounds a bit sloppy, so
we should avoid it.
* Producing available_externally vtables only when all the functions in it are
already used or weak_odr. This would cover cases like
--------------------
struct foo {
virtual ~foo();
};
struct bar : public foo {
virtual void zed();
};
void f() {
foo *x(new bar);
delete x;
}
void g(bar *x) {
x->~bar(); // force the destructor to be used
}
--------------------------
and
----------------------------------
template<typename T>
struct bar {
virtual ~bar();
};
template<typename T>
bar<T>::~bar() {
}
// make the destructor weak_odr instead of linkonce_odr
extern template class bar<int>;
void f() {
bar<int> *x(new bar<int>);
delete x;
}
----------------------------
These look like corner cases, so it is unclear if it is worth it.
* And finally: Just nuke this optimization. That is what this patch implements.
llvm-svn: 189852
|
|
|
|
|
|
| |
StringArgument since that is a more accurate modeling.
llvm-svn: 189851
|
|
|
|
|
|
| |
with a prior declaration. No functionality change intended.
llvm-svn: 189850
|
|
|
|
| |
llvm-svn: 189845
|
|
|
|
|
|
|
|
|
|
| |
Patch by chris.wailes@gmail.com
Functions can now declare what state the consumable type the are returning will
be in. This is then used on the caller side and checked on the callee side.
Constructors now use this attribute instead of the 'consumes' attribute.
llvm-svn: 189843
|
|
|
|
|
|
| |
here.
llvm-svn: 189838
|
|
|
|
| |
llvm-svn: 189833
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This paves the way for adding support for modeling the destructor of a
region before it is deleted. The statement "delete <expr>" now generates
this series of CFG elements:
1. <expr>
2. [B1.1]->~Foo() (Implicit destructor)
3. delete [B1.1]
Patch by Karthik Bhat!
llvm-svn: 189828
|
|
|
|
| |
llvm-svn: 189823
|
|
|
|
|
|
|
|
|
|
| |
Implements parsing of lambdas in the UnwrappedLineParser.
This introduces the correct line breaks; the formatting of
lambda captures are still incorrect, and the braces are also
still formatted as if they were braced init lists instead of
blocks.
llvm-svn: 189818
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
I have no idea why these were there in the first place, but now they are
certainly not necessary.
Reviewers: rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1581
llvm-svn: 189813
|
|
|
|
|
|
|
|
| |
This reverts commit r189795.
threadprivate_messages.cpp is faling on windows.
llvm-svn: 189811
|
|
|
|
|
|
|
| |
Convert the last few tests using -ccc-print-options to -### and remove
-ccc-print-options.
llvm-svn: 189802
|