Commit Graph

20982 Commits

Author SHA1 Message Date
Kevin Qin ce1f0e85ba [AArch64 NEON] Fix a bug about vcles_f32 and vcled_f64.
As vcles_f32() and vcled_f64 are implemented by FCMGE, operands
should make a swap.

llvm-svn: 199866
2014-01-23 03:42:06 +00:00
Justin Bogner be614c735c CodeGen: Fix tracking of PGO counters for the logical or operator
This adds tests for both logical or and for logical and, which was
already correct.

llvm-svn: 199865
2014-01-23 02:54:30 +00:00
Justin Bogner 81c22c2fae CodeGen: Handle PGO counters for constructors and destructors
llvm-svn: 199864
2014-01-23 02:54:27 +00:00
Justin Bogner 0960d091a9 test/CodeGenCXX: Give instr-profile exception tests their own file
This test requires asserts for now, and exception handling has an
awkward structure that leads to extra run lines. Because of this, the
test file's not a great place for other C++ PGO tests, but
instr-profile.cpp is obviously the better name for them.

llvm-svn: 199863
2014-01-23 02:54:23 +00:00
Justin Bogner fdac0cad1f test/CodeGen: Fix a typo
llvm-svn: 199862
2014-01-23 02:54:20 +00:00
Ben Langmuir 9eb229bfe5 Require a module.map file to load a module
Removes some old code that allowed a module to be loaded from a pcm file
even if the module.map could not be found.  Also update a number of
tests that relied on the old behavior.

llvm-svn: 199852
2014-01-22 23:19:39 +00:00
Richard Smith 8c7bd6ac1a Don't forget about a builtin if we're about to redeclare it and we couldn't
create an implicit declaration of it (because some type it depends on is
unavailable). This had the effect of causing us to not implicitly give it the
right attributes. It turns out that glibc's __sigsetjmp is declared before
sigjmp_buf is declared, and this resulted in us not implicitly giving it
__attribute__((returns_twice)), which in turn resulted in miscompiles in any C
code calling glibc's sigsetjmp.

(See also the vaguely-related sourceware.org/PR4662.)

llvm-svn: 199850
2014-01-22 23:07:19 +00:00
Aaron Ballman bc909618f2 If an attribute has a semantically meaningful spelling (such as ArgumentWithTypeTagAttr or MSInheritanceAttr), display the spelling used for the attribute as part of the AST dump. This should ease debugging the AST for these attributes. Attributes without semantically meaningful spelling variations are not affected.
llvm-svn: 199834
2014-01-22 21:51:20 +00:00
Mark Seaborn 74020868ee Handle va_arg on struct types for the le32 target (PNaCl and Emscripten)
PNaCl and Emscripten can both handle va_arg IR instructions with
struct type.

Also add a test to cover generating a va_arg IR instruction from
va_arg in C on le32 (as already handled by VisitVAArgExpr() in
CGExprScalar.cpp), which was not covered by a test before.

(This fixes https://code.google.com/p/nativeclient/issues/detail?id=2381)

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

llvm-svn: 199830
2014-01-22 20:11:01 +00:00
Richard Smith 566184ac75 When a special member is explicitly defaulted outside its class, and we reject
the defaulting because it would delete the member, produce additional notes
explaining why the member is implicitly deleted.

llvm-svn: 199829
2014-01-22 20:09:10 +00:00
David Blaikie ec59e75ef2 Driver: Suppression support for -Wa,--compress-debug-sections
(to go with existing suppression of -Wa,-compress-debug-sections)

llvm-svn: 199822
2014-01-22 19:22:21 +00:00
Fariborz Jahanian dad9630398 ObjectiveC. When issuing property implementation is
not using backing ivar warning, ignore when
property is not being synthesized (user declared its
implementation @dynamic). // rdar://1583425

llvm-svn: 199820
2014-01-22 19:02:20 +00:00
Weiming Zhao fb5c21a70b PR18465: [Thumbv8] add predefined macros
currently, for thumbv8, two predefined macros are missing:
 define __THUMB_INTERWORK__ 1
 define __THUMB_INTERWORK__ 1

This patch adds them for thumbv8.

llvm-svn: 199819
2014-01-22 18:42:13 +00:00
Ted Kremenek ef9e7f8059 Add basic checking for returning null from functions/methods marked 'returns_nonnull'.
This involved making CheckReturnStackAddr into a static function, which
is now called by a top-level return value checking routine called
CheckReturnValExpr.

llvm-svn: 199790
2014-01-22 06:10:28 +00:00
Hans Wennborg a6ae1209df clang-cl: make /Zp a Joined option (PR18503)
We don't currently support this option, but we should be able to parse it.

llvm-svn: 199787
2014-01-22 03:23:35 +00:00
Richard Smith 31875a0a6a Add a test file missed from r199782.
llvm-svn: 199783
2014-01-22 02:05:03 +00:00
Richard Smith c278c00613 Build an appropriate (albeit trivial) TypeSourceInfo for a destructor name, so
AST consumers can determine where the destructor name was written. Patch by
Olivier Goffart!

llvm-svn: 199779
2014-01-22 00:30:17 +00:00
Richard Smith e81daee21b When formatting a C++-only declaration name, enable C++ mode in the formatter's
language options. This is not really ideal -- we should require the right
language options to be passed in, or not require language options to format a
name -- but it fixes a number of *obviously* wrong formattings. Patch by
Olivier Goffart!

llvm-svn: 199778
2014-01-22 00:27:42 +00:00
Nico Rieck f8e8b5f5c2 Delay attribute checking until auto types are deduced
Checking in ActOnVariableDeclarator computes and caches the linkage using
the non-deduced auto type which defaults to external linkage. Depending on
how the auto type is deduced linkage can change and conflict with the
cached linkage, hitting asserts.

llvm-svn: 199774
2014-01-21 23:54:36 +00:00
Richard Smith 111d3485af Fix regression in r197623: only diagnose a by-copy capture of an incomplete
type if the capture is, actually, by copy.

llvm-svn: 199772
2014-01-21 23:27:46 +00:00
Chandler Carruth 902efc61be Teach Clang to look in its installation libdir for libraries (such as
libc++) when the installation is within the system root.

This doesn't really help cross compiles much, but we don't (currently)
have a great story around libc++, cross compiles, and who is responsible
for building and/or installing the libraries. However, it handles the
very common case of non-cross builds in a way entirely consistent with
GCC, so I'm hopeful this won't really hose anyone.

This is the second patch that I think should be backported to 3.4 to
give folks an easy to checkout and install working Clang+libc++
toolchain.

llvm-svn: 199769
2014-01-21 22:49:05 +00:00
David Majnemer b9a5f2d3b6 MSVC ABI: Support C++11's auto on variables
The MSVC C++ ABI always uses the deduced type in place of auto when
generating external names for variables.

N.B.  MSVC doesn't support C++1y's 'operator auto' and this patch will
not give us said functionality.

llvm-svn: 199764
2014-01-21 20:33:36 +00:00
David Blaikie 24b71b3072 Correct the function name shown in diagnostics in warn-thread-safety-analysis.c
Patch by Alex Wang.

llvm-svn: 199762
2014-01-21 19:07:40 +00:00
Adrian Prantl 3eff225a44 Debug info: use the file a typedef is defined in as its decl_file instead
of the current compilation unit.
As a side effect this enables many more LTO uniquing opportunities.

This reapplies r199757 with a better testcase.

llvm-svn: 199760
2014-01-21 18:42:27 +00:00
Adrian Prantl cb6e1257ff revert 199757 for buildbot breakage.
llvm-svn: 199758
2014-01-21 18:23:43 +00:00
Adrian Prantl 83788519a5 Debug info: use the file a typedef is defined in as its decl_file instead
of the current compilation unit.
As a side effect this enables many more LTO uniquing opportunities.

rdar://problem/15851206

llvm-svn: 199757
2014-01-21 18:20:52 +00:00
David Woodhouse 6996f6b9ec Add -m16 option for using x86-*-*-code16 triple
llvm-svn: 199754
2014-01-21 17:19:44 +00:00
Tim Northover d875d34171 Macho-embedded: fix tests after last rename
Very sorry, I managed to completely forget "make check".

llvm-svn: 199739
2014-01-21 13:23:09 +00:00
Nick Lewycky 36e9b3ccff Neither attribute overloadable nor enable_if are supported by GCC. Disable the
GCC warning about attributes on function definitions for both of them.

llvm-svn: 199710
2014-01-21 04:31:12 +00:00
Rafael Espindola e1bd71fea4 Use private linkage for utf-16 objc strings too.
llvm-svn: 199709
2014-01-21 02:57:56 +00:00
Rafael Espindola 6839d23be7 Now that r199688 avoids the real issue, use private linkage for objc strings.
llvm-svn: 199705
2014-01-21 01:50:12 +00:00
Bob Wilson 74b6cd15ed Stop linking with crt1.o etc. for the iOS simulator. <rdar://problem/11800973>
Recent versions of the iOS simulator no longer require linking with the
crt1.o, dylib1.o, or bundle1.o files. The relevant code is now included in
libSystem for the simulator.

llvm-svn: 199696
2014-01-21 00:17:10 +00:00
Rafael Espindola d19f80a0b4 Give explicit sections for string constants used in NSStrings.
Without them they can be merged with non unnamed_addr constants during LTO.
The resulting constant is not unnamed_addr and goes in a different section,
which causes ld64 to crash.

A testcase that would crash before:

* file1.mm:
void g(id notification) {
  [notification valueForKey:@"name"];
}

* file2.cpp:
extern const char js_name_str[] = "name";

* file3.cpp
extern bool JS_GetProperty(const char *name);
extern const char js_name_str[];
bool js_ReportUncaughtException() { JS_GetProperty(js_name_str); }

run

clang file1.mm  -o file1.o -c -w -emit-llvm
clang file2.cpp -o file2.o -c -w -emit-llvm
clang file3.cpp -o file3.o -c -w

ld -dylib -o XUL file1.o file2.o file3.o -undefined dynamic_lookup.

llvm-svn: 199688
2014-01-20 20:33:18 +00:00
Fariborz Jahanian 15f60cb2ba ObjectiveC driver. reinstate -fno-objc-legacy-dispatch behavior
when the deployment target is 10.5. // rdar://15852259

llvm-svn: 199682
2014-01-20 19:32:33 +00:00
Rafael Espindola 4f5f0b78a1 Add a triple. Should fix the 64 bit bots.
llvm-svn: 199670
2014-01-20 16:15:48 +00:00
Rafael Espindola a69024aa2a Make the test more strict.
llvm-svn: 199669
2014-01-20 15:58:59 +00:00
Aaron Ballman fc1951c505 Making some minor improvements to r199626.
llvm-svn: 199663
2014-01-20 14:19:44 +00:00
Bradley Smith 0f28f0cfc1 [ARM] Add ACLE enum/wchar size predefines
llvm-svn: 199642
2014-01-20 10:52:00 +00:00
Chandler Carruth 0cfd0e98df Add the test trees that were supposed to be part of r199632.
llvm-svn: 199633
2014-01-20 09:47:21 +00:00
Chandler Carruth 5a3d898758 Make the Linux support for finding libc++ somewhat less braindead.
Now instead of just looking in the system root for it, we also look
relative to the clang binary's directory. This should "just work" in
almost all cases. I've added test cases accordingly.

This is probably *very* worthwhile to backport to the 3.4 branch so that
folks can check it out, build it, and use that as their host compiler
going forward.

llvm-svn: 199632
2014-01-20 09:42:24 +00:00
Alp Toker c620cab8c4 PR18551: accepts invalid strong enum to bool when operator! is used
llvm-svn: 199627
2014-01-20 07:20:22 +00:00
Ted Kremenek dbf62e3eee Wire up basic parser/sema support for attribute 'returns_nonnull'.
This attribute is supported by GCC.  More generally it should
probably be a type attribute, but this behavior matches 'nonnull'.

This patch does not include warning logic for checking if a null
value is returned from a function annotated with this attribute.
That will come in subsequent patches.

llvm-svn: 199626
2014-01-20 05:50:47 +00:00
Alp Toker 73287bfe40 MSVC 2013 type trait support
Implement type trait primitives used in the latest edition of the Microsoft
standard C++ library type_traits header.

With this change we can parse much of the Visual Studio 2013 standard headers,
particularly anything that includes <type_traits>.

Fully implemented, available in all language modes:

 * __is_constructible()
 * __is_nothrow_constructible()
 * __is_nothrow_assignable()

Partially implemented, semantic analysis WIP, available as MS extensions:

 * __is_destructible()
 * __is_nothrow_destructible()

llvm-svn: 199619
2014-01-20 00:24:09 +00:00
Alp Toker b4bca41491 Fix nothrow trait with multiple default constructors
Check all default ctors, not just the first one we see. This brings
__has_nothrow_constructor() in line with the other unary type traits.

A C++ class can have multiple default constructors but clang was only checking
the first one written, presumably due to ambiguity in the GNU specification.

MSVC has the same bug, while g++ has the correct implementation which we now
match.

llvm-svn: 199618
2014-01-20 00:23:47 +00:00
Richard Smith f600441a04 PR18544: don't assert that 'operator new' is not declared inside a namespace;
such an assert will fail in invalid code that does so!

llvm-svn: 199617
2014-01-19 23:25:37 +00:00
NAKAMURA Takumi c28a9a2c33 [CMake] Deprecate CLANG_RUNTIME_OUTPUT_INTDIR and CLANG_LIBRARY_OUTPUT_INTDIR.
LLVM_*_OUTPUT_INTDIR should be available everywhere. It was my mistake when I introduced INTDIR stuff.

llvm-svn: 199597
2014-01-19 13:00:01 +00:00
NAKAMURA Takumi 718d3b63f6 [CMake] Prune LLVM_TOOLS_DIR and LLVM_LIBS_DIR in clang/test/CMakeLists.txt. They are overridden in configure_lit_site_cfg().
llvm-svn: 199591
2014-01-19 12:45:35 +00:00
NAKAMURA Takumi 2e3166af59 [CMake] check-clang requires clang-tblgen. It is not required by anyone when external CLANG_TABLEGEN is specified.
llvm-svn: 199579
2014-01-19 08:54:48 +00:00
David Blaikie d74be70aba Driver support for -fdebug-types-sections
Using backend-option like a few other debug codegen flags. I believe
Eric Christopher's working at porting those over to something nicer
such as an API level CodeGenOptions or the like, so this can be
improved along with that work.

llvm-svn: 199535
2014-01-18 02:02:06 +00:00
Alp Toker 0abb057715 Restrict redeclaration of tags introduced by using decls to MSVCCompat
This limits the facility added in r199490 while we seek clarification on the
standard.

llvm-svn: 199531
2014-01-18 00:59:32 +00:00
Richard Smith 59d26d2e67 PR12788: Remove unnecessary and incorrect special case for indirect fields.
This caused us to skip a step that was essential for correct access control.

llvm-svn: 199522
2014-01-17 22:29:43 +00:00
Ismail Pazarbasi 1121de36c2 Fix string-literal to char* conversion in overload resolution for C++11
String literal to char* conversion is deprecated in C++03, and is removed in
C++11. We still accept this conversion in C++11 mode as an extension, if we find
it in the best viable function.

llvm-svn: 199513
2014-01-17 21:08:52 +00:00
Richard Smith 990a692f4a Don't allow 'this' within typedefs within classes that otherwise look like they
might be member function declarations. Patch by Harald van Dijk!

llvm-svn: 199512
2014-01-17 21:01:18 +00:00
Aaron Ballman d6432f838e Adding a test case for nonnull being attached to something other than a function, Objective-C method, or parameter.
llvm-svn: 199496
2014-01-17 14:38:58 +00:00
Alp Toker 320374c4b1 Permit redeclaration of tags introduced by using decls
This valid construct appears in MSVC headers where it's used to provide a
definition for the '::type_info' compiler builtin type.

llvm-svn: 199490
2014-01-17 12:57:21 +00:00
Ted Kremenek 15478b32cb Add more test cases for attribute 'objc_protocol_requires_explicit_implementation'.
llvm-svn: 199480
2014-01-17 08:34:19 +00:00
NAKAMURA Takumi 5c486cf3f3 Revert r199416, "MS ABI: Improve selection of an inheritance model"
It broke tests for targeting x86_64-pc-win32:

    Clang Tools :: clang-modernize/LoopConvert/array.cpp
    Clang :: CodeGenCXX/2010-05-10-Var-DbgInfo.cpp
    Clang :: CodeGenCXX/member-call-parens.cpp
    Clang :: CodeGenCXX/ptr-to-datamember.cpp
    Clang :: SemaTemplate/instantiate-function-1.cpp

llvm-svn: 199475
2014-01-17 07:33:47 +00:00
Ted Kremenek f0ae7d0201 [analyzer] Teach NonNullParamChecker about 'nonnull' attributes on parameters.
llvm-svn: 199473
2014-01-17 07:15:35 +00:00
NAKAMURA Takumi 4ec59174fd Tweak clang/test/PCH/modified-module-dependency.m for win32 hosts.
llvm-svn: 199469
2014-01-17 07:04:17 +00:00
Ted Kremenek 9aedc159ef Enhance attribute 'nonnull' to be applicable to parameters directly (infix).
This allows the following syntax:

  void baz(__attribute__((nonnull)) const char *str);

instead of:

  void baz(const char *str) __attribute__((nonnull(1)));

This also extends to Objective-C methods.

The checking logic in Sema is not as clean as I would like.  Effectively
now we need to check both the FunctionDecl/ObjCMethodDecl and the parameters,
so the point of truth is spread in two places, but the logic isn't that
cumbersome.

Implements <rdar://problem/14691443>.

llvm-svn: 199467
2014-01-17 06:24:56 +00:00
Alp Toker e1252dfb02 Tweak test run line for readability
Matching up the argument order in r199455's two RUN lines better demonstrates
what's going on.

llvm-svn: 199456
2014-01-17 03:35:04 +00:00
Alp Toker 810940f3ec Make -verify a -cc1 NoDriverOption
'%clang -verify' will now issue an error instead of succeeding without
verification. This should catch flawed tests like r199347.

Followup to r199451.

llvm-svn: 199455
2014-01-17 03:21:54 +00:00
David Blaikie 372d950a24 Driver: Stub -Wa,-compress-debug-sections support for integrated-as with a suppressable warning
llvm-svn: 199454
2014-01-17 03:17:40 +00:00
Richard Smith 741081708e PR18477: Create a function scope representing the constructor call when
handling C++11 default initializers. Without this, other parts of Sema (such as
lambda capture) would think the default initializer is part of the surrounding
function scope.

llvm-svn: 199453
2014-01-17 03:11:34 +00:00
Richard Smith 2c6b449098 Issue a warning if a throwing operator new or operator new[] returns a null
pointer, since this invokes undefined behavior. Based on a patch by Artyom
Skrobov! Handling of dependent exception specifications and some additional
testcases by me.

llvm-svn: 199452
2014-01-17 02:09:33 +00:00
Alp Toker e9d2bfc7e9 Split out -verify into two distinct option flags
Instead of dual-purposing a single flag, rename the driver option to
--verify-debug-info.

The frontend -verify option that enables diagnostic verification remains
unchanged except that it's now a pure CC1Option.

Both have been given proper help text.

llvm-svn: 199451
2014-01-17 02:06:23 +00:00
Hans Wennborg 72005cb59d ms-intrin.cpp: add -Werror to the test
llvm-svn: 199450
2014-01-17 01:41:07 +00:00
Ben Langmuir e82630d5d5 Improve the error message when a PCH dependency is modified
Show the top-level pch file as the culprit, rather than the immediate
dependency when a pch file imports a pcm from a module. To clarify the
relationship, the pch import stack is printed as notes. The old behaviour was
misleading when a pch imported a pcm (from a module), since removing the pcm
would not fix the problem, whereas rebuilding the pch would.

llvm-svn: 199446
2014-01-17 00:19:09 +00:00
Adrian Prantl d1b151ed7c Debug info: Refactor NoLocation and ArtificialLocation to use a common base
class and use it pervasively to restore debug locations.
Fixes an interaction between cleanup and EH that caused the location
to not be restored properly after emitting a landing pad.
rdar://problem/15208190

llvm-svn: 199444
2014-01-17 00:15:10 +00:00
Richard Smith 3dd73db411 Move away from 'general' / 'generalized' as a way of identifying C++11
attribute syntax. There's nothing generalized about this; it's one of
several first-class attribute syntaxes we support, all of which are
more-or-less equally general.

As discussed on cfe-commits, we may want to revisit this if we start allowing
this syntax as an extension in C (or if C adopts the syntax), but hopefully
this diagnostic wording will be crystal clear to everyone in the mean time.

llvm-svn: 199443
2014-01-17 00:11:48 +00:00
Hans Wennborg b3dec1b4b9 ms-intrin.cpp: no need for -verify anymore
llvm-svn: 199442
2014-01-17 00:04:43 +00:00
Hans Wennborg aae6ac48e7 Relax the ms-intrin.cpp test
The part that checks that certain functions are marked deprecated doesn't
seem that useful, and it has the bad effect that the test hard-coded the
locations of the notes from that test.

llvm-svn: 199441
2014-01-16 23:59:08 +00:00
Richard Smith beef3453cd Clean up variable template handling a bit, and correct the behavior of name
lookup when declaring a variable template specialization.

llvm-svn: 199438
2014-01-16 23:39:20 +00:00
DeLesley Hutchins 80a38428e5 Consumed analysis: bugfix for operator calls. Also fixes some formatting
issues, a few testcases, and kills fish.

llvm-svn: 199436
2014-01-16 23:07:16 +00:00
David Majnemer 37054dd4e7 MS ABI: Improve selection of an inheritance model
The MSVC ABI is rather finicky about the exact representation of it's
pointer-to-member representation.  The exact position of when and where
it will go with one representation versus another appears to be when it
desires the pointer-to-member to be complete.

To properly implement this in clang, do several things:
- Give up on tracking the polymorphic nature of the class.  It isn't
  useful to Sema and is only pertinent when choosing CodeGen-time
  details like whether the field-offset can be 0 instead of -1.
- Insist on locking-in the inheritance model when we ask our
  pointer-to-member type to be complete.  From there, grab the
  underlying CXXRecordDecl and try to make *that* complete.  Once we've
  done this, we can calculate it's inheritance model and apply it using
  an attribute.

N.B. My first bullet point is a lie.  We will eventually care about the
specifics of whether or not a CXXRecordDecl is or is not polymorphic
because MSVC compatible mangling of such things depends on it.  However,
I believe we will handle this in a rather different way.

llvm-svn: 199416
2014-01-16 20:05:57 +00:00
Jordan Rose 2be02a7848 [analyzer] Shitfing a constant value by its bit width is undefined.
Citation: C++11 [expr.shift]p1 (and the equivalent text in C11).

This fixes PR18073, but the right thing to do (as noted in the FIXME) is to
have a real checker for too-large shifts.

llvm-svn: 199405
2014-01-16 18:02:23 +00:00
Jakob Stoklund Olesen 497332c05f SPARCv9 implements long double as an IEEE quad.
llvm-svn: 199399
2014-01-16 16:43:19 +00:00
Aaron Ballman 36a5350e51 Distinguish between attributes explicitly written at the request of the user, and attributes implicitly generated to assist in bookkeeping by the compiler. This is done so by table generating a CreateImplicit method for each attribute.
Additionally, remove the optional nature of the spelling list index when creating attributes. This is supported by table generating a Spelling enumeration when the spellings for an attribute are distinct enough to warrant it.

llvm-svn: 199378
2014-01-16 13:03:14 +00:00
David Majnemer f5b93794b7 Sema: Fix crash during member pointer conversion involving incomplete classes
We would attempt to determine the inheritance relationship between
classes 'A' and 'B' during static_cast if we tried to convert from 'int
A::*' to 'int B::*'.  However, the question "does A derive from B" is
not meaningful when 'A' isn't defined.

Handle this case by requiring that 'A' be defined.

This fixes PR18506.

llvm-svn: 199374
2014-01-16 12:02:55 +00:00
Evgeniy Stepanov d04b861e69 [asan] Remove -fsanitize-address-zero-base-shadow command line
flag from clang, and disable zero-base shadow support on all platforms
where it is not the default behavior.

- It is completely unused, as far as we know.
- It is ABI-incompatible with non-zero-base shadow, which means all
objects in a process must be built with the same setting. Failing to
do so results in a segmentation fault at runtime.
- It introduces a backward dependency of compiler-rt on user code,
which is uncommon and complicates testing.

This is the Clang part of a larger change.

llvm-svn: 199372
2014-01-16 10:19:31 +00:00
Tim Northover 157d911b42 MachO: use *-*-*-macho for MachO embedded targets.
Previously we had bodged together some hacks mapping MachO embedded
targets (i.e. mainly ARM v6M and v7M) to the "*-*-darwin-eabi" triple.
This is incorrect in both details (they don't run Darwin and they're
not EABI in any real sense).

This commit appropriates the existing "MachO" environment for the
purpose instead.

llvm-svn: 199367
2014-01-16 08:48:16 +00:00
Alp Toker 11a71128b7 Forbid driver use in Sema tests
This ports the last Sema tests over to use the frontend directly, and adds a
local lit substitution to disable inappropriate %clang usage under this
directory.

llvm-svn: 199348
2014-01-16 02:37:08 +00:00
Alp Toker b9411ce1f7 Disable and XFAIL a test that never worked
-verify was simply ignored by the driver.

This commit fixes the RUN line and XFAILs the test, unblocking changes to ban
use of the driver in Sema tests and avoid problems like this.

llvm-svn: 199347
2014-01-16 02:36:24 +00:00
Jan Wen Voung 1f9c4ee464 Ensure i686-nacl long long is aligned 8 bytes (like malign-double)
Set NaCl OSTargetInfo to have LongLongAlign = 64. Otherwise, it will
pick up the setting of 32 from X86_32TargetInfo.

llvm-svn: 199335
2014-01-15 21:42:41 +00:00
Roman Divacky dd9bfb2c1a Make -fno-inline attach NoInline attribute to all functions that are not
marked as AlwaysInline or ForceInline.

This moves us to what gcc does with -fno-inline. The attribute approach
was discussed to be better than switching to InlineAlways inliner in presence
of LTO.

llvm-svn: 199324
2014-01-15 19:07:16 +00:00
Jordan Rose e02e96a69f [analyzer] Print function name when dumping its CFG.
This allows us to use CHECK-LABEL to ensure that we're checking the right CFG.

Debugging change only.

llvm-svn: 199320
2014-01-15 17:25:05 +00:00
Erik Verbruggen 888d52a655 Fix for PR9812: warn about bool instead of _Bool.
llvm-svn: 199311
2014-01-15 09:15:43 +00:00
Chandler Carruth b653131345 Move a bunch of tests to directly use the CC1 layer. This at least saves
a subprocess invocation which is pretty significant on Windows. It also
likely saves a bunch of thrashing the host machine needlessly. Finally
it makes the tests much more predictable and less dependent on the host.
For example 'header_lookup1.c' was passing '-fno-ms-extensions' just to
thwart the host detection adding it into the compilation. By runnig CC1
directly we don't have to deal with such oddities.

llvm-svn: 199308
2014-01-15 09:08:07 +00:00
Chandler Carruth f9814063c6 Switch this test from needlessly running the clang driver to directly
test the CC1 layer.

This actually uncovered that the test semes to no longer be passing for
the reasons intended. =[ The name of the test would lead me to believe
that it should be testing the semantics of noreturn in the static
analyzer.... but there are in fact no -verify assertions about noreturn
that i can find. And the noreturn checker is no longer in 'alpha.core'.
It is in 'core.builtins'. The test *does* have one assertion for a null
dereference warning. This *also* isn't in 'alpha.core', but the driver
inserts a pile of other checker packages, including 'core' which has
this warning.

So I have switch the RUN line to actually do the minimal thing that this
test currently exercises, but someone who works on the static analyzer
should probably look at this and either nuke it or move it to actually
check the noreturn behavior.

llvm-svn: 199307
2014-01-15 09:07:56 +00:00
Serge Pavlov b620b9d0db Fixed error recovery if sizeof is used without parenthesis
Changes made in r192200 fixed PR16992, which requested fixit suggesting
parenthesis if sizeof is followed by type-id. However expression in form
T() followed by ')' was incorrectly considered as a type-id if 'T' is
typedef name. This change fixes this case.

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

llvm-svn: 199284
2014-01-15 01:53:39 +00:00
Bob Wilson a19fad7735 Rename QA_OVERRIDE_GCC3_OPTIONS to CCC_OVERRIDE_OPTIONS. <rdar://14578381>
Continue to accept the old name for a while to make it an easier transition
for people who rely on this.

llvm-svn: 199283
2014-01-15 01:41:52 +00:00
Hans Wennborg 1e76cbaebb lit.cfg: Don't expand %ms_abi_triple to non-X86 triples
This is a follow-up to r199260. On ARM hosts, we were attempting to run
tests with triples such as armv7l-unknown-win32. This expands that fix to
cover all non-x86 targets since we only support MS ABI on x86.

llvm-svn: 199280
2014-01-15 01:08:42 +00:00
Fariborz Jahanian bae1bcb6bf ObjectiveC. Improve on diagnostics per Jordan's feedback.
llvm-svn: 199278
2014-01-15 00:59:25 +00:00
Ted Kremenek 0f83390540 Teach DeadStoresChecker about attribute objc_precise_lifetime.
llvm-svn: 199277
2014-01-15 00:59:23 +00:00
Reid Kleckner 9e6e67c2ef Use i686 as the ISA in %microsoft_abi_triple on ARM
Long term we should make -triple arm7l-*-win32 do something sensible,
but for now it's broken and untested.

llvm-svn: 199260
2014-01-14 22:36:02 +00:00
Fariborz Jahanian 2ea30fb9b0 ObjectiveC. produce more expressive warning when
-Wselector detects an unimplemented method used
in an @selector expression. // rdar://15781538

llvm-svn: 199255
2014-01-14 20:35:13 +00:00
Hans Wennborg c9bd88e681 Remove the -cxx-abi command-line flag.
This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples,
Itanium otherwise. It's no longer possible to do weird combinations.

To be able to run a test with a specific ABI without constraining it to a
specific triple, new substitutions are added to lit: %itanium_abi_triple and
%ms_abi_triple can be used to get the current target triple adjusted to the
desired ABI. For example, if the test suite is running with the i686-pc-win32
target, %itanium_abi_triple will expand to i686-pc-mingw32.

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

llvm-svn: 199250
2014-01-14 19:35:09 +00:00
Tim Northover 8799445065 Darwin: add __sinpi (etc) and __exp10 libbuiltins
These functions have the same constness properties of the normal libm
functions, which allows LLVM to optimise code better in general. There
are also a couple of specific optimisations that only trigger when
these are properly marked.

rdar://problem/13729466

llvm-svn: 199249
2014-01-14 19:26:03 +00:00
Aaron Ballman 2689133805 Simplifying the OpenCL image attribute. It does not need a semantic integer parameter because the required information is encoded in the spelling. Added an appropriate subject to the attribute, and simplified the semantic checking (which will likely be expanded upon in a future patch). Also, removed the GNU spelling since it was unsupported in the first place.
llvm-svn: 199229
2014-01-14 17:41:53 +00:00
Jordan Rose 6f5f719806 CFG: use Visit instead of VisitStmt to look through parens.
PR18472

llvm-svn: 199227
2014-01-14 17:29:12 +00:00