]> granicus.if.org Git - clang/log
clang
10 years agoARM64: make sure HFAs on the stack get properly aligned.
Tim Northover [Fri, 18 Apr 2014 10:47:44 +0000 (10:47 +0000)]
ARM64: make sure HFAs on the stack get properly aligned.

Another AAPCS bug, part of PR19432.

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

10 years agoFix a -Wmicrosoft warning on an unrepresentable enum
Reid Kleckner [Fri, 18 Apr 2014 01:21:55 +0000 (01:21 +0000)]
Fix a -Wmicrosoft warning on an unrepresentable enum

0x80000000 isn't representable as an int, which is the default enum
type.

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

10 years agoBackendUtil: Pass through -mdisable-tail-calls
Duncan P. N. Exon Smith [Fri, 18 Apr 2014 01:05:25 +0000 (01:05 +0000)]
BackendUtil: Pass through -mdisable-tail-calls

The frontend option -fno-optimize-sibling-calls resolves to -cc1's
-mdisable-tail-calls, which is passed to the TargetMachine in the
backend.  PassManagerBuilder was adding the -tailcallelim pass anyway.

Use a new DisableTailCalls option in PassManagerBuilder to disable tail
calls harder.

Requires the matching commit in LLVM that adds DisableTailCalls.

<rdar://problem/16050591>

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

10 years agotest: Use llvm-profdata merge in Profile tests
Justin Bogner [Thu, 17 Apr 2014 22:49:06 +0000 (22:49 +0000)]
test: Use llvm-profdata merge in Profile tests

In preparation for using a binary format for instrumentation based
profiling, explicitly treat the test inputs as text and transform them
before running. This will allow us to leave the checked in files in
human readable format once the instrumentation format is binary.

No functional change.

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

10 years agoMS ABI: Don't append to vbtables that we shouldn't extend
Reid Kleckner [Thu, 17 Apr 2014 22:47:52 +0000 (22:47 +0000)]
MS ABI: Don't append to vbtables that we shouldn't extend

This was probably a benign bug, since nobody would look at the vbtable
slots that we were filling in.

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

10 years agoFollow-up to r206457 -- fix static adjustments for some subtle virtual inheritance...
Timur Iskhodzhanov [Thu, 17 Apr 2014 22:01:48 +0000 (22:01 +0000)]
Follow-up to r206457 -- fix static adjustments for some subtle virtual inheritance cases

Reviewed at http://reviews.llvm.org/D3410

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

10 years agoMaking some public members into private members. This also introduces a bit more...
Aaron Ballman [Thu, 17 Apr 2014 21:44:08 +0000 (21:44 +0000)]
Making some public members into private members. This also introduces a bit more const-correctness, and now uses some range-based for loops. No functional changes intended.

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

10 years agoFix comment.
Richard Smith [Thu, 17 Apr 2014 20:39:09 +0000 (20:39 +0000)]
Fix comment.

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

10 years agoAdd missing serialization code for one of the CXXRecordDecl definition flags.
Richard Smith [Thu, 17 Apr 2014 20:33:01 +0000 (20:33 +0000)]
Add missing serialization code for one of the CXXRecordDecl definition flags.

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

10 years agoNitpicky refactoring -- use of nullptr and auto, made a bit more const-correct. No...
Aaron Ballman [Thu, 17 Apr 2014 20:08:36 +0000 (20:08 +0000)]
Nitpicky refactoring -- use of nullptr and auto, made a bit more const-correct. No functional changes intended.

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

10 years agoRevised per Dmitri's comments. My first exposure to range-based for loops, thanks!
John Thompson [Thu, 17 Apr 2014 18:17:36 +0000 (18:17 +0000)]
Revised per Dmitri's comments. My first exposure to range-based for loops, thanks!

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

10 years agoclang-format.py: Don't omit the first two words from error messages.
Nico Weber [Thu, 17 Apr 2014 17:51:57 +0000 (17:51 +0000)]
clang-format.py: Don't omit the first two words from error messages.

This reverts r172072.  clang-format used to use DiagnosticEngine to output
errors: http://llvm.org/viewvc/llvm-project?view=revision&revision=172071. Now
it doesn't, so this code is obsolete.

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

10 years agoBug 18567: Fix constantexpr pointer casts with address spaces.
Matt Arsenault [Thu, 17 Apr 2014 17:45:37 +0000 (17:45 +0000)]
Bug 18567: Fix constantexpr pointer casts with address spaces.

Getting a pointer into a struct at a non-zero offset would try to
use the default address space.

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

10 years agoRevised per Dmitri's comments. My first exposure to range-based for loops, thanks!
John Thompson [Thu, 17 Apr 2014 17:06:13 +0000 (17:06 +0000)]
Revised per Dmitri's comments. My first exposure to range-based for loops, thanks!

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

10 years agoFix alignment of trailing block comments.
Alexander Kornienko [Thu, 17 Apr 2014 16:12:46 +0000 (16:12 +0000)]
Fix alignment of trailing block comments.

Summary:
This patch ensures that the lines of the block comments retain relative
column offsets. In order to do this WhitespaceManager::Changes representing
continuation of block comments keep a pointer on the change representing the
whitespace change before the block comment, and a relative column offset to this
change, so that the correct column can be reconstructed at the end of alignment
process.

Fixes http://llvm.org/PR19325

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D3408

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

10 years agoSince the object is new'ed in the enterCFG function, now deleting in the exitCFG...
Aaron Ballman [Thu, 17 Apr 2014 15:23:50 +0000 (15:23 +0000)]
Since the object is new'ed in the enterCFG function, now deleting in the exitCFG function instead of the destructor to ensure proper pairing. This allows reuse of the builder without creating a memory leak.

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

10 years agoFix Profile:cxx-lambda.cpp test for targets that do not generate zeroext
Keith Walker [Thu, 17 Apr 2014 13:04:53 +0000 (13:04 +0000)]
Fix Profile:cxx-lambda.cpp test for targets that do not generate zeroext

Change an expected match to allow for the fact that some targets
may not generated the zeroext operation.

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

10 years ago[ARM64] Fix __clear_cache - ensure it is predefined.
James Molloy [Thu, 17 Apr 2014 12:51:42 +0000 (12:51 +0000)]
[ARM64] Fix __clear_cache - ensure it is predefined.

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

10 years ago[ARM64] Add ARM64 RUN lines to a bunch of tests that had AARCH64 RUN lines.
James Molloy [Thu, 17 Apr 2014 12:51:36 +0000 (12:51 +0000)]
[ARM64] Add ARM64 RUN lines to a bunch of tests that had AARCH64 RUN lines.

This covers all tests in tests/Driver and tests/Preprocessor, but there are some
failing tests in test/Sema that need looking into.

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

10 years ago[ARM64] Teach Targets.cpp about Cortex-A53 and Cortex-A57, and enable more tests.
James Molloy [Thu, 17 Apr 2014 12:51:28 +0000 (12:51 +0000)]
[ARM64] Teach Targets.cpp about Cortex-A53 and Cortex-A57, and enable more tests.

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

10 years ago[ARM64] Plumb in big-endian - add arm64_be to the many switches where it was missing.
James Molloy [Thu, 17 Apr 2014 12:51:23 +0000 (12:51 +0000)]
[ARM64] Plumb in big-endian - add arm64_be to the many switches where it was missing.

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

10 years ago[ARM64] Default to the 'generic' CPU, unless -arch is present for backwards compatibi...
James Molloy [Thu, 17 Apr 2014 12:51:17 +0000 (12:51 +0000)]
[ARM64] Default to the 'generic' CPU, unless -arch is present for backwards compatibility.

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

10 years agoPreventing future MSVC 2012 surprises with SimpleArray by giving it an explicit move...
Aaron Ballman [Thu, 17 Apr 2014 12:50:54 +0000 (12:50 +0000)]
Preventing future MSVC 2012 surprises with SimpleArray by giving it an explicit move assignment operator.

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

10 years agoclang-format: Respect BinPackParameters in Cpp11BracedListStyle.
Daniel Jasper [Thu, 17 Apr 2014 11:32:02 +0000 (11:32 +0000)]
clang-format: Respect BinPackParameters in Cpp11BracedListStyle.

With BinPackParameters=false and Cpp11BracedListStyle=true (i.e. mostly
for Chromium):

Before:
  const Aaaaaa aaaaa = {aaaaa, bbbbb,  ccccc,  ddddd,  eeeee, ffffff,
                        ggggg, hhhhhh, iiiiii, jjjjjj, kkkkkk};

After:
  const Aaaaaa aaaaa = {aaaaa,
                        bbbbb,
                        ccccc,
                        ddddd,
                        eeeee,
                        ffffff,
                        ggggg,
                        hhhhhh,
                        iiiiii,
                        jjjjjj,
                        kkkkkk};

This fixes llvm.org/PR19359. I am not sure we'll want this in all cases
in the long run, but I'll guess we'll get feedback on that.

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

10 years agoFix PR19408 - Missing static this adjustment in a vtordisp thunk
Timur Iskhodzhanov [Thu, 17 Apr 2014 11:01:41 +0000 (11:01 +0000)]
Fix PR19408 - Missing static this adjustment in a vtordisp thunk

Also fix a few other vtordisp-related bugs.

Reviewed at http://reviews.llvm.org/D3400

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

10 years agoARM64: remove holes from *all* HFAs on the stack.
Tim Northover [Thu, 17 Apr 2014 10:20:38 +0000 (10:20 +0000)]
ARM64: remove holes from *all* HFAs on the stack.

My first attempt to make sure HFAs were contiguous was in the block dealing
with padding registers, which meant it only triggered on the first stack-based
HFA. This should extend it to the rest as well.

Another part of PR19432.

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

10 years agoSemaTemplate.cpp: Rework r206451. Removing an argument was really bad idea.
NAKAMURA Takumi [Thu, 17 Apr 2014 08:57:09 +0000 (08:57 +0000)]
SemaTemplate.cpp: Rework r206451. Removing an argument was really bad idea.

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

10 years agoSemaTemplate.cpp: Appease msvc to get rid of default argument in lambda definition.
NAKAMURA Takumi [Thu, 17 Apr 2014 08:42:31 +0000 (08:42 +0000)]
SemaTemplate.cpp: Appease msvc to get rid of default argument in lambda definition.

  clang\lib\Sema\SemaTemplate.cpp(1826) : error C2064: term does not evaluate to a function taking 1 arguments

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

10 years agoPR19340: If we see a declaration of a member of an unspecialized class template
Richard Smith [Thu, 17 Apr 2014 03:52:20 +0000 (03:52 +0000)]
PR19340: If we see a declaration of a member of an unspecialized class template
that looks like it might be an explicit specialization, don't recover as an
explicit specialization (bypassing the check that would reject that).

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

10 years agoWhen writing YAML in libclang, use yaml::escape instead of write_escaped
Ben Langmuir [Thu, 17 Apr 2014 03:31:02 +0000 (03:31 +0000)]
When writing YAML in libclang, use yaml::escape instead of write_escaped

The YAMLParser has its own escaped string representation, and does not
handle octal escape sequences. When writing the virtual file system to a
YAML file, use yaml::escape().

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

10 years agoRefactor all the checking for missing 'template<>'s when a declaration has a
Richard Smith [Thu, 17 Apr 2014 03:29:33 +0000 (03:29 +0000)]
Refactor all the checking for missing 'template<>'s when a declaration has a
template-id after its scope specifier into a single place.

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

10 years agoDon't emit an ExtWarn on declarations of variable template specializations;
Richard Smith [Thu, 17 Apr 2014 02:56:49 +0000 (02:56 +0000)]
Don't emit an ExtWarn on declarations of variable template specializations;
we'll already have issued the relevant diagnostic when we saw the declaration
of the primary template.

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

10 years ago[Parser] Remove "add -fmodules" from the "use of '@import' when modules are disabled...
Argyrios Kyrtzidis [Thu, 17 Apr 2014 02:32:52 +0000 (02:32 +0000)]
[Parser] Remove "add -fmodules" from the "use of '@import' when modules are disabled, add -fmodules" error.

We disable modules for C++, at which point this is confusing.
rdar://16641918

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

10 years agoAdding type info for f16c floating-point type. This is consistent with the
Yunzhong Gao [Thu, 17 Apr 2014 02:26:26 +0000 (02:26 +0000)]
Adding type info for f16c floating-point type. This is consistent with the
Itanium ABI in 2.9.2 Place of Emission.

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

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

10 years agoImplement [over.match.oper]p3 properly, by filtering the non-candidates out
Richard Smith [Thu, 17 Apr 2014 01:52:14 +0000 (01:52 +0000)]
Implement [over.match.oper]p3 properly, by filtering the non-candidates out
when building the candidate set, rather than trying to contort name lookup into
handling this.

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

10 years agoPR19452: Implement more of [over.match.oper]p3's restrictions on which non-member...
Richard Smith [Thu, 17 Apr 2014 01:12:17 +0000 (01:12 +0000)]
PR19452: Implement more of [over.match.oper]p3's restrictions on which non-member overloaded operators can be found when no operand is of class type. We used to fail to implement this rule if there was an operand of dependent type.

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

10 years agoFurther simplify r206430.
Adrian Prantl [Thu, 17 Apr 2014 01:04:01 +0000 (01:04 +0000)]
Further simplify r206430.

rdar://problem/16636569.

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

10 years agoRename lib/Headers/module.map to module.modulemap
Ben Langmuir [Thu, 17 Apr 2014 00:52:48 +0000 (00:52 +0000)]
Rename lib/Headers/module.map to module.modulemap

Don't install a file using the legacy spelling.

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

10 years agoDebug info: When collecting the parameters of C++ partial template
Adrian Prantl [Thu, 17 Apr 2014 00:30:48 +0000 (00:30 +0000)]
Debug info: When collecting the parameters of C++ partial template
specializations collect all arguments and not just the ones from the
class template partial specialization from which this class template
specialization was instantiated. The debug info does not represent the
partial specialization otherwise and so specialized parameters would
go missing.

rdar://problem/16636569.

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

10 years agoAttempting to unbreak the MSVC 2012 build a second time.
Aaron Ballman [Wed, 16 Apr 2014 21:32:23 +0000 (21:32 +0000)]
Attempting to unbreak the MSVC 2012 build a second time.

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

10 years agoAdded dump method for global module index.
John Thompson [Wed, 16 Apr 2014 21:03:41 +0000 (21:03 +0000)]
Added dump method for global module index.

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

10 years agoHandle -m32 for NetBSD/sparc64 correctly. Extend test case to also check
Joerg Sonnenberger [Wed, 16 Apr 2014 20:44:17 +0000 (20:44 +0000)]
Handle -m32 for NetBSD/sparc64 correctly. Extend test case to also check
ARM, MIPS and i386 ABIs.

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

10 years agoRevert "Move -fms-extensions predefined macros into InitPreprocessor"
Reid Kleckner [Wed, 16 Apr 2014 20:10:16 +0000 (20:10 +0000)]
Revert "Move -fms-extensions predefined macros into InitPreprocessor"

This reverts commit r206413.

This was proposed before, but it's not clear if this is really a good
idea:
http://reviews.llvm.org/D3034

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

10 years agoAttempting to unbreak the MSVC 2012 build.
Aaron Ballman [Wed, 16 Apr 2014 19:59:42 +0000 (19:59 +0000)]
Attempting to unbreak the MSVC 2012 build.

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

10 years agoMove -fms-extensions predefined macros into InitPreprocessor
Reid Kleckner [Wed, 16 Apr 2014 19:47:06 +0000 (19:47 +0000)]
Move -fms-extensions predefined macros into InitPreprocessor

If someone on Linux asks for -fms-extensions, there's no reason not to
define the feature test macros that MSVC defines.

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

10 years agoFix check failure on hexagon targets.
Diego Novillo [Wed, 16 Apr 2014 19:02:35 +0000 (19:02 +0000)]
Fix check failure on hexagon targets.

This test was failing because there is no assembler for hexagon-elf on
this buildbot:

http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/10470

Fixed by adding -S to the driver invocation.

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

10 years agoFix indentation, NFC.
Argyrios Kyrtzidis [Wed, 16 Apr 2014 18:45:32 +0000 (18:45 +0000)]
Fix indentation, NFC.

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

10 years ago[objc] -[NSObject init] is documented to not do anything, don't warn if subclasses...
Argyrios Kyrtzidis [Wed, 16 Apr 2014 18:32:51 +0000 (18:32 +0000)]
[objc] -[NSObject init] is documented to not do anything, don't warn if subclasses do not call [super init] on their initializers.

Part of rdar://16568441

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

10 years ago[objc] Consider new initializers inside @implementation when determining if the class
Argyrios Kyrtzidis [Wed, 16 Apr 2014 18:32:42 +0000 (18:32 +0000)]
[objc] Consider new initializers inside @implementation when determining if the class
introduces new initializers.

Part of rdar://16568441

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

10 years agoMore minor refactoring. Updated for const-correctness, moved another deleted function...
Aaron Ballman [Wed, 16 Apr 2014 17:44:02 +0000 (17:44 +0000)]
More minor refactoring. Updated for const-correctness, moved another deleted function to be private, 0 -> nullptr and some style corrections. No functional changes intended.

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

10 years agoMinor cleanups for deleted functions to ensure they're a bit more robustly "deleted".
Aaron Ballman [Wed, 16 Apr 2014 17:20:26 +0000 (17:20 +0000)]
Minor cleanups for deleted functions to ensure they're a bit more robustly "deleted".

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

10 years agoObjective-C rewriter. Use _WIN64 instead of __LLP64__
Fariborz Jahanian [Wed, 16 Apr 2014 17:03:06 +0000 (17:03 +0000)]
Objective-C rewriter. Use _WIN64 instead of __LLP64__
to conditinalize on 64bit length in a generated meta-data.
// rdar://16489050

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

10 years agoAdd support for optimization reports.
Diego Novillo [Wed, 16 Apr 2014 16:54:24 +0000 (16:54 +0000)]
Add support for optimization reports.

Summary:
This patch adds a new flag -Rpass=. The flag indicates the name
of the optimization pass that should emit remarks stating when it
made a transformation to the code.

This implements the design I proposed in:

https://docs.google.com/document/d/1FYUatSjZZO-zmFBxjOiuOzAy9mhHA8hqdvklZv68WuQ/edit?usp=sharing

Other changes:
- Add DiagnosticIDs::isRemark(). Use it in printDiagnosticOptions to
  print "-R" instead of "-W" in the diagnostic message.

- In BackendConsumer::OptimizationRemarkHandler, get a SourceLocation
  object out of the file name, line and column number. Use that location
  in the call to Diags.Report().

- When -Rpass is used without debug info a note is emitted alerting
  the user that they need to use -gline-tables-only -gcolumn-info to
  get this information.

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3226

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

10 years agoInstrProf: Calculate a better function hash
Duncan P. N. Exon Smith [Wed, 16 Apr 2014 16:03:27 +0000 (16:03 +0000)]
InstrProf: Calculate a better function hash

The function hash should change when control flow changes.  This patch
hashes the type of each AST node that affects counters, rather than just
counting how many there are.  These types are combined into a small
enumerator that currently has 16 values.

The new hash algorithm packs the enums for consecutively visited types
into a `uint64_t`.  In order to save space for new types, the types are
assumed to be 6-bit values (instead of 4-bit).  In order to minimize
overhead for functions with little control flow, the `uint64_t` is used
directly as a hash if it never fills up; if it does, it's passed through
an MD5 context.

<rdar://problem/16435801>

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

10 years ago[ARM64] Plumb in the -mfpu= flag.
James Molloy [Wed, 16 Apr 2014 15:33:56 +0000 (15:33 +0000)]
[ARM64] Plumb in the -mfpu= flag.

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

10 years ago[ARM64] Allow the disabling of NEON and crypto instructions. Update tests to pass...
James Molloy [Wed, 16 Apr 2014 15:33:48 +0000 (15:33 +0000)]
[ARM64] Allow the disabling of NEON and crypto instructions. Update tests to pass -target-feature +neon.

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

10 years ago[ARM64] Fix up predefines, including adding big endian support to Targets.cpp
James Molloy [Wed, 16 Apr 2014 15:06:20 +0000 (15:06 +0000)]
[ARM64] Fix up predefines, including adding big endian support to Targets.cpp

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

10 years agoMinor formatting cleanups -- no functional changes intended.
Aaron Ballman [Wed, 16 Apr 2014 13:16:19 +0000 (13:16 +0000)]
Minor formatting cleanups -- no functional changes intended.

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

10 years agoclang-format: Add special case to reduce indentaiton in streams.
Daniel Jasper [Wed, 16 Apr 2014 12:26:54 +0000 (12:26 +0000)]
clang-format: Add special case to reduce indentaiton in streams.

This is similar to how we treat assignments and seems to be generally
desirable.

Before:
  llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
                      aaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                      aaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
  llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

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

10 years agoAdding a move constructor (due to CopyOnWriteVector requiring move-only semantics...
Aaron Ballman [Wed, 16 Apr 2014 11:09:33 +0000 (11:09 +0000)]
Adding a move constructor (due to CopyOnWriteVector requiring move-only semantics) to appease MSVC.

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

10 years agoHopefully avoid a warning on some GCCs (but not all strangely,
Chandler Carruth [Wed, 16 Apr 2014 11:04:33 +0000 (11:04 +0000)]
Hopefully avoid a warning on some GCCs (but not all strangely,
preventing me from seeing it initially). GCC doesn't use the unused
attribute on members for anything, so while it works to suppress Clang's
warning for an unused private member, it adds a GCC warning for the
attribute. =/ Silence Clang's warning with a void cast in the
constructor instead which doesn't trigger any complaints from GCC.

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

10 years agoSema: Factor out argument range checks for builtin functions
Richard Sandiford [Wed, 16 Apr 2014 08:47:51 +0000 (08:47 +0000)]
Sema: Factor out argument range checks for builtin functions

No behavioural change intended.

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

10 years agoRe-enable several builtins in non-gnu modes.
Evgeniy Stepanov [Wed, 16 Apr 2014 08:06:33 +0000 (08:06 +0000)]
Re-enable several builtins in non-gnu modes.

This is a partial revert of 183015.
By not recognizing things like _setjmp we lose (returns_twice) attribute on
them, which leads to incorrect code generation.
Fixes PR16138.

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

10 years ago-Wunreachable-code: refine recognition of unreachable "sigil" to cope with implicit...
Ted Kremenek [Wed, 16 Apr 2014 07:26:09 +0000 (07:26 +0000)]
-Wunreachable-code: refine recognition of unreachable "sigil" to cope with implicit casts in C++.

Fixes <rdar://problem/16631033>.

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

10 years agoLex: Fix __has_feature(cxx_exceptions) for objective C++
Justin Bogner [Wed, 16 Apr 2014 02:56:48 +0000 (02:56 +0000)]
Lex: Fix __has_feature(cxx_exceptions) for objective C++

At one point, -fexceptions was a synonym for -fcxx-exceptions. While
the driver options still enables cxx-exceptions by default, the cc1
flag is purely about exception tables and this doesn't account for
objective C exceptions. Because of this, checking for the
cxx_exceptions feature in objective C++ often gives the wrong answer.

The cxx_exceptions feature should be based on the -fcxx-exceptions cc1
flag, not -fexceptions. Furthermore, at some point the tests were
changed to use cc1 even though they were testing the driver behaviour.
We're better off testing both the driver and cc1 here.

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

10 years agothreadSafety::SExprBuilder::BlockInfo: Non-static member initializer is unavailable...
NAKAMURA Takumi [Wed, 16 Apr 2014 01:22:22 +0000 (01:22 +0000)]
threadSafety::SExprBuilder::BlockInfo: Non-static member initializer is unavailable. Use default constructor instead.

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

10 years agoReformat.
NAKAMURA Takumi [Wed, 16 Apr 2014 01:22:07 +0000 (01:22 +0000)]
Reformat.

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

10 years agothreadSafety::CopyOnWriteVector: Use LLVM_DELETED_FUNCTION here due to missing functi...
NAKAMURA Takumi [Wed, 16 Apr 2014 01:21:53 +0000 (01:21 +0000)]
threadSafety::CopyOnWriteVector: Use LLVM_DELETED_FUNCTION here due to missing functionality of msc17.

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

10 years agoFixed problem with exclude header. The exclude header argument needs to be relative...
John Thompson [Wed, 16 Apr 2014 00:07:06 +0000 (00:07 +0000)]
Fixed problem with exclude header. The exclude header argument needs to be relative to the module.map file.

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

10 years agoFix build after r206338
Duncan P. N. Exon Smith [Tue, 15 Apr 2014 23:58:06 +0000 (23:58 +0000)]
Fix build after r206338

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

10 years agoMake -Wabsolute-value C++-aware.
Richard Trieu [Tue, 15 Apr 2014 23:47:53 +0000 (23:47 +0000)]
Make -Wabsolute-value C++-aware.

Warn on std::abs() with unsigned argument.
Suggest std::abs as replacement for the C absolute value functions.
Suggest C++ headers if the specific std::abs overload is not found.

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

10 years agoFormat.cpp: Don't use initializer list.
NAKAMURA Takumi [Tue, 15 Apr 2014 23:29:04 +0000 (23:29 +0000)]
Format.cpp: Don't use initializer list.

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

10 years agoThread Safety Analysis: rewrite SSA pass to use the new SExpr and CFG
DeLesley Hutchins [Tue, 15 Apr 2014 23:23:19 +0000 (23:23 +0000)]
Thread Safety Analysis: rewrite SSA pass to use the new SExpr and CFG
traversal system.  The new pass is still undergoing testing; no change in
functionality.

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

10 years ago[Allocator] Make the ContentCache object actually carry the 8-byte
Chandler Carruth [Tue, 15 Apr 2014 21:34:12 +0000 (21:34 +0000)]
[Allocator] Make the ContentCache object actually carry the 8-byte
alignment constraint rather than using the allocator function's over
alignment "feature". This was the only use of the "feature" which I plan
to remove next. =] Attaching the alignment to the type seems cleaner and
more principled anyways.

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

10 years agoCodeGen: Emit warnings for out of date profile data during PGO
Justin Bogner [Tue, 15 Apr 2014 21:22:35 +0000 (21:22 +0000)]
CodeGen: Emit warnings for out of date profile data during PGO

This adds a warning that triggers when profile data doesn't match for
the source that's being compiled with -fprofile-instr-use=. This fires
only once per translation unit, as warning on every mismatched
function would be quite noisy.

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

10 years agoCodeGen: Remove a comment that isn't in the right place
Justin Bogner [Tue, 15 Apr 2014 20:37:41 +0000 (20:37 +0000)]
CodeGen: Remove a comment that isn't in the right place

This comment also appears elsewhere where it actually makes sense, and
it's just confusing here.

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

10 years agoMove comment back to being next to the thing it's describing.
Richard Smith [Tue, 15 Apr 2014 20:27:15 +0000 (20:27 +0000)]
Move comment back to being next to the thing it's describing.

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

10 years agoAST: Respect alignment attributes on typedef'd arrays
Justin Bogner [Tue, 15 Apr 2014 20:12:41 +0000 (20:12 +0000)]
AST: Respect alignment attributes on typedef'd arrays

When instantiating an array that has an alignment attribute on it, we
were looking through the array type and only considering the element
type for the resulting alignment. We need to make sure we take the
array's requirements into account too.

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

10 years ago[ARM64] Update tests to reflect the change of the default CPU in llvm.
Quentin Colombet [Tue, 15 Apr 2014 19:09:58 +0000 (19:09 +0000)]
[ARM64] Update tests to reflect the change of the default CPU in llvm.

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

10 years agoHonour -ivfsoverlay in ASTUnit to match clang
Ben Langmuir [Tue, 15 Apr 2014 18:16:25 +0000 (18:16 +0000)]
Honour -ivfsoverlay in ASTUnit to match clang

This allows code indexing, etc. to use the VFS in the same way as the
compiler.

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

10 years agoReplace push_back()s by initializer list for shorter and cleaner code.
Eli Bendersky [Tue, 15 Apr 2014 17:19:26 +0000 (17:19 +0000)]
Replace push_back()s by initializer list for shorter and cleaner code.

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

10 years agoAdd test case for r206302
Eli Bendersky [Tue, 15 Apr 2014 16:57:53 +0000 (16:57 +0000)]
Add test case for r206302

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

10 years agoAdd support for CUDA __launch_bounds__ attribute to CodeGen.
Eli Bendersky [Tue, 15 Apr 2014 16:57:05 +0000 (16:57 +0000)]
Add support for CUDA __launch_bounds__ attribute to CodeGen.

Sema does have a CUDALaunchBoundsAttr, but CodeGen was doing nothing with it.
This change translates CUDALaunchBoundsAttr to maxntidx and minctasm
metadata, which NVPTX then translates to the correct PTX directives.

Patch by Manjunath Kudlur.

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

10 years agoverify-di: Call debug info verifier from clang
Duncan P. N. Exon Smith [Tue, 15 Apr 2014 16:27:43 +0000 (16:27 +0000)]
verify-di: Call debug info verifier from clang

This is paired with a patch to LLVM that creates a separate pass for
verifying debug info.

<rdar://problem/15500563>

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

10 years agoFix a comment to match the implementation
Alp Toker [Tue, 15 Apr 2014 16:24:50 +0000 (16:24 +0000)]
Fix a comment to match the implementation

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

10 years agoARM64: track alignment padding registers on AAPCS targets
Tim Northover [Tue, 15 Apr 2014 14:55:11 +0000 (14:55 +0000)]
ARM64: track alignment padding registers on AAPCS targets

This implements clause C.8 of the AAPCS in the front-end, so that Clang
accurately knows when the registers run out and it has to insert padding before
the stack objects begin.

PR19432.

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

10 years agoFix assertion when breaking string literals with tab characters.
Alexander Kornienko [Tue, 15 Apr 2014 14:52:43 +0000 (14:52 +0000)]
Fix assertion when breaking string literals with tab characters.

Summary: Fixes http://llvm.org/PR19368

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D3379

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

10 years agoMark clang/test/Index/pch-with-errors.c as XFAIL:mingw for now. Investigating.
NAKAMURA Takumi [Tue, 15 Apr 2014 14:44:55 +0000 (14:44 +0000)]
Mark clang/test/Index/pch-with-errors.c as XFAIL:mingw for now. Investigating.

This has been failing since r206202.

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

10 years agoAllow address space qualifiers on OpenCL array parameters
Fraser Cormack [Tue, 15 Apr 2014 11:38:29 +0000 (11:38 +0000)]
Allow address space qualifiers on OpenCL array parameters

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

10 years agoPR19178 __is_constructible returns true for abstract types.
Nikola Smiljanic [Tue, 15 Apr 2014 11:30:15 +0000 (11:30 +0000)]
PR19178 __is_constructible returns true for abstract types.

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

10 years agoclang-format: Understand proto text format without commas.
Daniel Jasper [Tue, 15 Apr 2014 09:54:30 +0000 (09:54 +0000)]
clang-format: Understand proto text format without commas.

Also removed spaces before colons as they don't seem to be used
frequently.

Before:
optional int32 b = 2
    [(foo_options) = {aaaaaaaaaaaaaaaaaaa : 123 bbbbbbbbbbbbbbbbbbbbbbbb :
                          "baz"}];

After:
optional int32 b = 2 [(foo_options) = {aaaaaaaaaaaaaaaaaaa: 123,
                                       bbbbbbbbbbbbbbbbbbbbbbbb:"baz"}];

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

10 years agox
Daniel Jasper [Tue, 15 Apr 2014 09:54:24 +0000 (09:54 +0000)]
x

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

10 years agoTest commit: minor formatting
Fraser Cormack [Tue, 15 Apr 2014 08:59:09 +0000 (08:59 +0000)]
Test commit: minor formatting

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

10 years agoclang-format: Basic support for C++1y.
Daniel Jasper [Tue, 15 Apr 2014 08:49:21 +0000 (08:49 +0000)]
clang-format: Basic support for C++1y.

Before:
  int bi{1 '000' 000};
After:
  int bi{1'000'000};

This fixes llvm.org/PR19342.

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

10 years agoclang-format: Early cut-off for inlining nested blocks.
Daniel Jasper [Tue, 15 Apr 2014 08:28:06 +0000 (08:28 +0000)]
clang-format: Early cut-off for inlining nested blocks.

Specifically, for a nested block or lambda, don't try to put the single
statement body inline, if it exceeds the column limit.

This should not change any observable behavior (as those would never
have led to the 'best' solution), but significantly speeds up formatting
time.

This fixes llvm.org/PR18761. Formatting time goes down from ~100s to a
few ms.

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

10 years agoclang-format: Cache results of formatting nested blocks.
Daniel Jasper [Tue, 15 Apr 2014 08:13:47 +0000 (08:13 +0000)]
clang-format: Cache results of formatting nested blocks.

This somewhat improves the performance problem reported in
llvm.org/PR18761. No other behavior changes intended.

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

10 years agoAST: Elaborated type specifier mangling occurs before nested-name
David Majnemer [Tue, 15 Apr 2014 05:51:25 +0000 (05:51 +0000)]
AST: Elaborated type specifier mangling occurs before nested-name

The Ts/Tu/Te manglings should occur before the nested-name's N.

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

10 years agoPartial revert of r206229, to get the build bots green again.
Aaron Ballman [Tue, 15 Apr 2014 01:19:35 +0000 (01:19 +0000)]
Partial revert of r206229, to get the build bots green again.

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

10 years agoFix typo from r206232
Richard Trieu [Tue, 15 Apr 2014 01:06:38 +0000 (01:06 +0000)]
Fix typo from r206232

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

10 years agoFix a bad interaction between -Wtautological-overlap-compare and delayed
Richard Trieu [Tue, 15 Apr 2014 00:57:50 +0000 (00:57 +0000)]
Fix a bad interaction between -Wtautological-overlap-compare and delayed
diagnostics which caused delayed diagnostics on dead paths to be emitted.

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