Commit Graph

46193 Commits

Author SHA1 Message Date
Chandler Carruth 6aa92ad762 Fix a couple of PPC predefined macros that I spotted while driving by
this code. These aren't technically standard predefines for the platform
but apparantly lots of folks use them as they show up within LLVM's own
codebase. ;] This may even fix some self host issues w/ the JIT!!!

llvm-svn: 184830
2013-06-25 11:13:47 +00:00
Rafael Espindola 37d229de2f Add r184803 back now that the bug in unique_file has been fixed.
Original message:

Use the new PathV2 instead of implementing the logic in clang.

llvm-svn: 184825
2013-06-25 04:26:55 +00:00
Rafael Espindola e7f89915b4 Revert "Use the new PathV2 instead of implementing the logic in clang."
This reverts commit 184803 while I debug the failures on the bots.

llvm-svn: 184818
2013-06-25 02:35:32 +00:00
Chandler Carruth 3bab90a400 Revert r184787: "Added arm_neon intrinsic tests."
This test doesn't actually pass when run with llvm-lit for me or in
a bot that actually always tries to run it.

llvm-svn: 184817
2013-06-25 02:18:39 +00:00
Jordan Rose b8e286548c [analyzer] Handle zeroing CXXConstructExprs.
Re-apply r184511, reverted in r184561, with the trivial default constructor
fast path removed -- it turned out not to be necessary here.

Certain expressions can cause a constructor invocation to zero-initialize
its object even if the constructor itself does no initialization. The
analyzer now handles that before evaluating the call to the constructor,
using the same "default binding" mechanism that calloc() uses, rather
than simply ignoring the zero-initialization flag.

<rdar://problem/14212563>

llvm-svn: 184815
2013-06-25 01:56:08 +00:00
Jordan Rose b3b976f061 [analyzer] Don't initialize virtual base classes more than once.
In order to make sure virtual base classes are always initialized once,
the AST contains initializers for the base class in /all/ of its
descendents, not just the immediate descendents. However, at runtime,
the most-derived object is responsible for initializing all the virtual
base classes; all the other initializers will be ignored.

The analyzer now checks to see if it's being called from another base
constructor, and if so does not perform virtual base initialization.

<rdar://problem/14236851>

llvm-svn: 184814
2013-06-25 01:55:59 +00:00
Eli Friedman 5a8738ffe0 Fix regression from r184810.
Specifically, CallExpr::getCalleeDecl() can return null, so make sure to
handle that correctly.

llvm-svn: 184813
2013-06-25 01:55:41 +00:00
Nick Lewycky d3f3e4f04c Make -vectorize-... proper cc1 flags instead of abusing -backend-option. Fixes
usage of clang as a library.

llvm-svn: 184812
2013-06-25 01:49:44 +00:00
Richard Smith 5de91b58d0 Fix deserializing of class template partial specializations. Assign sequence
numbers as we deserialize class template partial specializations. We can't
assume that the old sequence numbers will work.

The sequence numbers are still deterministic, but are now a lot less
predictable for class template partial specializations in modules/PCH.

llvm-svn: 184811
2013-06-25 01:25:15 +00:00
Eli Friedman 0423b76be1 Fix noexcept for delete expressions.
Using "delete" on a pointer to an incomplete type can't throw.
While I'm here, clean up the signature of the canCalleeThrow() helper.

llvm-svn: 184810
2013-06-25 01:24:22 +00:00
Rafael Espindola e3d0c4a9bd Remove PathV1.h from Driver.cpp.
llvm-svn: 184807
2013-06-25 01:11:59 +00:00
Nico Weber ec9e41076b Formatter/ObjC: Correctly format casts in objc message send expressions.
llvm-svn: 184804
2013-06-25 00:55:57 +00:00
Rafael Espindola 503b726b43 Use the new PathV2 instead of implementing the logic in clang.
llvm-svn: 184803
2013-06-25 00:55:28 +00:00
Eli Friedman 96dbf6f082 Delete a couple dead checks.
Use castAs<> where appropriate. Don't check conditionals which are
always true. Delete a bit of dead code. Reindent a bunch of code which
is no longer guarded by an if statement.

llvm-svn: 184801
2013-06-25 00:46:32 +00:00
Nico Weber e8d78249ad Formatter/Objc: Add a test that checks that @import is formatted correctly.
llvm-svn: 184796
2013-06-25 00:25:40 +00:00
Eli Friedman f6e1fd7567 Delete dead code.
llvm-svn: 184795
2013-06-25 00:25:19 +00:00
Eric Christopher 89d2b74245 Reorder builds based by ordering.
llvm-svn: 184794
2013-06-25 00:21:29 +00:00
Richard Smith bf78e646e1 Check for matching template-parameter-lists when merging template declarations.
llvm-svn: 184791
2013-06-24 22:51:00 +00:00
Rafael Espindola 49ddb8675b Accept both / and \\ to fix the windows bots.
llvm-svn: 184790
2013-06-24 22:07:15 +00:00
Ted Kremenek 009d61dd16 Tweak -Wdeprecated-objc-pointer-introspection to have a subgroup for results of using -performSelectorXXX.
-performSelector: and friends return a value that is boxed as an Objective-C
pointer.  Sometimes it is an Objective-C pointer, sometimes it isn't.
Some clients may wish to silence this warning based on calling
this method.

Fixes <rdar://problem/14147304>

llvm-svn: 184789
2013-06-24 21:35:39 +00:00
Michael Gottesman a35103a8cf Added arm_neon intrinsic tests.
This is a large test and thus it will only run if you pass in --param
run_long_tests=trueto LIT. This is intended so that this test can run on
buildbots and not when one runs make check.

llvm-svn: 184787
2013-06-24 21:25:42 +00:00
Michael Gottesman 1169a52c83 [NeonIntrinsicTestEmitter] vld1/vst1 do not require the :64 hint.
llvm-svn: 184786
2013-06-24 21:25:39 +00:00
Michael Gottesman c6b5e56c19 [NeonIntrinsicTestEmitter] Fix incorrect FileCheck pattern where we were expecting a ',' prefix to alignment hints.
llvm-svn: 184785
2013-06-24 21:25:37 +00:00
Michael Gottesman d95c49a91c [NeonIntrinsicTestEmitter] Add requirement to arm neon intrinsic tests for the feature long_tests.
This will prevent the tests from running on normal make check. You will need to
actually pass in --param run_long_tests=true to LIT in order to run these.

llvm-svn: 184784
2013-06-24 21:25:34 +00:00
Argyrios Kyrtzidis 48d88de2af [libclang/codecompletion] Make sure the top-level decl hash takes into account ImportDecls.
The top-level hash is used to determine if we need to update the global code-completion results.
ImportDecls did not affect the hash so a newly introduced ImportDecl would not trigger an update of the global results.

rdar://14202797

llvm-svn: 184782
2013-06-24 21:19:12 +00:00
Eli Friedman d0ee1294c1 Change mangling of objects inside block literals.
This changes the mangling of local static variables/etc. inside blocks
to do something simple and sane.  This avoids depending on the way we mangle
blocks, which isn't really appropriate here.

John, please take a look at this to make sure the mangling I chose is sane.

Fixes <rdar://problem/14074423>.

llvm-svn: 184780
2013-06-24 20:24:19 +00:00
Reid Kleckner 91960de0fe Fix "funciton" typo from r184763
llvm-svn: 184779
2013-06-24 20:08:40 +00:00
Reid Kleckner 18da98ef99 [ms-cxxabi] Use sugared types in the mangler instead of canonical types
At this point, it's clear that the MSVC mangler uses the type-as-written
instead of the canonical type, so this should bring us closer to MSVC.
The main thrust of this change is to fix the way we mangle decayed array
parameters of function pointer parameters.  With a DecayedType sugar
node, this code can now be much simpler.

Fixes PR16096.

This also fixes a separate issue that Richard spotted in review.
Because separate declarations of the same entity can be spelled and
mangled differently, MSVC always mangles the earliest declaration in an
attempt to avoid link errors.  Clang now does the same.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D844

llvm-svn: 184777
2013-06-24 19:21:52 +00:00
Argyrios Kyrtzidis b11a192dfc [arcmt/driver] For the -ccc-arcmt-* flags, claim them when -fno-objc-arc is passed to avoid the
"argument unused during compilation" warning.

rdar://14240566

llvm-svn: 184776
2013-06-24 19:01:18 +00:00
Eli Friedman 57d1f1c8a5 Use getAs<> where appropriate on QualTypes instead of using dyn_cast.
llvm-svn: 184775
2013-06-24 18:47:11 +00:00
Rafael Espindola 609a664427 Convert some uses of llvm::sys::Path.
llvm-svn: 184774
2013-06-24 18:33:43 +00:00
Rafael Espindola 0294075f9b Use the simpler version of llvm::sys::fs::exists.
llvm-svn: 184770
2013-06-24 18:19:15 +00:00
Anna Zaks 7925e3db63 [analyzer] Add a debug checker that prints Exploded Graph
Add a debug checker that is useful to understand how the ExplodedGraph is
built; it can be triggered using the following command:

 clang -cc1 -analyze -analyzer-checker=debug.ViewExplodedGraph my_program.c

A patch by Béatrice Creusillet!

llvm-svn: 184768
2013-06-24 18:12:12 +00:00
Rafael Espindola 03bc68268f Convert last use of PathV1.h in Compilation.cpp
The way we decide which file to remove is fairly odd. I took a quick look at
maybe changing that, but it would be a more work than I want to put at this
right now, so I left pair of FIXMEs.

llvm-svn: 184766
2013-06-24 17:59:44 +00:00
Reid Kleckner 8a36502a60 [AST] Introduce a new DecayedType sugar node
The goal of this sugar node is to be able to look at an arbitrary
FunctionType and tell if any of the parameters were decayed from an
array or function type.  Ultimately this is necessary to implement
Microsoft's C++ name mangling scheme, which mangles decayed arrays
differently from normal pointers.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1014

llvm-svn: 184763
2013-06-24 17:51:48 +00:00
Kaelyn Uhrain 52dd02d8ef Add the global namespace (the "::" namespace specifier) to the list of
namespaces to try for potential typo corrections.

llvm-svn: 184762
2013-06-24 17:49:03 +00:00
Reid Kleckner 7f62b95480 Check the canonical parameter type with getAs<>() in a static checker
This will prevent breakage when I introduce the DecayedType sugar node.

llvm-svn: 184755
2013-06-24 16:56:16 +00:00
Rafael Espindola a466b9aeb9 Convert a use of PathV1.h
llvm-svn: 184753
2013-06-24 16:46:15 +00:00
Matt Beaumont-Gay 4cd3c9adf9 Add some invalid-decl checks to clang_Type_getOffsetOf.
print-size-type.cpp was checking for specific record layout output for invalid
decls; I've removed the checks but left the records as tests for not crashing.

llvm-svn: 184751
2013-06-24 16:12:35 +00:00
Rafael Espindola 36da85486a Convert a use of PathV1.h.
llvm-svn: 184743
2013-06-24 15:00:11 +00:00
Reid Kleckner 5a11580205 [Sema] Call CheckParmForFunctionDef on ObjC method parameters
CheckParmForFunctionDef performs standard checks for type completeness
and other things like a destructor check for the MSVC++ ABI.

llvm-svn: 184740
2013-06-24 14:38:26 +00:00
NAKAMURA Takumi 1d7bdb171a clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp: Suppress unexpected failures on MS hosts.
FIXME: A couple of tests have been suppressed.
I know it'd be bad with _MSC_VER here, though.

llvm-svn: 184727
2013-06-24 13:19:26 +00:00
NAKAMURA Takumi f5a240b0bf clang/test/Driver/coverage-ld.c: Tweak expressions to match dosish pathsep on win32 hosts.
llvm-svn: 184726
2013-06-24 13:19:20 +00:00
Chandler Carruth e4458b3204 The profile library must come before the C library so that it can use
atexit.

llvm-svn: 184708
2013-06-24 09:38:45 +00:00
Richard Smith cf4ab520b5 Avoid adding entries to the DeclContext lookup table multiple times when lazily
constructing a lookup table.

Previously, buildLookup would add lookup table entries for each item lexically
within the DC, and adding the first entry with a given name would trigger the
external source to add all its entries with that name. Then buildLookup would
carry on and re-add those entries all over again.

Instead, follow a simple rule: a declaration from an external source is only
ever made visible by the external source. One exception to this: since we don't
usually build a lookup table for the TU in C, and we never serialize one, we
don't expect the external source to provide lookups in the TU in C, so we build
those ones ourselves.

llvm-svn: 184696
2013-06-24 07:20:36 +00:00
David Blaikie ce1ae387d6 DebugInfo: ensure negative enumerators are emitted as such
There's still a problem here - since we're not appropriately using the
signedness/range of the enum to chooset the encoding and emission of
enumerators, but GCC has some bugs around this too so I assume that's
not /such/ a high priority though I may get to it soon out of
completeness.

llvm-svn: 184695
2013-06-24 07:13:13 +00:00
David Blaikie a24c397ee1 DebugInfo: Merge a bad debug info enum test into a good one
The assembly generation testing has been moved to an LLVM test case.

llvm-svn: 184693
2013-06-24 06:47:30 +00:00
Richard Smith 8f8f05cf00 Slightly improve cross-module merging for function templates.
llvm-svn: 184689
2013-06-24 04:45:28 +00:00
Dmitri Gribenko 02489eb406 Comment parsing: allow "\param ..." to describe variadic arguments
Original patch by Fariborz Jahanian; extended by me.

Fixes rdar://14124644

llvm-svn: 184688
2013-06-24 04:41:32 +00:00
Richard Smith 51445cd307 When setting the external visible declarations for a decl context, check
whether they replace any existing lookups in the context, rather than
accumulating a bunch of lookup results referring to the same entity.

llvm-svn: 184679
2013-06-24 01:46:41 +00:00