Commit Graph

60845 Commits

Author SHA1 Message Date
Devin Coughlin 6bc780ccc0 [analyzer] Move the ObjCGenericsChecker out of the alpha package.
It is now in the osx.cocoa package and so will be on by default for Apple
toolchains.

llvm-svn: 251966
2015-11-03 19:38:03 +00:00
Douglas Gregor 6623e1f10f Introduce module file extensions to piggy-back data onto module files.
Introduce the notion of a module file extension, which introduces
additional information into a module file at the time it is built that
can then be queried when the module file is read. Module file
extensions are identified by a block name (which must be unique to the
extension) and can write any bitstream records into their own
extension block within the module file. When a module file is loaded,
any extension blocks are matched up with module file extension
readers, that are per-module-file and are given access to the input
bitstream.

Note that module file extensions can only be introduced by
programmatic clients that have access to the CompilerInvocation. There
is only one such extension at the moment, which is used for testing
the module file extension harness. As a future direction, one could
imagine allowing the plugin mechanism to introduce new module file
extensions.

llvm-svn: 251955
2015-11-03 18:33:07 +00:00
Tim Northover 33e3ed17da Revert "Support watchOS and tvOS in compiler-rt builds"
The required compiler-rt changes aren't present yet so attempting to
build with compiler-rt breaks. And since we're trying to deprecate
autotools we actually want to fix this in CMake primarily anyway.

This reverts r251712.

llvm-svn: 251953
2015-11-03 18:14:42 +00:00
Douglas Gregor e17765eed0 Simplify Sema::ProcessPropertyDecl. NFC
Now that the properties created within Objective-C class extensions go
into the extension themselves, we don't need any of the extra
complexity here.

llvm-svn: 251949
2015-11-03 17:02:34 +00:00
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