]> granicus.if.org Git - clang/log
clang
10 years ago[leaks] Fix a leak recently introduced to the pragma handling. This
Chandler Carruth [Fri, 2 May 2014 21:44:48 +0000 (21:44 +0000)]
[leaks] Fix a leak recently introduced to the pragma handling. This
whole code would be better with std::unique_ptr managing the lifetimes
of the handlers, but I wanted to make a targeted fix to the leaks first.
With this change, all of the Clang preprocessor tests are leak free with
LSan.

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

10 years agoRemove unused typedef found by gcc's -Wunused-local-typedefs.
Nico Weber [Fri, 2 May 2014 21:22:21 +0000 (21:22 +0000)]
Remove unused typedef found by gcc's -Wunused-local-typedefs.

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

10 years agoFix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl.
Alex McCarthy [Fri, 2 May 2014 20:24:11 +0000 (20:24 +0000)]
Fix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl.

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

10 years ago[driver] Enable the slp vectorizer at -Oz.
Chad Rosier [Fri, 2 May 2014 18:41:57 +0000 (18:41 +0000)]
[driver] Enable the slp vectorizer at -Oz.
PR19568

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

10 years agoFix bad comment from r207573.
Hans Wennborg [Fri, 2 May 2014 18:12:30 +0000 (18:12 +0000)]
Fix bad comment from r207573.

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

10 years agoSmall formatting change.
Eric Christopher [Fri, 2 May 2014 17:52:19 +0000 (17:52 +0000)]
Small formatting change.

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

10 years agoFixes issue with Allman BreakBeforeBraces for Objective C @interface
Dinesh Dwivedi [Fri, 2 May 2014 17:01:46 +0000 (17:01 +0000)]
Fixes issue with Allman BreakBeforeBraces for Objective C @interface

Before:
        @interface BSApplicationController () {
    @private
      id _extraIvar;
    }
    @end

After:
    @interface BSApplicationController ()
    {
    @private
      id _extraIvar;
    }
    @end

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

10 years agoAdd support for -march=bdver4.
Benjamin Kramer [Fri, 2 May 2014 15:47:51 +0000 (15:47 +0000)]
Add support for -march=bdver4.

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

10 years ago[ARM64/AArch64] Define the correct value for __ARM_NEON_FP
Bradley Smith [Fri, 2 May 2014 15:18:38 +0000 (15:18 +0000)]
[ARM64/AArch64] Define the correct value for __ARM_NEON_FP

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

10 years ago[ARM64/AArch64] Hook up CRC32 subtarget feature to the driver
Bradley Smith [Fri, 2 May 2014 15:17:51 +0000 (15:17 +0000)]
[ARM64/AArch64] Hook up CRC32 subtarget feature to the driver

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

10 years agoUpdated the attribute tablegen emitter for variadic arguments to emit a range accesso...
Aaron Ballman [Fri, 2 May 2014 13:35:42 +0000 (13:35 +0000)]
Updated the attribute tablegen emitter for variadic arguments to emit a range accessor in addition to the iterators. Updated code using iterators to use range-based for loops.

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

10 years agoRenaming the CallableState variadic attribute argument to be CallableStates. No funct...
Aaron Ballman [Fri, 2 May 2014 13:17:57 +0000 (13:17 +0000)]
Renaming the CallableState variadic attribute argument to be CallableStates. No functional changes intended.

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

10 years agoXCore target: fix bug in dereferencing null pointer.
Robert Lytton [Fri, 2 May 2014 09:33:30 +0000 (09:33 +0000)]
XCore target: fix bug in dereferencing null pointer.

Also add basic cpp ABI tests where they differ from C ABI output.

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

10 years agoXCore target: fix handling of -g0 flag
Robert Lytton [Fri, 2 May 2014 09:33:25 +0000 (09:33 +0000)]
XCore target: fix handling of -g0 flag

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

10 years agoXCore target: Add TypeString meta data to IR output.
Robert Lytton [Fri, 2 May 2014 09:33:20 +0000 (09:33 +0000)]
XCore target: Add TypeString meta data to IR output.

This includes the addition of the virtual function:
TargetCodeGenInfo::EmitTargetMD()

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

10 years agoCodeGen: reorder ARM hint
Saleem Abdulrasool [Fri, 2 May 2014 07:01:34 +0000 (07:01 +0000)]
CodeGen: reorder ARM hint

__yield is part of the ACLE specified extensions and not specific to MSVC.
Move the declaration for the hint to the proper group.

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

10 years agoCodeGen: rename __builtin_arm_sevl to __sevl
Saleem Abdulrasool [Fri, 2 May 2014 06:53:57 +0000 (06:53 +0000)]
CodeGen: rename __builtin_arm_sevl to __sevl

ACLE adds the __sevl() extension.  Rename the hint from a custom name to the
ACLE specified name.

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

10 years agoReformat code following Preprocessor constructor updates
Alp Toker [Fri, 2 May 2014 03:43:38 +0000 (03:43 +0000)]
Reformat code following Preprocessor constructor updates

Landing this separately to make the previous commits easy to follow at home.

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

10 years agoFactor TargetInfo pointer/DelayInitialization bool pair out of Preprocessor ctor
Alp Toker [Fri, 2 May 2014 03:43:30 +0000 (03:43 +0000)]
Factor TargetInfo pointer/DelayInitialization bool pair out of Preprocessor ctor

The Preprocessor::Initialize() function already offers a clear interface to
achieve this, further reducing the confusing number of states a newly
constructed preprocessor can have.

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

10 years agoRemove unused IncrProcessing parameter from Preprocessor ctor
Alp Toker [Fri, 2 May 2014 03:43:21 +0000 (03:43 +0000)]
Remove unused IncrProcessing parameter from Preprocessor ctor

Preprocessor::enableIncrementalProcessing() provides a consistent interface to
enable the feature.

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

10 years agoCut off parsing early during code completion
Alp Toker [Fri, 2 May 2014 03:43:14 +0000 (03:43 +0000)]
Cut off parsing early during code completion

These calls to ConsumeCodeCompletionToken() caused parsing to continue
needlessly when an immediate cutOffParsing() would do.

Document the function to clarify its correct usage.

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

10 years agoHandle -fdelayed-template-parsing of out-of-line definitions of
Hans Wennborg [Fri, 2 May 2014 02:01:07 +0000 (02:01 +0000)]
Handle -fdelayed-template-parsing of out-of-line definitions of
class template member classes (PR19613)

Also improve this code in general by implementing suggestions
from Richard.

Differential Revision: http://reviews.llvm.org/D3555?id=9020

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

10 years agoRemove unused variable that I missed in my rush to fix the bots
Reid Kleckner [Fri, 2 May 2014 01:17:12 +0000 (01:17 +0000)]
Remove unused variable that I missed in my rush to fix the bots

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

10 years agoWin64: Use ConvertType instead of checking the MS inheritance
Reid Kleckner [Fri, 2 May 2014 01:14:59 +0000 (01:14 +0000)]
Win64: Use ConvertType instead of checking the MS inheritance

dependent-type-member-pointer.cpp is failing on a win64 bot because
-fms-extensions is not enabled.  Use ConvertType rather than relying on
the inheritance attributes.  It's less code, but probably slower.

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

10 years agoWin64: Pass member pointers larger than 8 bytes by reference
Reid Kleckner [Fri, 2 May 2014 00:51:20 +0000 (00:51 +0000)]
Win64: Pass member pointers larger than 8 bytes by reference

The Win64 ABI docs on MSDN say that arguments bigger than 8 bytes are
passed by reference.  Prior to this change, we were only applying this
logic to RecordType arguments.  This affects both the Itanium and
Microsoft C++ ABIs.

Reviewers: majnemer

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

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

10 years agoMS ABI: Fix logic bug in member pointer null test code
Reid Kleckner [Fri, 2 May 2014 00:05:16 +0000 (00:05 +0000)]
MS ABI: Fix logic bug in member pointer null test code

This code is trying to test if the pointer is *not* null.  Therefore we
should use 'or' instead of 'and' to combine the results of 'icmp ne'.
This logic is consistent with the general member pointer comparison code
in EmitMemberPointerComparison.

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

10 years ago-fsyntax-only for a test
Lubos Lunak [Thu, 1 May 2014 23:58:20 +0000 (23:58 +0000)]
-fsyntax-only for a test

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

10 years agoBitrig's standard C++ standard library changed from libstdc++ to libc++.
Richard Smith [Thu, 1 May 2014 23:24:24 +0000 (23:24 +0000)]
Bitrig's standard C++ standard library changed from libstdc++ to libc++.
Also, it uses libc++abi and needs pthread.  While there, fix the libc++
include path. Patch by Patrick Wildt!

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

10 years agoBitrig now supports TLS, so enable TLS support when targeting it. Patch by Patrick...
Richard Smith [Thu, 1 May 2014 23:19:06 +0000 (23:19 +0000)]
Bitrig now supports TLS, so enable TLS support when targeting it. Patch by Patrick Wildt!

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

10 years agoUse std::abs(int) portably.
David Blaikie [Thu, 1 May 2014 23:01:41 +0000 (23:01 +0000)]
Use std::abs(int) portably.

Code review feedback from Reid Kleckner on r207806.

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

10 years agoUse %clang_cc1 in rewrite-includes-messages.c test and drop REQUIRES: shell
Reid Kleckner [Thu, 1 May 2014 22:45:16 +0000 (22:45 +0000)]
Use %clang_cc1 in rewrite-includes-messages.c test and drop REQUIRES: shell

This test passes on Windows with lit's shell interpreter.

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

10 years agodo not hide clang stderr output during a test
Lubos Lunak [Thu, 1 May 2014 22:40:00 +0000 (22:40 +0000)]
do not hide clang stderr output during a test

I don't know why this fails on the buildbot.

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

10 years agoFix some -Wabsolute-value warnings introduced in r207796.
David Blaikie [Thu, 1 May 2014 22:23:56 +0000 (22:23 +0000)]
Fix some -Wabsolute-value warnings introduced in r207796.

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

10 years agoRevert "Use make_unique<T>(...) rather than unique_ptr<T>(new T(...))"
David Blaikie [Thu, 1 May 2014 21:40:37 +0000 (21:40 +0000)]
Revert "Use make_unique<T>(...) rather than unique_ptr<T>(new T(...))"

Seems to be crashing clang (3.3 and 3.4) on some buildbots...

This reverts commit r207792.

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

10 years agouse 'diff' rather than 'cmp -s' in a test
Lubos Lunak [Thu, 1 May 2014 21:36:08 +0000 (21:36 +0000)]
use 'diff' rather than 'cmp -s' in a test

That's what all tests use, no idea where I got the latter from.

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

10 years agoWhen sorting overload candidates, sort arity mismatches in ascending
Kaelyn Takata [Thu, 1 May 2014 21:15:24 +0000 (21:15 +0000)]
When sorting overload candidates, sort arity mismatches in ascending
order by the number of missing or extra parameters. This is useful if
there are more than a few overload candidates with arity mismatches,
particularly in the presence of -fshow-overloads=best.

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

10 years agowrite a line marker right before adding included file
Lubos Lunak [Thu, 1 May 2014 21:11:57 +0000 (21:11 +0000)]
write a line marker right before adding included file

Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.

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

10 years agodo not use "1" for line marker for the predefines "file" either
Lubos Lunak [Thu, 1 May 2014 21:10:08 +0000 (21:10 +0000)]
do not use "1" for line marker for the predefines "file" either

Similar to r207764.

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

10 years agoUse make_unique<T>(...) rather than unique_ptr<T>(new T(...))
David Blaikie [Thu, 1 May 2014 20:46:30 +0000 (20:46 +0000)]
Use make_unique<T>(...) rather than unique_ptr<T>(new T(...))

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

10 years agoUpdate documentation to match recent API change. newFrontendActionFactory now returns...
Richard Smith [Thu, 1 May 2014 20:04:39 +0000 (20:04 +0000)]
Update documentation to match recent API change. newFrontendActionFactory now returns a unique_ptr.

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

10 years agoPR19601: testcase improvement
Arnaud A. de Grandmaison [Thu, 1 May 2014 19:36:13 +0000 (19:36 +0000)]
PR19601: testcase improvement

The test can now catch all cases:
 - no removal of the 'no-integrated-as' flag
 - bogus removal of the flag, like when the remove_if was not followed by an erase

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

10 years agoPR19623: Support typedefs (and alias templates) of void.
David Blaikie [Thu, 1 May 2014 18:25:19 +0000 (18:25 +0000)]
PR19623: Support typedefs (and alias templates) of void.

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

10 years agoFix debug-info-alias test to add CHECK to some lines that were missing it.
David Blaikie [Thu, 1 May 2014 18:13:24 +0000 (18:13 +0000)]
Fix debug-info-alias test to add CHECK to some lines that were missing it.

To simplify source location offsets, this test uses line directives to
force particular lines of interest to have known line numbers so that
adjustments before/after those points don't require updates to the CHECK
lines.

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

10 years agoAST: Mangle reference temporaries reliably
David Majnemer [Thu, 1 May 2014 17:50:17 +0000 (17:50 +0000)]
AST: Mangle reference temporaries reliably

Summary:
Previously, we would generate a single name for all reference
temporaries and allow LLVM to rename them for us.  Instead, number the
reference temporaries as we build them in Sema.

Reviewers: rsmith

Subscribers: cfe-commits

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

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

10 years agoFix typo (first commit to test commit access).
Dinesh Dwivedi [Thu, 1 May 2014 17:19:34 +0000 (17:19 +0000)]
Fix typo (first commit to test commit access).

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

10 years agoFix declspec-thread.cpp test with a triple
Reid Kleckner [Thu, 1 May 2014 17:12:20 +0000 (17:12 +0000)]
Fix declspec-thread.cpp test with a triple

Not all triples support it.

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

10 years agoMSVCCompat: Don't produce an invalid AST when accepting void pseudo-dtors
Reid Kleckner [Thu, 1 May 2014 16:50:23 +0000 (16:50 +0000)]
MSVCCompat: Don't produce an invalid AST when accepting void pseudo-dtors

We accept 'void *p; p->~void();' for MSVC compatibility since r148682.
However, we were returning ExprError, rather than producing an AST,
despite only diagnosing it with a warning.  CodeGen noticed that the
template function specialization had an invalid AST, and therefore
didn't generate code for it.  This change makes us produce an AST with a
void pseudo-dtor call.

Part of PR18256.

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

10 years ago[libclang] Add attribute support for 'pure', 'const' and 'noduplicate'.
Joey Gouly [Thu, 1 May 2014 15:41:58 +0000 (15:41 +0000)]
[libclang] Add attribute support for 'pure', 'const' and 'noduplicate'.

This bumps CINDEX_VERSION_MINOR up (to 26).

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

10 years agoFixing a FIXME -- no longer using std::memcpy, since that would fail for non-trivial...
Aaron Ballman [Thu, 1 May 2014 15:21:03 +0000 (15:21 +0000)]
Fixing a FIXME -- no longer using std::memcpy, since that would fail for non-trivial types. Replaced with std::copy. No functional changes intended since all uses of this functionality either use pointers or integers.

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

10 years agoSupport 'remark' in VerifyDiagnosticConsumer
Tobias Grosser [Thu, 1 May 2014 14:06:01 +0000 (14:06 +0000)]
Support 'remark' in VerifyDiagnosticConsumer

After Diego added support for -Rpass=inliner we have now in-tree remarks which
we can use to properly test this feature.

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

10 years agodo not use "1" for line marker for the main file
Lubos Lunak [Thu, 1 May 2014 13:50:44 +0000 (13:50 +0000)]
do not use "1" for line marker for the main file

"1" means entering a new file (from a different one), but the main
file is not included from anything (and this would e.g. confuse -Wunused-macros
to not report unused macros in the main file, see pr15610, or also see pr18948).
The line marker is still useful e.g. if the resulting file is renamed or used
via a pipe.

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

10 years agorevert r207756
Lubos Lunak [Thu, 1 May 2014 13:37:55 +0000 (13:37 +0000)]
revert r207756

There's nothing wrong with the change itself, but
test/Frontend/rewrite-includes-messages.c fails without another
not-yet-committed fix.

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

10 years agodo not warn about unknown pragmas in modes that do not handle them (pr9537)
Lubos Lunak [Thu, 1 May 2014 12:54:03 +0000 (12:54 +0000)]
do not warn about unknown pragmas in modes that do not handle them (pr9537)

And refactor to have just one place in code that sets up the empty
pragma handlers.

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

10 years agowrite a line marker right before adding included file
Lubos Lunak [Thu, 1 May 2014 12:45:08 +0000 (12:45 +0000)]
write a line marker right before adding included file

Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.

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

10 years agoAvoid a potential race between stat() and open() of ASTFile
Ben Langmuir [Thu, 1 May 2014 03:33:36 +0000 (03:33 +0000)]
Avoid a potential race between stat() and open() of ASTFile

We need to open an ASTFile while checking its expected size and
modification time, or another clang instance can modify the file between
the stat() and the open().

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

10 years agoAdd support for __declspec(thread) under -fms-extensions
Reid Kleckner [Thu, 1 May 2014 03:16:47 +0000 (03:16 +0000)]
Add support for __declspec(thread) under -fms-extensions

Reviewers: rsmith

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

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

10 years agoMS ABI x64: Don't destroy arguments twice on x64
Reid Kleckner [Thu, 1 May 2014 03:07:18 +0000 (03:07 +0000)]
MS ABI x64: Don't destroy arguments twice on x64

We were destroying them in the callee, and then again in the caller.  We
should use an EH-only cleanup and disable it at the point of the call
for win64, even though we don't use inalloca.

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

10 years agoMake typo-correction of inheriting constructors work a bit better. Limit
Richard Smith [Thu, 1 May 2014 00:35:04 +0000 (00:35 +0000)]
Make typo-correction of inheriting constructors work a bit better. Limit
correction to direct base class members, and recover properly after we apply
such a correction.

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

10 years agoComment parsing: remove HTML attribute validation
Dmitri Gribenko [Wed, 30 Apr 2014 21:54:30 +0000 (21:54 +0000)]
Comment parsing: remove HTML attribute validation

Since the community says that a blacklist is not good enough, and I don't have
enough time now to implement a proper whitelist, let's just remove the
attribute validation.

But, nevertheless, we can still communicate in the generated XML if our parser
found an issue with the HTML.  But this bit is best-effort and is specifically
called out in the schema as such.

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

10 years agoPR19601: std::remove_if does not really remove the elements.
Arnaud A. de Grandmaison [Wed, 30 Apr 2014 19:59:22 +0000 (19:59 +0000)]
PR19601: std::remove_if does not really remove the elements.

It moves them at the end of the range instead, so an extra erase is needed.

It is strange that this code works without the erase. On the other hand, removing the remove_if will make fail some tests.

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

10 years agoFix typos in carries_dependency docs
Reid Kleckner [Wed, 30 Apr 2014 18:50:03 +0000 (18:50 +0000)]
Fix typos in carries_dependency docs

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

10 years agoSema: Implement DR477
David Majnemer [Wed, 30 Apr 2014 18:24:01 +0000 (18:24 +0000)]
Sema: Implement DR477

Summary: Friend declarations shouldn't mention explicit or virtual.

Reviewers: rsmith

Subscribers: cfe-commits

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

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

10 years agoWhen typo-correcting a member using declaration, don't exclude member templates.
Richard Smith [Wed, 30 Apr 2014 18:15:00 +0000 (18:15 +0000)]
When typo-correcting a member using declaration, don't exclude member templates.

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

10 years agoWhen typo-correcting a member using-declaration, only consider members of base classes.
Richard Smith [Wed, 30 Apr 2014 18:03:21 +0000 (18:03 +0000)]
When typo-correcting a member using-declaration, only consider members of base classes.

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

10 years agoFix crash if typo correction corrects a member using-declaration to a
Richard Smith [Wed, 30 Apr 2014 17:40:35 +0000 (17:40 +0000)]
Fix crash if typo correction corrects a member using-declaration to a
non-member declaration. Patch by Dinesh Dwivedi!

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

10 years ago__thread: Move constant init check to CheckCompleteVariableDeclaration
Reid Kleckner [Wed, 30 Apr 2014 17:10:18 +0000 (17:10 +0000)]
__thread: Move constant init check to CheckCompleteVariableDeclaration

We were emitting dynamic initializers for __thread variables if there
was no explicit initializer, as in this test case:

struct S { S(); };
__thread S s;

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

10 years ago-Wunused-parameter: Don't fire on defaulted or deleted functions
Reid Kleckner [Wed, 30 Apr 2014 16:31:28 +0000 (16:31 +0000)]
-Wunused-parameter: Don't fire on defaulted or deleted functions

Patch by Dinesh Dwivedi!

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

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

10 years agoAndroid uses -fpic for arm64 as well.
Logan Chien [Wed, 30 Apr 2014 12:18:12 +0000 (12:18 +0000)]
Android uses -fpic for arm64 as well.

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

10 years agoAdd a test for big-endian NEON on ARM64.
James Molloy [Wed, 30 Apr 2014 12:12:45 +0000 (12:12 +0000)]
Add a test for big-endian NEON on ARM64.

The enabled test #includes <arm_neon.h>, which is sufficient to test all
the code in r207624.

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

10 years ago[ARM64] Port remaining relevant AArch64 clang tests over to ARM64
Bradley Smith [Wed, 30 Apr 2014 10:52:05 +0000 (10:52 +0000)]
[ARM64] Port remaining relevant AArch64 clang tests over to ARM64

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

10 years ago[ARM64] Add arm64_be where it was accidentally missed from a bunch of if-conditions.
James Molloy [Wed, 30 Apr 2014 10:11:40 +0000 (10:11 +0000)]
[ARM64] Add arm64_be where it was accidentally missed from a bunch of if-conditions.

I think this is the last commit for ARM64 big endian in clang. This commit makes
arm_neon.h compile correctly.

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

10 years agoSimplify test. No functional change intended.
Andrea Di Biagio [Wed, 30 Apr 2014 10:04:58 +0000 (10:04 +0000)]
Simplify test. No functional change intended.

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

10 years agoAdd a triple to new test.
Nico Weber [Wed, 30 Apr 2014 04:54:42 +0000 (04:54 +0000)]
Add a triple to new test.

NULL is just 0 on Windows, so the Wsentinel part of the test doesn't pass there.

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

10 years agoLet stddef.h respect __need_{wchar_t, size_t, NULL, ptrdiff_t, wint_t}.
Nico Weber [Wed, 30 Apr 2014 04:35:09 +0000 (04:35 +0000)]
Let stddef.h respect __need_{wchar_t, size_t, NULL, ptrdiff_t, wint_t}.

glibc expects that stddef.h only defines a single thing if either of these
defines is set.  For example, before this change, a C file containing

  #include <stdlib.h>
  int ptrdiff_t = 0;

would compile with gcc but not with clang. Now it compiles with clang too.

This also fixes PR12997, where older versions of the Linux headers would define
NULL incorrectly, and glibc would define __need_NULL and expect stddef.h to
redefine NULL with the correct definition.

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

10 years agoDefer loading any pending update records until we've finished deserializing.
Richard Smith [Wed, 30 Apr 2014 02:24:17 +0000 (02:24 +0000)]
Defer loading any pending update records until we've finished deserializing.
This fixes a bug where an update record causes us to load an entity that refers
to an entity we've not finished loading yet, resulting in badness.

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

10 years agoDrop non-cfi assembly support from clang.
Rafael Espindola [Wed, 30 Apr 2014 02:22:09 +0000 (02:22 +0000)]
Drop non-cfi assembly support from clang.

After this patch clang will ignore -fdwarf2-cfi-asm and -ffno-dwarf2-cfi-asm and
always print assembly that uses cfi directives.

In llvm, MC itself supports cfi since the end of 2010 (support started
in r119972, is reported in the 2.9 release notes).

In binutils the support has been around for much longer. It looks like
support started to be added in May 2003. It is available in 2.15
(31-Aug-2011, 2.14 is from 12-Jun-2003).

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

10 years agoAdd test case for revision 207575 to verify that on Windows, clang doesn't
Andrea Di Biagio [Tue, 29 Apr 2014 20:19:13 +0000 (20:19 +0000)]
Add test case for revision 207575 to verify that on Windows, clang doesn't
crash with an assertion failure when 'nul' is passed in input.

Modified clang/test/lit.py to add feature 'system-windows' if
`platform.system()` returns 'Windows'.

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

10 years agoscanf analysis: handle scanlists that start with ^] (PR19559)
Hans Wennborg [Tue, 29 Apr 2014 19:42:27 +0000 (19:42 +0000)]
scanf analysis: handle scanlists that start with ^] (PR19559)

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

10 years ago[PCH/Modules] Don't tie TargetOptions::LinkerVersion to a module/PCH, it's a driver...
Argyrios Kyrtzidis [Tue, 29 Apr 2014 18:45:01 +0000 (18:45 +0000)]
[PCH/Modules] Don't tie TargetOptions::LinkerVersion to a module/PCH, it's a driver only thing and doesn't affect any language/preprocessor/etc. semantics.

rdar://16714526

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

10 years agoAndroid uses -fpic for aarch64.
Logan Chien [Tue, 29 Apr 2014 18:18:58 +0000 (18:18 +0000)]
Android uses -fpic for aarch64.

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

10 years ago[analyzer] Improve test from r207486.
Jordan Rose [Tue, 29 Apr 2014 17:08:17 +0000 (17:08 +0000)]
[analyzer] Improve test from r207486.

The constructor that comes right before a variable declaration in the CFG might
not be the initialization of that variable. Previously, we just checked that
the variable's initializer expression was different from the construction
expression, but forgot to see whether the variable had an initializer expression
at all.

Thanks for the prompting, David.

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

10 years ago[analyzer] Don't assert when combining using .* on a temporary.
Jordan Rose [Tue, 29 Apr 2014 17:08:12 +0000 (17:08 +0000)]
[analyzer] Don't assert when combining using .* on a temporary.

While we don't model pointer-to-member operators yet (neither .* nor ->*),
CallAndMessageChecker still checks to make sure the 'this' object is not
null or undefined first. However, it also expects that the object should
always have a valid MemRegion, something that's generally important elsewhere
in the analyzer as well. Ensure this is true ahead of time, just like we do
for member access.

PR19531

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

10 years agoReapply r207477 and r207479 without cyclic dependency
Ben Langmuir [Tue, 29 Apr 2014 16:25:26 +0000 (16:25 +0000)]
Reapply r207477 and r207479 without cyclic dependency

Fixed by moving ProcessWarningOptions from Frontend into Basic. All of
the dependencies for ProcessWarningOptions were already in Basic, so
this was a small change.

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

10 years agoObjective-C. Improve diagnosis of bridging types.
Fariborz Jahanian [Tue, 29 Apr 2014 16:12:56 +0000 (16:12 +0000)]
Objective-C. Improve diagnosis of bridging types.
// rdar://16737117

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

10 years agoclang-format: Don't bin-pack text-proto-formatted options.
Daniel Jasper [Tue, 29 Apr 2014 15:54:14 +0000 (15:54 +0000)]
clang-format: Don't bin-pack text-proto-formatted options.

Before:
  repeated double value = 1
      [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaaAAAAAAAAAA,
                              bbbbbbb: BBBB, bbbb: BBB}];

After:
  repeated double value = 1
      [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaaAAAAAAAAAA,
                              bbbbbbb: BBBB,
                              bbbb: BBB}];

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

10 years agoclang-format: Remove accidentally added debug output.
Daniel Jasper [Tue, 29 Apr 2014 15:35:28 +0000 (15:35 +0000)]
clang-format: Remove accidentally added debug output.

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

10 years agoclang-format: Allow single-line function in WebKit style.
Daniel Jasper [Tue, 29 Apr 2014 14:05:20 +0000 (14:05 +0000)]
clang-format: Allow single-line function in WebKit style.

Before:
  void f() {
      return; }

After:
  void f() { return; }

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

10 years agoAdd comments regarding isPIEDefault usage for r207520
Alexey Volkov [Tue, 29 Apr 2014 12:07:34 +0000 (12:07 +0000)]
Add comments regarding isPIEDefault usage for r207520

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

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

10 years agoPass -pie to linker when generating executable on Android
Alexey Volkov [Tue, 29 Apr 2014 10:25:20 +0000 (10:25 +0000)]
Pass -pie to linker when generating executable on Android
This fixes problem with LTO on Android.

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

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

10 years agoAST: Fix visibility calculation for VarTemplateSpecializationDecl
David Majnemer [Tue, 29 Apr 2014 07:32:26 +0000 (07:32 +0000)]
AST: Fix visibility calculation for VarTemplateSpecializationDecl

It is possible that a variable template specialization might not have a
VisibilityAttr attached to it while the template that it specializes
does, in fact, have one.

We should consider the template in such cases.

This fixes PR19597.

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

10 years agoRevert r207477 (and r207479), "Check -Werror options during module validation"
NAKAMURA Takumi [Tue, 29 Apr 2014 06:58:59 +0000 (06:58 +0000)]
Revert r207477 (and r207479), "Check -Werror options during module validation"

It tried to introduce cyclic dependencies. Serialization shouldn't depend on Frontend, since Frontend depends on Serialization.

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

10 years agoCodeGen: Reference temporaries inherit visibility
David Majnemer [Tue, 29 Apr 2014 06:18:53 +0000 (06:18 +0000)]
CodeGen: Reference temporaries inherit visibility

Reference temporaries inherited many properties from the variable that
they correspond to but visibility wasn't one of them.

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

10 years agoMake test independent of label. Thanks to Richard Smith for catching this!
Adrian Prantl [Tue, 29 Apr 2014 02:27:33 +0000 (02:27 +0000)]
Make test independent of label. Thanks to Richard Smith for catching this!

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

10 years agoRun this test through instnamer to stop it failing on non-asserts clang builds.
Richard Smith [Tue, 29 Apr 2014 02:18:35 +0000 (02:18 +0000)]
Run this test through instnamer to stop it failing on non-asserts clang builds.

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

10 years ago[analyzer] Don't crash when a construction is followed by an uninitialized variable.
Jordan Rose [Tue, 29 Apr 2014 01:56:12 +0000 (01:56 +0000)]
[analyzer] Don't crash when a construction is followed by an uninitialized variable.

This could happen due to unfortunate CFG coincidences.

PR19579

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

10 years agoscan-build: Don't use realpath when the user provides an explicit path.
Jordan Rose [Tue, 29 Apr 2014 01:37:19 +0000 (01:37 +0000)]
scan-build: Don't use realpath when the user provides an explicit path.

PR19583

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

10 years agoRevert r207482; I fail at reading IRC.
Nico Weber [Tue, 29 Apr 2014 01:25:49 +0000 (01:25 +0000)]
Revert r207482; I fail at reading IRC.

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

10 years agoLet stddef.h redefine NULL if __need_NULL is set, as needed by glibc, PR12997.
Nico Weber [Tue, 29 Apr 2014 01:19:21 +0000 (01:19 +0000)]
Let stddef.h redefine NULL if __need_NULL is set, as needed by glibc, PR12997.

See the bug and the cfe-commits thread "[patch] Let stddef.h redefine NULL if
__need_NULL is set" for discussion.

Fixes PR12997 and is similar to the __need_wint_t bits already in this file.

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

10 years agoDebug info: Improve line table for functions with cleanups an early exit
Adrian Prantl [Tue, 29 Apr 2014 01:07:59 +0000 (01:07 +0000)]
Debug info: Improve line table for functions with cleanups an early exit
and no return expr at the end of the function.
The "function has only simple returns" check in FinishFunction tests
whether the number of simple return exprs equals the number of return
exprs, but so far a fallthrough at the end of a function was not counted
as a return, which would result in cleanup code being associated with the
wrong source line.

rdar://problem/16733984.

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

10 years agoAdd missing triple to make -isysroot work
Ben Langmuir [Tue, 29 Apr 2014 01:04:34 +0000 (01:04 +0000)]
Add missing triple to make -isysroot work

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