]> granicus.if.org Git - clang/log
clang
11 years agolibclang: remove 'using namespace cxstring'
Dmitri Gribenko [Sun, 3 Feb 2013 13:52:47 +0000 (13:52 +0000)]
libclang: remove 'using namespace cxstring'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174285 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agolibclang: migrate IndexingDeclVisitor to ConstDeclVisitor
Dmitri Gribenko [Sun, 3 Feb 2013 13:42:20 +0000 (13:42 +0000)]
libclang: migrate IndexingDeclVisitor to ConstDeclVisitor

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174284 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agolibclang: remove unneeded const_cast
Dmitri Gribenko [Sun, 3 Feb 2013 13:26:20 +0000 (13:26 +0000)]
libclang: remove unneeded const_cast

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174283 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConstify ASTContext::getObjContainingInterface
Dmitri Gribenko [Sun, 3 Feb 2013 13:23:21 +0000 (13:23 +0000)]
Constify ASTContext::getObjContainingInterface

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174282 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agolibclang: migrate USRGenerator to ConstDeclVisitor
Dmitri Gribenko [Sun, 3 Feb 2013 13:21:23 +0000 (13:21 +0000)]
libclang: migrate USRGenerator to ConstDeclVisitor

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174281 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agolibclang: remove unneeded const_casts
Dmitri Gribenko [Sun, 3 Feb 2013 13:19:54 +0000 (13:19 +0000)]
libclang: remove unneeded const_casts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174280 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang/test/CodeGenCXX/debug-info-class.cpp: Tweak to unbreak test for a few targets.
NAKAMURA Takumi [Sun, 3 Feb 2013 12:52:54 +0000 (12:52 +0000)]
clang/test/CodeGenCXX/debug-info-class.cpp: Tweak to unbreak test for a few targets.

  - Relax a expression for arm-gnueabi.
  - Exclude msvc to limit target triplets to add limited a few targets.
    Feel free to remove actions if guys thought they redundant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174278 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "[analyzer] Model trivial copy/move ctors with an aggregate bind."
Jordan Rose [Sat, 2 Feb 2013 05:15:53 +0000 (05:15 +0000)]
Revert "[analyzer] Model trivial copy/move ctors with an aggregate bind."

...again. The problem has not been fixed and our internal buildbot is still
getting hangs.

This reverts r174212, originally applied in r173951, then reverted in r174069.
Will not re-apply until the entire project analyzes successfully on my
local machine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174265 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agolibclang: introduce cxstring::{createRef,createDup} for StringRefs
Dmitri Gribenko [Sat, 2 Feb 2013 02:19:29 +0000 (02:19 +0000)]
libclang: introduce cxstring::{createRef,createDup} for StringRefs

Also migrate all clients from the old API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174263 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPR15132: Replace "address expression must be an lvalue or a function
Richard Smith [Sat, 2 Feb 2013 02:14:45 +0000 (02:14 +0000)]
PR15132: Replace "address expression must be an lvalue or a function
designator" diagnostic with more correct and more human-friendly "cannot take
address of rvalue of type 'T'".

For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully
saying "cannot take address of rvalue of type '<overloaded function type>'".

For the case of &array_temporary, treat it just like a class temporary
(including allowing it as an extension); the existing diagnostic wording
for the class temporary case works fine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174262 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCorrectly classify T{} as an array temporary if T is an array of class type with...
Richard Smith [Sat, 2 Feb 2013 02:11:36 +0000 (02:11 +0000)]
Correctly classify T{} as an array temporary if T is an array of class type with nontrivial destructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174261 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd some horrible Perl code to teach scan-build to recursively walk a directory for...
Ted Kremenek [Sat, 2 Feb 2013 01:52:41 +0000 (01:52 +0000)]
Add some horrible Perl code to teach scan-build to recursively walk a directory for HTML files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174260 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't forget to run destructors when we create an array temporary of class type.
Richard Smith [Sat, 2 Feb 2013 01:13:06 +0000 (01:13 +0000)]
Don't forget to run destructors when we create an array temporary of class type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174257 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "Update checker build to checker-271."
Ted Kremenek [Sat, 2 Feb 2013 01:06:22 +0000 (01:06 +0000)]
Revert "Update checker build to checker-271."

Turns out we didn't update scan-build to work with HTML files in nested directories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174256 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed another whitespace issue... *sigh*.
Michael Gottesman [Sat, 2 Feb 2013 01:05:06 +0000 (01:05 +0000)]
Fixed another whitespace issue... *sigh*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174255 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed whitespace.
Michael Gottesman [Sat, 2 Feb 2013 01:03:01 +0000 (01:03 +0000)]
Fixed whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174254 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoOn platforms which do not support ARC natively, do not mark objc_retain/objc_release...
Michael Gottesman [Sat, 2 Feb 2013 00:57:44 +0000 (00:57 +0000)]
On platforms which do not support ARC natively, do not mark objc_retain/objc_release as "nonlazybind".

rdar://13108298.
rdar://13129783.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174253 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate checker build to checker-271.
Ted Kremenek [Sat, 2 Feb 2013 00:57:28 +0000 (00:57 +0000)]
Update checker build to checker-271.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174252 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r174246, accidentally committed.
David Blaikie [Sat, 2 Feb 2013 00:39:32 +0000 (00:39 +0000)]
Revert r174246, accidentally committed.

This reverts commit 1513eb9284c23acfd19cf742b95996fbb11ca741.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174249 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSentenc-ify comment added in r174206.
David Blaikie [Sat, 2 Feb 2013 00:36:58 +0000 (00:36 +0000)]
Sentenc-ify comment added in r174206.

Based on post-commit review by Paul Robinson.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174248 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGeneralize DebugInfo tests by avoiding explicit metadata numbers
David Blaikie [Sat, 2 Feb 2013 00:34:26 +0000 (00:34 +0000)]
Generalize DebugInfo tests by avoiding explicit metadata numbers

This addresses several (not all) debug info tests that use explicit metadata
numbers. Wherever the same number appeared more than once in a test I used
a named match to ensure the same number appeared in all those cases (this may
still be overly constraining test cases as they may not have actually cared
about that relationship). For one-off numbers I just replaced them with an
unnamed regex.

This may underconstrain poorly written test cases that were interested in
checking that certain metadata nodes were related but didn't actually match
on all the related nodes numbers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174247 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoBasics
David Blaikie [Sat, 2 Feb 2013 00:34:16 +0000 (00:34 +0000)]
Basics

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174246 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Always inline functions with bodies generated by BodyFarm.
Anna Zaks [Sat, 2 Feb 2013 00:30:04 +0000 (00:30 +0000)]
[analyzer] Always inline functions with bodies generated by BodyFarm.

Inlining these functions is essential for correctness. We often have
cases where we do not inline calls. For example, the shallow mode and
when reanalyzing previously inlined ObjC methods as top level.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174245 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Print Inline mode with -analyzer-display-progress.
Anna Zaks [Sat, 2 Feb 2013 00:30:02 +0000 (00:30 +0000)]
[analyzer] Print Inline mode with -analyzer-display-progress.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174244 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Fix typo.
Anna Zaks [Sat, 2 Feb 2013 00:29:59 +0000 (00:29 +0000)]
[analyzer] Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174243 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThis patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
Nick Lewycky [Sat, 2 Feb 2013 00:25:55 +0000 (00:25 +0000)]
This patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use.

Also fixes a bug that caused us to not mark the function referenced just
because we didn't want to mark it odr used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174242 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agolibclang: introduce cxstring::{createRef,createDup} for C strings
Dmitri Gribenko [Sat, 2 Feb 2013 00:02:12 +0000 (00:02 +0000)]
libclang: introduce cxstring::{createRef,createDup} for C strings

Also migrate all clients from the old API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174238 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMerge "special" types from different modules in the AST reader.
Douglas Gregor [Fri, 1 Feb 2013 23:45:03 +0000 (23:45 +0000)]
Merge "special" types from different modules in the AST reader.

Different modules may have different views of the various "special"
types in the AST, such as the redefinition type for "id". Merge those
types rather than only considering the redefinition types for the
first AST file loaded.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174234 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang/test/CodeGenCXX/debug-info-class.cpp: Fixup for -Asserts.
NAKAMURA Takumi [Fri, 1 Feb 2013 22:53:19 +0000 (22:53 +0000)]
clang/test/CodeGenCXX/debug-info-class.cpp: Fixup for -Asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174229 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConst'ify Preprocessor::getPredefinesFileID.
Argyrios Kyrtzidis [Fri, 1 Feb 2013 20:35:47 +0000 (20:35 +0000)]
Const'ify Preprocessor::getPredefinesFileID.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174218 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUnbreak Makefile build after r174216
Dmitri Gribenko [Fri, 1 Feb 2013 20:30:26 +0000 (20:30 +0000)]
Unbreak Makefile build after r174216

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174217 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoComment parsing: improve the fidelity of XML output for many block commands
Dmitri Gribenko [Fri, 1 Feb 2013 20:23:57 +0000 (20:23 +0000)]
Comment parsing: improve the fidelity of XML output for many block commands

This change introduces a 'kind' attribute for the <Para> tag, that captures the
kind of the parent block command.

For example:

\todo Meow.

used to be just <Para>Meow.</Para>, but now it is
<Para kind="todo">Meow.</Para>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174216 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd some missing PPC cpus
Bill Schmidt [Fri, 1 Feb 2013 20:23:10 +0000 (20:23 +0000)]
Add some missing PPC cpus

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174215 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoobjc: Provide correct fixit instruction when two mismatched
Fariborz Jahanian [Fri, 1 Feb 2013 20:04:49 +0000 (20:04 +0000)]
objc: Provide correct fixit instruction when two mismatched
nsstringis are compared without. // rdar://12716301

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174214 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Explain why we have system-header-simulator*.h files.
Jordan Rose [Fri, 1 Feb 2013 19:50:01 +0000 (19:50 +0000)]
[analyzer] Explain why we have system-header-simulator*.h files.

Suggested by Csaba. Text based on an e-mail of mine on cfe-dev.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174213 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRe-apply "[analyzer] Model trivial copy/move ctors with an aggregate bind."
Jordan Rose [Fri, 1 Feb 2013 19:49:59 +0000 (19:49 +0000)]
Re-apply "[analyzer] Model trivial copy/move ctors with an aggregate bind."

With the optimization in the previous commit, this should be safe again.

Originally applied in r173951, then reverted in r174069.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174212 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Reuse a LazyCompoundVal if its type matches the new region.
Jordan Rose [Fri, 1 Feb 2013 19:49:57 +0000 (19:49 +0000)]
[analyzer] Reuse a LazyCompoundVal if its type matches the new region.

This allows us to keep from chaining LazyCompoundVals in cases like this:
  CGRect r = CGRectMake(0, 0, 640, 480);
  CGRect r2 = r;
  CGRect r3 = r2;

Previously we only made this optimization if the struct did not begin with
an aggregate member, to make sure that we weren't picking up an LCV for
the first field of the struct. But since LazyCompoundVals are typed, we can
make that inference directly by comparing types.

This is a pure optimization; the test changes are to guard against possible
future regressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174211 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix exception handling line table problems introduced by r173593
David Blaikie [Fri, 1 Feb 2013 19:09:49 +0000 (19:09 +0000)]
Fix exception handling line table problems introduced by r173593

r173593 made us a little too eager to associate all code at the end of a
function with the user-written 'return' line. This caused problems with
breakpoints as they'd be set in exception handling code preceeding the
actual non-exception return handling code, leading to the breakpoint never
being hit in non-exceptional execution.

This change restores the pre-r173593 exception handling line information where
the cleanup code is associated with the '}' not the return line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174206 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd -mqpx and -mno-qpx feature flags to toggle use of the PPC QPX vector instruction set
Hal Finkel [Fri, 1 Feb 2013 18:44:19 +0000 (18:44 +0000)]
Add -mqpx and -mno-qpx feature flags to toggle use of the PPC QPX vector instruction set

I've renamed the altivec test to ppc-features (because now there is more than one feature to test).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174204 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[driver] Don't try to generate diagnostic information for dsymutil crashes.
Chad Rosier [Fri, 1 Feb 2013 18:30:26 +0000 (18:30 +0000)]
[driver] Don't try to generate diagnostic information for dsymutil crashes.
Part of rdar://13134273

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174203 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMicro change: moved '{' for better readability (+don't confuse -Wimplicit-fallthrough)
Alexander Kornienko [Fri, 1 Feb 2013 18:28:04 +0000 (18:28 +0000)]
Micro change: moved '{' for better readability (+don't confuse -Wimplicit-fallthrough)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174202 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix indent
Dmitri Gribenko [Fri, 1 Feb 2013 18:18:00 +0000 (18:18 +0000)]
Fix indent

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174201 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix comments: these are not trailing comments
Dmitri Gribenko [Fri, 1 Feb 2013 17:25:11 +0000 (17:25 +0000)]
Fix comments: these are not trailing comments

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174197 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agolibclang: document the purpose of createNull()
Dmitri Gribenko [Fri, 1 Feb 2013 16:38:41 +0000 (16:38 +0000)]
libclang: document the purpose of createNull()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174195 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agolibclang: add comments for CXStringFlag
Dmitri Gribenko [Fri, 1 Feb 2013 16:36:31 +0000 (16:36 +0000)]
libclang: add comments for CXStringFlag

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174194 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[modules] Introduce ModuleFile::DirectImportLoc which is the source location
Argyrios Kyrtzidis [Fri, 1 Feb 2013 16:36:14 +0000 (16:36 +0000)]
[modules] Introduce ModuleFile::DirectImportLoc which is the source location
where the module was explicitly or implicitly imported in the local translation unit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174192 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFor ModuleLoader::makeModuleVisible() also pass the source location where the
Argyrios Kyrtzidis [Fri, 1 Feb 2013 16:36:12 +0000 (16:36 +0000)]
For ModuleLoader::makeModuleVisible() also pass the source location where the
module import occurred.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174191 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIntroduce SourceManager::PredefinesFileID, to allow each checking of whether
Argyrios Kyrtzidis [Fri, 1 Feb 2013 16:36:07 +0000 (16:36 +0000)]
Introduce SourceManager::PredefinesFileID, to allow each checking of whether
a source location came from the predefines buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174190 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd check for @foo
Bill Schmidt [Fri, 1 Feb 2013 15:52:51 +0000 (15:52 +0000)]
Add check for @foo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174185 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a string not seen without asserts
Bill Schmidt [Fri, 1 Feb 2013 15:41:02 +0000 (15:41 +0000)]
Fix a string not seen without asserts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174183 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed segmentation fault when a CFGBlock has NULL successor.
Alexander Kornienko [Fri, 1 Feb 2013 15:39:20 +0000 (15:39 +0000)]
Fixed segmentation fault when a CFGBlock has NULL successor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174182 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix PR14881 by implementing conversion rules between int and complex int.
Bill Schmidt [Fri, 1 Feb 2013 15:34:29 +0000 (15:34 +0000)]
Fix PR14881 by implementing conversion rules between int and complex int.

Prior to the patch, Clang does not properly promote types when a complex
integer operand is combined with an integer via a binary operator, or when
one is assigned to the other in either order.  This patch detects when
promotion is needed (and permissible) and generates the necessary code.

The test assmes no target has the same size operands for "char" and
"long long," and that no target performs arithmetic on char operands without
extending them to a larger format first.  If there are any targets for
which this is not the case, they should be XFAILed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174181 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevise unit testing for -fno-altivec, -mno-altivec.
Bill Schmidt [Fri, 1 Feb 2013 14:45:29 +0000 (14:45 +0000)]
Revise unit testing for -fno-altivec, -mno-altivec.

As suggested, reverted the end-to-end test and added variations to an
existing Driver test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174176 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agolibclang: itroduce cxstring::createEmpty()
Dmitri Gribenko [Fri, 1 Feb 2013 14:21:22 +0000 (14:21 +0000)]
libclang: itroduce cxstring::createEmpty()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174174 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agolibclang: introduce cxstring::createNull()
Dmitri Gribenko [Fri, 1 Feb 2013 14:13:32 +0000 (14:13 +0000)]
libclang: introduce cxstring::createNull()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174173 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRe-design the convenience interfaces on MatchFinder.
Manuel Klimek [Fri, 1 Feb 2013 13:41:35 +0000 (13:41 +0000)]
Re-design the convenience interfaces on MatchFinder.

First, this implements a match() method on MatchFinder; this allows us
to get rid of the findAll implementation, as findAll is really a special
case of recursive matchers on match.

Instead of findAll, provide a convenience function match() that lets
users iterate easily over the results instead of needing to implement
callbacks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174172 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse const visitors in ASTDumper.
Alexander Kornienko [Fri, 1 Feb 2013 12:35:51 +0000 (12:35 +0000)]
Use const visitors in ASTDumper.
http://llvm-reviews.chandlerc.com/D355
Patch by Philip Craig!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174171 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHopefully fix windows build due to non-standard pair implementation.
Daniel Jasper [Fri, 1 Feb 2013 11:28:16 +0000 (11:28 +0000)]
Hopefully fix windows build due to non-standard pair implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174169 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevamp of the basic layouting algorithm in clang-format.
Daniel Jasper [Fri, 1 Feb 2013 11:00:45 +0000 (11:00 +0000)]
Revamp of the basic layouting algorithm in clang-format.

In order to end up with good solutions, clang-format needs to try
"all" combinations of line breaks, evaluate them and select the
best one. Before, we have done this using a DFS with memoization
and cut-off conditions. However, this approach is very limited
as shown by the huge static initializer in the attachment of
llvm.org/PR14959.

Instead, this new implementation uses a variant of Dijkstra's
algorithm to do a prioritized BFS over the solution space.

Some numbers:
lib/Format/TokenAnnotator.cpp: 1.5s -> 0.15s
Attachment of PR14959: 10min+ (didn't finish) -> 10s

No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174166 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix diagnostic for bad alignas use: it can't be applied to functions.
Richard Smith [Fri, 1 Feb 2013 08:25:07 +0000 (08:25 +0000)]
Fix diagnostic for bad alignas use: it can't be applied to functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174160 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a new -Wundefined-inline warning for inline functions which are used but not
Nick Lewycky [Fri, 1 Feb 2013 08:13:20 +0000 (08:13 +0000)]
Add a new -Wundefined-inline warning for inline functions which are used but not
defined. Fixes PR14993!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174158 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoImplement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.
Richard Smith [Fri, 1 Feb 2013 08:12:08 +0000 (08:12 +0000)]
Implement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.
Also support alignas(0), which C++11 and C11 require us to ignore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174157 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd PPC A2Q core and BG/Q preprocessor definitions
Hal Finkel [Fri, 1 Feb 2013 05:53:33 +0000 (05:53 +0000)]
Add PPC A2Q core and BG/Q preprocessor definitions

The a2q core is the variant of the a2 core used on the BG/Q supercomputers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174151 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDestroy arrays and ARC fields when throwing out of ctors.
John McCall [Fri, 1 Feb 2013 05:11:40 +0000 (05:11 +0000)]
Destroy arrays and ARC fields when throwing out of ctors.

Previously we were only handling non-array fields of class type.

Testcases derived from a patch by WenHan Gu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174146 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't do delayed exception-specification checking on an invalid
Douglas Gregor [Fri, 1 Feb 2013 04:49:10 +0000 (04:49 +0000)]
Don't do delayed exception-specification checking on an invalid
class. Fixes <rdar://problem/13017229>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174145 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable -fno-altivec, -mno-altivec for PowerPC.
Bill Schmidt [Fri, 1 Feb 2013 02:14:03 +0000 (02:14 +0000)]
Enable -fno-altivec, -mno-altivec for PowerPC.

Introduces these negation forms explicitly and uses them to control a new
"altivec" target feature for PowerPC.  This allows avoiding generating
Altivec instructions on processors that support Altivec.

The new test case verifies that the Altivec "lvx" instruction is not
used when -fno-altivec is present on the command line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174140 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Sema][Attr]Fix alignment attribute printing.
Michael Han [Fri, 1 Feb 2013 01:19:17 +0000 (01:19 +0000)]
[Sema][Attr]Fix alignment attribute printing.

Remove "IsMSDeclspec" argument from Align attribute since the arguments in Attr.td should
only model those appear in source code. Introduce attribute Accessor, and teach TableGen
to generate syntax kind accessors for Align attribute, and use those accessors to decide
if an alignment attribute is a declspec attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174133 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConsistently format sample diagnostics on this page.
Richard Smith [Fri, 1 Feb 2013 00:45:12 +0000 (00:45 +0000)]
Consistently format sample diagnostics on this page.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174126 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang/test/Index/headerfile-comment-to-html.m: Try to unbreak libxml2-less hosts...
NAKAMURA Takumi [Fri, 1 Feb 2013 00:17:45 +0000 (00:17 +0000)]
clang/test/Index/headerfile-comment-to-html.m: Try to unbreak libxml2-less hosts to eliminate "CommentXMLValid".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174124 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoComment parsing: add more comments to CommentCommands.td
Dmitri Gribenko [Thu, 31 Jan 2013 23:31:14 +0000 (23:31 +0000)]
Comment parsing: add more comments to CommentCommands.td

I hope the ASCII art delimiters are OK, since they group *groups* of commands --
that is really helpful.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174114 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEscape backslash in the comment.
Dmitri Gribenko [Thu, 31 Jan 2013 23:20:06 +0000 (23:20 +0000)]
Escape backslash in the comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174112 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate the tests.
Bill Wendling [Thu, 31 Jan 2013 23:17:12 +0000 (23:17 +0000)]
Update the tests.

This update coincides with r174110. That change ordered the attributes
alphabetically.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174111 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Comment parsing] Add support for recognizing
Fariborz Jahanian [Thu, 31 Jan 2013 23:12:39 +0000 (23:12 +0000)]
[Comment parsing] Add support for recognizing
\headerfile command and representing it in an xml
document. Patch reviewed by Dmitri Gribenko.
// rdar://12397511

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174109 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer]RetainCount: Fix an autorelease related false positive.
Anna Zaks [Thu, 31 Jan 2013 22:36:17 +0000 (22:36 +0000)]
[analyzer]RetainCount: Fix an autorelease related false positive.

The Cnt variable is adjusted (incremented) for simplification of
checking logic. The increment should not be stored in the state.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174104 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Don't track autorelease pools created by +new.
Jordan Rose [Thu, 31 Jan 2013 22:06:02 +0000 (22:06 +0000)]
[analyzer] Don't track autorelease pools created by +new.

This matches our behavior for autorelease pools created by +alloc. Some
people like to create autorelease pools in one method and release them
somewhere else.

If you want safe autorelease pool semantics, use the new ARC-compatible
syntax: @autoreleasepool { ... }

<rdar://problem/13121353>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174096 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLexer: Don't warn about Unicode in preprocessor directives.
Jordan Rose [Thu, 31 Jan 2013 19:48:48 +0000 (19:48 +0000)]
Lexer: Don't warn about Unicode in preprocessor directives.

This allows people to use Unicode in their #pragma mark and in macros
that exist only to be string-ized.

<rdar://problem/13107323&13121362>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174081 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPreprocessor: initialize member introduced in r173881.
Jordan Rose [Thu, 31 Jan 2013 19:26:01 +0000 (19:26 +0000)]
Preprocessor: initialize member introduced in r173881.

Compilation always sets this explicitly, but creating a preprocessor
manually should still put the 'IsPreprocessedOutput' flag in a valid state.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174077 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReverted unintendedly-committed file.
Alexander Kornienko [Thu, 31 Jan 2013 19:05:31 +0000 (19:05 +0000)]
Reverted unintendedly-committed file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174076 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMicro-change: moved a brace for better readability
Alexander Kornienko [Thu, 31 Jan 2013 19:03:16 +0000 (19:03 +0000)]
Micro-change: moved a brace for better readability

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174075 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "[analyzer] Model trivial copy/move ctors with an aggregate bind."
Jordan Rose [Thu, 31 Jan 2013 18:04:03 +0000 (18:04 +0000)]
Revert "[analyzer] Model trivial copy/move ctors with an aggregate bind."

It's causing hangs on our internal analyzer buildbot. Will restore after
investigating.

This reverts r173951 / baa7ca1142990e1ad6d4e9d2c73adb749ff50789.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174069 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang/test/Index/skip-parsed-bodies/compile_commands.json: Mark it as XFAIL:mingw32...
NAKAMURA Takumi [Thu, 31 Jan 2013 16:01:13 +0000 (16:01 +0000)]
clang/test/Index/skip-parsed-bodies/compile_commands.json: Mark it as XFAIL:mingw32, for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174064 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoNever break inside something that was a preprocessor directive.
Manuel Klimek [Thu, 31 Jan 2013 15:58:48 +0000 (15:58 +0000)]
Never break inside something that was a preprocessor directive.

Just put it in one unwrapped line and let the formatter handle it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174063 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSeveral improvements to the formatting of static initializers.
Daniel Jasper [Thu, 31 Jan 2013 14:59:26 +0000 (14:59 +0000)]
Several improvements to the formatting of static initializers.

1. Never avoid bin packing in static initializers as this can
   lead to terrible results.
2. If an element has to be broken over multiple lines, break after
   the following comma.

This should be a step forward, but there are still many cases
especially with nested static initializers that we handle badly.
More patches will follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174061 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAttempt to fix Windows build breakage.
Evgeniy Stepanov [Thu, 31 Jan 2013 14:27:38 +0000 (14:27 +0000)]
Attempt to fix Windows build breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174060 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove commonly useful code for AST testing into MatchVerfier.h.
Manuel Klimek [Thu, 31 Jan 2013 13:10:40 +0000 (13:10 +0000)]
Move commonly useful code for AST testing into MatchVerfier.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174057 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for AArch64 target.
Tim Northover [Thu, 31 Jan 2013 12:13:10 +0000 (12:13 +0000)]
Add support for AArch64 target.

In cooperation with the LLVM patch, this should implement all scalar front-end
parts of the C and C++ ABIs for AArch64.

This patch excludes the NEON support also reviewed due to an outbreak of
batshit insanity in our legal department. That will be committed soon bringing
the changes to precisely what has been approved.

Further reviews would be gratefully received.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174055 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r174043 and tweak the comment wording so I'm (hopefully) not confused by it...
Richard Smith [Thu, 31 Jan 2013 11:30:17 +0000 (11:30 +0000)]
Revert r174043 and tweak the comment wording so I'm (hopefully) not confused by it again!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174053 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdded outer template parameter lists to friend type AST nodes.
Enea Zaffanella [Thu, 31 Jan 2013 09:54:08 +0000 (09:54 +0000)]
Added outer template parameter lists to friend type AST nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174050 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[msan] Run more optimizations after MemorySanitizer pass.
Evgeniy Stepanov [Thu, 31 Jan 2013 09:53:29 +0000 (09:53 +0000)]
[msan] Run more optimizations after MemorySanitizer pass.

MSan instrumentation is driven by the original code. We take every
incoming instruction and emit another instruction (or ten) next to
it, operating on the shadow values (but sometimes on the real values,
too). Two programs in one, essentially. There can be any kinds of
redundancies in the second one, so we just run whatever is normally
run at -O2, and then exclude some passes that do not help much with
benchmarks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174049 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove incorrect warning signs from QualType::getUnqualifiedType(). These
Richard Smith [Thu, 31 Jan 2013 06:13:11 +0000 (06:13 +0000)]
Remove incorrect warning signs from QualType::getUnqualifiedType(). These
statements were only true for 65 CLs after they were introduced two years ago.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174043 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen we're emitting a constructor or destructor call from a delegating
Douglas Gregor [Thu, 31 Jan 2013 05:50:40 +0000 (05:50 +0000)]
When we're emitting a constructor or destructor call from a delegating
constructor, retrieve our VTT parameter directly. Fixes PR14588 /
<rdar://problem/12867962>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174042 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoImprove 'failed template argument deduction' diagnostic for the case where we
Richard Smith [Thu, 31 Jan 2013 05:19:49 +0000 (05:19 +0000)]
Improve 'failed template argument deduction' diagnostic for the case where we
have a direct mismatch between some component of the template and some
component of the argument. The diagnostic now says what the mismatch was, but
doesn't yet say which part of the template doesn't match.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174039 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen code completing in a statement, parenthesized expression, or
Douglas Gregor [Thu, 31 Jan 2013 05:03:46 +0000 (05:03 +0000)]
When code completing in a statement, parenthesized expression, or
Objective-C message receiver, the user is as likely to want to write a
type name as any other declaration, so give types the same priority as
other declarations. Fixes <rdar://problem/12480600>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174038 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAllow the computation of the base priority for a declaration code completion result...
Douglas Gregor [Thu, 31 Jan 2013 04:52:16 +0000 (04:52 +0000)]
Allow the computation of the base priority for a declaration code completion result to consider the completion context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174037 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReplace "failed template argument deduction" diagnostic with something useful
Richard Smith [Thu, 31 Jan 2013 04:03:12 +0000 (04:03 +0000)]
Replace "failed template argument deduction" diagnostic with something useful
in the one case where we've already factored out a reason code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174036 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove elements from Sema.UndefinedInternals as functions are defined. Also
Nick Lewycky [Thu, 31 Jan 2013 03:23:57 +0000 (03:23 +0000)]
Remove elements from Sema.UndefinedInternals as functions are defined. Also
filter the elements before emitting them into a PCH. No user-visible
functionality change, except that PCH files may be smaller?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174034 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix grammar in comment.
Nick Lewycky [Thu, 31 Jan 2013 03:15:20 +0000 (03:15 +0000)]
Fix grammar in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174033 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoClarify the diagnostic for -Wnested-anon-types.
Richard Smith [Thu, 31 Jan 2013 03:11:12 +0000 (03:11 +0000)]
Clarify the diagnostic for -Wnested-anon-types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174032 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] If a lazy binding is undefined, pretend that it's unknown instead.
Jordan Rose [Thu, 31 Jan 2013 02:57:06 +0000 (02:57 +0000)]
[analyzer] If a lazy binding is undefined, pretend that it's unknown instead.

This is a hack to work around the fact that we don't track extents for our
default bindings:

  CGPoint p;
  p.x = 0.0;
  p.y = 0.0;
  rectParam.origin = p;
  use(rectParam.size); // warning: uninitialized value in rectParam.size.width

In this case, the default binding for 'p' gets copied into 'rectParam',
because the 'origin' field is at offset 0 within CGRect. From then on,
rectParam's old default binding (in this case a symbol) is lost.

This patch silences the warning by pretending that lazy bindings are never
made from uninitialized memory, but not only is that not true, the original
default binding is still getting overwritten (see FIXME test cases).
The long-term solution is tracked in <rdar://problem/12701038>

PR14765 and <rdar://problem/12875012>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174031 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen comparing two template template arguments in the template differ, consider
Richard Trieu [Thu, 31 Jan 2013 02:47:46 +0000 (02:47 +0000)]
When comparing two template template arguments in the template differ, consider
them the same if they are actually the same; having the same name isn't enough.

Similar to r174013, template template arguments were also mistakenly considered
the same when they had the same name but were in different namespaces.
In addition, when printing template template arguments, use the qualified name
if the regular name is the same.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174029 91177308-0d34-0410-b5e6-96231b3b80d8