]> granicus.if.org Git - clang/log
clang
9 years agodocs: Document optimizations in control flow integrity design doc.
Peter Collingbourne [Wed, 25 Feb 2015 03:35:03 +0000 (03:35 +0000)]
docs: Document optimizations in control flow integrity design doc.

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

9 years agoRevert "Wrap clang module files in a Mach-O, ELF, or COFF container."
Adrian Prantl [Wed, 25 Feb 2015 02:44:04 +0000 (02:44 +0000)]
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."

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

9 years agoRevert "Add a missing target requirement."
Adrian Prantl [Wed, 25 Feb 2015 02:43:38 +0000 (02:43 +0000)]
Revert "Add a missing target requirement."

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

9 years agoFix bots failing on an explicit triple
Reid Kleckner [Wed, 25 Feb 2015 02:32:00 +0000 (02:32 +0000)]
Fix bots failing on an explicit triple

Why do we need a registered target for this?

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

9 years agoDon't crash on missing '{' after __except or __finally, PR22687.
Nico Weber [Wed, 25 Feb 2015 02:22:06 +0000 (02:22 +0000)]
Don't crash on missing '{' after __except or __finally, PR22687.

Also add some general test/Parser coverage for SEH blocks.

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

9 years agoReland r230314 "Fix codegen for virtual methods that are (re-) exported from multiple...
Reid Kleckner [Wed, 25 Feb 2015 02:19:56 +0000 (02:19 +0000)]
Reland r230314 "Fix codegen for virtual methods that are (re-) exported from multiple modules."

This reverts the revert from commit r230406.

The changes in r230445 and r230446 make the test pass on Windows now.

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

9 years agoMS ABI: Add triple to test relying on key functions
Reid Kleckner [Wed, 25 Feb 2015 02:16:15 +0000 (02:16 +0000)]
MS ABI: Add triple to test relying on key functions

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

9 years agoMS ABI: Try to respect external AST source record layouts
Reid Kleckner [Wed, 25 Feb 2015 02:16:09 +0000 (02:16 +0000)]
MS ABI: Try to respect external AST source record layouts

Covered by existing tests in test/CodeGen/override-layout.c and
test/CodeGenCXX/override-layout.cpp. Seriously, they found real bugs in
my code. :)

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

9 years agoAdd missing MD canonicalization to MS vtable builder
Reid Kleckner [Wed, 25 Feb 2015 02:16:02 +0000 (02:16 +0000)]
Add missing MD canonicalization to MS vtable builder

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

9 years agoAdd a missing target requirement.
Adrian Prantl [Wed, 25 Feb 2015 01:52:05 +0000 (01:52 +0000)]
Add a missing target requirement.

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

9 years agoRemove slow and apparently pointless updating of all identifiers at the start
Richard Smith [Wed, 25 Feb 2015 01:45:32 +0000 (01:45 +0000)]
Remove slow and apparently pointless updating of all identifiers at the start
of writing out an AST file.

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

9 years agoFold ParseSEHTryBlockCommon() into its only caller. No behavior change.
Nico Weber [Wed, 25 Feb 2015 01:43:27 +0000 (01:43 +0000)]
Fold ParseSEHTryBlockCommon() into its only caller. No behavior change.

ParseCXXTryBlockCommon() makes sense because it has two callers due to
function try blocks.  There are no SEH function try blocks.

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

9 years agoWrap clang module files in a Mach-O, ELF, or COFF container.
Adrian Prantl [Wed, 25 Feb 2015 01:31:45 +0000 (01:31 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

This reapplies r230044 with a fixed configure+make build and updated
dependencies and testcase requirements. Over the last iteration this
version adds
- missing target requirements for testcases that specify an x86 triple,
- a missing clangCodeGen.a dependency to libClang.a in the make build.

rdar://problem/19104245

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

9 years agoMake RedeclarableResult's ownership-transferring constructor be a move
Richard Smith [Wed, 25 Feb 2015 01:11:29 +0000 (01:11 +0000)]
Make RedeclarableResult's ownership-transferring constructor be a move
constructor.

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

9 years ago[modules] Fix a bug that would result in a build with P paths through a module
Richard Smith [Wed, 25 Feb 2015 00:56:02 +0000 (00:56 +0000)]
[modules] Fix a bug that would result in a build with P paths through a module
graph with M modules to take O(P) time, not just O(M) time, when using explicit
module builds.

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

9 years agoRevert r230314, "Fix codegen for virtual methods that are (re-) exported from multipl...
NAKAMURA Takumi [Wed, 25 Feb 2015 00:18:22 +0000 (00:18 +0000)]
Revert r230314, "Fix codegen for virtual methods that are (re-) exported from multiple modules."

It crashes for targeting (i686|x86_64)-win32.

  clang: clang/lib/AST/VTableBuilder.cpp:142: {anonymous}::FinalOverriders::OverriderInfo {anonymous}::FinalOverriders::getOverrider(const clang::CXXMethodDecl*, clang::CharUnits) const: Assertion `OverridersMap.count(std::make_pair(MD, BaseOffset)) && "Did not find overrider!"' failed.

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

9 years agoclang-format: Change location of stashed token
Jacques Pienaar [Tue, 24 Feb 2015 23:23:24 +0000 (23:23 +0000)]
clang-format: Change location of stashed token

Commit of patch in http://reviews.llvm.org/D7871

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

9 years agoInstrProf: Simplify a couple of tests after r230383
Justin Bogner [Tue, 24 Feb 2015 21:49:28 +0000 (21:49 +0000)]
InstrProf: Simplify a couple of tests after r230383

Most of the checks in these two tests were actually testing the
behaviour of the instrprof LLVM pass. Now that we're testing that
specifically in LLVM's test suite, it's better if we only test the
frontend's behaviour here.

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

9 years agoCUDA: Add option to allow host device functions to call host functions
Jacques Pienaar [Tue, 24 Feb 2015 21:45:33 +0000 (21:45 +0000)]
CUDA: Add option to allow host device functions to call host functions

Commiting code from review http://reviews.llvm.org/D7841

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

9 years agoPR22673 again: diagnose use of the used decl, not the found decl. This is also
Richard Smith [Tue, 24 Feb 2015 21:44:43 +0000 (21:44 +0000)]
PR22673 again: diagnose use of the used decl, not the found decl. This is also
wrong (DiagnoseUseOfDecl should take both), but it's more consistent with what
we do in other places.

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

9 years agoPR22673: Don't forget to check a constructor for deletedness when we use it to
Richard Smith [Tue, 24 Feb 2015 21:16:19 +0000 (21:16 +0000)]
PR22673: Don't forget to check a constructor for deletedness when we use it to
implicitly construct a temporary in a reference binding.

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

9 years agoAdd test that we reject invocations of deleted constructors. One of these
Richard Smith [Tue, 24 Feb 2015 20:41:36 +0000 (20:41 +0000)]
Add test that we reject invocations of deleted constructors. One of these
constructs is not rejected by should be; that's PR22673.

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

9 years agoMS extensions: Properly diagnose address of MS property decl
Reid Kleckner [Tue, 24 Feb 2015 20:29:40 +0000 (20:29 +0000)]
MS extensions: Properly diagnose address of MS property decl

Summary: Fixes PR22671.

Reviewers: rsmith

Subscribers: cfe-commits

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

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

9 years agoARM: Simplify PCS handling.
Tim Northover [Tue, 24 Feb 2015 17:22:40 +0000 (17:22 +0000)]
ARM: Simplify PCS handling.

The backend should now be able to handle all AAPCS rules based on argument
type, which means Clang no longer has to duplicate the register-counting logic
and the CodeGen can be significantly simplified.

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

9 years agoCommit patch for PR19649. Set the correct sign of wide character for literals based...
Michael Wong [Tue, 24 Feb 2015 13:34:20 +0000 (13:34 +0000)]
Commit patch for PR19649. Set the correct sign of wide character for literals based on underlying type of wchar_t.
Reviewed:
http://reviews.llvm.org/D7559
Patch by Rachel Craig; Test cases by Hubert Tong.

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

9 years ago[OPENMP] Update codegen for 'omp flush' directive.
Alexey Bataev [Tue, 24 Feb 2015 12:55:09 +0000 (12:55 +0000)]
[OPENMP] Update codegen for 'omp flush' directive.
__kmpc_omp_flush() runtime library now has only one argument and is not a vararg
anymore. This update makes the codegen compatible with these changes.

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

9 years ago[WinX86_64 ABI] Treat C99 _Complex as a struct
Michael Kuperstein [Tue, 24 Feb 2015 09:35:58 +0000 (09:35 +0000)]
[WinX86_64 ABI] Treat C99 _Complex as a struct

MSVC does not support C99 _Complex.
ICC, however, does support it on windows x86_64, and treats it, for purposes of parameter passing, as equivalent to a struct containing two fields (for the real and imaginary part).

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

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

9 years agoFix codegen for virtual methods that are (re-) exported from multiple modules.
Manuel Klimek [Tue, 24 Feb 2015 09:06:28 +0000 (09:06 +0000)]
Fix codegen for virtual methods that are (re-) exported from multiple modules.

Fixes multiple crashes where a non-canonical decl would be used as key
in a lookup.

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

9 years agoRevert "Wrap clang module files in a Mach-O, ELF, or COFF container."
Adrian Prantl [Tue, 24 Feb 2015 05:14:17 +0000 (05:14 +0000)]
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."

This reverts commit r230305.
Off to fix another round of missing dependencies on various platforms.

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

9 years agoDon't load Framework module.map files when searching subdirectories
Ben Langmuir [Tue, 24 Feb 2015 04:58:15 +0000 (04:58 +0000)]
Don't load Framework module.map files when searching subdirectories

This would cause frameworks to have spurious "redefinition" errors if
they had both a (legacy) "module.map" and a (new) "module.modulemap" file and we
happened to do a sub-directory search in that directory using a
non-framework include path (e.g. -Ifoo/ -Ffoo/).  For migration
purposes it's very handy that the compiler will prefer the new spelling
of the filename and not look at the old one if it doesn't need to.

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

9 years agoWrap clang module files in a Mach-O, ELF, or COFF container.
Adrian Prantl [Tue, 24 Feb 2015 04:25:59 +0000 (04:25 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

This reapplies r230044 with a fixed configure+make build and updated
dependencies. Take 3.

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

9 years agoInstrProf: Make sure counts in lambdas don't escape to the parent scope
Justin Bogner [Tue, 24 Feb 2015 04:13:56 +0000 (04:13 +0000)]
InstrProf: Make sure counts in lambdas don't escape to the parent scope

When generating coverage maps, we were traversing the body as if it
were part of the parent function, but this doesn't make sense since
we're currently counting lambdas as separate functions.

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

9 years ago[modules] Properly check whether a declaration is std::initializer_list. This
Richard Smith [Tue, 24 Feb 2015 03:30:14 +0000 (03:30 +0000)]
[modules] Properly check whether a declaration is std::initializer_list. This
bug is not actually modules-specific, but it's a little tricky to tickle it
outside of modules builds, so submitting with the reduced testcase I have.

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

9 years ago[modules] Ensure we've imported all declarations of a template before
Richard Smith [Tue, 24 Feb 2015 02:44:23 +0000 (02:44 +0000)]
[modules] Ensure we've imported all declarations of a template before
attempting to lazily deserialize its specializations; otherwise, there might be
pending specializations that we don't know about yet.

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

9 years agoRefactor *TemplateDecl::addSpecialization to reduce duplication and add some
Richard Smith [Tue, 24 Feb 2015 01:23:23 +0000 (01:23 +0000)]
Refactor *TemplateDecl::addSpecialization to reduce duplication and add some
more asserts.

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

9 years agoCodeGenModule::EmitVTableBitSetEntries: Add check for identical bit set entries.
Peter Collingbourne [Tue, 24 Feb 2015 01:12:53 +0000 (01:12 +0000)]
CodeGenModule::EmitVTableBitSetEntries: Add check for identical bit set entries.

No two elements of this array should be the same, but the standard library
may pass the same element as both arguments to this function.

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

9 years agoRestore the libc++ definition of max_align_t on Apple platforms
Dmitri Gribenko [Tue, 24 Feb 2015 01:06:22 +0000 (01:06 +0000)]
Restore the libc++ definition of max_align_t on Apple platforms

Clang has introduced ::max_align_t in stddef.h in r201729, but libc++ was
already defining std::max_align_t on Darwin because there was none in the
global namespace.  After that Clang commit though, libc++ started defining
std::max_align_t to be a typedef for ::max_align_t, which has a different
definition.  This changed the ABI.  This commit restores the previous
definition.

rdar://19919394 rdar://18557982

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

9 years agoRevert "Improve declaration / expression disambiguation around ptr-operators, and...
Justin Bogner [Mon, 23 Feb 2015 22:36:28 +0000 (22:36 +0000)]
Revert "Improve declaration / expression disambiguation around ptr-operators, and use"

This seems to break mixing function-style and c-style casts, and is
breaking bootstrapping llvm.

This reverts r230261.

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

9 years agoFix copy-paste errors in the test
Dmitri Gribenko [Mon, 23 Feb 2015 22:08:10 +0000 (22:08 +0000)]
Fix copy-paste errors in the test

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

9 years agoImprove declaration / expression disambiguation around ptr-operators, and use
Richard Smith [Mon, 23 Feb 2015 21:16:05 +0000 (21:16 +0000)]
Improve declaration / expression disambiguation around ptr-operators, and use
the presence of an abstract declarator with a ptr-operator as proof that a
construct cannot parse as an expression to improve diagnostics along error
recovery paths.

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

9 years agoOnly lower __builtin_setjmp / __builtin_longjmp to
Joerg Sonnenberger [Mon, 23 Feb 2015 20:23:47 +0000 (20:23 +0000)]
Only lower __builtin_setjmp / __builtin_longjmp to
llvm.eh.sjlj.setjmp / llvm.eh.sjlj.longjmp, if the backend is known to
support them outside the Exception Handling context. The default
handling in LLVM codegen doesn't work and will create incorrect code.
The ARM backend on the other hand will assert if the intrinsics are
used.

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

9 years agoCFI: Improve design doc with larger virtual tables and asm examples.
Peter Collingbourne [Mon, 23 Feb 2015 20:22:17 +0000 (20:22 +0000)]
CFI: Improve design doc with larger virtual tables and asm examples.

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

9 years agoFixed typo.
Zoran Jovanovic [Mon, 23 Feb 2015 20:20:49 +0000 (20:20 +0000)]
Fixed typo.

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

9 years agoInstrProf: Run clang-format to fix some strange indentation (NFC)
Justin Bogner [Mon, 23 Feb 2015 19:27:00 +0000 (19:27 +0000)]
InstrProf: Run clang-format to fix some strange indentation (NFC)

Somehow this file ended up with a strange hybrid of the old "indent
inside a namespace" style and the new "don't", giving us a wonderful
two-space indent starting halfway through a namespace. Fix it.

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

9 years ago-fms-extensions: Bump the default _MSC_VER from 1700 to 1800, aka VS2013
Reid Kleckner [Mon, 23 Feb 2015 19:25:48 +0000 (19:25 +0000)]
-fms-extensions: Bump the default _MSC_VER from 1700 to 1800, aka VS2013

VS 2013 is the minimum supported version, so it's reasonable for Clang
to simulate this by default. This also simplifies the clang-cl
self-host, since we have the 18.00 version check.

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

9 years ago[TSan][Clang][MIPS] Enabled thread option for MIPS64 platform
Mohit K. Bhakkad [Mon, 23 Feb 2015 09:32:35 +0000 (09:32 +0000)]
[TSan][Clang][MIPS] Enabled thread option for MIPS64 platform

Reviewers: kcc, samsonov, petarj, eugenis

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

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

9 years agoAdd C11 *_DECIMAL_DIG.
Ed Schouten [Mon, 23 Feb 2015 09:12:31 +0000 (09:12 +0000)]
Add C11 *_DECIMAL_DIG.

Before C11 there was only the DECIMAL_DIG definition. As of C11, we now
have one definition per floating point type (e.g. DBL_DECIMAL_DIG).
Change the existing code to define the new versions. To remain backward
compatible, define __DECIMAL_DIG__ as __LDBL_DECIMAL_DIG__.

Also update the tests. It seems that some of the existing test vectors
were incorrect. Change all tests for __DECIMAL_DIG__ to expect
__LDBL_DECIMAL_DIG__. Add tests for *_DECIMAL_DIG for FreeBSD/amd64, as
I happen to have such a system laying around. I've validated that the
values are in sync with <float.h>.

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

9 years agoRemove comment addressed by d0k in r229327.
Nico Weber [Mon, 23 Feb 2015 02:23:19 +0000 (02:23 +0000)]
Remove comment addressed by d0k in r229327.

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

9 years agoRelax the requirement on sized deallocation a bit: Default on unsized delete if sized...
Larisse Voufo [Sun, 22 Feb 2015 06:36:53 +0000 (06:36 +0000)]
Relax the requirement on sized deallocation a bit: Default on unsized delete if sized delete is not provided in global scope, and -fdefine-sized-deallocation option is disabled.

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

9 years agoFix typo.
Larisse Voufo [Sun, 22 Feb 2015 06:36:49 +0000 (06:36 +0000)]
Fix typo.

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

9 years agoMove -fdefine-sized-deallocation and -fno-sized-deallocation options from driver...
Larisse Voufo [Sun, 22 Feb 2015 06:36:46 +0000 (06:36 +0000)]
Move -fdefine-sized-deallocation and -fno-sized-deallocation options from driver into CC1 for now.

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

9 years agoRemove two unused methods. No behavior change.
Nico Weber [Sun, 22 Feb 2015 00:27:32 +0000 (00:27 +0000)]
Remove two unused methods.  No behavior change.

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

9 years agoCleanup: remove artificial division between lookup results and const lookup
Richard Smith [Sat, 21 Feb 2015 02:45:19 +0000 (02:45 +0000)]
Cleanup: remove artificial division between lookup results and const lookup
results. No-one was ever modifying a lookup result, and it would not be
reasonable to do so.

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

9 years agoRevert r167816 and replace it with a proper fix for the issue: do not
Richard Smith [Sat, 21 Feb 2015 02:31:57 +0000 (02:31 +0000)]
Revert r167816 and replace it with a proper fix for the issue: do not
invalidate lookup_iterators and lookup_results for some name within a
DeclContext if the lookup results for a *different* name change.

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

9 years agoImprove diagnostic when failing to synthesize implicit member due to dllexport (PR22591)
Hans Wennborg [Sat, 21 Feb 2015 01:07:24 +0000 (01:07 +0000)]
Improve diagnostic when failing to synthesize implicit member due to dllexport (PR22591)

This is only a problem in C++03 mode targeting MS ABI (MinGW doesn't
export inline methods, and C++11 marks these methods implicitly
deleted).

Since targeting the MS ABI in pre-C++11 mode is a rare configuration,
this will probably not get fixed, but we can at least have a better
error message.

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

9 years agoFix typo.
Larisse Voufo [Sat, 21 Feb 2015 01:05:29 +0000 (01:05 +0000)]
Fix typo.

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

9 years agoMove -fdefine-sized-deallocation and -fno-sized-deallocation options from driver...
Larisse Voufo [Sat, 21 Feb 2015 01:03:48 +0000 (01:03 +0000)]
Move -fdefine-sized-deallocation and -fno-sized-deallocation options from driver into CC1 for now.

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

9 years ago[Objective-C]. Provide a new formatting kind, "os_trace" which
Fariborz Jahanian [Sat, 21 Feb 2015 00:45:58 +0000 (00:45 +0000)]
[Objective-C]. Provide a new formatting kind, "os_trace" which
can take a "const char*" format but supports standard printf
and CF/NS types . rdar://19904147

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

9 years agoRevert "Wrap clang module files in a Mach-O, ELF, or COFF container."
Adrian Prantl [Sat, 21 Feb 2015 00:29:14 +0000 (00:29 +0000)]
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."

This reverts commit 230099.

The Linux configure+make build variant still needs some work.

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

9 years agoconfigure+make: Rearange clangCodeGen to come before clangAST.
Adrian Prantl [Sat, 21 Feb 2015 00:15:40 +0000 (00:15 +0000)]
configure+make: Rearange clangCodeGen to come before clangAST.
Follow-up to r230089.

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

9 years agoconfigure+make: Add ipo to the dependencies of libclang.
Adrian Prantl [Sat, 21 Feb 2015 00:04:15 +0000 (00:04 +0000)]
configure+make: Add ipo to the dependencies of libclang.
Follow-up to r230089.

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

9 years ago[Mips] Support mips32r3, mips32r5, mips64r3, mips64r5 MIPS ISA names
Simon Atanasyan [Fri, 20 Feb 2015 23:37:40 +0000 (23:37 +0000)]
[Mips] Support mips32r3, mips32r5, mips64r3, mips64r5 MIPS ISA names

The patch teaches the clang's driver to understand new MIPS ISA names,
pass appropriate options to the assembler, defines corresponding macros etc

http://reviews.llvm.org/D7737

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

9 years agoWrap clang module files in a Mach-O, ELF, or COFF container.
Adrian Prantl [Fri, 20 Feb 2015 23:34:26 +0000 (23:34 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

This reapplies r230044 with a fixed configure+make build and updated
dependencies. Take 2.

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

9 years agoRevert "Wrap clang module files in a Mach-O, ELF, or COFF container."
Adrian Prantl [Fri, 20 Feb 2015 22:12:19 +0000 (22:12 +0000)]
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."

This reverts commit r230067.

Investigating another batch of problems found by the bots.

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

9 years agoWrap clang module files in a Mach-O, ELF, or COFF container.
Adrian Prantl [Fri, 20 Feb 2015 21:53:12 +0000 (21:53 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

This reapplies r230044 with a fixed configure+make build and updated
dependencies.

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

9 years agoDon't try to rebuild modules on umbrella header mismatch
Ben Langmuir [Fri, 20 Feb 2015 21:46:39 +0000 (21:46 +0000)]
Don't try to rebuild modules on umbrella header mismatch

There are two issues here:
1) It's too late to rebuild at this point, because we won't go through
removeModules and when we try to reload the new .pcm we'll get the old
one instead.  We might be able to call removeModules after an OutOfDate
here, but I'm not yet confident that it is always safe to do so.

2) In practice, this check fails spuriously when the umbrella header
appears to change because of a VFS change that means it maps to a
different copy of the same file.  Because of this, we just skip the
check for now.

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

9 years agoFix merging of << at end of input.
Jacques Pienaar [Fri, 20 Feb 2015 21:09:01 +0000 (21:09 +0000)]
Fix merging of << at end of input.

Commit of review http://reviews.llvm.org/D7766

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

9 years agoImplement Control Flow Integrity for virtual calls.
Peter Collingbourne [Fri, 20 Feb 2015 20:30:56 +0000 (20:30 +0000)]
Implement Control Flow Integrity for virtual calls.

This patch introduces the -fsanitize=cfi-vptr flag, which enables a control
flow integrity scheme that checks that virtual calls take place using a vptr of
the correct dynamic type. More details in the new docs/ControlFlowIntegrity.rst
file.

It also introduces the -fsanitize=cfi flag, which is currently a synonym for
-fsanitize=cfi-vptr, but will eventually cover all CFI checks implemented
in Clang.

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

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

9 years agoRevert "Wrap clang module files in a Mach-O, ELF, or COFF container."
Adrian Prantl [Fri, 20 Feb 2015 20:00:27 +0000 (20:00 +0000)]
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."

This reverts commit r230044 while dealing with buildbot breakage.

Conflicts:
test/Modules/module_container.m

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

9 years agoRequire a target for this testacse.
Adrian Prantl [Fri, 20 Feb 2015 19:52:43 +0000 (19:52 +0000)]
Require a target for this testacse.

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

9 years agoWrap clang module files in a Mach-O, ELF, or COFF container.
Adrian Prantl [Fri, 20 Feb 2015 19:44:52 +0000 (19:44 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

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

9 years agoAdd -funique-section-names and -fno-unique-section-names options.
Rafael Espindola [Fri, 20 Feb 2015 18:08:57 +0000 (18:08 +0000)]
Add -funique-section-names and -fno-unique-section-names options.

For now -funique-section-names is the default, so no change in default behavior.

The total .o size in a build of llvm and clang goes from 241687775 to 230649031
bytes if -fno-unique-section-names is used.

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

9 years agoclang-format: [js] Support template strings.
Daniel Jasper [Fri, 20 Feb 2015 13:47:38 +0000 (13:47 +0000)]
clang-format: [js] Support template strings.

Merge template strings (marked by backticks ``).
Do not format any contents of template strings.

Patch by Martin Probst. Thank you.

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

9 years agoAdd -fno-implicit-modules.
Manuel Klimek [Fri, 20 Feb 2015 11:44:41 +0000 (11:44 +0000)]
Add -fno-implicit-modules.

If this flag is set, we error out when a module build is required. This is
useful in environments where all required modules are passed via -fmodule-file.

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

9 years agoPR22435: Correctly implement tiebreaker for reference ordering in function
Richard Smith [Fri, 20 Feb 2015 04:45:22 +0000 (04:45 +0000)]
PR22435: Correctly implement tiebreaker for reference ordering in function
template partial ordering rules. This rule applies per pair of types being
compared, not per pair of function templates being compared.

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

9 years agoAdd -fno-sized-deallocation option for completeness of fix in r229241 in documentatio...
Larisse Voufo [Fri, 20 Feb 2015 02:07:22 +0000 (02:07 +0000)]
Add -fno-sized-deallocation option for completeness of fix in r229241 in documentation in r229818.

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

9 years ago[analyzer] RetainCountChecker: don't try to track ivars known to be nil.
Jordan Rose [Thu, 19 Feb 2015 23:57:04 +0000 (23:57 +0000)]
[analyzer] RetainCountChecker: don't try to track ivars known to be nil.

We expect in general that any nil value has no retain count information
associated with it; violating this results in unexpected state unification
/later/ when we decide to throw the information away. Unexpectedly caching
out can lead to an assertion failure or crash.

rdar://problem/19862648

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

9 years agoDon't dllexport inline methods when targeting MinGW.
Hans Wennborg [Thu, 19 Feb 2015 22:39:24 +0000 (22:39 +0000)]
Don't dllexport inline methods when targeting MinGW.

MinGW neither imports nor exports such methods. The import bit was
committed earlier, in r221154, and this takes care of the export part.

This also partially fixes PR22591.

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

9 years agoAdd support for analyzing FreeBSD kernel printf extensions.
Dimitry Andric [Thu, 19 Feb 2015 22:32:33 +0000 (22:32 +0000)]
Add support for analyzing FreeBSD kernel printf extensions.

This adds a new __freebsd_kprintf__ format string type, which enables
checking when used in __attribute__((format(...))) attributes.  It can
check the FreeBSD kernel specific %b, %D, %r and %y specifiers, using
existing diagnostic messages.  Also adds test cases for all these
specifiers.

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

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

9 years ago[Objective-C Sema]. Don't warn about use of
Fariborz Jahanian [Thu, 19 Feb 2015 21:52:41 +0000 (21:52 +0000)]
[Objective-C Sema]. Don't warn about use of
property accessors in @selector not implemented
because they will be auto-synthesized. rdar://16607480

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

9 years agoItanium ABI: Pack expansions change the arity of expressions to unknown
David Majnemer [Thu, 19 Feb 2015 21:41:48 +0000 (21:41 +0000)]
Itanium ABI: Pack expansions change the arity of expressions to unknown

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

9 years agoAvoid using a COMDAT for sized delete on MachO
Reid Kleckner [Thu, 19 Feb 2015 21:13:45 +0000 (21:13 +0000)]
Avoid using a COMDAT for sized delete on MachO

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

9 years agoPut the implicit weak sized deallocation funciton in C++14 in a comdat
Reid Kleckner [Thu, 19 Feb 2015 21:01:34 +0000 (21:01 +0000)]
Put the implicit weak sized deallocation funciton in C++14 in a comdat

Fixes PR22635.

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

9 years agoRevert "Mangle the IsSystem bit into the .pcm file name"
Ben Langmuir [Thu, 19 Feb 2015 20:23:22 +0000 (20:23 +0000)]
Revert "Mangle the IsSystem bit into the .pcm file name"

While I investigate some possible problems with this patch.

This reverts commit r228966

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

9 years ago[PCH/Modules] Check that the specific module cache path the PCH was built with, is...
Argyrios Kyrtzidis [Thu, 19 Feb 2015 20:12:20 +0000 (20:12 +0000)]
[PCH/Modules] Check that the specific module cache path the PCH was built with, is the same as
the one in the current compiler invocation. If they differ reject the PCH.

This protects against the badness occurring from getting modules loaded from different module caches (see crashes).

rdar://19889860

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

9 years agoCodeGen: Weak reference temporaries belong in a COMDAT
David Majnemer [Thu, 19 Feb 2015 19:35:18 +0000 (19:35 +0000)]
CodeGen: Weak reference temporaries belong in a COMDAT

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

9 years agoCodeGen: static constexpr data members should have a linkonce_odr init
David Majnemer [Thu, 19 Feb 2015 19:25:17 +0000 (19:25 +0000)]
CodeGen: static constexpr data members should have a linkonce_odr init

Classes can be defined in multiple translation units.  This means that
the static constexpr data members should have identical initializers in
all translation units.  Implement this by giving the reference temporary
linkonce_odr linkage.

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

9 years agoMake the _mm256_insert_epi64 definition more consistent
Filipe Cabecinhas [Thu, 19 Feb 2015 19:00:33 +0000 (19:00 +0000)]
Make the _mm256_insert_epi64 definition more consistent

Use long long for the epi64 argument, like the other intrinsics.
NFC since this is only defined in 64-bit mode, not in 32-bit.

Fix suggested by H. J. Lu!

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

9 years agoclang-format: [js] Support ES6 module exports.
Daniel Jasper [Thu, 19 Feb 2015 16:14:18 +0000 (16:14 +0000)]
clang-format: [js] Support ES6 module exports.

Patch by Martin Probst, thank you!

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

9 years agoclang-format: [js] Support ES6 module imports.
Daniel Jasper [Thu, 19 Feb 2015 16:07:32 +0000 (16:07 +0000)]
clang-format: [js] Support ES6 module imports.

Patch by Martin Probst.

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

9 years agoclang-format: [js] Do not fall through for JS structural elements.
Daniel Jasper [Thu, 19 Feb 2015 16:03:16 +0000 (16:03 +0000)]
clang-format: [js] Do not fall through for JS structural elements.

Patch by Martin Probst. Thank you.

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

9 years agoFIX PR 18432, default args, friends & late-parsed members.
Nathan Sidwell [Thu, 19 Feb 2015 14:03:22 +0000 (14:03 +0000)]
FIX PR 18432, default args, friends & late-parsed members.

Sema::MergeCXXFunctionDecl: propagate hasUnparsedDefaultArg to new decl.

Parser::HandleMemberFunctionDeclDelays: check hasUnparsedDefaultArg
flag.

Parser::ParseLexedMethodDeclaration: handle inherited unparsed default
arg case.

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

9 years ago[analyzer] Different handling of alloca().
Anton Yartsev [Thu, 19 Feb 2015 13:36:20 +0000 (13:36 +0000)]
[analyzer] Different handling of alloca().

+ separate bug report for "Free alloca()" error to be able to customize checkers responsible for this error.
+ Muted "Free alloca()" error for NewDelete checker that is not responsible for c-allocated memory, turned on for unix.MismatchedDeallocator checker.
+ RefState for alloca() - to be able to detect usage of zero-allocated memory by upcoming ZeroAllocDereference checker.
+ AF_Alloca family to handle alloca() consistently - keep proper family in RefState, handle 'alloca' by getCheckIfTracked() facility, etc.
+ extra tests.

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

9 years agoSpelling correction.
Yaron Keren [Thu, 19 Feb 2015 11:21:11 +0000 (11:21 +0000)]
Spelling correction.

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

9 years agoMake -fmodules-decluse and -fmodules-strict-decluse compatible options.
Daniel Jasper [Thu, 19 Feb 2015 09:56:13 +0000 (09:56 +0000)]
Make -fmodules-decluse and -fmodules-strict-decluse compatible options.

They don't actually influence the result of the module compilation.

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

9 years agoMark DR1940 as implemented
David Majnemer [Thu, 19 Feb 2015 07:29:01 +0000 (07:29 +0000)]
Mark DR1940 as implemented

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

9 years agoMark DR1947 as implemented
David Majnemer [Thu, 19 Feb 2015 07:28:57 +0000 (07:28 +0000)]
Mark DR1947 as implemented

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

9 years agoMark DR1948 as implemented
David Majnemer [Thu, 19 Feb 2015 07:28:55 +0000 (07:28 +0000)]
Mark DR1948 as implemented

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

9 years agoMark DR1994 as a duplicate of DR529
David Majnemer [Thu, 19 Feb 2015 07:28:52 +0000 (07:28 +0000)]
Mark DR1994 as a duplicate of DR529

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

9 years agoMark DR1968 as implemented
David Majnemer [Thu, 19 Feb 2015 07:28:49 +0000 (07:28 +0000)]
Mark DR1968 as implemented

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