Commit Graph

60841 Commits

Author SHA1 Message Date
David Majnemer 19cd42a558 Remove unused #include
No functionality change is intended.

llvm-svn: 251941
2015-11-03 16:32:15 +00:00
Martell Malone eec224eef7 Remove some legacy mingw-w64 gcc struct info
As of gcc 4.7 mingw-w64 no longer emits 128-bit structs as i128

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

llvm-svn: 251930
2015-11-03 15:57:45 +00:00
Craig Topper 5ea50fc806 [X86] Rounding mode for roundps/pd/ss/sd builtins should be an ICE.
llvm-svn: 251902
2015-11-03 07:20:07 +00:00
Craig Topper 991d499457 Fix a couple intrinsic header comments. NFC
llvm-svn: 251900
2015-11-03 06:16:31 +00:00
Richard Smith 5cd86f8cec [modules] Rationalize the behavior of Decl::declarationReplaces, and in
particular don't assume that two declarations of the same kind in the same
context are declaring the same entity. That's not true when the same name is
declared multiple times as internal-linkage symbols within a module.
(getCanonicalDecl is cheap now, so we can just use it here.)

llvm-svn: 251898
2015-11-03 03:13:11 +00:00
Douglas Gregor 7dd37e52b1 Eliminate "rewritten decls" from the AST writer. NFC
llvm-svn: 251877
2015-11-03 01:20:54 +00:00
Richard Smith 3df3f1d27f Switch to using an explicit scope object to ensure we don't forget to pop ObjC
type parameters off the scope, and fix the cases where we failed to do so.

llvm-svn: 251875
2015-11-03 01:19:56 +00:00
Douglas Gregor acf4fd3039 Stop back-patching 'readonly' Objective-C properties with 'readwrite' ones.
A 'readonly' Objective-C property declared in the primary class can
effectively be shadowed by a 'readwrite' property declared within an
extension of that class, so long as the types and attributes of the
two property declarations are compatible.

Previously, this functionality was implemented by back-patching the
original 'readonly' property to make it 'readwrite', destroying source
information and causing some hideously redundant, incorrect
code. Simplify the implementation to express how this should actually
be modeled: as a separate property declaration in the extension that
shadows (via the name lookup rules) the declaration in the primary
class. While here, correct some broken Fix-Its, eliminate a pile of
redundant code, clean up the ARC migrator's handling of properties
declared in extensions, and fix debug info's naming of methods that
come from categories.

A wonderous side effect of doing this write is that it eliminates the
"AddedObjCPropertyInClassExtension" method from the AST mutation
listener, which in turn eliminates the last place where we rewrite
entire declarations in a chained PCH file or a module file. This
change (which fixes rdar://problem/18475765) will allow us to
eliminate the rewritten-decls logic from the serialization library,
and fixes a crash (rdar://problem/23247794) illustrated by the
test/PCH/chain-categories.m example.

llvm-svn: 251874
2015-11-03 01:15:46 +00:00
Alexander Kornienko e39993eb86 Make hasLHS and hasRHS matchers available for ArraySubscriptExpr
Summary:
The hasBase and hasIndex don't tell anything about the position of the
base and the index in the code, so we need hasLHS and hasRHS in some cases.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 251842
2015-11-02 22:23:21 +00:00
Tim Northover 935d79b0b1 watchOS & tvOS: add a few more tests.
llvm-svn: 251832
2015-11-02 21:14:48 +00:00
Reid Kleckner f7e61478df [PTH] Fix data length used for stat cache entries
This came up in a boost build, which apparently uses PTH. This was
broken in r187619 when we migrated it to uses llvm::fs instead of raw
stat calls.

Constructing a test case with a hash table collision in-tree is tough.
Instead, I have a pending change to OnDiskChainedHashTable that asserts
that the reported length of the data agrees with the data actually
written. All of the existing in-tree tests find the bug with this
assert.

llvm-svn: 251828
2015-11-02 20:47:31 +00:00
Daniel Jasper f83834feb1 clang-format: Simplify and improve stop condition for formatting
unaffected lines with incorrect initial indent.

Starting from:
  namespace {
    int i; // There shouldn't be indentation here.
    int j; // <- call clang-format on this line.
  }

Before:
  namespace {
    int i;
    int j;
    }

After:
  namespace {
    int i;
    int j;
  }

llvm-svn: 251824
2015-11-02 20:02:49 +00:00
Tim Northover 4c5cb9c1da Fix va_arg on watchOS.
As in other contexts, alignments can go up to 16 bytes in a va_list.

llvm-svn: 251821
2015-11-02 19:32:23 +00:00
Teresa Johnson 6ef80dc1e1 Clang format a few prior patches (NFC)
I had clang formatted my earlier patches using the wrong style.
Reformatted with the LLVM style.

llvm-svn: 251813
2015-11-02 18:03:12 +00:00
Reid Kleckner 738d48d5fe Sink some PTHManager includes out of Preprocessor.h
This reduces the number of .cpp files needed to be rebuilt after
touching OnDiskHashTable from 120 to 21 for me.

llvm-svn: 251810
2015-11-02 17:53:55 +00:00
Andrey Bokhanko 158b8b898c [x86] Front-end part of MCU psABI support
This patch implements two things in front-end for MCU psABI support:

1) "long double type is the same as double."
2) "New predefined C/C++ pre-processor symbols: iamcu and iamcu__.

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

llvm-svn: 251786
2015-11-02 09:54:17 +00:00
David Majnemer 8671c6e03d [MS ABI] Don't zero-initialize vbptrs in bases
Certain CXXConstructExpr nodes require zero-initialization before a
constructor is called.  We had a bug in the case where the constructor
is called on a virtual base: we zero-initialized the base's vbptr field.
A complementary bug is present in MSVC where no zero-initialization
occurs for the subobject at all.

This fixes PR25370.

llvm-svn: 251783
2015-11-02 09:01:44 +00:00
Daniel Jasper f67c32466d clang-format: Be slightly more cautious when formatting subsequent lines after a change. With r251474, clang-format could indent the entire rest of the file, if there is a missing closing brace, e.g. while writing code in an editor.
Summary:
With this change, clang-format stops formatting when either it leaves
the current scope or when it comes back to the initial scope after
going into a nested one.

Reviewers: klimek

Subscribers: cfe-commits, klimek

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

llvm-svn: 251760
2015-11-01 00:27:35 +00:00
David Majnemer 6bf02820bc [MSVC Compat] Permit conversions from pointer-to-function to pointer-to-object iff -fms-compatibility
We permit implicit conversion from pointer-to-function to
pointer-to-object when -fms-extensions is specified.  This is rather
unfortunate, move this into -fms-compatibility and only permit it within
system headers unless -Wno-error=microsoft-cast is specified.

llvm-svn: 251738
2015-10-31 08:42:14 +00:00
Akira Hatanaka 7791f1a4a9 [CodeGen] Call SetInternalFunctionAttributes to attach function
attributes to internal functions.

This patch fixes CodeGenModule::CreateGlobalInitOrDestructFunction to
use SetInternalFunctionAttributes instead of SetLLVMFunctionAttributes
to attach function attributes to internal functions.

Also, make sure the correct CGFunctionInfo is passed instead of always
passing what arrangeNullaryFunction returns.

rdar://problem/20828324

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

llvm-svn: 251734
2015-10-31 01:28:07 +00:00
Saleem Abdulrasool a174241cf1 Sema: correct typo recovery with blocks
Handle blocks in the tree transform for the typo correction as otherwise, the
capture may miss.  This would trigger an assertion.  Thanks to Doug Gregor for
the help with this!

Fixes PR25001.

llvm-svn: 251729
2015-10-31 00:39:15 +00:00
NAKAMURA Takumi b2978da715 CGExprConstant.cpp: Appease Modules.
llvm-svn: 251713
2015-10-30 16:37:27 +00:00
Tim Northover 15fb74beb4 Support watchOS and tvOS in compiler-rt builds
Hopefully autotools will be deprecated soon and this entire file can go away,
but until then...

llvm-svn: 251712
2015-10-30 16:30:51 +00:00
Tim Northover 7a73cc71d7 Support tvOS and watchOS availability attributes
llvm-svn: 251711
2015-10-30 16:30:49 +00:00
Tim Northover 5627d3935a ARMv7k: implement ABI changes for watchOS from standard iOS.
llvm-svn: 251710
2015-10-30 16:30:45 +00:00
Tim Northover e931f9fc0d Disable SjLj exceptions for watchOS
llvm-svn: 251709
2015-10-30 16:30:41 +00:00
Tim Northover 756447a67c Watch and TV OS: wire up basic ABI choices
This sets the mostly expected Darwin default ABI options for these two
platforms. Active changes from these defaults for watchOS are in a later patch.

llvm-svn: 251708
2015-10-30 16:30:36 +00:00
Tim Northover 67465f80ec Preprocessor: define correct tvOS and watchOS version macros
llvm-svn: 251707
2015-10-30 16:30:30 +00:00
Tim Northover 6f3ff22e73 Support watchOS and tvOS driver options
This patch should add support for almost all command-line options and
driver tinkering necessary to produce a correct "clang -cc1"
invocation for watchOS and tvOS.

llvm-svn: 251706
2015-10-30 16:30:27 +00:00
NAKAMURA Takumi c3afea57fb Modules: Add a declaration in clang/Serialization/GlobalModuleIndex.h.
llvm-svn: 251703
2015-10-30 15:54:34 +00:00
Sean Eveson 70eece21c2 Reapply r251621 "[Analyzer] Widening loops which do not exit"
It was not the cause of the build bot failure.

llvm-svn: 251702
2015-10-30 15:23:57 +00:00
NAKAMURA Takumi 01ca33d93d clang/module.modulemap: Exclude Frontend/PCHContainerOperations.h in Clang_Frontend.
FIXME: It should be dissolved to interface and impl.
llvm-svn: 251701
2015-10-30 15:14:55 +00:00
Vasileios Kalintiris 71b0dfea26 Revert "[mips] Add support for the new mips-mti-linux toolchain."
This reverts commits r251633. I'll investigate the test failure off trunk in
order to keep the buildbots clean.

llvm-svn: 251698
2015-10-30 11:28:39 +00:00
Sean Eveson 4c7b3bf6ba Revert r251621 "[Analyzer] Widening loops which do not exit" (bot failure)
Seems to be causing clang-cmake-mips build bot to fail (timeout)

http://lab.llvm.org:8011/builders/clang-cmake-mips/builds/10299

llvm-svn: 251697
2015-10-30 11:13:07 +00:00
Renato Golin 94b648d3ab Revert "Try to run and investigate the mips-mti-linux.c test failure on ARM buildbots."
This reverts commit r251695. Debug is meant to be done off tree, not use the buildbots
experiments. I'll help investigate this problem off trunk.

llvm-svn: 251696
2015-10-30 11:12:36 +00:00
Vasileios Kalintiris dc5f826128 Try to run and investigate the mips-mti-linux.c test failure on ARM buildbots.
This should be a NFC for every toolchain other than mips-mti-linux (where we
print the list of directories searched for crt files). It will soon be
reverted once we hit the clang-cmake-armv7-a15-selfhost-neon buildbot.

llvm-svn: 251695
2015-10-30 10:35:38 +00:00
Angel Garcia Gomez 4647ed74ac Add "equalsNode" for types and "isCopyAssignmentOperator" matchers.
Summary: This matchers are going to be used in modernize-use-default, but are generic enough to be placed in ASTMatchers.h.

Reviewers: klimek

Subscribers: alexfh, cfe-commits, klimek

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

llvm-svn: 251693
2015-10-30 09:35:51 +00:00
Dehao Chen bd3c94e84b Update debug-info-scope test to remove "FIXME", which is fixed in r251689
llvm-svn: 251691
2015-10-30 05:08:43 +00:00
Saleem Abdulrasool 328085f325 Format: support inline namespaces
Correct handling for C++17 inline namespaces.  We would previously fail to
identify the inline namespaces as a namespace name since multiple ones may be
concatenated now with C++17.

llvm-svn: 251690
2015-10-30 05:07:56 +00:00
John McCall 17f0275d4c Initialize @catch variables correctly in fragile-runtime ARC.
llvm-svn: 251677
2015-10-30 00:56:02 +00:00
John McCall f5ea072e01 Fix the emission of ARC ivar layouts in the non-fragile Mac runtime.
My previous change in this area accidentally broke the rule when
InstanceBegin was not a multiple of the word size.

llvm-svn: 251666
2015-10-29 23:36:14 +00:00
Nico Weber e8df6750f4 Mark InternalDebugOpt driver options as CoreOptions.
Mostly has the effect of making -ccc-print-phases usable from clang-cl.

llvm-svn: 251653
2015-10-29 20:53:49 +00:00
John McCall 03107a4ef0 Add support for __builtin_{add,sub,mul}_overflow.
Patch by David Grayson!

llvm-svn: 251651
2015-10-29 20:48:01 +00:00
Nico Weber b25423525c Suppress uninteresting output from crash-recovery-modules.m
No behavior change, but it makes this test a bit easier to debug when it fails.

llvm-svn: 251650
2015-10-29 20:43:31 +00:00
Daniel Jasper b488a74f99 clang-format: [JS] Add goog.setTestOnly to the list of stuff that
is import-statement-like and shouldn't be wrapped.

llvm-svn: 251643
2015-10-29 19:05:20 +00:00
Sylvestre Ledru 43b9571706 add support of the latest Ubuntu (Xenial Xerus)
llvm-svn: 251639
2015-10-29 17:27:55 +00:00
Ehsan Akhgari f16435d85e Add a link to the DXR project
DXR is a project developed at Mozilla that implements a code indexing
and browsing utility on top of libclang that has features such as
call graph querying.

llvm-svn: 251638
2015-10-29 17:20:17 +00:00
Vasileios Kalintiris 45faf47e93 [mips] Add support for the new mips-mti-linux toolchain.
The original commit in r249137 added the mips-mti-linux toolchain. However,
the newly added tests of that commit failed in few buildbots. This commit
re-applies the original changes but XFAILs the test file which caused
the buildbot failures. This will allow us to examine what's going wrong
without having to commit/revert large changes.

llvm-svn: 251633
2015-10-29 15:33:53 +00:00
Sean Eveson 83390e45b3 [Analyzer] Widening loops which do not exit
Summary:
Dear All,

We have been looking at the following problem, where any code after the constant bound loop is not analyzed because of the limit on how many times the same block is visited, as described in bugzillas #7638 and #23438. This problem is of interest to us because we have identified significant bugs that the checkers are not locating. We have been discussing a solution involving ranges as a longer term project, but I would like to propose a patch to improve the current implementation.

Example issue:
```
for (int i = 0; i < 1000; ++i) {...something...}
int *p = 0;
*p = 0xDEADBEEF;
```

The proposal is to go through the first and last iterations of the loop. The patch creates an exploded node for the approximate last iteration of constant bound loops, before the max loop limit / block visit limit is reached. It does this by identifying the variable in the loop condition and finding the value which is “one away” from the loop being false. For example, if the condition is (x < 10), then an exploded node is created where the value of x is 9. Evaluating the loop body with x = 9 will then result in the analysis continuing after the loop, providing x is incremented.

The patch passes all the tests, with some modifications to coverage.c, in order to make the ‘function_which_gives_up’ continue to give up, since the changes allowed the analysis to progress past the loop.

This patch does introduce possible false positives, as a result of not knowing the state of variables which might be modified in the loop. I believe that, as a user, I would rather have false positives after loops than do no analysis at all. I understand this may not be the common opinion and am interested in hearing your views. There are also issues regarding break statements, which are not considered. A more advanced implementation of this approach might be able to consider other conditions in the loop, which would allow paths leading to breaks to be analyzed.

Lastly, I have performed a study on large code bases and I think there is little benefit in having “max-loop” default to 4 with the patch. For variable bound loops this tends to result in duplicated analysis after the loop, and it makes little difference to any constant bound loop which will do more than a few iterations. It might be beneficial to lower the default to 2, especially for the shallow analysis setting.

Please let me know your opinions on this approach to processing constant bound loops and the patch itself.

Regards,

Sean Eveson
SN Systems - Sony Computer Entertainment Group

Reviewers: jordan_rose, krememek, xazax.hun, zaks.anna, dcoughlin

Subscribers: krememek, xazax.hun, cfe-commits

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

llvm-svn: 251621
2015-10-29 10:04:41 +00:00
Xinliang David Li d796887961 Fix a soon to be invalid test
Remove a check that won't be valid when LLVM stops
emitting runtime hook user function.

llvm-svn: 251611
2015-10-29 04:04:07 +00:00