Граф коммитов

41972 Коммитов

Автор SHA1 Сообщение Дата
Dmitri Gribenko 8c718e7d87 libclang: type safety for CXTranslationUnitImpl::CIdx
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173590 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 21:49:50 +00:00
Dmitri Gribenko 337ee24785 libclang: type safety for CXTranslationUnitImpl::FormatContext
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173589 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 21:39:50 +00:00
Dmitri Gribenko e42e578ad8 libclang: some type safety for CXTranslationUnitImpl's internals
There is no reason to store pointers as 'void*' in CXTranslationUnitImpl, since
it does not affect libclang ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173588 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 21:32:42 +00:00
Fariborz Jahanian e3fac338e0 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173587 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 20:50:23 +00:00
Fariborz Jahanian 87611cdd0c Attach any tag type's documentation to its typedef if
latter does not have one of its own. // rdar://13067629


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173586 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 20:49:30 +00:00
Dmitri Gribenko 5694feb5cc libclang: factor out the frequent pattern static_cast<ASTUnit *>(TU->TUData)
into a getter cxtu::getASTUnit(TU)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173585 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 18:53:38 +00:00
Dmitri Gribenko 404628caa5 libclang: make getCursorParentDecl() return 'const Decl *'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173584 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 18:12:08 +00:00
Dmitri Gribenko 7d91438047 libclang: change getCursorAttr() to return 'const Attr *'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173583 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 18:08:08 +00:00
Dmitri Gribenko a8a908b81d Migrate tests to -verify
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173582 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 17:11:39 +00:00
Enea Zaffanella 9677eb864f Added ASTContext methods getIntPtrType and getUIntPtrType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173581 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 17:08:37 +00:00
Dmitri Gribenko adeb7822cb <limits.h> includes <linux/limits.h> on Linux, no need to special-case it
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173578 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 16:29:36 +00:00
Dmitri Gribenko ff74f96839 libclang: make getCursorStmt() and getCursorExpr() return const pointers
Also change EnqueueVisitor to use ConstStmtVisitor as a consequence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173577 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 15:29:08 +00:00
Tim Northover 9eca9f7da9 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173576 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 15:27:54 +00:00
Dmitri Gribenko 7d9f07732b Constify getOptionalExplicitTemplateArgs()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173575 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 15:24:56 +00:00
Dmitri Gribenko d615f88e3c Constify some getters of DesignatedInitExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173574 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 15:15:52 +00:00
NAKAMURA Takumi 1a1b3ab6d7 clang/test/Misc/diag-template-diffing-color.cpp: Symbolize color sequences in FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173561 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 06:13:05 +00:00
Argyrios Kyrtzidis db84e7a44d [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173559 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 04:52:52 +00:00
NAKAMURA Takumi 4e4d7cedb8 clang/test/Misc/ast-dump-color.cpp: Symbolize color sequences in FileCheck.
FIXME: If FileCheck had expressions something predefined well-known...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173558 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 03:48:55 +00:00
Jordan Rose 07c52d2813 [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173557 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 03:16:31 +00:00
Richard Trieu db55c04cb3 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".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173556 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 02:31:38 +00:00
Richard Smith 98bfbf5354 Fix mismatch between pointer and pointee type when diagnosing an incorrect
object argument type for a member call.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173554 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 02:07:32 +00:00
Richard Trieu 67234726d2 Fix test case by being more lenient on what to accept as a path name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173553 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 01:54:31 +00:00
Nick Lewycky 87827616cd Remove function that is newly dead as of r173538.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173550 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 01:36:54 +00:00
Fariborz Jahanian a9cd3d8452 Hopefuly unbreak buldbot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173549 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 01:35:28 +00:00
Richard Trieu 7ba443aa8c 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173548 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 01:31:20 +00:00
Jordan Rose 44ec3f00e6 [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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173547 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 01:28:23 +00:00
Jordan Rose dede2fd56d [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173546 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 01:28:19 +00:00
Jordan Rose aeca2cc3a6 [analyzer] Add 'prune-paths' config option to disable path pruning.
This should be used for testing only. Path pruning is still on by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173545 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 01:28:15 +00:00
Jordan Rose 7ee8906295 [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173544 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 01:28:09 +00:00
Fariborz Jahanian a7db6a200a Fix up the test.
for // rdar://11861085


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173543 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 01:25:32 +00:00
Douglas Gregor 713b7c0118 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173542 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 00:55:12 +00:00
Richard Smith 25cf8abf30 Revert r172285 (suppressing a 'redundant' -Wc++98-compat warning) and add a
testcase for a situation it caused us to miss.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173540 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 00:39:02 +00:00
Dmitri Gribenko 10442564e1 Comment parsing: actually check for a block command after "\param x"
This fixes PR15068.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173539 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 00:36:14 +00:00
Nick Lewycky 01a41140cd Preserve Sema::UndefinedInternals across PCH boundaries. Fixes
-Wundefined-internal warnings with PCH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173538 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 00:35:08 +00:00
Fariborz Jahanian 3ac83d69c6 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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173535 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 23:57:05 +00:00
NAKAMURA Takumi b2274d64ec clang/test/Index/annotate-comments-typedef.m: Remove CommentXMLValid in CHECKs. Don't assume libxml2 here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173534 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 23:56:54 +00:00
John McCall f3bbb155be 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173531 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 23:36:19 +00:00
John McCall 96fcde0b8e Move the decision about the kind of CGCXXABI to make inside
the family-specific files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173530 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 23:36:14 +00:00
Douglas Gregor 188bdcd1aa 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173529 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 23:32:03 +00:00
NAKAMURA Takumi 59273eb526 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"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173525 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 23:17:20 +00:00
Daniel Dunbar 856e06bda5 [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173523 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 23:12:17 +00:00
Fariborz Jahanian 23799e3ec4 simplify code by removing excessive bracing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173521 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 23:08:39 +00:00
Fariborz Jahanian 41170b55ba Attach enum's documentation to its typedef if
latter does not have one of its own. // rdar://13067629


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173516 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 22:48:32 +00:00
John McCall d5617eeafc 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173515 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 22:31:03 +00:00
John McCall b8b2c9da87 First pass at abstracting out a class for the target C++ ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173514 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 22:30:49 +00:00
Douglas Gregor d07865b42d 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%.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173512 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 22:25:23 +00:00
Dmitri Gribenko 3d115cfd1b Remove useless 'XPASS: *' from tests
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173511 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 22:20:24 +00:00
Renato Golin 69bb7f6bbe Temporarily disabling ms-asm test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173510 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 22:13:50 +00:00
Dmitri Gribenko d08606817a This test actually passes, just add the missing expected-error
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173504 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 22:08:24 +00:00
Dmitri Gribenko ff3e102bc9 Migrate test from grep to -fdiagnostics-parseable-fixits
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173496 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 21:41:29 +00:00