]> granicus.if.org Git - clang/log
clang
10 years agoCodeGen: Cleanup visibility in RTTIBuilder
Duncan P. N. Exon Smith [Mon, 5 May 2014 17:38:39 +0000 (17:38 +0000)]
CodeGen: Cleanup visibility in RTTIBuilder

No functionality change.

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

10 years agoAdd -Wmodule-build to make it easy to see when modules are (re)built
Ben Langmuir [Mon, 5 May 2014 16:58:47 +0000 (16:58 +0000)]
Add -Wmodule-build to make it easy to see when modules are (re)built

Warning is default ignore, and not in -Wall.

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

10 years agoclang-format: Understand functions with decltype return type.
Daniel Jasper [Mon, 5 May 2014 13:48:09 +0000 (13:48 +0000)]
clang-format: Understand functions with decltype return type.

Before:
  decltype(long_name_forcing_break)
      f() {}

After:
  decltype(long_name_forcing_break)
  f() {}

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

10 years agoAdded some heuristics to identify c style casting
Dinesh Dwivedi [Mon, 5 May 2014 13:14:35 +0000 (13:14 +0000)]
Added some heuristics to identify c style casting

Before:
void f() { my_int a = (my_int) * b; }
void f() { return P ? (my_int) * P : (my_int)0; }

After:
void f() { my_int a = (my_int)*b; }
void f() { return P ? (my_int)*P : (my_int)0; }

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

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

10 years agoDriver: Recognize CentOS 6 as RHEL 6.
Benjamin Kramer [Mon, 5 May 2014 12:39:32 +0000 (12:39 +0000)]
Driver: Recognize CentOS 6 as RHEL 6.

Patch by Dimitry Andric!

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

10 years agoStringRefize and take out an old FIXME
Alp Toker [Mon, 5 May 2014 12:38:48 +0000 (12:38 +0000)]
StringRefize and take out an old FIXME

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

10 years agoclang-format: Improve understanding of decltype.
Daniel Jasper [Mon, 5 May 2014 12:36:29 +0000 (12:36 +0000)]
clang-format: Improve understanding of decltype.

Before:
  SomeFunction([](decltype(x), A * a) {});

After:
  SomeFunction([](decltype(x), A *a) {});

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

10 years agoFix bug in clang-format while merging short function
Dinesh Dwivedi [Mon, 5 May 2014 11:36:35 +0000 (11:36 +0000)]
Fix bug in clang-format while merging short function

Before:
    #ifdef _DEBUG
    int foo( int i = 0 )
    #else
    int foo( int i = 5 )
    #endif { return i; }

After:
    #ifdef _DEBUG
    int foo( int i = 0 )
    #else
    int foo( int i = 5 )
    #endif
    {
     return i;
    }

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

10 years agoFix crash when resolving branch conditions for temporary destructor condition blocks.
Manuel Klimek [Mon, 5 May 2014 09:58:03 +0000 (09:58 +0000)]
Fix crash when resolving branch conditions for temporary destructor condition blocks.

Document and simplify ResolveCondition.

1. Introduce a temporary special case for temporary desctructors when resolving
the branch condition - in an upcoming patch, alexmc will change temporary
destructor conditions to not run through this logic, in which case we can remove
this (marked as FIXME); this currently fixes a crash.

2. Simplify ResolveCondition; while documenting the function, I noticed that it
always returns the last statement - either that statement is the condition
itself (in which case the condition was returned anyway), or the rightmost
leaf is returned; for correctness, the rightmost leaf must be evaluated anyway
(which the CFG does in the last statement), thus we can just return the last
statement in that case, too. Added an assert to verify the invariant.

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

10 years agoSimplify getARMCPUForMArch() and make it more consistent
Christian Pirker [Mon, 5 May 2014 08:48:18 +0000 (08:48 +0000)]
Simplify getARMCPUForMArch() and make it more consistent

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

10 years agoclang-format: Fix import statements with ColumnLimit: 0
Daniel Jasper [Mon, 5 May 2014 08:08:07 +0000 (08:08 +0000)]
clang-format: Fix import statements with ColumnLimit: 0

These used to interact badly with AlwaysBreakBeforeMultilineStrings.

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

10 years agoUpdate lit.cfg to support the clang-interpreter test from r207950
Alp Toker [Mon, 5 May 2014 06:42:07 +0000 (06:42 +0000)]
Update lit.cfg to support the clang-interpreter test from r207950

Performs behind-the-scenes RUN line substitution similarly to what's done with
clang-check and clang-format to ensure the executable is found.

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

10 years agoAdd speculative clang-interpreter test
Alp Toker [Mon, 5 May 2014 06:22:21 +0000 (06:22 +0000)]
Add speculative clang-interpreter test

Let's see how far this gets on the build servers. The application requires
native JIT and uses the C standard library, but hopefully we can get this
tested on at least some configurations.

Taking a lead from the clang-format tests, we'll just expect the executable to
get picked up from the build output path for now.

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

10 years agoMake module self-import an error
Ben Langmuir [Mon, 5 May 2014 05:31:33 +0000 (05:31 +0000)]
Make module self-import an error

Ideally, importing Foo.a from Foo.b would "do the right thing", but
until it does, this patch makes it an error rather than allow it to
silently be ignored.

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

10 years agocindex-dump.py: fix the --show-ids description string
Alp Toker [Mon, 5 May 2014 04:42:26 +0000 (04:42 +0000)]
cindex-dump.py: fix the --show-ids description string

It looks like this was botched back in r94936.

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

10 years agoFix cindex-dump.py --show-ids
Alp Toker [Mon, 5 May 2014 04:39:18 +0000 (04:39 +0000)]
Fix cindex-dump.py --show-ids

This option flag was incorrectly expecting an argument:

$ cindex-dump.py --show-ids test.cpp
cindex-dump.py: error: invalid number arguments

With this change the feature correctly gets enabled by --show-ids.

No tests.

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

10 years agoSplit out header integration tests
Alp Toker [Sun, 4 May 2014 13:00:32 +0000 (13:00 +0000)]
Split out header integration tests

These are somewhat arbitrary tests that check if "thing goes fine" when
processing various platform-specific headers.

Also move warn-sysheader.cpp to Misc where the other diagnostics infrastructure
tests live.

File moves only.

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

10 years agoSpeculative fix to unbreak the buildbots that fail with compiler errors.
Argyrios Kyrtzidis [Sun, 4 May 2014 05:27:24 +0000 (05:27 +0000)]
Speculative fix to unbreak the buildbots that fail with compiler errors.

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

10 years agoFix a use-after-free bug I recently introduced in lookupModuleFile
Ben Langmuir [Sun, 4 May 2014 05:20:54 +0000 (05:20 +0000)]
Fix a use-after-free bug I recently introduced in lookupModuleFile

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

10 years ago[Modules] Add the resource-dir to the module hash.
Argyrios Kyrtzidis [Sun, 4 May 2014 04:35:31 +0000 (04:35 +0000)]
[Modules] Add the resource-dir to the module hash.

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

10 years agoCodeGen: complete ARM ACLE hint 8.4 support
Saleem Abdulrasool [Sun, 4 May 2014 02:52:25 +0000 (02:52 +0000)]
CodeGen: complete ARM ACLE hint 8.4 support

Add support for the remaining hints from the ACLE.  Although __dbg is listed as
a hint, it is handled different, so it is not covered by this change.

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

10 years agoTarget: fix wchar_t definition for Windows on ARM
Saleem Abdulrasool [Sun, 4 May 2014 01:56:04 +0000 (01:56 +0000)]
Target: fix wchar_t definition for Windows on ARM

Windows on ARM uses AAPCS, but has some deviations.  wchar_t remains an unsigned
short on WoA, which does not conform to AAPCS.  Ensure that wchar_t is defined
accordingly.

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

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