Commit Graph

9616 Commits

Author SHA1 Message Date
Bob Wilson 7201af3914 Use intrinsics for Neon vmull operations. Radar 9208957.
llvm-svn: 128590
2011-03-31 00:09:00 +00:00
Ted Kremenek 723cdf16fa Put "#pragma message ..." into its own warning (human friendly) category.
llvm-svn: 128573
2011-03-30 21:09:57 +00:00
Argyrios Kyrtzidis e9c3272f55 Silence warnings of unkwown -Wlarger-than and -Wframe-larger-than. Fixes rdar://6970318.
llvm-svn: 128560
2011-03-30 18:02:43 +00:00
Ted Kremenek 98a24e37c5 Begin reworking static analyzer support for C++ method calls. The current logic was divorced
from how we process ordinary function calls, had a tremendous about of redundancy, and relied
strictly on inlining behavior (which was incomplete) to provide semantics instead of falling
back to the conservative analysis we use for C functions.  This is a significant step into
making C++ analyzer support more useful.

llvm-svn: 128557
2011-03-30 17:41:19 +00:00
Fariborz Jahanian 7a26ba4d0d Fix IRGen issues related to using property-dot syntax
for prperty reference types. // rdar://9208606.

llvm-svn: 128551
2011-03-30 16:11:20 +00:00
Argyrios Kyrtzidis 4ee039647a [analyzer] Checker Packages can now belong to a group. This requires llvm commit r128474.
llvm-svn: 128475
2011-03-29 18:54:02 +00:00
Daniel Dunbar 67919b2a5b Integrated-As: Support -Wa,-L when using the integrated assembler.
llvm-svn: 128433
2011-03-28 22:49:28 +00:00
Daniel Dunbar 9cf7bc7a6c Frontend/cc1as: Add support for -L.
llvm-svn: 128432
2011-03-28 22:49:24 +00:00
Eli Friedman 9db11f82a5 Remove stray null from the middle of a comment. (Found because my editor
was refusing to open the file.)

llvm-svn: 128402
2011-03-28 02:00:21 +00:00
Francois Pichet 4e7a2c09b2 Improve recovery (error + fix-it) when parsing type dependent template name without the "template" keyword.
For example:
   typename C1<T>:: /*template*/ Iterator<0> pos; 

Also the error is downgraded to an ExtWarn in Microsoft mode.

llvm-svn: 128387
2011-03-27 19:41:34 +00:00
Chandler Carruth 33bf3e758d Diagnose uninitialized uses of a variable within its own initializer.
This is basically the same idea as the warning on uninitialized uses of
fields within an initializer list. As such, it is on by default and
under -Wuninitialized.

Original patch by Richard Trieu, with some massaging from me on the
wording and grouping of the diagnostics.

llvm-svn: 128376
2011-03-27 09:46:56 +00:00
Anton Yartsev 28ccef788b supported: AltiVec vector initialization with a single literal according to PIM section 2.5.1 - after initialization all elements have the value specified by the literal
llvm-svn: 128375
2011-03-27 09:32:40 +00:00
Chandler Carruth b6766f07c8 Add an option to suppress include stack printing on note diagnostics.
These stacks are often less important than those on primary diagnostics.

As the number of notes grows, this becomes increasingly important. The
include stack printing is clever and doesn't print stacks for adjacent
diagnostics from the same file, but when a note is in between a sequence
of errors in a header file, and the notes all refer to some other file,
we end up getting a worst-case ping-pong of include stacks that take up
a great deal of vertical space.

Still, for now, the default behavior isn't changed. We can evaluate user
feedback with the flag.

Patch by Richard Trieu, a couple of style tweaks from me.

llvm-svn: 128371
2011-03-27 01:50:55 +00:00
Chandler Carruth 6e50103acd Add -f[no-]strict-overflow to the Clang driver. Use it to set the
default for -fwrapv if that flag isn't specified explicitly. We always
prefer an explict setting of -fwrapv when present. Also adds support for
-fno-wrapv to allow disabling -fwrapv even when -fno-strict-overflow is
passed.

llvm-svn: 128353
2011-03-27 00:04:55 +00:00
Fariborz Jahanian 071caefef2 More coherent diagnostic attempting to assign to a member of a const object returned
from an objective-c message: // rdar://9005189

llvm-svn: 128348
2011-03-26 19:48:30 +00:00
Fariborz Jahanian c85269fb40 Make diagnostic clearer.
llvm-svn: 128343
2011-03-26 17:07:06 +00:00
Douglas Gregor 1baf38f5a6 On Mac OS X, the presence of an 'availability' attribute for that
platform implies default visibility. To achieve these, refactor our
lookup of explicit visibility so that we search for both an explicit
VisibilityAttr and an appropriate AvailabilityAttr, favoring the
VisibilityAttr if it is present.

llvm-svn: 128336
2011-03-26 12:10:19 +00:00
Douglas Gregor 7ab142b55a Extend the new 'availability' attribute with support for an
'unavailable' argument, which specifies that the declaration to which
the attribute appertains is unavailable on that platform.

llvm-svn: 128329
2011-03-26 03:35:55 +00:00
John McCall 7853595253 Allow GC qualifiers to be added/removed by conversions from/to void*
without a warning.

llvm-svn: 128328
2011-03-26 02:56:45 +00:00
Craig Silverstein c31d4ce81c TraverseNestedNameSpecifier -> TraverseNestedNameSpecifierLoc in a few
places where we can, now.  OK-ed by dgregor.

llvm-svn: 128307
2011-03-25 23:31:36 +00:00
Anders Carlsson cafbab7443 Remove the last of ClassVirtSpecifiers.
llvm-svn: 128279
2011-03-25 14:53:29 +00:00
Anders Carlsson 30f29444c0 Get rid of handling of the 'explicit' keyword from class-head. We still parse it though, although that will change shortly.
llvm-svn: 128277
2011-03-25 14:31:08 +00:00
Anders Carlsson 806aa66e8f Remove warnings about using override control keywords in inline function definitions; they will be allowed in the next C++0x draft.
llvm-svn: 128273
2011-03-25 11:28:25 +00:00
Anders Carlsson debd3ec14d Remove 'new' from virt-specifier since it's going to be removed in the next C++0x draft
llvm-svn: 128271
2011-03-25 11:19:41 +00:00
Nick Lewycky d469321186 Apply the nonnull attribute to constructor expressions too.
llvm-svn: 128253
2011-03-25 01:44:32 +00:00
John McCall 084e83dfe7 Insomniac refactoring: change how the parser allocates attributes so that
AttributeLists do not accumulate over the lifetime of parsing, but are
instead reused.  Also make the arguments array not require a separate
allocation, and make availability attributes store their stuff in
augmented memory, too.

llvm-svn: 128209
2011-03-24 11:26:52 +00:00
Anders Carlsson 98766db785 Add a new warning for exit-time destructors.
llvm-svn: 128188
2011-03-24 01:01:41 +00:00
John McCall c23308ceea Call out ObjC parameter types as a different kind of declarator context
from a normal type-spec, just for completeness.

llvm-svn: 128185
2011-03-23 23:43:04 +00:00
Fariborz Jahanian 16f92ce539 Support for Transparent unions used as overloadable
function parameter. // rdar:// 9129552
and PR9406.

llvm-svn: 128159
2011-03-23 19:50:54 +00:00
Douglas Gregor 899b68fdf5 Teach DelayedDiagnostic to copy its string, rather than hope that the
string itself lives longer than the DelayedDiagnostic. Fixes a recent
use-after-free regression due to my availability attribute work. 

llvm-svn: 128148
2011-03-23 15:13:44 +00:00
Chris Lattner ce6c42f65f switch a few Driver APIs to use llvm::ArrayRef, cleaning up code.
llvm-svn: 128142
2011-03-23 04:04:01 +00:00
Ted Kremenek 1ba9bbc149 Fix crash in clang_getInstantiationLoc() when SourceManager::getInstantiationLoc() can return a SourceLocatin with an invalid
FileID on invalid code.  Fixes <rdar://problem/9164623>.

llvm-svn: 128139
2011-03-23 02:16:44 +00:00
Douglas Gregor 20b2ebd785 Implement a new 'availability' attribute, that allows one to specify
which versions of an OS provide a certain facility. For example,

  void foo()
  __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));

says that the function "foo" was introduced in 10.2, deprecated in
10.4, and completely obsoleted in 10.6. This attribute ties in with
the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that
we want to deploy back to Mac OS X 10.1). There are several concrete
behaviors that this attribute enables, as illustrated with the
function foo() above:

  - If we choose a deployment target >= Mac OS X 10.4, uses of "foo"
    will result in a deprecation warning, as if we had placed
    attribute((deprecated)) on it (but with a better diagnostic)
  - If we choose a deployment target >= Mac OS X 10.6, uses of "foo"
    will result in an "unavailable" warning (in C)/error (in C++), as
    if we had placed attribute((unavailable)) on it
  - If we choose a deployment target prior to 10.2, foo() is
    weak-imported (if it is a kind of entity that can be weak
    imported), as if we had placed the weak_import attribute on it.

Naturally, there can be multiple availability attributes on a
declaration, for different platforms; only the current platform
matters when checking availability attributes.

The only platforms this attribute currently works for are "ios" and
"macosx", since we already have -mxxxx-version-min flags for them and we
have experience there with macro tricks translating down to the
deprecated/unavailable/weak_import attributes. The end goal is to open
this up to other platforms, and even extension to other "platforms"
that are really libraries (say, through a #pragma clang
define_system), but that hasn't yet been designed and we may want to
shake out more issues with this narrower problem first.

Addresses <rdar://problem/6690412>.

As a drive-by bug-fix, if an entity is both deprecated and
unavailable, we only emit the "unavailable" diagnostic.

llvm-svn: 128127
2011-03-23 00:50:03 +00:00
John McCall aa01737782 Warn about unused declaration-specifiers on tag declarations.
llvm-svn: 128118
2011-03-22 23:00:04 +00:00
Daniel Dunbar 12100e2c7f Frontend: Add a more explicit -backend-option flag for passing backend command
line options, instead of leveraging the blanket -mllvm option.
 - This allows using the frontend itself without requiring the backend have
   those options available (i.e., if the target wasn't built).

llvm-svn: 128087
2011-03-22 16:48:17 +00:00
Benjamin Kramer ce276e3822 Don't clear OverloadCandidateSets on destruction, it has no effect anymore.
And clearing a SmallPtrSet can be an expensive operation.

llvm-svn: 128081
2011-03-22 09:46:54 +00:00
Ted Kremenek 4c9d46b310 Migrate 'PrettySTackTraceParserEntry' object out of Parser, and have it constructed within ParseAST. This avoids double crashes
during crash recovery.

llvm-svn: 128056
2011-03-22 01:15:17 +00:00
Daniel Dunbar fe908a805b Frontend: Change CC_PRINT_HEADERS to not print header depth markers, these don't
really make any sense in this environment.

llvm-svn: 128014
2011-03-21 19:37:38 +00:00
Ted Kremenek 5e14d39a88 Improve crash recovery cleanup to recovery CompilerInstances during crash recovery. This was a huge resource "root" during crashes.
This change requires making a bunch of fundamental Clang structures (optionally) reference counted to allow correct
ownership semantics of these objects (e.g., ASTContext) to play out between an active ASTUnit and CompilerInstance
object.

llvm-svn: 128011
2011-03-21 18:40:17 +00:00
Joerg Sonnenberger bc923f3f7d Memorize presence/absence of -nostdlib in Driver.
Drop program paths on NetBSD (unused). Only include lib dir, if
-nostdlib is absent. Use = to allow --sysroot to work.

llvm-svn: 127995
2011-03-21 13:59:26 +00:00
Joerg Sonnenberger 6165ab1132 Remember sysroot in Driver. Pass it down to ld for NetBSD, FreeBSD
and DragonFly. Use the --sysroot= form for Linux. Fix handling of =
prefix for -B.

llvm-svn: 127994
2011-03-21 13:51:29 +00:00
Francois Pichet 13b4e68642 Downgrade err_mismatched_exception_spec to a ExtWarning in Microsoft mode. MSVC doesn't do any validation on exception specifications.
This remove 1 error when parsing MSVC stl lib with clang.

llvm-svn: 127961
2011-03-19 23:05:18 +00:00
Benjamin Kramer f4ac9ffac1 Initialize FakeAddressSpaceMap flag.
llvm-svn: 127950
2011-03-19 13:04:25 +00:00
Anton Yartsev acb43dbf9b makes vec_step operator work when AltiVec support is enabled
llvm-svn: 127949
2011-03-19 07:53:43 +00:00
Ken Dyck 54d4d9fb19 Add pre- and post-increment/decrement operators to CharUnits.
llvm-svn: 127937
2011-03-19 01:25:59 +00:00
Ted Kremenek ddc06d0bd0 Rename class 'CFGReachabilityAnalysis' to 'CFGReverseBlockReachabilityAnalysis'.
This rename serves two purposes:

- It reflects the actual functionality of this analysis.
- We will have more than one reachability analysis.

llvm-svn: 127930
2011-03-19 01:00:33 +00:00
Ted Kremenek 1ec7b33079 Add libclang hook 'clang_toggleCrashRecovery()', which provides a mechanism for a client to enable/disable CrashRecovery within libclang function calls.
llvm-svn: 127920
2011-03-18 23:05:39 +00:00
Peter Collingbourne 599cb8e430 Add support for language-specific address spaces. On top of that,
add support for the OpenCL __private, __local, __constant and
__global address spaces, as well as the __read_only, _read_write and
__write_only image access specifiers.  Patch originally by ARM;
language-specific address space support by myself.

llvm-svn: 127915
2011-03-18 22:38:29 +00:00
Daniel Dunbar 1057f86d0e Lexer: Add extremely limited support for -traditional-cpp, ignoring BCPL
comments.

llvm-svn: 127910
2011-03-18 21:23:38 +00:00
Daniel Dunbar 1e1c3ca51c Driver: Give SelectTool access to the action inputs.
llvm-svn: 127902
2011-03-18 20:14:00 +00:00