Daniel Jasper [Wed, 28 May 2014 09:11:53 +0000 (09:11 +0000)]
clang-format: Format array and dict literals similar to blocks.
Especially, reduce the amount of indentation if it doesn't increase
readability.
Before:
NSMutableDictionary* dictionary = [NSMutableDictionary
dictionaryWithDictionary:@{
aaaaaaaaaaaaaaaaaaaaa :
aaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbb : bbbbb,
cccccccccccccccc :
ccccccccccccccc
}];
After:
NSMutableDictionary* dictionary =
[NSMutableDictionary dictionaryWithDictionary:@{
aaaaaaaaaaaaaaaaaaaaa :
aaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbb : bbbbb,
cccccccccccccccc :
ccccccccccccccc
}];
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209720
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Wed, 28 May 2014 07:40:25 +0000 (07:40 +0000)]
[OPENMP] Additional checking for local vars in initial values for threadprivate vars
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209716
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Wed, 28 May 2014 06:15:33 +0000 (06:15 +0000)]
[OPENMP] Reformatting of parsing code for OpenMP constructs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209714
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Wed, 28 May 2014 05:53:51 +0000 (05:53 +0000)]
[OPENMP][C++11] Formatting and make more C++11 compliant of OpenMP sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209713
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Wed, 28 May 2014 02:16:01 +0000 (02:16 +0000)]
Move the logic for testing for namespace std into one location. This check can
be performed by using Decl::isInStdNamespace or DeclContext::isStdNamespace
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209708
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 28 May 2014 01:52:23 +0000 (01:52 +0000)]
Don't dllimport/export destructor variants implemented by thunks.
MSVC doesn't export these functions, so trying to import them doesnt' work.
Also, don't let any dll attributes on the CXXDestructorDecl influence the
thunk's linkage -- they should always be linkonce_odr.
This takes care of the FIXME's for this in Nico's tests.
Differential Revision: http://reviews.llvm.org/D3930
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209706
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Tue, 27 May 2014 21:29:22 +0000 (21:29 +0000)]
Retain isImplicit flag for local variable declarations when instantiating
templates.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D3924
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209686
91177308-0d34-0410-b5e6-
96231b3b80d8
Ben Langmuir [Tue, 27 May 2014 19:57:48 +0000 (19:57 +0000)]
Add a test that we don't store stale modtime in modules
The change from r209195 turned out to be important to avoid saving stale
modification time/expected size information in a module file when there
are 3 or more modules in a dependency chain and the bottom one is
rebuilt. So add a test for that.
rdar://problem/
17038180
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209682
91177308-0d34-0410-b5e6-
96231b3b80d8
James Dennett [Tue, 27 May 2014 19:13:04 +0000 (19:13 +0000)]
Add range accessors for captures of a LambdaExpr.
Summary:
This adds LambdaExpr::captures(), LambdaExpr::explicit_captures()
and LambdaExpr::implicit_captures() as simple wrappers over the underlying
*_begin()/*_end() functions.
Reviewers: aaron.ballman
Differential Revision: http://reviews.llvm.org/D3926
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209679
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 27 May 2014 18:26:09 +0000 (18:26 +0000)]
Objective-C. Fixes an obscuer crash caused by multiple inclusion of
same framework after complaining about duplicate class definition.
// rdar://
17024681
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209672
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Tue, 27 May 2014 17:01:21 +0000 (17:01 +0000)]
Fix pr19841, bb are also unnamed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209668
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Tue, 27 May 2014 16:51:36 +0000 (16:51 +0000)]
Fix pr19841.cpp on release mode
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209666
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Tue, 27 May 2014 16:46:27 +0000 (16:46 +0000)]
Revert small change to EmitDeclRefLValue
That small change, although it looked harmless, it made emitting the LValue
on the PHI node without the proper cast. Reverting it fixes PR19841.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209663
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 27 May 2014 15:13:51 +0000 (15:13 +0000)]
ASTMatchers.h: Appease msc17.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209661
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Musman [Tue, 27 May 2014 15:12:19 +0000 (15:12 +0000)]
Parsing/Sema for OMPCollapseClause.
Actual usage in Sema for collapsing loops will in some future patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209660
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Tue, 27 May 2014 12:31:10 +0000 (12:31 +0000)]
Make equalsNode work with pointers to subtypes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209652
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Tue, 27 May 2014 10:04:12 +0000 (10:04 +0000)]
Adds child traversal matchers for IfStmt's then and else branches.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209649
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Tue, 27 May 2014 07:45:18 +0000 (07:45 +0000)]
Allow hasBody on CXXForRangeStmt nodes and update the docs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209647
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 27 May 2014 02:45:47 +0000 (02:45 +0000)]
[C++11] Use 'nullptr'. StaticAnalyzer edition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209642
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Mon, 26 May 2014 17:03:54 +0000 (17:03 +0000)]
Rejecting the mutable specifier on a freestanding type declaration, instead of supporting it as a "extension" (which serves no purpose). Un-XFAILing the test for mutable specifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209635
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Mon, 26 May 2014 13:10:39 +0000 (13:10 +0000)]
clang-format: Split up moveStateToNextToken.
No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209626
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Mon, 26 May 2014 07:24:34 +0000 (07:24 +0000)]
clang-format: Keep '{' of dict literals on the same line in Allman style
Before:
void f()
{
[object
someMethod:@
{ @"a" : @"b" }];
}
After:
void f()
{
[object someMethod:@{ @"a" : @"b" }];
}
This fixes llvm.org/PR19854.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209615
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 26 May 2014 06:22:03 +0000 (06:22 +0000)]
[C++11] Use 'nullptr'. Sema edition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209613
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 26 May 2014 06:21:51 +0000 (06:21 +0000)]
[C++11] Use 'nullptr'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209612
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Sun, 25 May 2014 10:35:03 +0000 (10:35 +0000)]
Sema: Add dll attribute tests for member functions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209598
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Sun, 25 May 2014 10:34:36 +0000 (10:34 +0000)]
Sema: Add dll attribute tests for variable templates
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209597
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Sun, 25 May 2014 10:34:16 +0000 (10:34 +0000)]
IRGen: Add more tests for dll attributes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209596
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Sat, 24 May 2014 20:18:32 +0000 (20:18 +0000)]
Fix some misplaced spaces around 'override'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209588
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Sat, 24 May 2014 12:52:07 +0000 (12:52 +0000)]
AArch64/ARM64: rename ARM64 components to AArch64
This keeps Clang consistent with backend naming conventions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209579
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Sat, 24 May 2014 12:51:25 +0000 (12:51 +0000)]
AArch64/ARM64: update Clang after AArch64 removal.
A few (mostly CodeGen) parts of Clang were tightly coupled to the
AArch64 backend. Now that it's gone, they will not even compile.
I've also deduplicated RUN lines in many of the AArch64 tests. This
might improve "make check-all" time noticably: some of those NEON
tests were monsters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209578
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Sat, 24 May 2014 07:19:25 +0000 (07:19 +0000)]
CXXInfo memory should be released after calling the destructor
instead of before. The wrong order had no effect since Deallocate()
does nothing right now, but we may replace allocator in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209567
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 23 May 2014 23:29:44 +0000 (23:29 +0000)]
This test doesn't need -O2 -disable-llvm-optzns
I forgot to fix this one in r209145. We use these flags on dllimport tests
to make sure we emit code for available_externaly functions and don't inline
the IR.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209564
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 23 May 2014 22:12:01 +0000 (22:12 +0000)]
Recommit r209532 with -ffreestanding.
This is a test case for r209489.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209559
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 23 May 2014 21:35:50 +0000 (21:35 +0000)]
Remove test while I investigate why the test is breaking the bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209558
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 23 May 2014 21:31:59 +0000 (21:31 +0000)]
Recompute the injected class name type for a class template specialization
rather than saving and restoring it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209557
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 23 May 2014 21:24:24 +0000 (21:24 +0000)]
XFAIL test which is breaking some of the build bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209556
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 23 May 2014 21:13:45 +0000 (21:13 +0000)]
Use comdats to avoid double initialization of weak data
Initializers of global data that can appear multiple TUs (static data
members of class templates or __declspec(selectany) data) are now in a
comdat group keyed on the global variable being initialized. On
non-Windows platforms, this is a code size and startup time
optimization. On Windows, this is necessary for ABI compatibility with
MSVC.
Fixes PR16959.
Reviewers: rsmith
Differential Revision: http://reviews.llvm.org/D3811
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209555
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 23 May 2014 21:00:28 +0000 (21:00 +0000)]
[modules] If a referenced-but-not-instantiated class template specialization
gets explicitly specialized, don't reuse the previous class template
specialization declaration as a new declaration. The benefit here is fairly
marginal, it harms source fidelity, and this is horrible to model if the
specialization was imported from another module (without this change, it
asserts or worse).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209552
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 23 May 2014 20:37:38 +0000 (20:37 +0000)]
Emit used/dllexport inline method definitions in nested classes (PR19743, PR11170)
The previous code that was supposed to handle this didn't work
since parsing of inline method definitions is delayed to the end
of the outer class definition. Thus, when HandleTagDeclDefinition()
got called for the inner class, the inline functions in that class
had not been parsed yet.
Richard suggested that the way to do this is by handling inline
method definitions through a new ASTConsumer callback.
I really wanted to call ASTContext::DeclMustBeEmitted() instead of
checking for attributes, but doing that causes us to compute linkage,
and then we fail with "error: unsupported: typedef changes linkage
of anonymous type, but linkage was already computed" on tests like
this: (from SemaCXX/undefined-internal.cpp) :-/
namespace test7 {
typedef struct {
void bar();
void foo() { bar(); }
} A;
}
Differential Revision: http://reviews.llvm.org/D3809
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209549
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 23 May 2014 20:16:41 +0000 (20:16 +0000)]
Don't suppress warning about dllimport on typedefs etc. in MicrosoftExt mode
It's true the MSVC doesn't warn about dllimport when applied to e.g. a typedef,
but that applies to dllexport too. I'd like us to be consistent, and I think
the right thing to do is to warn.
The original test that came with implementing the old behaviour doesn't provide
a good motivation, and it said it was checking that we're not repoting an *error*,
which is still true since this is just a warning.
There are plenty of tests e.g. in Sema/dllimport.c to check that we do warn
about dllimport on non functions or variables.
Differential Revision: http://reviews.llvm.org/D3832
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209546
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Fri, 23 May 2014 19:07:49 +0000 (19:07 +0000)]
Sema: Add more tests for dll attributes on inline functions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209542
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Fri, 23 May 2014 19:07:25 +0000 (19:07 +0000)]
Fix broken FileCheck prefix
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209541
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Fri, 23 May 2014 19:07:09 +0000 (19:07 +0000)]
Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209540
91177308-0d34-0410-b5e6-
96231b3b80d8
Ben Langmuir [Fri, 23 May 2014 18:15:47 +0000 (18:15 +0000)]
Stopgap fix for finding module for a file mapped in the VFS
If we lookup a path using its 'real' path first, we need to ensure that
when we run header search we still use the VFS-mapped path or we will
not be able to find the corresponding module for the header.
The real problem is that we tie the name of a file to its underlying
FileEntry, which is uniqued by inode, so we only ever get the first name
it is looked up by. This doesn't work with modules, which rely on a
specific file system structure. I'm hoping to have time to write up a
proposal for fixing this more permanently soon, but as a stopgap this
patch updates the name of the file's directory if it comes from a VFS
mapping.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209534
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Fri, 23 May 2014 17:49:03 +0000 (17:49 +0000)]
Add the hasRangeInit() matcher for range-based for loop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209533
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 23 May 2014 17:35:08 +0000 (17:35 +0000)]
Test case for r209489.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209532
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Fri, 23 May 2014 17:09:56 +0000 (17:09 +0000)]
Make dead return statement detection more robust against changes in the CFG.
This change is a precondition to the proposed change to handle temporary
dtors correctly.
The idea is to explicitly search for the next return that doesn't have other
paths into it (that is, if the current block is dead, the block containing the
return must be dead, too). Thus, introducing non-control-flow block
transitions will not break the logic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209531
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Fri, 23 May 2014 16:58:18 +0000 (16:58 +0000)]
Make the ParentVector default to size 2.
As Jordan noted, it makes more sense when we store it in the ParentMap,
and doesn't really make a difference when we return it from getParents.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209530
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Fri, 23 May 2014 16:47:42 +0000 (16:47 +0000)]
revert "r209526 List the function/method name in the index page of scan-build "
Depends on http://reviews.llvm.org/D3762
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209527
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Fri, 23 May 2014 16:40:46 +0000 (16:40 +0000)]
List the function/method name in the index page of scan-build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209526
91177308-0d34-0410-b5e6-
96231b3b80d8
Warren Hunt [Fri, 23 May 2014 16:26:32 +0000 (16:26 +0000)]
[MS-ABI] Silence warning from r209523
no functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209525
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Fri, 23 May 2014 16:10:00 +0000 (16:10 +0000)]
Replace system() by native perl calls
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209524
91177308-0d34-0410-b5e6-
96231b3b80d8
Warren Hunt [Fri, 23 May 2014 16:07:43 +0000 (16:07 +0000)]
[MS-ABI] Implements MS-compatible RTTI
Enables the emission of MS-compatible RTTI data structures for use with
typeid, dynamic_cast and exceptions. Does not implement dynamic_cast
or exceptions. As an artiface, typeid works in some cases but proper
support an testing will coming in a subsequent patch.
majnemer has fuzzed the results. Test cases included.
Differential Revision: http://reviews.llvm.org/D3833
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209523
91177308-0d34-0410-b5e6-
96231b3b80d8
Dario Domizioli [Fri, 23 May 2014 13:53:12 +0000 (13:53 +0000)]
[test] Force a triple in the pragma optimize test due to expected mangled names.
No functional change to the compiler.
This should just make the test pass on all buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209515
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikola Smiljanic [Fri, 23 May 2014 12:48:27 +0000 (12:48 +0000)]
PR19352 - getLocation() points to the wrong position for FriendDecls
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209511
91177308-0d34-0410-b5e6-
96231b3b80d8
Dario Domizioli [Fri, 23 May 2014 12:13:25 +0000 (12:13 +0000)]
Implemented support for "pragma clang optimize on/off", based on attribute 'optnone'.
This patch implements support for selectively disabling optimizations on a
range of function definitions through a pragma. The implementation is that
all function definitions in the range are decorated with attribute
'optnone'.
#pragma clang optimize off
// All function definitions in here are decorated with 'optnone'.
#pragma clang optimize on
// Compilation resumes as normal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209510
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Lytton [Fri, 23 May 2014 07:34:08 +0000 (07:34 +0000)]
Fix '-main-file-name <name>' so that it is used for the ModuleID.
Summary:
Previously, you could not specify the original file name when passing a preprocessed file into the compiler
Now you can use 'clang -Xclang -main-file-name -Xclang <original file name> ...'
Or 'clang -cc1 -main-file-name <original file name> ...'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209503
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Fri, 23 May 2014 01:37:30 +0000 (01:37 +0000)]
Clean DiagRanges. Fix a possible problem introduced in r209468.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209491
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 23 May 2014 00:38:07 +0000 (00:38 +0000)]
Fix a bug in xmmintrin.h.
The last step of _mm_cvtps_pi16 should use _mm_packs_pi32, which is a function
that reads two __m64 values and packs four 32-bit values into four 16-bit
values.
<rdar://problem/
16873717>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209489
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 22 May 2014 23:33:27 +0000 (23:33 +0000)]
Don't set unnamed_addr in CreateRuntimeVariable.
This was fairly broken. For example,
@__dso_handle would or would not get an unnamed_addr depending on how many
global destructors were used in a translation unit.
The consensus was that not every runtime variable is unnamed_addr and that
__dso_handle handle should not be, so just don't add unnamed_addr in
CreateRuntimeVariable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209484
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 22 May 2014 23:19:02 +0000 (23:19 +0000)]
Avoid allocating extra memory to handle the lazy definition data pointer for
CXXRecordDecls when modules is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209482
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 22 May 2014 22:57:39 +0000 (22:57 +0000)]
Don't reduce the stack protector level given -fstack-protector.
Before -fstack-protector would always force a level of 1, even if the default
was 2.
Patch by Brad Smith.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209479
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Thu, 22 May 2014 22:06:08 +0000 (22:06 +0000)]
Use error_code::success() instead of make_error_code(llvm::errc::success).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209477
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 22 May 2014 21:13:30 +0000 (21:13 +0000)]
Unify the name of compiler-rt builtins library on Linux.
Call it "libclang_rt.builtins-<arch>.a" to be consistent
with sanitizers/profile libraries naming. Modify Makefile
and CMake build systems and Clang driver accordingly.
Fixes PR19822.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209474
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 22 May 2014 20:59:29 +0000 (20:59 +0000)]
If a class template specialization from one module has its definition
instantiated in another module, and the instantiation uses a partial
specialization, include the partial specialization and its template arguments
in the update record. We'll need them if someone imports the second module and
tries to instantiate a member of the template.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209472
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 22 May 2014 20:45:53 +0000 (20:45 +0000)]
Don't warn about undefined inline functions if they're dllexport/import
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209471
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Thu, 22 May 2014 19:56:11 +0000 (19:56 +0000)]
Remove limits on the number of fix-it hints and ranges in the DiagnosticsEngine.
Summary:
The limits on the number of fix-it hints and ranges attached to a
diagnostic are arbitrary and don't apply universally to all users of the
DiagnosticsEngine. The way the limits are enforced may lead to diagnostics
generating invalid sets of fixes. I suggest removing the limits, which will also
simplify the implementation.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D3879
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209468
91177308-0d34-0410-b5e6-
96231b3b80d8
Abramo Bagnara [Thu, 22 May 2014 19:20:46 +0000 (19:20 +0000)]
Improved location for non-constant initializers diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209466
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 22 May 2014 18:57:49 +0000 (18:57 +0000)]
Forgot to add updated datalayout test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209465
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 22 May 2014 18:33:55 +0000 (18:33 +0000)]
Update R600 datalayout
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209464
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 22 May 2014 15:46:15 +0000 (15:46 +0000)]
An inline function redeclaration does not drop the dllimport attribute
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209449
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 22 May 2014 15:13:48 +0000 (15:13 +0000)]
clang-format: Add basic test for -style=none.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209447
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 22 May 2014 15:12:22 +0000 (15:12 +0000)]
clang-format: Introduce DisableFormat that prevents formatting.
And "none" pseudo-style indicating that formatting should be not
applied.
(1) Using .clang-format with "DisableFormat: true" effectively prevents
formatting for all files within the folder containing such .clang-format
file.
(2) Using -fallback-style=none together with -style=file prevents
formatting when .clang-format is not found, which can be used in on-save
callback.
Patch by Adam Strzelecki. Thank you!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209446
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 22 May 2014 13:53:55 +0000 (13:53 +0000)]
clang-format: Don't use Allman brace breaking for ObjC blocks.
It just seems wrong. This fixes llvm.org/PR19736.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209440
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 22 May 2014 13:25:26 +0000 (13:25 +0000)]
clang-format: Fix corner case in AllowShortBlocksOnASingleLine.
Before:
template <int> struct A4 { A4() { }
};
After:
template <int i> struct A4 {
A4() {}
};
This fixes llvm.org/PR19813 (at least the part that isn't working as
intended).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209438
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 22 May 2014 13:12:14 +0000 (13:12 +0000)]
MachO: look for nearby tools on all MachO platforms.
This brings "-arch armv7m" (etc) behaviour more in line with what's expected
for developers on OS X, and allows Clang to find an "ld" (for example) in the
same directory instead of using the default /usr/bin/ld.
Unfortunately no test because it relies on the specific place Clang is running
from.
rdar://problem/
16427320
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209437
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 22 May 2014 12:55:29 +0000 (12:55 +0000)]
Revert "TMP"
This reverts r209433. Sorry about that, it needs a test & better message.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209435
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 22 May 2014 12:54:30 +0000 (12:54 +0000)]
MachO: perform ARM ABI detection even for non-Darwin triples.
When "-arch armv7m" is specified, we want "aapcs", for example.
rdar://problem/
16581138
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209434
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 22 May 2014 12:54:24 +0000 (12:54 +0000)]
TMP
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209433
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 22 May 2014 12:52:35 +0000 (12:52 +0000)]
Use stack protector strong by default on OpenBSD.
Use stack protector strong by default to match the base OS and ports/packages
compiler policy.
Patch by Brad Smith.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209432
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 22 May 2014 12:46:38 +0000 (12:46 +0000)]
clang-format: Fix braced list detection.
Before:
static_assert(std::is_integral<int> {} + 0, "");
int a = std::is_integral<int> {}
+ 0;
After:
static_assert(std::is_integral<int>{} + 0, "");
int a = std::is_integral<int>{} + 0;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209431
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 22 May 2014 12:11:13 +0000 (12:11 +0000)]
clang-format: Fix incorrect braced init identification.
Before:
int foo(int i) {
return fo1 {}
(i);
}
int foo(int i) {
return fo1 {}
(i);
}
After:
int foo(int i) { return fo1{}(i); }
int foo(int i) { return fo1{}(i); }
This fixes llvm.org/PR19812.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209428
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 22 May 2014 11:47:01 +0000 (11:47 +0000)]
clang-format: Store pointers to seen formatting states.
As the memory ownership is handled by the SpecificBumpPtrAllocator
anyway, there is no need to duplicate states when inserting them into
the Seen-set. This leads to an improvement of ~10% on the benchmark
formatting file.
No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209422
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 22 May 2014 11:37:05 +0000 (11:37 +0000)]
clang-format: Fix vim-integration for empty files.
Discovered by Ahmed Charles in http://reviews.llvm.org/D3018.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209417
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 22 May 2014 09:10:04 +0000 (09:10 +0000)]
clang-format: [JS] Understand line breaks in concatenated strings.
Before:
var literal = 'hello ' + 'world';
After:
var literal = 'hello ' +
'world';
There is no reason to concatenated two string literals with a '+' unless
the line break is intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209413
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 22 May 2014 09:00:33 +0000 (09:00 +0000)]
clang-format: Correctly identify multiplications in braces init lists.
Before:
int i{a *b};
After:
int i{a * b};
Also fix unrelated issue where braced init lists were counted as blocks
and prevented single-line functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209412
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Musman [Thu, 22 May 2014 08:54:05 +0000 (08:54 +0000)]
This patch adds a helper class (CGLoopInfo) for marking memory instructions with llvm.mem.parallel_loop_access metadata.
It also adds a simple initial version of codegen for pragma omp simd (it will change in the future to support all the clauses).
Differential revision: http://reviews.llvm.org/D3644
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209411
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 22 May 2014 08:36:53 +0000 (08:36 +0000)]
clang-format: Correctly calculate line lenghts for nest blocks.
If simple (one-statement) blocks can be inlined, the length needs to be
calculated correctly.
Before (in JavaScript but this also affects lambdas, etc.):
var x = {
valueOf: function() { return 1; }
};
After:
var x = {valueOf: function() { return 1; }};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209410
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 22 May 2014 06:04:59 +0000 (06:04 +0000)]
Frontend: Propagate ASTReaderListener API in ChainedASTReaderListener
ASTReaderListener's documentation states that visitInputFile will be
called based on the return values of needsInputFileVisitation and
needsSystemInputFileVisitation, but ChainedASTReaderListener may call
these methods on a child listener based on the values returned by the
other child.
Even worse, the calls to visitInputFile may be short-circuited due to
the use of the boolean or, so the calls to visit may not occur at all
for the second listener.
This updates ChainedASTReaderListener::visitInputFile to propagate the
ASTReaderListener behaviour to both children.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209394
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 22 May 2014 05:54:18 +0000 (05:54 +0000)]
[C++11] Use 'nullptr'. Serialization edition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209392
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 22 May 2014 04:46:25 +0000 (04:46 +0000)]
[C++11] Use 'nullptr'. Frontend edition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209389
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Thu, 22 May 2014 01:39:16 +0000 (01:39 +0000)]
Add hasSameType overload to ASTContext for Type pointers. Switch a type
comparison check to use this instead of calling Type::getCanonicalTypeInternal
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209378
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 21 May 2014 22:46:51 +0000 (22:46 +0000)]
VirtualFileSystem: Fix a few directory traversal bugs in VFSWriter
There are a couple of issues with writing VFS maps that are awkward to
fix within the current mutually recursive approach. Instead, replace
the algorithm with an iterative version that uses an explicit stack of
directories.
Includes tests for cases the old approach was tripping on.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209332
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Wed, 21 May 2014 21:23:39 +0000 (21:23 +0000)]
Provide an aka for the C++ operator name macro diagnostic
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209322
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 21 May 2014 20:19:59 +0000 (20:19 +0000)]
Sema: Implement DR244
Summary:
Naming the destructor using a typedef-name for the class-name is
well-formed.
This fixes PR19620.
Reviewers: rsmith, doug.gregor
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D3583
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209319
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Wed, 21 May 2014 19:17:38 +0000 (19:17 +0000)]
cindex/test_cursor.py: no need to skip implicit decls in tests
clang was fixed some time ago to always skip "builtins and other cruft" so
tools no longer need hacks like this.
Passes nosetests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209316
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 21 May 2014 15:57:22 +0000 (15:57 +0000)]
Remove outdated diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209304
91177308-0d34-0410-b5e6-
96231b3b80d8
Serge Pavlov [Wed, 21 May 2014 14:48:43 +0000 (14:48 +0000)]
Improved recovery of switch statement
Make better diagnostic produced by erroneous switch statement.
It fixes PR19022.
Differential Revision: http://reviews.llvm.org/D3137
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209302
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 21 May 2014 14:19:22 +0000 (14:19 +0000)]
Move virtual methods out of line.
This is generally a good thing and in this case should also fix the
BUILD_SHARED_LIBS=ON build (see pr19774).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209300
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Wed, 21 May 2014 13:28:59 +0000 (13:28 +0000)]
Make the parent-map use significantly less memory.
On test files I ran this on, memory consumption overall went down from
2.5G to 2G, without performance regressions.
I also investigated making DynTypedNode by itself smaller (by pulling
out pointers for everything that doesn't fit in 8 bytes). This led to
another 200-300MB saved, but also introduced a significant regression in
performance due to the memory management overhead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209297
91177308-0d34-0410-b5e6-
96231b3b80d8