]> granicus.if.org Git - clang/log
clang
10 years agoMS ABI: Don't always instantiate all members of dllexported class templates (PR20163)
Hans Wennborg [Thu, 21 Aug 2014 01:14:01 +0000 (01:14 +0000)]
MS ABI: Don't always instantiate all members of dllexported class templates (PR20163)

Normally we mark all members of exported classes referenced to get them emitted.

However, MSVC doesn't do this for class templates that are implicitly specialized or
just have an explicit instantiation declaration. For such specializations, the members
are emitted when referenced.

The exception is the case when the dllexport attribute is propagated from a base class
to a base class template that doesn't have an explicit attribute: in this case all
methods of the base class template do get instantiated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216145 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agotest/CodeGenCXX/dllexport.cpp: don't instantiate templates in USEMEMFUNC macro
Hans Wennborg [Thu, 21 Aug 2014 00:10:34 +0000 (00:10 +0000)]
test/CodeGenCXX/dllexport.cpp: don't instantiate templates in USEMEMFUNC macro

Use the derived class in the macro instead, to make it unambigous where
the template is being instantiated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216142 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[test] Turn off warnings for test/Analysis/identical-expressions.cpp.
Jordan Rose [Wed, 20 Aug 2014 22:40:57 +0000 (22:40 +0000)]
[test] Turn off warnings for test/Analysis/identical-expressions.cpp.

Also, make it slightly clearer what's being tested by only differentiating integer
literals based on their suffix, rather than using a very large constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216133 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTest: CoverageMapping: use "RUN: FileCheck" command instead of "RUN: cat | Filecheck".
Alex Lorenz [Wed, 20 Aug 2014 17:29:47 +0000 (17:29 +0000)]
Test: CoverageMapping: use "RUN: FileCheck" command instead of "RUN: cat | Filecheck".

Change the lit RUN commands for 3 tests to use the following pattern
"FileCheck -input-file ..." instead of "cat ... | FileCheck ..." as
suggested by Justin Bogner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216085 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCoverage mapping: fix mapping for objective-c for statement
Alex Lorenz [Wed, 20 Aug 2014 17:11:53 +0000 (17:11 +0000)]
Coverage mapping: fix mapping for objective-c for statement

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216082 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCoverage mapping: fix mapping for objective-c message expression
Alex Lorenz [Wed, 20 Aug 2014 17:10:56 +0000 (17:10 +0000)]
Coverage mapping: fix mapping for objective-c message expression

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216081 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[analyzer] UnixAPI: Check that the third argument to open(2) (if present) is an integer.
Jordan Rose [Wed, 20 Aug 2014 16:58:09 +0000 (16:58 +0000)]
[analyzer] UnixAPI: Check that the third argument to open(2) (if present) is an integer.

Patch by Daniel Fahlgren.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216079 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[analyzer] UnixAPI: Check when open(2) is called with more than three arguments.
Jordan Rose [Wed, 20 Aug 2014 16:58:03 +0000 (16:58 +0000)]
[analyzer] UnixAPI: Check when open(2) is called with more than three arguments.

Patch by Daniel Fahlgren.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216078 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[analyzer] IdenticalExpr: don't try to compare integer literals with different widths.
Jordan Rose [Wed, 20 Aug 2014 16:51:26 +0000 (16:51 +0000)]
[analyzer] IdenticalExpr: don't try to compare integer literals with different widths.

PR20659. Patch by Anders Rönnholm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216076 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[analyzer] IdenticalExpr: use getBytes rather than getString to compare string literals.
Jordan Rose [Wed, 20 Aug 2014 16:51:18 +0000 (16:51 +0000)]
[analyzer] IdenticalExpr: use getBytes rather than getString to compare string literals.

PR20693. Patch by Anders Rönnholm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216075 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoObjective-C [qoi]. Provide fix-it hint when sending
Fariborz Jahanian [Tue, 19 Aug 2014 23:39:17 +0000 (23:39 +0000)]
Objective-C [qoi]. Provide fix-it hint when sending
class method to an object receiver. rdar://16263395

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216038 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoHandle SPARC float command line parameters for SPARCv9.
Brad Smith [Tue, 19 Aug 2014 21:50:15 +0000 (21:50 +0000)]
Handle SPARC float command line parameters for SPARCv9.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216029 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTest: Coverage Mapping: add missing RUN commands
Alex Lorenz [Tue, 19 Aug 2014 20:51:54 +0000 (20:51 +0000)]
Test: Coverage Mapping: add missing RUN commands

Add the llvm-lit RUN commands for the two coverage mapping tests
that filecheck a temporary file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216020 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd tests for coverage mapping generation.
Alex Lorenz [Tue, 19 Aug 2014 17:32:30 +0000 (17:32 +0000)]
Add tests for coverage mapping generation.

This patch adds the tests for the coverage mapping generation.
Most of the tests check the mapping regions produced by
the generator, and one checks the llvm IR.

Differential Revision: http://reviews.llvm.org/D4847

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215995 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoext_vector IRGen. Patch to allow indexing into
Fariborz Jahanian [Tue, 19 Aug 2014 17:17:40 +0000 (17:17 +0000)]
ext_vector IRGen. Patch to allow indexing into
ext_vector_type's 'hi/lo' components when
used as lvalue. rdar://18031917 pr20697

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215991 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoC++1y is now C++14!
Aaron Ballman [Tue, 19 Aug 2014 15:55:55 +0000 (15:55 +0000)]
C++1y is now C++14!

Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215982 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove the body out of line to try to fix a buildbot.
Rafael Espindola [Tue, 19 Aug 2014 14:36:35 +0000 (14:36 +0000)]
Move the body out of line to try to fix a buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215980 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoGo back to having a takeModule instead of a getModule.
Rafael Espindola [Tue, 19 Aug 2014 14:32:16 +0000 (14:32 +0000)]
Go back to having a takeModule instead of a getModule.

Returning a std::unique_ptr is more constrained. Thanks to David Blaikie for the
suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215979 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[OPENMP] Extract common superclass from all the loop directives. No functional change...
Alexander Musman [Tue, 19 Aug 2014 11:27:13 +0000 (11:27 +0000)]
[OPENMP] Extract common superclass from all the loop directives. No functional changes (having common superclass is convenient for future loop directives CodeGen implementation)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215975 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMS ABI: Update alias template mangling for VC "14" CTP 3
David Majnemer [Tue, 19 Aug 2014 07:29:03 +0000 (07:29 +0000)]
MS ABI: Update alias template mangling for VC "14" CTP 3

MSVC "14" CTP 3 has fixed it's mangling for alias templates when used as
template-template arguments; update clang to be compatible with this
mangling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215972 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate for llvm api change.
Rafael Espindola [Tue, 19 Aug 2014 04:04:30 +0000 (04:04 +0000)]
Update for llvm api change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215968 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a warning flag for an existing diagnostic.
Nico Weber [Mon, 18 Aug 2014 23:02:03 +0000 (23:02 +0000)]
Add a warning flag for an existing diagnostic.

One more, and the number of flags without a dedicated flag fits in two decimal
digits :-)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215946 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate link strategy for sanitizer runtime libraries on Linux:
Alexey Samsonov [Mon, 18 Aug 2014 22:10:42 +0000 (22:10 +0000)]
Update link strategy for sanitizer runtime libraries on Linux:

1. Always put static sanitizer runtimes to the front of the linker
invocation line. This was already done for all sanitizers except UBSan:
in case user provides static libstdc++ we need to make sure that new/delete
operator definitions are picked from sanitizer runtimes instead of libstdc++.
We have to put UBSan runtime first for similar reasons: it depends on some
libstdc++ parts (e.g. __dynamic_cast function), and has to go first in
link line to ensure these functions will be picked up from libstdc++.

2. Put sanitizer libraries system dependencies (-ldl, -lpthread etc.) right
after sanitizer runtimes. This will ensure these libraries participate in
the link even if user provided -Wl,-as-needed flag. This should fix PR15823.

3. In case we link in several sanitizer runtimes (e.g. "ubsan", "ubsan_cxx"
and "san"), add system dependencies (-ldl, -lpthread, ...) only once.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215940 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix the rececl chain for redeclarations of predefined decls
Ben Langmuir [Mon, 18 Aug 2014 19:32:45 +0000 (19:32 +0000)]
Fix the rececl chain for redeclarations of predefined decls

Predefined decls like 'Protocol' in objc are not loaded from AST files,
so we cannot rely on loading the canonical decl to complete the redecl
chain for redeclarations of these decls.  The broken redecl chain was
non-circular, so looping over redecls() would hang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215929 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoStore std::unique_ptr in InMemoryBuffers. NFC.
Rafael Espindola [Mon, 18 Aug 2014 19:16:31 +0000 (19:16 +0000)]
Store std::unique_ptr in InMemoryBuffers. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215928 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoreturn a std::unique_ptr from getMainBufferWithPrecompiledPreamble. NFC.
Rafael Espindola [Mon, 18 Aug 2014 18:47:08 +0000 (18:47 +0000)]
return a std::unique_ptr from getMainBufferWithPrecompiledPreamble. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215927 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse std::unique_ptr to simplify this code a bit.
Rafael Espindola [Mon, 18 Aug 2014 18:33:41 +0000 (18:33 +0000)]
Use std::unique_ptr to simplify this code a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215926 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInline function into only use.
Rafael Espindola [Mon, 18 Aug 2014 18:17:32 +0000 (18:17 +0000)]
Inline function into only use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215925 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSimplify ASTUnit::Parse a bit by passing a std::unique_ptr to it.
Rafael Espindola [Mon, 18 Aug 2014 16:23:45 +0000 (16:23 +0000)]
Simplify ASTUnit::Parse a bit by passing a std::unique_ptr to it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215900 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[x32] Handle -m64/-m32 switches by Driver in x32 mode
Pavel Chupin [Mon, 18 Aug 2014 15:38:38 +0000 (15:38 +0000)]
[x32] Handle -m64/-m32 switches by Driver in x32 mode

Summary:
Adding remaining 2 cases handling:
* from x32 to 32 via -m32
* from x32 to 64 via -m64

Test Plan: linux-ld test updated

Reviewers: chandlerc, atanasyan

Subscribers: cfe-commits, zinovy.nis

Differential Revision: http://reviews.llvm.org/D4930

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215899 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix a memory leak in one of the test unit. Silent coverity warning CID 1095912
Sylvestre Ledru [Mon, 18 Aug 2014 15:18:56 +0000 (15:18 +0000)]
Fix a memory leak in one of the test unit. Silent coverity warning CID 1095912

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215898 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd the break in the switch case (even if there is llvm_unreachable. It will silent...
Sylvestre Ledru [Mon, 18 Aug 2014 15:13:44 +0000 (15:13 +0000)]
Add the break in the switch case (even if there is llvm_unreachable. It will silent coverity warning CID 1231654

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215897 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate the call to llvm::sys::fs::UniqueID to match the definition: UniqueID(uint64_t...
Sylvestre Ledru [Mon, 18 Aug 2014 15:00:11 +0000 (15:00 +0000)]
Update the call to llvm::sys::fs::UniqueID to match the definition: UniqueID(uint64_t Device, uint64_t File)
Fixes CID 1095247

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215896 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRepace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to...
Craig Topper [Sun, 17 Aug 2014 23:49:53 +0000 (23:49 +0000)]
Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215869 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse the pointer-like API of ErrorOr.
Rafael Espindola [Sun, 17 Aug 2014 23:31:27 +0000 (23:31 +0000)]
Use the pointer-like API of ErrorOr.

Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215866 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCreate a std::unique_ptr earlier.
Rafael Espindola [Sun, 17 Aug 2014 23:27:13 +0000 (23:27 +0000)]
Create a std::unique_ptr earlier.

Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215865 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse std::unique_ptr in a few methods that take ownership.
Rafael Espindola [Sun, 17 Aug 2014 23:12:27 +0000 (23:12 +0000)]
Use std::unique_ptr in a few methods that take ownership.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215864 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate for llvm api changes.
Rafael Espindola [Sun, 17 Aug 2014 22:20:41 +0000 (22:20 +0000)]
Update for llvm api changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215856 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoConvert a few ownership comments with std::unique_ptr.
Rafael Espindola [Sun, 17 Aug 2014 22:12:58 +0000 (22:12 +0000)]
Convert a few ownership comments with std::unique_ptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215853 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDo not rely on bin/ path prefix in tests.
Manuel Klimek [Sun, 17 Aug 2014 19:11:18 +0000 (19:11 +0000)]
Do not rely on bin/ path prefix in tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215845 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a test for -no-canonical-prefixes.
Rafael Espindola [Sun, 17 Aug 2014 16:22:16 +0000 (16:22 +0000)]
Add a test for -no-canonical-prefixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215836 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix assertion on asm register that are "%"
Olivier Goffart [Sun, 17 Aug 2014 13:19:48 +0000 (13:19 +0000)]
Fix assertion on asm register that are "%"

Name might be empty again after we removed the '%' prefix
and Name[0] would assert.

Found on code like
register int foo asm("%" MACRO);
where MACRO was supposed to be defined in a header file that was not found.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215834 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUniformed parsing of GNU attributes at line beginnning and added GNU attributes parsi...
Abramo Bagnara [Sat, 16 Aug 2014 08:29:27 +0000 (08:29 +0000)]
Uniformed parsing of GNU attributes at line beginnning and added GNU attributes parsing FIXMEs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215814 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoWhen loading a module with no local entities, still bump the size of the
Ben Langmuir [Sat, 16 Aug 2014 04:54:18 +0000 (04:54 +0000)]
When loading a module with no local entities, still bump the size of the

tables that correspond to ContinuousRangeMaps, since the keys to those
maps need to be unique, or we may map to the wrong offset.

This fixes a crash + malformed AST file seen when loading some modules
that import Cocoa on Darwin, which is a module with no contents except
imports of other modules. Unfortunately I have not been able to find a
reduced test case that reproduces this problem.

Also add an assert that we aren't mapping one key to multiple values
in CRM.  We ought to be able to say there are no duplicate keys at all,
but there are a bunch of 0 -> 0 mappings that are showing up, probably
coming from the source location table.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215810 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoClarify.
Nick Lewycky [Sat, 16 Aug 2014 02:14:37 +0000 (02:14 +0000)]
Clarify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215808 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTry indenting to put all the text inside the block.
Nick Lewycky [Sat, 16 Aug 2014 02:11:54 +0000 (02:11 +0000)]
Try indenting to put all the text inside the block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215807 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDocument what's experimental about __attribute__((enable_if)). PR20392
Nick Lewycky [Sat, 16 Aug 2014 02:09:42 +0000 (02:09 +0000)]
Document what's experimental about __attribute__((enable_if)). PR20392

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215806 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[libclang] Introduce clang_File_isEqual for comparing CXFile handles.
Argyrios Kyrtzidis [Sat, 16 Aug 2014 00:26:19 +0000 (00:26 +0000)]
[libclang] Introduce clang_File_isEqual for comparing CXFile handles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215796 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert "Update for LLVM change (StringSaver)"
Sean Silva [Fri, 15 Aug 2014 23:39:12 +0000 (23:39 +0000)]
Revert "Update for LLVM change (StringSaver)"

This reverts commit r215785 / 170ebf4f19459ae51a9561d0e65c87ee4c9b2c97.

LLD has some StringSavers that need to be updated. One of which takes a
lock and I need to investigate that more closely.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215791 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake sure that vtables referenced from delay-parsed templates get referenced.
Nico Weber [Fri, 15 Aug 2014 23:21:41 +0000 (23:21 +0000)]
Make sure that vtables referenced from delay-parsed templates get referenced.

This fixes PR20671, see the bug for details. In short, ActOnTranslationUnit()
calls DefineUsedVTables() and only then PerformPendingInstantiations(). But
PerformPendingInstantiations() is what does delayed template parsing, so
vtables only references from late-parsed templates weren't marked used.

As a fix, move the SavePendingInstantiationsAndVTableUsesRAII in
PerformPendingInstantiations() up above the delayed template parsing code.
That way, vtables referenced from templates end up in the RAII object, and the
call to DefineUsedVTables() in PerformPendingInstantiations() marks them used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215786 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate for LLVM change (StringSaver)
Sean Silva [Fri, 15 Aug 2014 23:18:49 +0000 (23:18 +0000)]
Update for LLVM change (StringSaver)

There is more cleanup to be done here. Once
llvm::sys::Process::GetArgumentVector is switched over to StringSaver,
we can simplify this code a fair amount.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215785 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a RAII class for saving and restoring instantiations and uses. No behavior change.
Nico Weber [Fri, 15 Aug 2014 22:29:14 +0000 (22:29 +0000)]
Add a RAII class for saving and restoring instantiations and uses. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215780 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoWrap to 80 columns, no behavior change.
Nico Weber [Fri, 15 Aug 2014 22:15:00 +0000 (22:15 +0000)]
Wrap to 80 columns, no behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215776 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRename as suggested by dblaikie
Sean Silva [Fri, 15 Aug 2014 21:40:51 +0000 (21:40 +0000)]
Rename as suggested by dblaikie

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215774 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoArrayRef'ize
Sean Silva [Fri, 15 Aug 2014 21:38:36 +0000 (21:38 +0000)]
ArrayRef'ize

I've shied away from ArrayRef'izing CompilerInvocation::CreateFromArgs
in this commit because that is a less localized change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215773 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDebugInfo: While loop backedge should be attribute to the start of the while statement.
David Blaikie [Fri, 15 Aug 2014 21:11:25 +0000 (21:11 +0000)]
DebugInfo: While loop backedge should be attribute to the start of the while statement.

A little test case simplification - this could be simplified further,
though there are certainly interesting connections to the if/else
construct so I'm hesitant to remove that entirely though it does appear
somewhat unrelated.

(similar fix to r215766, related to PR19864)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215768 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRename this function to better reflect its purpose
Sean Silva [Fri, 15 Aug 2014 20:59:03 +0000 (20:59 +0000)]
Rename this function to better reflect its purpose

Thanks to dblaikie for the impetus to look for a better name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215767 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDebugInfo: Fix PR19864 better - attribute the jump at the end of a range-for loop...
David Blaikie [Fri, 15 Aug 2014 20:50:45 +0000 (20:50 +0000)]
DebugInfo: Fix PR19864 better - attribute the jump at the end of a range-for loop, to the start of the loop.

This avoids debuggers stepping to strange places (like the last
statement in the loop body, or the first statement in the if).

This is not the whole answer, though - similar bugs no doubt exist in
other loops (patches to follow) and attributing exception handling code
to the correct line is also tricky (based on the previous fix to
PR19864, exception handling is still erroneously attributed to the 'if'
line).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215766 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTypo fix in comments: definintion -> definition
James Dennett [Fri, 15 Aug 2014 20:04:40 +0000 (20:04 +0000)]
Typo fix in comments: definintion -> definition

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215764 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[cleanup] Rename this function to better reflect its purpose. NFC.
Sean Silva [Fri, 15 Aug 2014 19:23:53 +0000 (19:23 +0000)]
[cleanup] Rename this function to better reflect its purpose. NFC.

This also suggests some refactoring to simplify this code. Basically, a
ton of complexity in this argument handling code comes from the need to
save const char *'s in stable storage for pushing onto argv.
It seems like llvm::cl::StringSaver can be improved to cover all the
needs here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215761 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[cleanup] Range-for'ify this loop. NFC.
Sean Silva [Fri, 15 Aug 2014 19:23:50 +0000 (19:23 +0000)]
[cleanup] Range-for'ify this loop. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215760 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[cleanup] Factor out handling CC1 tools. NFC.
Sean Silva [Fri, 15 Aug 2014 19:23:47 +0000 (19:23 +0000)]
[cleanup] Factor out handling CC1 tools. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215759 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd missing matchers to the dynamic registry.
Samuel Benzaquen [Fri, 15 Aug 2014 19:13:27 +0000 (19:13 +0000)]
Add missing matchers to the dynamic registry.

Reviewers: klimek

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D4910

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215757 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[cleanup] Factor out setting the driver's install dir. NFC.
Sean Silva [Fri, 15 Aug 2014 18:58:15 +0000 (18:58 +0000)]
[cleanup] Factor out setting the driver's install dir. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215756 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[cleanup] Factor out initializing the DianosticOptions. NFC.
Sean Silva [Fri, 15 Aug 2014 18:58:12 +0000 (18:58 +0000)]
[cleanup] Factor out initializing the DianosticOptions. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215755 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[cleanup] Factor out adjusting "cl.exe" to "clang-cl.exe". NFC.
Sean Silva [Fri, 15 Aug 2014 18:58:09 +0000 (18:58 +0000)]
[cleanup] Factor out adjusting "cl.exe" to "clang-cl.exe". NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215754 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[cleanup] Factor out some checks. NFC.
Sean Silva [Fri, 15 Aug 2014 18:50:00 +0000 (18:50 +0000)]
[cleanup] Factor out some checks. NFC.

The core logic in main() is actually pretty simple, but there's lots of
stuff that has been added over time which obscures the flow of the code.
In upcoming patches, I'll be pulling more stuff out of the main
codepath.

I'm open to naming suggestions for these helper functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215751 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMS ABI: Virtual member pointer thunks are not unnamed_addr
Reid Kleckner [Fri, 15 Aug 2014 18:12:40 +0000 (18:12 +0000)]
MS ABI: Virtual member pointer thunks are not unnamed_addr

They can be compared for identity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215745 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600: Add ldexp intrinsic
Matt Arsenault [Fri, 15 Aug 2014 17:44:32 +0000 (17:44 +0000)]
R600: Add ldexp intrinsic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215738 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoObjective-C. Do not warn if user is using property-dox syntax to name a
Fariborz Jahanian [Fri, 15 Aug 2014 17:39:00 +0000 (17:39 +0000)]
Objective-C. Do not warn if user is using property-dox syntax to name a
user provided setter name (as declared in @property attribute declaration).
rdar://18022762

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215736 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove some code into a helper function. NFC.
Rafael Espindola [Fri, 15 Aug 2014 17:14:35 +0000 (17:14 +0000)]
Move some code into a helper function. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215731 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse a valid arch name in this triple.
Rafael Espindola [Fri, 15 Aug 2014 16:55:25 +0000 (16:55 +0000)]
Use a valid arch name in this triple.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215726 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd isDeleted() matcher for FunctionDecl nodes.
Samuel Benzaquen [Fri, 15 Aug 2014 14:20:59 +0000 (14:20 +0000)]
Add isDeleted() matcher for FunctionDecl nodes.

Reviewers: klimek

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D4911

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215714 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoConst-correctness, return-after-else, and formatting updates. NFC.
Aaron Ballman [Fri, 15 Aug 2014 12:38:17 +0000 (12:38 +0000)]
Const-correctness, return-after-else, and formatting updates. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215706 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThere are no overloads of this virtual function, nor are there any callers of it...
Aaron Ballman [Fri, 15 Aug 2014 12:34:08 +0000 (12:34 +0000)]
There are no overloads of this virtual function, nor are there any callers of it. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215705 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdding const-qualifiers to auto declarations. NFC.
Aaron Ballman [Fri, 15 Aug 2014 12:29:39 +0000 (12:29 +0000)]
Adding const-qualifiers to auto declarations. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215704 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoarm_acle.h: Small cleanup
Yi Kong [Fri, 15 Aug 2014 08:53:22 +0000 (08:53 +0000)]
arm_acle.h: Small cleanup

Since __SIZEOF_LONG_LONG__ is always defined as 8 on ARM targets,
there's no point in checking this. NFC.

Patch by Moritz Roth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215697 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Prefer breaking after return type over template param
Daniel Jasper [Fri, 15 Aug 2014 05:00:39 +0000 (05:00 +0000)]
clang-format: Prefer breaking after return type over template param

Before:
  typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa aaaaaaaaaa<
      aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(bool *aaaaaaaaaaaaaaaaaa,
                                                   bool *aa) {}

After:
  typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa
  aaaaaaaaaa<aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      bool *aaaaaaaaaaaaaaaaaa, bool *aa) {}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215693 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: [proto] Understand text-format nesting without :
Daniel Jasper [Fri, 15 Aug 2014 05:00:35 +0000 (05:00 +0000)]
clang-format: [proto] Understand text-format nesting without :

Before:
  option (MyProto.options) = {
    field_c : "OK" msg_field{field_d : 123}
  };

After:
  option (MyProto.options) = {
    field_c : "OK"
    msg_field{field_d : 123}
  };

(Note that the colon after "msg_field" is optional).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215692 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake sure CallExpr::getLocStart doesn't segfault
Keno Fischer [Fri, 15 Aug 2014 01:39:12 +0000 (01:39 +0000)]
Make sure CallExpr::getLocStart doesn't segfault

Summary:
When the CallExpr passed to Sema::ConvertArgumentsForCall has all default parameters, and the number of actual arguments passed is zero, this function will segfault in the call to Call->getLocStart() if the Callee has an invalid getLocStart(), the reason being that since ConvertArgumentsForCall has set the correct number of arguments, but has not filled them in yet, getLocStart() will try to access the first (not yet existent) argument and thus segfaults.

This fixes that by making getLocStart return an invalid source location if the queried argument is NULL rather than segfaulting.

Reviewers: rnk

Reviewed By: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4917

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215686 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoLimit our MSVC compat hack for nested names from dependent bases
Reid Kleckner [Thu, 14 Aug 2014 23:34:52 +0000 (23:34 +0000)]
Limit our MSVC compat hack for nested names from dependent bases

Previously, any undeclared unqualified id starting a nested name
specifier in a dependent context would have its lookup retried during
template instantiation.  Now we limit that retry hack to methods of a
class with dependent bases.  Free function templates in particular are
no longer affected by this hack.

Also, diagnose this as a Microsoft extension. This has the downside that
template authors may see this warning *and* an error during
instantiation time about this identifier. Fixing that will probably
require formalizing some kind of "delayed" identifier, instead of our
ad-hoc solutions of forming dependent AST nodes when lookup fails.

Based on a patch by Kim Gräsman!

Differential Revision: http://reviews.llvm.org/D4854

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215683 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThread Safety Analysis: Move -Wthread-safety-negative out of the
DeLesley Hutchins [Thu, 14 Aug 2014 21:54:34 +0000 (21:54 +0000)]
Thread Safety Analysis:  Move -Wthread-safety-negative out of the
-Wthread-safety umbrella flag, pending updates to documentation.  The flag
works, but is likely to be confusing to existing users of -Wthread-safety.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215679 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse a switch statement for IsIntegratedAssemblerDefault().
Brad Smith [Thu, 14 Aug 2014 21:43:07 +0000 (21:43 +0000)]
Use a switch statement for IsIntegratedAssemblerDefault().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215678 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThread safety analysis: add -Wthread-safety-verbose flag, which adds additional notes...
DeLesley Hutchins [Thu, 14 Aug 2014 21:40:15 +0000 (21:40 +0000)]
Thread safety analysis: add -Wthread-safety-verbose flag, which adds additional notes that are helpful when compiling statistics on thread safety warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215677 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[modules] Turn off a broken optimization: we need to pick up implicit special
Richard Smith [Thu, 14 Aug 2014 20:30:52 +0000 (20:30 +0000)]
[modules] Turn off a broken optimization: we need to pick up implicit special
members from all redefinitions of a class that have them, in case the special
member is defined in one module but only declared in another.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215675 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't Lex past EOF when lexing _Pragma
Reid Kleckner [Thu, 14 Aug 2014 19:47:06 +0000 (19:47 +0000)]
Don't Lex past EOF when lexing _Pragma

Fixes PR20662.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215672 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThread Safety Analysis: fix to improve handling of references to guarded
DeLesley Hutchins [Thu, 14 Aug 2014 19:17:06 +0000 (19:17 +0000)]
Thread Safety Analysis: fix to improve handling of references to guarded
data members and range based for loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215671 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse the big endian emulations for NetBSD/arm in EB mode.
Joerg Sonnenberger [Thu, 14 Aug 2014 19:12:41 +0000 (19:12 +0000)]
Use the big endian emulations for NetBSD/arm in EB mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215670 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AVX512] Add FMA intrinsics
Adam Nemet [Thu, 14 Aug 2014 17:17:57 +0000 (17:17 +0000)]
[AVX512] Add FMA intrinsics

Part of <rdar://problem/17688758>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215666 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse the proper post-order traversal in LiveVariables analysis,
Artyom Skrobov [Thu, 14 Aug 2014 16:04:47 +0000 (16:04 +0000)]
Use the proper post-order traversal in LiveVariables analysis,
to recover the performance after r214064.

Also sorts out the naming for PostOrderCFGView, ReversePostOrderCFGView,
BackwardDataflowWorklist and ForwardDataflowWorklist, to match the accepted
terminology.

Also unifies BackwardDataflowWorklist and ForwardDataflowWorklist to share
the "worklist for prioritization, post-order traversal for fallback" logic,
and to avoid repetitive sorting.

Also cleans up comments in the affected area.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215650 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert "CodeGen: When bitfields fall on natural boundaries, split them up"
Justin Bogner [Thu, 14 Aug 2014 15:44:29 +0000 (15:44 +0000)]
Revert "CodeGen: When bitfields fall on natural boundaries, split them up"

It fits better with LLVM's memory model to try to do this in the
backend. Specifically, narrowing wide loads in the backends should be
relatively straightforward and is generally valuable, whereas widening
loads tends to be very constrained.

Discussion here:

  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140811/112581.html

This reverts commit r215614.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215648 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDelete support for AuroraUX.
Rafael Espindola [Thu, 14 Aug 2014 15:14:51 +0000 (15:14 +0000)]
Delete support for AuroraUX.

auroraux.org is not resolving.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215644 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSplit a large unit-test, so that it doesn't exceed stack frame size in certain test...
Alexander Kornienko [Thu, 14 Aug 2014 13:07:35 +0000 (13:07 +0000)]
Split a large unit-test, so that it doesn't exceed stack frame size in certain test environments

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215639 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Fix AlwaysBreakAfterDefinitionReturnType in Stroutrup style
Daniel Jasper [Thu, 14 Aug 2014 11:36:03 +0000 (11:36 +0000)]
clang-format: Fix AlwaysBreakAfterDefinitionReturnType in Stroutrup style

Before:
  template <class T>
  T *f(T &c)  // Problem here: no line break before f
  {
    return NULL;
  }

After:
  template <class T>
  T *
  f(T &c)
  {
    return NULL;
  }

Patch by Marek Kurdej, thank you!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215633 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Support chained dereferenced assignments.
Daniel Jasper [Thu, 14 Aug 2014 10:53:19 +0000 (10:53 +0000)]
clang-format: Support chained dereferenced assignments.

Before:
  x = * a(x) = *a(y);

After:
  x = *a(x) = *a(y);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215632 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoclang-format: Support breaking arguments of function type typedefs.
Daniel Jasper [Thu, 14 Aug 2014 10:52:56 +0000 (10:52 +0000)]
clang-format: Support breaking arguments of function type typedefs.

Before:
  typedef size_t (*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
      const aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
  typedef size_t (*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
      const aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
          aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215631 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix a crash when compiling blocks in OpenCL with multiple
Pekka Jaaskelainen [Thu, 14 Aug 2014 09:37:50 +0000 (09:37 +0000)]
Fix a crash when compiling blocks in OpenCL with multiple
address spaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215629 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoParse: Don't attempt to act on #pragma init_seg when not targeting MSVC
David Majnemer [Thu, 14 Aug 2014 06:35:08 +0000 (06:35 +0000)]
Parse: Don't attempt to act on #pragma init_seg when not targeting MSVC

It doesn't really make sense to try and do stuff with #pragma init_seg
when targeting non-Microsoft platforms; notions like library vs user
initializers don't exist for other targets.

This fixes PR20639.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215618 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[modules] Factor .td-generated diagnostics stuff out into its own module; this
Richard Smith [Thu, 14 Aug 2014 04:11:33 +0000 (04:11 +0000)]
[modules] Factor .td-generated diagnostics stuff out into its own module; this
avoids users of AllDiagnostics.h from needing to pregenerate *all* generated
headers. Hopefully this will make my modules buildbot happier...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215617 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[modules] Don't assert if the same imported class template specialization
Richard Smith [Thu, 14 Aug 2014 03:30:27 +0000 (03:30 +0000)]
[modules] Don't assert if the same imported class template specialization
declaration has its definition instantiated in two sibling modules and they use
a partial specialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215616 91177308-0d34-0410-b5e6-96231b3b80d8