Commit Graph

44852 Commits

Author SHA1 Message Date
Tareq A. Siraj 0de0dd4923 Parser support for #pragma clang __debug captured
This patch implements parsing ‘#pragma clang __debug’ as a first step for
implementing captured statements. Captured statements are a mechanism for
doing outlining in the AST.
see http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html.

Currently returns StmtEmpty

Author: Andy Zhang <andy.zhang@intel.com>

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

llvm-svn: 179614
2013-04-16 18:41:26 +00:00
Daniel Dunbar e246fbe40b [Modules] Convert module specific -fno-modules-autolink into -fno-autolink.
- There is no reason to have a modules specific flag for disabling
   autolinking. Instead, convert the existing flag into -fno-autolink (which
   should cover other autolinking code generation paths like #pragmas if and
   when we support them).

llvm-svn: 179612
2013-04-16 18:21:19 +00:00
Fariborz Jahanian f177c035b7 modify test to try to make buildbot happy.
llvm-svn: 179606
2013-04-16 17:18:37 +00:00
Jyotsna Verma e90fe76abd Remove setjmp.h header file from Sema/return.c test and include necessary
declarations explicitly in the test.

llvm-svn: 179604
2013-04-16 16:10:38 +00:00
Douglas Gregor 012efe22bc Fix PR4296: Add parser detection/error recovery for nested functions, from Serve Pavlov!
llvm-svn: 179603
2013-04-16 16:01:32 +00:00
Jyotsna Verma abd62140c0 Use -emit-llvm for the following tests to stop them from failing for Hexagon:
CodeGenCXX/vtable-debug-info.cpp
Driver/objc++-cpp-output.mm
Driver/objc-cpp-output.m

llvm-svn: 179602
2013-04-16 15:55:41 +00:00
Douglas Gregor 8997dac30a Fix handling of atomic shift operations, from Serge Pavlov.
llvm-svn: 179600
2013-04-16 15:41:08 +00:00
Fariborz Jahanian d1b6778e69 Objective-C IRGen. Use llvm::WeakVH
for caching couple of global symbols used
for generation of CF/NS string meta-data
so they are not released prematuely in certain
corner cases. // rdar:// 13598026.
Reviewed by John M.

llvm-svn: 179599
2013-04-16 15:25:39 +00:00
Rafael Espindola 3c4a251ce8 Suppress unused warning on static inline function template specializations.
Patch by Halfdan Ingvarsson!

llvm-svn: 179598
2013-04-16 15:21:30 +00:00
Jakob Stoklund Olesen 4dda152d14 Add support for sparcv9 targets.
The SPARC v8 and SPARC v8 architectures are very similar, so use a base
class to share most information between them.

Include operating systems with known SPARC v9 ports.

Also fix two issues with the SPARC v8 data layout string: SPARC v8 is a
big endian target with a 64-bit aligned stack.

llvm-svn: 179596
2013-04-16 15:17:49 +00:00
John McCall 5e77d76c95 Basic support for Microsoft property declarations and
references thereto.

Patch by Tong Shen!

llvm-svn: 179585
2013-04-16 07:28:30 +00:00
Rafael Espindola 9dd86de771 Correctly propagate the storage class to function template instantiations.
This fixes pr15753. This is another case of the fuzzy definition of the
"as written" storage class of an instantiation.

llvm-svn: 179581
2013-04-16 02:29:15 +00:00
Anna Zaks e4cfcd4e41 [analyzer] Improve the malloc checker stack hint message
llvm-svn: 179580
2013-04-16 00:22:55 +00:00
Anna Zaks 8591aa78db [analyzer] Do not crash when processing binary "?:" in C++
When computing the value of ?: expression, we rely on the last expression in
the previous basic block to be the resulting value of the expression. This is
not the case for binary "?:" operator (GNU extension) in C++. As the last
basic block has the expression for the condition subexpression, which is an
R-value, whereas the true subexpression is the L-value.

Note the operator evaluation just happens to work in C since the true
subexpression is an R-value (like the condition subexpression). CFG is the
same in C and C++ case, but the AST nodes are different, which the LValue to
Rvalue conversion happening after the BinaryConditionalOperator evaluation.

Changed the logic to only use the last expression from the predecessor only
if it matches either true or false subexpression. Note, the logic needed
fortification anyway: L and R were passed but not even used by the function.

Also, change the conjureSymbolVal to correctly compute the type, when the
expression is an LG-value.

llvm-svn: 179574
2013-04-15 22:38:07 +00:00
Anna Zaks 7460deb15d [analyzer] Add pretty printing to CXXBaseObjectRegion.
llvm-svn: 179573
2013-04-15 22:38:04 +00:00
Anna Zaks e2e8ea62df [analyzer] Address code review for r179395
Mostly refactoring + handle the nested fields by printing the innermost field only.

llvm-svn: 179572
2013-04-15 22:37:59 +00:00
Anna Zaks 0881b8882e [analyzer] Add more specialized error messages for corner cases as per Jordan's code review for r179396
llvm-svn: 179571
2013-04-15 22:37:53 +00:00
Daniel Jasper 1b8e76f14e Break after multiline parameters.
We do this in general, but missed a few cases.

Before:
void aaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbb bbbb);

After:
void aaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
    bbbb bbbb);

llvm-svn: 179570
2013-04-15 22:36:37 +00:00
Jordan Rose 27ae8a2800 [analyzer] Don't assert on a temporary of pointer-to-member type.
While we don't do anything intelligent with pointers-to-members today,
it's perfectly legal to need a temporary of pointer-to-member type to, say,
pass by const reference. Tweak an assertion to allow this.

PR15742 and PR15747

llvm-svn: 179563
2013-04-15 22:03:38 +00:00
Joey Gouly 75e81e645d Remove some dead code that has not been used since 2010.
llvm-svn: 179558
2013-04-15 21:13:33 +00:00
Jordan Rose 2820e3dfca [analyzer] Be lazy about struct/array global invalidation too.
Structs and arrays can take advantage of the single top-level global
symbol optimization (described in the previous commit) just as well
as scalars.

No intended behavioral change.

llvm-svn: 179555
2013-04-15 20:39:48 +00:00
Jordan Rose fa80736bca [analyzer] Re-enable using global regions as a symbolic base.
Now that we're invalidating global regions properly, we want to continue
taking advantage of a particular optimization: if all global regions are
invalidated together, we can represent the bindings of each region with
a "derived region value" symbol. Essentially, this lazily links each
global region with a single symbol created at invalidation time, rather
than binding each region with a new symbolic value.

We used to do this, but haven't been for a while; the previous commit
re-enabled this code path, and this handles the fallout.

<rdar://problem/13464044>

llvm-svn: 179554
2013-04-15 20:39:45 +00:00
Jordan Rose 577749a337 [analyzer] Properly invalidate global regions on opaque function calls.
This fixes a regression where a call to a function we can't reason about
would not actually invalidate global regions that had explicit bindings.

  void test_that_now_works() {
    globalInt = 42;
    clang_analyzer_eval(globalInt == 42); // expected-warning{{TRUE}}

    invalidateGlobals();
    clang_analyzer_eval(globalInt == 42); // expected-warning{{UNKNOWN}}
  }

This has probably been around since the initial "cluster" refactoring of
RegionStore, if not longer.

<rdar://problem/13464044>

llvm-svn: 179553
2013-04-15 20:39:41 +00:00
Jordan Rose d02adbf03c [analyzer] Tests: move system functions into system header simulator files.
Some checkers ascribe different behavior to functions declared in system
headers, so when working with standard library functions it's probably best
to always have them in a standard location.

Test change only (no functionality change), but necessary for the next commit.

llvm-svn: 179552
2013-04-15 20:39:37 +00:00
Argyrios Kyrtzidis fe7a59d9c2 Revert "Speed-up ObjCMethodDecl::getOverriddenMethods()."
This reverts commit r179436.

Due to caching, it was possible that we could miss overridden methods that
were introduced by categories later on.

Along with reverting the commit I also included a test case that would have caught this.

llvm-svn: 179547
2013-04-15 18:47:22 +00:00
Rafael Espindola 05976798dc Remove XFAIL now that the test is standalone.
llvm-svn: 179538
2013-04-15 17:06:15 +00:00
Argyrios Kyrtzidis 7134bb4531 [PCH/test] Make test/PCH/cxx-typeid.cpp self-contained by including the relevant standard library declarations
instead of depending on a system header inclusion.

llvm-svn: 179537
2013-04-15 16:52:57 +00:00
Alexander Kornienko c3c8affc06 Fix unused variable warning with assertions disabled.
llvm-svn: 179531
2013-04-15 15:47:34 +00:00
Rafael Espindola 3f532c5c38 Use llvm::sys::IsBigEndianHost.
llvm-svn: 179529
2013-04-15 15:10:35 +00:00
Alexander Kornienko cb45bc1861 Unified token breaking logic for strings and block comments.
Summary:
Both strings and block comments are broken into lines in
breakProtrudingToken. Logic specific for strings or block comments is abstracted
in implementations of the BreakToken interface. Among other goodness, this
change fixes placement of backslashes after a block comment inside a
preprocessor directive (see removed FIXMEs in unit tests).

The code is far from being polished, and some parts of it will be changed for
line comments support.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits

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

llvm-svn: 179526
2013-04-15 14:28:00 +00:00
Timur Iskhodzhanov 088b603989 Add a missing space
llvm-svn: 179525
2013-04-15 14:16:31 +00:00
Rafael Espindola 5bddd6a92a Remove hasExternalLinkageUncached.
It was being used correctly, but it is a very dangerous API to have around.
Instead, move the logic from the filtering to when we are deciding if we should
link two decls.

llvm-svn: 179523
2013-04-15 12:49:13 +00:00
Rafael Espindola 29cda59a9d Fix the storage class of method instantiations.
We keep the "as written" storage class, but that is a fuzzy concept for
instantiations. With this patch instantiations of methods of class templates
now get a storage class that is based on the semantics of isStatic(). With this
can simplify isStatic() itself.

llvm-svn: 179521
2013-04-15 12:38:20 +00:00
Tim Northover 737889ded7 Remove reference to MSVC only building X86 backend.
This is no longer true.

llvm-svn: 179519
2013-04-15 11:55:27 +00:00
Richard Smith 5990db62f6 Local thread_local variables are implicitly 'static'. (This doesn't apply to _Thread_local nor __thread.)
llvm-svn: 179517
2013-04-15 08:33:22 +00:00
Richard Smith 774672e943 Properly check for a constant initializer for a thread-local variable.
llvm-svn: 179516
2013-04-15 08:07:34 +00:00
Richard Smith a8f52c8d88 Add triple to another test.
llvm-svn: 179515
2013-04-15 08:02:05 +00:00
Richard Smith 643a2869b3 Add triples to these tests since they're now using TLS, which isn't available on all targets.
llvm-svn: 179514
2013-04-15 08:00:15 +00:00
Nadav Rotem 6a0dd6b78c Add a new flag -vectorize-slp-aggressive to enable Hals BB vectorizer.
llvm-svn: 179507
2013-04-15 05:38:41 +00:00
Nadav Rotem 0a2604daab Rename the slp-vectorizer clang/llvm flags. No functionality change.
llvm-svn: 179506
2013-04-15 04:57:18 +00:00
Dmitri Gribenko 6e06e04ec1 Comment command table: use inheritance instead of duplicating code
llvm-svn: 179501
2013-04-15 02:31:50 +00:00
Richard Smith dbf74baee5 CodeGen support for function-local static thread_local variables with
non-constant constructors or non-trivial destructors. Plus bugfixes for
thread_local references bound to temporaries (the temporaries themselves are
lifetime-extended to become thread_local), and the corresponding case for
std::initializer_list.

llvm-svn: 179496
2013-04-14 23:01:42 +00:00
Rafael Espindola e45f58d8a9 Removed #if 0 code that doesn't compiled if uncommented.
llvm-svn: 179495
2013-04-14 22:08:07 +00:00
Richard Smith 6ea1a4d1dc Diagnose if a __thread or _Thread_local variable has a non-constant initializer
or non-trivial destructor.

llvm-svn: 179491
2013-04-14 20:11:31 +00:00
Anna Zaks 1ebded0a11 [analyzer] Add a link to the Building a Checker in 24 Hours talk to the developer manual
llvm-svn: 179490
2013-04-14 18:36:51 +00:00
Simon Atanasyan 607776140b [Mips] Support -mmicromips / -mno-micromips command line options.
llvm-svn: 179489
2013-04-14 14:07:51 +00:00
Simon Atanasyan f00872479c [Mips] Fix indentation.
llvm-svn: 179488
2013-04-14 14:07:41 +00:00
Simon Atanasyan 82eec3aeba [Mips] Follow-up to r179481. Reduce code duplication. Use
AddTargetFeature() routine to handle -msingle-float / -mdouble-float
options.

llvm-svn: 179487
2013-04-14 14:07:36 +00:00
Simon Atanasyan 1607191e66 [Mips] Follow-up to r179481. Consider "single-float" as a separate
independent of float ABI feature in the MipsTargetInfoBase class.

llvm-svn: 179486
2013-04-14 14:07:30 +00:00
Rafael Espindola 50ba983d25 Add driver support for fedora 18 on ARM.
llvm-svn: 179484
2013-04-14 10:14:21 +00:00