]> granicus.if.org Git - clang/log
clang
10 years agoMinor cleanups, no behavior change.
Nico Weber [Sat, 3 May 2014 22:07:35 +0000 (22:07 +0000)]
Minor cleanups, no behavior change.

* Fixes a "return" that was indented at the same level as the continuation
  from the previous line
* Wrap several lines to 80 columns
* Remove an if check that was always true
* Move a variable declaration slightly closer to its use

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

10 years agoWrap a few lines at 80 columns, change a confusing indent. No behavior change.
Nico Weber [Sat, 3 May 2014 21:57:40 +0000 (21:57 +0000)]
Wrap a few lines at 80 columns, change a confusing indent. No behavior change.

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

10 years agoReplace one-element SmallVectors inside DenseMaps with TinyPtrVector.
Benjamin Kramer [Sat, 3 May 2014 18:44:26 +0000 (18:44 +0000)]
Replace one-element SmallVectors inside DenseMaps with TinyPtrVector.

That's exactly what TinyPtrVector was designed for. No functionality change.

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

10 years agoRemove unused diagnostics.
Benjamin Kramer [Sat, 3 May 2014 12:32:50 +0000 (12:32 +0000)]
Remove unused diagnostics.

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

10 years ago[leaks] The PDFileEntry nodes in the FilesMade FoldingSet contain
Chandler Carruth [Sat, 3 May 2014 10:39:05 +0000 (10:39 +0000)]
[leaks] The PDFileEntry nodes in the FilesMade FoldingSet contain
a std::vector that allocates on the heap. As a consequence, we have to
run all of their destructors when tearing down the set, not just
deallocate the memory blobs.

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

10 years ago[leaks] Re-shuffle code such that we don't create a basic block for
Chandler Carruth [Sat, 3 May 2014 09:16:57 +0000 (09:16 +0000)]
[leaks] Re-shuffle code such that we don't create a basic block for
initializing an array unless we need it. Specifically, position the
creation of a new basic block after we've checked all of the cases that
bypass the need for it.

Fixes another leak in test/CodeGen* found by LSan.

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

10 years ago[leaks] Don't leak the fake arguments we synthesize for LLVM option
Chandler Carruth [Sat, 3 May 2014 08:39:35 +0000 (08:39 +0000)]
[leaks] Don't leak the fake arguments we synthesize for LLVM option
parsing.

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

10 years agoEliminate ASTContext's DelayInitialization flag
Alp Toker [Sat, 3 May 2014 03:46:04 +0000 (03:46 +0000)]
Eliminate ASTContext's DelayInitialization flag

Having various possible states of initialization following construction doesn't
add value here.

Also remove the unused size_reserve parameter.

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

10 years agoFix a bunch of mislayered clang/Lex includes from Sema
Alp Toker [Sat, 3 May 2014 03:45:55 +0000 (03:45 +0000)]
Fix a bunch of mislayered clang/Lex includes from Sema

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

10 years agoUpdate Preprocessor::Initialize() documentation following r207825
Alp Toker [Sat, 3 May 2014 03:45:43 +0000 (03:45 +0000)]
Update Preprocessor::Initialize() documentation following r207825

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

10 years agoCodeGen: Cleanup ABIArgInfo
David Majnemer [Sat, 3 May 2014 02:23:35 +0000 (02:23 +0000)]
CodeGen: Cleanup ABIArgInfo

ABIArgInfo was pretty hard to grok, it had data members with names like
"BoolData0" and "UIntData".  Constructors with lots of bool arguments.
Reusing the same data member for multiple purposes.

It was also wasteful with memory, this new layout is 8 bytes smaller.

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

10 years agoRevert "Sema: Implement DR244"
David Majnemer [Sat, 3 May 2014 02:22:11 +0000 (02:22 +0000)]
Revert "Sema: Implement DR244"

This was accidentally committed.

This reverts commit r207892.

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

10 years agoSema: Implement DR244
David Majnemer [Sat, 3 May 2014 02:18:46 +0000 (02:18 +0000)]
Sema: Implement DR244

Naming the destructor using a typedef-name for the class-name is
well-formed.

This fixes PR19620.

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

10 years agoErr, wait. Those new test functions in r207890 need CHECK lines.
Nick Lewycky [Sat, 3 May 2014 01:19:39 +0000 (01:19 +0000)]
Err, wait. Those new test functions in r207890 need CHECK lines.

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

10 years agoRewrite NRVO determination. Track NRVO candidates on the parser Scope and apply the...
Nick Lewycky [Sat, 3 May 2014 00:41:18 +0000 (00:41 +0000)]
Rewrite NRVO determination. Track NRVO candidates on the parser Scope and apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal.

Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith.

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

10 years agoMS ABI x64: Pass small objects with dtors but no copy ctors directly
Reid Kleckner [Sat, 3 May 2014 00:33:28 +0000 (00:33 +0000)]
MS ABI x64: Pass small objects with dtors but no copy ctors directly

Passing objects directly (in registers or memory) creates a second copy
of the object in the callee.  The callee always destroys its copy, but
we also have to destroy any temporary created in the caller.  In other
words, copy elision of these kinds of objects is impossible.

Objects larger than 8 bytes with non-trivial dtors and trivial copy
ctors are still passed indirectly, and we can still elide copies of
them.

Fixes PR19640.

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

10 years ago[leaks] Fix a leak of a basic block when we successfully fold a switch
Chandler Carruth [Sat, 3 May 2014 00:14:49 +0000 (00:14 +0000)]
[leaks] Fix a leak of a basic block when we successfully fold a switch
condition to a constant and emit only the relevant statement. In that
case, we were previously creating the epilog jump destination, a cleanup
scope, and emitting any condition variable into it. Instead, we can emit
the condition variable (if we have one) into the cleanup scope used for
the entire folded case sequence. We avoid creating a jump dest, a basic
block, and an extra cleanup scope. Win!

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

10 years agoFix PR 19630, don't crash when file ends with whitespace.
Richard Trieu [Fri, 2 May 2014 23:40:32 +0000 (23:40 +0000)]
Fix PR 19630, don't crash when file ends with whitespace.

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

10 years ago[leaks] Parse the schema file every time we try to verify the XML. Yes,
Chandler Carruth [Fri, 2 May 2014 23:30:59 +0000 (23:30 +0000)]
[leaks] Parse the schema file every time we try to verify the XML. Yes,
this is wasteful, blah blah, but this is a test utility only. It turns
out that without doing this, libxml2 will always leak a bunch of the XML
data, and that is causing failures with LSan. This is also quite a bit
simpler and I don't think it is slow enough to really be a show stopper.
If someone yells about the runtime of c-index-test, we can do other
things to try to mitigate it, but the current strategy wasn't working
well.

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

10 years agoFix clang-cl Driver leak
Hans Wennborg [Fri, 2 May 2014 22:55:30 +0000 (22:55 +0000)]
Fix clang-cl Driver leak

We were synthesizing new arguments from e.g. '/Tcfile.c' arguments,
but didn't handle ownership correctly.

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

10 years agoclang-c: Fix a typo
Justin Bogner [Fri, 2 May 2014 22:37:02 +0000 (22:37 +0000)]
clang-c: Fix a typo

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

10 years ago[sanitizers] Propagate the sanitizer options through to the lit context.
Chandler Carruth [Fri, 2 May 2014 21:46:39 +0000 (21:46 +0000)]
[sanitizers] Propagate the sanitizer options through to the lit context.
This makes it *really* easy to debug leaks FYI:

ASAN_OPTIONS=detect_leaks=1 ./bin/llvm-lit -v <path to test>

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

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