Commit Graph

43091 Commits

Author SHA1 Message Date
Enea Zaffanella f11ceb6897 Added ASTContext methods getIntPtrType and getUIntPtrType.
llvm-svn: 173581
2013-01-26 17:08:37 +00:00
Dmitri Gribenko eadae014ed <limits.h> includes <linux/limits.h> on Linux, no need to special-case it
llvm-svn: 173578
2013-01-26 16:29:36 +00:00
Dmitri Gribenko e835406cd7 libclang: make getCursorStmt() and getCursorExpr() return const pointers
Also change EnqueueVisitor to use ConstStmtVisitor as a consequence.

llvm-svn: 173577
2013-01-26 15:29:08 +00:00
Tim Northover 20122ad27d Specify non-GNU-ARM triples for key-function test.
Since ARM has diverging ABIs on this detail, it's probably worth
testing both it and a "normal" Itanium system.

llvm-svn: 173576
2013-01-26 15:27:54 +00:00
Dmitri Gribenko 19ae7a88b0 Constify getOptionalExplicitTemplateArgs()
llvm-svn: 173575
2013-01-26 15:24:56 +00:00
Dmitri Gribenko d06f7ff6d3 Constify some getters of DesignatedInitExpr
llvm-svn: 173574
2013-01-26 15:15:52 +00:00
NAKAMURA Takumi 12b1d5d8a4 clang/test/Misc/diag-template-diffing-color.cpp: Symbolize color sequences in FileCheck.
llvm-svn: 173561
2013-01-26 06:13:05 +00:00
Argyrios Kyrtzidis ac08b26611 [libclang] Introduce clang_getFileUniqueID which returns a struct
for a CXFile containing device/inode/modification time.

Intended to be useful as a key associated with a unique file across
an indexing session.

rdar://13091837

llvm-svn: 173559
2013-01-26 04:52:52 +00:00
NAKAMURA Takumi 6350e07ecd clang/test/Misc/ast-dump-color.cpp: Symbolize color sequences in FileCheck.
FIXME: If FileCheck had expressions something predefined well-known...
llvm-svn: 173558
2013-01-26 03:48:55 +00:00
Jordan Rose 9853371f24 [analyzer] C++ initializers may require cleanups; look through these.
When the analyzer sees an initializer, it checks if the initializer
contains a CXXConstructExpr. If so, it trusts that the CXXConstructExpr
does the necessary work to initialize the object, and performs no further
initialization.

This patch looks through any implicit wrapping expressions like
ExprWithCleanups to find the CXXConstructExpr inside.

Fixes PR15070.

llvm-svn: 173557
2013-01-26 03:16:31 +00:00
Richard Trieu 9c67267a7b Give a more informative error message when the dot or arrow operator is used
on a type.  Currently, it gives a generic "expected unqualified-id" error.
The new error message is "cannot use (dot|arrow) operator on a type".

llvm-svn: 173556
2013-01-26 02:31:38 +00:00
Richard Smith 03c66d3c57 Fix mismatch between pointer and pointee type when diagnosing an incorrect
object argument type for a member call.

llvm-svn: 173554
2013-01-26 02:07:32 +00:00
Richard Trieu d006f6eb5f Fix test case by being more lenient on what to accept as a path name.
llvm-svn: 173553
2013-01-26 01:54:31 +00:00
Nick Lewycky d191472c99 Remove function that is newly dead as of r173538.
llvm-svn: 173550
2013-01-26 01:36:54 +00:00
Fariborz Jahanian f6f21d207c Hopefuly unbreak buldbot.
llvm-svn: 173549
2013-01-26 01:35:28 +00:00
Richard Trieu d215b8d557 Highlight various parts of the AST dump with color. Colors are controlled by
-f(no-)color-diagnostics.  In addition, dumpColor() function calls are added
to force color printing.  No structural changes to -ast-dump.

llvm-svn: 173548
2013-01-26 01:31:20 +00:00
Jordan Rose aea020f04e [analyzer] Track null object lvalues back through C++ method calls.
The expression 'a->b.c()' contains a call to the 'c' method of 'a->b'.
We emit an error if 'a' is NULL, but previously didn't actually track
the null value back through the 'a->b' expression, which caused us to
miss important false-positive-suppression cases, including
<rdar://problem/12676053>.

llvm-svn: 173547
2013-01-26 01:28:23 +00:00
Jordan Rose c362edad85 [analyzer] bugreporter::getDerefExpr now takes a Stmt, not an ExplodedNode.
This allows it to be used in places where the interesting statement
doesn't match up with the current node. No functionality change.

llvm-svn: 173546
2013-01-26 01:28:19 +00:00
Jordan Rose 329bbe8e11 [analyzer] Add 'prune-paths' config option to disable path pruning.
This should be used for testing only. Path pruning is still on by default.

llvm-svn: 173545
2013-01-26 01:28:15 +00:00
Jordan Rose 8de30305f6 [analyzer] Rename PruneNullReturnPaths to SuppressNullReturnPaths.
"Prune" is the term for eliminating pieces of a path that are not
relevant to the user. "Suppress" means don't show that path at all.

llvm-svn: 173544
2013-01-26 01:28:09 +00:00
Fariborz Jahanian cd598aba86 Fix up the test.
for // rdar://11861085

llvm-svn: 173543
2013-01-26 01:25:32 +00:00
Douglas Gregor e00c8b205e Since we're stuck with realpath for the header <-> module mapping,
factor the realpath calls into FileManager::getCanonicalName() so we
can cache the results of this epically slow operation. 5% speedup on
my modules test, and realpath drops out of the profile.

llvm-svn: 173542
2013-01-26 00:55:12 +00:00
Richard Smith d0c842d7a4 Revert r172285 (suppressing a 'redundant' -Wc++98-compat warning) and add a
testcase for a situation it caused us to miss.

llvm-svn: 173540
2013-01-26 00:39:02 +00:00
Dmitri Gribenko 7146930591 Comment parsing: actually check for a block command after "\param x"
This fixes PR15068.

llvm-svn: 173539
2013-01-26 00:36:14 +00:00
Nick Lewycky 8334af8c2a Preserve Sema::UndefinedInternals across PCH boundaries. Fixes
-Wundefined-internal warnings with PCH.

llvm-svn: 173538
2013-01-26 00:35:08 +00:00
Fariborz Jahanian 7865220da4 patch for PR9027 and // rdar://11861085
Title: [PR9027] volatile struct bug: member is not loaded at -O;
This is caused by last flag passed to @llvm.memcpy being false, 
not honoring that aggregate has at least one 'volatile' data member 
(even though aggregate itself has not been qualified as 'volatile'. 
As a result, optimization optimizes away the memcpy altogether.
Patch review by John MaCall (I still need to fix up a test though).

llvm-svn: 173535
2013-01-25 23:57:05 +00:00
NAKAMURA Takumi a06572b58b clang/test/Index/annotate-comments-typedef.m: Remove CommentXMLValid in CHECKs. Don't assume libxml2 here.
llvm-svn: 173534
2013-01-25 23:56:54 +00:00
John McCall c19c7066c2 ARM says that the array cookie should always be eight bytes.
ARM is not thinking about over-aligned structures.
Overrule ARM in both our generic-ARM and iOS ABI implementations.

llvm-svn: 173531
2013-01-25 23:36:19 +00:00
John McCall 5762592b49 Move the decision about the kind of CGCXXABI to make inside
the family-specific files.

llvm-svn: 173530
2013-01-25 23:36:14 +00:00
Douglas Gregor 7211ac15bb Improve coordination between the module manager and the global module
index, optimizing the operation that skips lookup in modules where we
know the identifier will not be found. This makes the global module
index optimization actually useful, providing an 8.5% speedup over
modules without the global module index for -fsyntax-only.

llvm-svn: 173529
2013-01-25 23:32:03 +00:00
NAKAMURA Takumi f10ef4d40c clang/test/Preprocessor/iwithprefix.c: Tweak default includes not to use /usr/include.
You may see such a message on non-posix system;
  ignoring nonexistent directory "/usr/local/include"
  ignoring nonexistent directory "/usr/include"

llvm-svn: 173525
2013-01-25 23:17:20 +00:00
Daniel Dunbar 96568f91cd [utils] Kill another no-longer-useful utility script.
- We are long past the days of getting clang to fail in mass on swaths of code,
   fortunately.

llvm-svn: 173523
2013-01-25 23:12:17 +00:00
Fariborz Jahanian 66024d0244 simplify code by removing excessive bracing.
llvm-svn: 173521
2013-01-25 23:08:39 +00:00
Fariborz Jahanian 40abf3424c Attach enum's documentation to its typedef if
latter does not have one of its own. // rdar://13067629

llvm-svn: 173516
2013-01-25 22:48:32 +00:00
John McCall 6bd2a89d5a The standard ARM C++ ABI dictates that inline functions are
never key functions.  We did not implement that rule for the
iOS ABI, which was driven by what was implemented in gcc-4.2.
However, implement it now for other ARM-based platforms.

llvm-svn: 173515
2013-01-25 22:31:03 +00:00
John McCall 359b885e12 First pass at abstracting out a class for the target C++ ABI.
llvm-svn: 173514
2013-01-25 22:30:49 +00:00
Douglas Gregor e41d7feaf5 Optimize ModuleManager::visit() by precomputing the visitation order
and limiting ourselves to two memory allocations. 10% speedup in
-fsyntax-only time for modules.

With this change, we can actually see some performance different from
the global module index, but it's still about 1%.

llvm-svn: 173512
2013-01-25 22:25:23 +00:00
Dmitri Gribenko c9f860d124 Remove useless 'XPASS: *' from tests
llvm-svn: 173511
2013-01-25 22:20:24 +00:00
Renato Golin 7b80076b79 Temporarily disabling ms-asm test
llvm-svn: 173510
2013-01-25 22:13:50 +00:00
Dmitri Gribenko 699ad11c58 This test actually passes, just add the missing expected-error
llvm-svn: 173504
2013-01-25 22:08:24 +00:00
Dmitri Gribenko 472661479a Migrate test from grep to -fdiagnostics-parseable-fixits
llvm-svn: 173496
2013-01-25 21:41:29 +00:00
Daniel Dunbar 23af2b1a2c [utils] Remove the OptionalTests subdir no one runs.
llvm-svn: 173491
2013-01-25 21:12:20 +00:00
Daniel Dunbar e462e0f665 [utils] Remove C++Tests that I don't think anyone uses anymore.
llvm-svn: 173490
2013-01-25 21:12:17 +00:00
Alexander Kornienko 09f15f3edf Silence unintended fallthrough diagnostic on a case label preceded with a normal label.
Summary:
It's unlikely that a fallthrough is unintended in the following code:
switch (n) {
...
  label:
  case 1:
...
    goto label;
...
}

Reviewers: rsmith, doug.gregor

Reviewed By: doug.gregor

CC: cfe-commits

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

llvm-svn: 173486
2013-01-25 20:44:56 +00:00
Dmitri Gribenko f079de0a08 FileCheck'ize tests
llvm-svn: 173484
2013-01-25 20:34:08 +00:00
Dmitri Gribenko d9c7ceebde Migrate tests to -verify and merge them
llvm-svn: 173482
2013-01-25 20:33:53 +00:00
Daniel Dunbar b7eaa6b8ac [tests] Force a triple to ensure /usr/include is one of the entries.
llvm-svn: 173469
2013-01-25 18:50:18 +00:00
Daniel Dunbar bd5dfe4511 [tests] Add a test for -iwithprefix.
- This just scratches the surface, We have pretty horrible test coverage in
   this area it seems like, but this at least covers the change in r173410.

llvm-svn: 173464
2013-01-25 18:08:53 +00:00
Fariborz Jahanian d0ed6c249d Add space after ';'.
llvm-svn: 173462
2013-01-25 17:47:49 +00:00
Fariborz Jahanian 740396437b Improve diagnsotic further on integer overflow.
llvm-svn: 173461
2013-01-25 17:19:07 +00:00