Commit Graph

62771 Commits

Author SHA1 Message Date
Peter Collingbourne 0446e7cfae CodeGen: Mark functions used in vtables as unnamed_addr.
This marks virtual function declarations, as well as runtime library functions
__cxa_pure_virtual, __cxa_deleted_virtual and _purecall, as unnamed_addr. This
will allow us to correctly form relative references to them from vtables in
the relative vtable ABI.

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

llvm-svn: 263464
2016-03-14 18:41:59 +00:00
Richard Smith 8d4e90b319 [modules] Don't diagnose non-modular includes from modular files that are
implementation units of modules rather than interface units.

llvm-svn: 263449
2016-03-14 17:52:37 +00:00
Samuel Antao aeb7b539f5 [OpenMP] Replace offloading option that start with -o with -fo.
Summary:
The current offloading implementation is using -omptargets and -omp-host-ir-file-path options in the frontend. This causes the user a lot of trouble due to to the conflicts with the -o option. E.g. if the user misspells  omptargets he will end up with a file with a weird name.

This patches replaces these two options with  -fomptargets and -fomp-host-ir-file-path to avoid these issues, and it is also more consistent with the other options like -fopenmp.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: cfe-commits, caomhin, fraggamuffin

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

llvm-svn: 263442
2016-03-14 15:57:41 +00:00
Benjamin Kramer 35bc38af20 Revert "Recommitted r261634 "Supporting all entities declared in lexical scope in LLVM debug info." After fixing PR26715 at r263379."
This reverts commit r263425. Breaks self-host.

llvm-svn: 263436
2016-03-14 14:58:28 +00:00
Jonas Hahnfeld f2e73a1adb Fix some more tests with CLANG_DEFAULT_CXX_STDLIB
Also use -stdlib=platform instead of -stdlib=libstdc++ when testing if Clang
chooses the correct default for the given platform.

llvm-svn: 263435
2016-03-14 14:34:10 +00:00
Jonas Hahnfeld 099541907f Make FreeBSD and NetBSD use CLANG_DEFAULT_CXX_STDLIB
Also introduce -stdlib=platform to override the configured value
and use it to make the tests always pass.

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

llvm-svn: 263434
2016-03-14 14:34:04 +00:00
Benjamin Kramer 12f2de1a1f [Frontend] Disable value name discarding for all sanitizers.
ASan also relies on names on allocas and will emit unhelpful output if
they're not present. Just force-enable value names for now. Should
unbreak release builds of asan.

llvm-svn: 263429
2016-03-14 13:23:58 +00:00
Amjad Aboud 22c997deb6 Recommitted r261634 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26715 at r263379.

llvm-svn: 263425
2016-03-14 12:03:55 +00:00
Andrey Turetskiy a486857cd4 [Driver] Enable --rtlib option for MSVC target
This enables "--rtlib compiler-rt" option under MSVC environment.

Patch by Roman Shirokiy.

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

llvm-svn: 263422
2016-03-14 11:19:43 +00:00
Eric Christopher c2c3a545c1 Temporarily make discard value names depend on whether or not we're
trying to track origins in the memory sanitizer since the backend
instrumentation pass currently takes names from the Instruction.

Fixes all of the origin tracking tests in compiler-rt after the
-discard-value-name option was added.

llvm-svn: 263412
2016-03-14 08:10:47 +00:00
Eric Christopher ae6d694ae7 Give the test a temporary output so it can be cleaned up.
llvm-svn: 263410
2016-03-14 06:21:07 +00:00
Nico Weber 627fa8e424 Try to get cl-pch-showincludes passing on AArch64 bots.
llvm-svn: 263400
2016-03-13 22:26:26 +00:00
Mehdi Amini 557c20a886 Remove compile time PreserveName in favor of a runtime cc1 -discard-value-names option
Summary:
This flag is enabled by default in the driver when NDEBUG is set. It
is forwarded on the LLVMContext to discard all value names (but
GlobalValue) for performance purpose.

This an improved version of D18024

Reviewers: echristo, chandlerc

Subscribers: cfe-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263394
2016-03-13 21:05:23 +00:00
Amjad Aboud 13d7a70657 Added test that covers changes in r263379.
llvm-svn: 263380
2016-03-13 11:12:57 +00:00
Matt Arsenault c477f48f03 Update for new argument to scalbn
llvm-svn: 263371
2016-03-13 05:12:47 +00:00
Nico Weber deed64e52c Also test that the pch file is not printed in /showIncludes
llvm-svn: 263355
2016-03-13 03:04:46 +00:00
Nico Weber efe190a6eb Make test a bit stricter to check not just the file basename is printed.
llvm-svn: 263353
2016-03-13 02:48:51 +00:00
Nico Weber 4b5aedef16 clang-cl: Add /Yc argument to /showIncludes output.
To make this work, delay printing of ExtraDeps in HeaderIncludesCallback a bit,
so that it happens after CompilerInstance::InitializeSourceManager() has run.

General /FI arguments are still missing from /showIncludes output, this still
needs to be fixed.

llvm-svn: 263352
2016-03-13 02:44:13 +00:00
Nico Weber 1f8bad5198 clang-cl: Add a test for the interaction of /Yc and /showIncludes.
We almost get this right, but not completely (see FIXME).  It looks like /FI
headers generally aren't included in /showIncludes yet, but they should be.
But it seems good to have test coverage for the bits that already work.

llvm-svn: 263344
2016-03-12 19:55:59 +00:00
Eric Christopher 02e3dd4b2e Temporarily revert these patches:
commit 60d9845f6a037122d9be9a6d92d4de617ef45b04
Author: Mehdi Amini <mehdi.amini@apple.com>
Date:   Fri Mar 11 18:48:02 2016 +0000

    Fix clang crash: when CodeGenAction is initialized without a
    context, use the member and not the parameter

    From: Mehdi Amini <mehdi.amini@apple.com>

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

commit af7ce3bf04a75ad5124b457b805df26006bd215b
Author: Mehdi Amini <mehdi.amini@apple.com>
Date:   Fri Mar 11 17:32:58 2016 +0000

    Fix build: use -> with pointers and not .

    Silly typo.

    From: Mehdi Amini <mehdi.amini@apple.com>

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

commit d0eea119192814954e7368c77d0dc5a9eeec1fbb
Author: Mehdi Amini <mehdi.amini@apple.com>
Date:   Fri Mar 11 17:15:44 2016 +0000

    Remove compile time PreserveName switch based on NDEBUG

    Summary:
    Following r263086, we are now relying on a flag on the Context to
    discard Value names in release builds.

    Reviewers: chandlerc

    Subscribers: cfe-commits

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

    From: Mehdi Amini <mehdi.amini@apple.com>

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

until we can fix the Release builds.

This reverts commits 263257, 263267, 263273

llvm-svn: 263320
2016-03-12 01:47:11 +00:00
Daniel Jasper be50836514 Make functions in altivec.h be __inline__. As they are all also marked
__always_inline__, this has likely been meant from the start.

Review: http://reviews.llvm.org/D18015
llvm-svn: 263302
2016-03-11 22:13:28 +00:00
Bob Wilson cf2cf0dba4 Add fix-it for format-security warnings.
llvm-svn: 263299
2016-03-11 21:55:37 +00:00
Jordan Rose 31cf7d49db Fix ObjCMethodDecl::findPropertyDecl for class properties.
This affects code completion and a few other things; hopefully the code completion
test is sufficient to catch regressions.

llvm-svn: 263295
2016-03-11 21:14:40 +00:00
Reid Kleckner 4776f2ed75 Add missing triple to instantiate-sizeof.cpp test
llvm-svn: 263285
2016-03-11 19:17:53 +00:00
Reid Kleckner 1af391df13 Allow sizeof(UnrelatedClass::field) in C++11 class template methods
This feature works outside of templates by forming a DeclRefExpr to a
FieldDecl instead of a MemberExpr, which requires a base object in
addition to the FieldDecl.

Previously, while building up the template AST before instantiation, we
formed a CXXDependentScopeMemberExpr, which always instantiates to a
MemberExpr. Now, in unevaluated contexts we form a
DependentScopeDeclRefExpr, which is a more flexible node that can
instantiate to either a MemberExpr or a DeclRefExpr depending on lookup
results.

Fixes PR26893.

llvm-svn: 263279
2016-03-11 18:59:12 +00:00
Teresa Johnson f39a70cf32 Update test case for llvm summary format changes in D17592.
llvm-svn: 263276
2016-03-11 18:52:42 +00:00
Mehdi Amini 4661b39e33 Fix clang crash: when CodeGenAction is initialized without a context, use the member and not the parameter
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263273
2016-03-11 18:48:02 +00:00
Reid Kleckner e10b601537 [SEH] Remove nounwind/noinline from outlined finally funclets
With the new EH representation this is no longer necessary.

llvm-svn: 263269
2016-03-11 17:36:16 +00:00
Mehdi Amini 7850f596e2 Fix build: use -> with pointers and not .
Silly typo.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263267
2016-03-11 17:32:58 +00:00
Mehdi Amini e803fc3276 Remove compile time PreserveName switch based on NDEBUG
Summary:
Following r263086, we are now relying on a flag on the Context to
discard Value names in release builds.

Reviewers: chandlerc

Subscribers: cfe-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263257
2016-03-11 17:15:44 +00:00
Alexandros Lamprineas 5ccf78b67d Add tests for ARM Cortex-R8
Add command-line tests for ARM Cortex-R8 checking that the driver calls
clang -cc1 with the correct little-endian/big-endian, and ARM/Thumb triple.

Patch by Pablo Barrio <pablo.barrio@arm.com>

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

llvm-svn: 263245
2016-03-11 15:03:40 +00:00
Chandler Carruth 4ddaadca76 Update to include the new header file providing createGVNPass.
llvm-svn: 263210
2016-03-11 09:02:43 +00:00
Dmitry Polukhin 644a9252ab [OpenMP] NFC fix compilation warning about unused variable
lib/Sema/SemaOpenMP.cpp:9243:13: warning: variable ‘IsRightMostExpression’ set but not used

llvm-svn: 263202
2016-03-11 07:58:34 +00:00
John McCall 7509ba64c4 Removing the friend declaration was not a good idea.
llvm-svn: 263194
2016-03-11 05:03:01 +00:00
John McCall 519966fc92 Speculatively attempt to fix the MSVC build by making some
methods non-private.

llvm-svn: 263193
2016-03-11 04:55:21 +00:00
John McCall f26e73df75 Add a coerce-and-expand ABIArgInfo as a generalization of some
of the things we do with Expand / Direct.

NFC for now, but this will be used by swiftcall expansion.

llvm-svn: 263192
2016-03-11 04:30:43 +00:00
John McCall c56a8b3284 Preserve ExtParameterInfos into CGFunctionInfo.
As part of this, make the function-arrangement interfaces
a little simpler and more semantic.

NFC.

llvm-svn: 263191
2016-03-11 04:30:31 +00:00
Ekaterina Romanova 13f189da86 Add doxygen comments to avxintrin.h's intrinsics.
Only around 25% of the intrinsics in this file are documented here. The patches for the other half will be sent out later.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream.

llvm-svn: 263175
2016-03-11 00:05:54 +00:00
Manman Ren 42e09eb022 Print strict in Availability attribute when it is on.
llvm-svn: 263172
2016-03-10 23:54:12 +00:00
Manman Ren 515758e076 Add has_feature objc_class_property.
rdar://23891898

llvm-svn: 263171
2016-03-10 23:51:03 +00:00
Jonathan Coe 02281b8419 libclang python bindings: Fix for bug 26394
Summary:
https://llvm.org/bugs/show_bug.cgi?id=26394 reports that clang's python bindings tests are failing.

I can confirm that the bug exists and that the proposed fix is good.

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

llvm-svn: 263170
2016-03-10 23:29:45 +00:00
Nico Weber 416ad130ea Reenable asm-errors.c
r134811 made the test pass and reenabled it, but r134831
accidentally disabled it again due to a bad merge.

llvm-svn: 263168
2016-03-10 22:40:02 +00:00
Richard Smith 4d3d785e3f Add test for r263138.
llvm-svn: 263155
2016-03-10 19:22:21 +00:00
Manman Ren 073db02476 Add TreatUnavailableAsInvalid for the verification-only mode in InitListChecker.
Given the following test case:
typedef struct {
  const char *name;
  id field;
} Test9;
extern void doSomething(Test9 arg);
void test9() {
  Test9 foo2 = {0, 0};
  doSomething(foo2);
}
With a release compiler, we don't emit any message and silently ignore the
variable "foo2". With an assert compiler, we get an assertion failure.

The root cause —————————————
Back in r140457 we gave InitListChecker a verification-only mode, and will use
CanUseDecl instead of DiagnoseUseOfDecl for verification-only mode.

These two functions handle unavailable issues differently:
In Sema::CanUseDecl, we say the decl is invalid when the Decl is unavailable and
the current context is available.

In Sema::DiagnoseUseOfDecl, we say the decl is usable by ignoring the return
code of DiagnoseAvailabilityOfDecl

So with an assert build, we will hit an assertion in diagnoseListInit
assert(DiagnoseInitList.HadError() &&
       "Inconsistent init list check result.");

The fix -------------------
If we follow what is implemented in CanUseDecl and treat Decls with
unavailable issues as invalid, the variable decl of “foo2” will be marked as
invalid. Since unavailable checking is processed in delayed diagnostics
(r197627), we will silently ignore the diagnostics when we find out that
the variable decl is invalid.

We add a flag "TreatUnavailableAsInvalid" for the verification-only mode.
For overload resolution, we want to say decls with unavailable issues are
invalid; but for everything else, we should say they are valid and
emit diagnostics. Depending on the value of the flag, CanUseDecl
can return different values for unavailable issues.

rdar://23557300
Differential Revision: http://reviews.llvm.org/D15314

llvm-svn: 263149
2016-03-10 18:53:19 +00:00
Nico Weber f0b1f09389 Make remaining ImplicitFallthrough warning DefaultIgnore.
Follow-up to r262881, which caused this to fire more often.

llvm-svn: 263138
2016-03-10 18:42:37 +00:00
Simon Pilgrim 05e07836c8 Updated SSE3 builtin tests to more closely match the llvm fast-isel equivalent tests
llvm-svn: 263117
2016-03-10 14:46:49 +00:00
Simon Pilgrim 99665cb77f Added note to SSE4a builtins about keeping in sync with llvm tests
llvm-svn: 263116
2016-03-10 14:44:32 +00:00
Simon Pilgrim baed60dd0a Updated SSSE3 builtin tests to more closely match the llvm fast-isel equivalent tests
llvm-svn: 263115
2016-03-10 14:42:17 +00:00
Simon Pilgrim 0d1e3fff2b Minor Wdocumentation fix. NFCI.
llvm-svn: 263113
2016-03-10 14:16:36 +00:00
Aaron Ballman 10670b4f1c Correcting an attribute documentation generation error by giving the abi_tag attribute a documentation category.
llvm-svn: 263109
2016-03-10 13:08:22 +00:00