]> granicus.if.org Git - clang/log
clang
11 years agoFix code that attempted to produce a diagnostic with one DiagnosticEngine, then
Richard Smith [Thu, 20 Dec 2012 02:22:15 +0000 (02:22 +0000)]
Fix code that attempted to produce a diagnostic with one DiagnosticEngine, then
produce a note for that diagnostic either with a different DiagnosticEngine or
after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the
wrong thing if the original diagnostic was suppressed.

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

11 years agoProvide couple of DeclPrint tests for my last patch.
Fariborz Jahanian [Thu, 20 Dec 2012 02:20:09 +0000 (02:20 +0000)]
Provide couple of DeclPrint tests for my last patch.

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

11 years agoImplement AST dumper for Decls.
Alexander Kornienko [Thu, 20 Dec 2012 02:09:13 +0000 (02:09 +0000)]
Implement AST dumper for Decls.
http://llvm-reviews.chandlerc.com/D52

Patch by Philip Craig!

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

11 years ago[analyzer] Add the pointer escaped callback.
Anna Zaks [Thu, 20 Dec 2012 00:38:25 +0000 (00:38 +0000)]
[analyzer] Add the pointer escaped callback.

Instead of using several callbacks to identify the pointer escape event,
checkers now can register for the checkPointerEscape.

Converted the Malloc checker to use the new callback.
SimpleStreamChecker will be converted next.

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

11 years ago[preprocessor] When "merging" macro argument tokens into one SLocEntry chunk,
Argyrios Kyrtzidis [Wed, 19 Dec 2012 23:55:44 +0000 (23:55 +0000)]
[preprocessor] When "merging" macro argument tokens into one SLocEntry chunk,
make sure they came from the same kind of FileIDs.

Thanks to Abramo Bagnara for providing the test case.

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

11 years agoTypo.
Chad Rosier [Wed, 19 Dec 2012 23:47:16 +0000 (23:47 +0000)]
Typo.

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

11 years ago[driver] Have -isysroot warn on nonexistent paths.
Chad Rosier [Wed, 19 Dec 2012 23:41:50 +0000 (23:41 +0000)]
[driver] Have -isysroot warn on nonexistent paths.
rdar://12282267

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

11 years agoAudit DeclPrinter with -ast-dump on Cocoa.h and
Fariborz Jahanian [Wed, 19 Dec 2012 23:36:00 +0000 (23:36 +0000)]
Audit DeclPrinter with -ast-dump on Cocoa.h and
fix any bad objectiveC syntax coming out of
DeclPrinter. This is on going. Also, introduce a new
PrintPolicy and use it as needed when declaration tag
is to be produced via DeclPrinter.

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

11 years ago[PCH/Modules] In ASTReader::completeVisibleDeclsMap, make sure to visit all
Argyrios Kyrtzidis [Wed, 19 Dec 2012 22:21:18 +0000 (22:21 +0000)]
[PCH/Modules] In ASTReader::completeVisibleDeclsMap, make sure to visit all
modules when getting the decls for a namespace or translation unit.

Otherwise the code-completion results will not be complete.

rdar://12889089

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

11 years agoDocumentation: UsersManual.rst: some cleanups after semi-automatic conversion
Dmitri Gribenko [Wed, 19 Dec 2012 22:06:59 +0000 (22:06 +0000)]
Documentation: UsersManual.rst: some cleanups after semi-automatic conversion

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

11 years agoobjective-C: Don't warn of unimplemented property of protocols in
Fariborz Jahanian [Wed, 19 Dec 2012 18:58:55 +0000 (18:58 +0000)]
objective-C: Don't warn of unimplemented property of protocols in
category, when those properties will be implemented in category's
primary class or one of its super classes. // rdar://12568064

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

11 years agoForgot to remove trailing whitespace when I converted the BlockLanguageSpec.txt ...
Michael Gottesman [Wed, 19 Dec 2012 18:42:42 +0000 (18:42 +0000)]
Forgot to remove trailing whitespace when I converted the BlockLanguageSpec.txt => BlockLanguageSpec.rst. It has been eliminated.

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

11 years agoConverted BlockLanguageSpec.txt => BlockLanguageSpec.rst.
Michael Gottesman [Wed, 19 Dec 2012 18:41:09 +0000 (18:41 +0000)]
Converted BlockLanguageSpec.txt => BlockLanguageSpec.rst.

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

11 years agoChange test to dump Filecheck output to an intermediate file. This makes it easier...
Ted Kremenek [Wed, 19 Dec 2012 18:30:38 +0000 (18:30 +0000)]
Change test to dump Filecheck output to an intermediate file.  This makes it easier to update this test.

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

11 years agoFix PR14591: Windows newlines in doxygen comments cause failed assertion in
Dmitri Gribenko [Wed, 19 Dec 2012 17:34:55 +0000 (17:34 +0000)]
Fix PR14591: Windows newlines in doxygen comments cause failed assertion in
TextDiagnostic

Patch by Janusz Chorko.

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

11 years agoAdd a missing 'else'. Found by grep '} if'
Dmitri Gribenko [Wed, 19 Dec 2012 17:29:30 +0000 (17:29 +0000)]
Add a missing 'else'.  Found by grep '} if'

No testcase because this did not affect correctness: a declaration can only be
ClassTemplateDecl or a FunctionTemplateDecl, not both.

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

11 years agoComment parsing: add a missing 'else'. Found by inspection.
Dmitri Gribenko [Wed, 19 Dec 2012 17:17:09 +0000 (17:17 +0000)]
Comment parsing: add a missing 'else'.  Found by inspection.

No testcase because we were just building an extra AST node and eventually
throwing it away, so it did not affect correctness.

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

11 years agoImprove on header comment suggested by James Dennet.
Fariborz Jahanian [Wed, 19 Dec 2012 17:03:46 +0000 (17:03 +0000)]
Improve on header comment suggested by James Dennet.

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

11 years agoRename the 'Attributes' class to 'Attribute'. It's going to represent a single attrib...
Bill Wendling [Wed, 19 Dec 2012 07:18:12 +0000 (07:18 +0000)]
Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

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

11 years agoAttempt to clarify a vexing-parse diagnostic.
Richard Smith [Wed, 19 Dec 2012 03:15:32 +0000 (03:15 +0000)]
Attempt to clarify a vexing-parse diagnostic.

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

11 years agoFix assertion failure in self-host (and probably bogus template instantiation
Richard Smith [Wed, 19 Dec 2012 02:27:38 +0000 (02:27 +0000)]
Fix assertion failure in self-host (and probably bogus template instantiation
too). When instantiating a direct-initializer, if we find it has zero
arguments, produce an empty ParenListExpr rather than returning a null
expression.

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

11 years agoPR13470: Ensure that copy-list-initialization isntantiates as
Richard Smith [Wed, 19 Dec 2012 01:39:02 +0000 (01:39 +0000)]
PR13470: Ensure that copy-list-initialization isntantiates as
copy-list-initialization (and doesn't add an additional copy step):

Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it
when instantiating initializers in order to correctly handle instantiation of
copy-list-initialization. Teach TreeTransform that function arguments are
initializations, and so need this special treatment too. Finally, remove some
hacks which were working around SubstInitializer's shortcomings.

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

11 years agoPass AnalyzerOptions to PathDiagnosticConsumer to make analyzer options accessible...
Ted Kremenek [Wed, 19 Dec 2012 01:35:35 +0000 (01:35 +0000)]
Pass AnalyzerOptions to PathDiagnosticConsumer to make analyzer options accessible there.

This is plumbing needed for later functionality changes.

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

11 years agoSimplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.
Ted Kremenek [Wed, 19 Dec 2012 01:16:49 +0000 (01:16 +0000)]
Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.

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

11 years agofixes a doxygen comment.
Fariborz Jahanian [Wed, 19 Dec 2012 01:00:36 +0000 (01:00 +0000)]
fixes a doxygen comment.

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

11 years agotest/Index/preamble_macro_template.cpp: Suppress this probably due to Lit/win32 issue...
NAKAMURA Takumi [Wed, 19 Dec 2012 00:57:48 +0000 (00:57 +0000)]
test/Index/preamble_macro_template.cpp: Suppress this probably due to Lit/win32 issue. Investigating.

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

11 years agoChange DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review...
David Blaikie [Wed, 19 Dec 2012 00:45:41 +0000 (00:45 +0000)]
Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review discussion in r170365

This does limit these typedefs to being sequences, but no current usage
requires them to be contiguous (we could expand this to a more general
iterator pair range concept at some point).

Also, it'd be nice if SmallVector were constructible directly from an ArrayRef
but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the
inverse conversion. (& generalizing over all range-like things, while nice,
would require some nontrivial SFINAE I haven't thought about yet)

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

11 years agoIncreas number of iterations before a new libclang format object
Fariborz Jahanian [Wed, 19 Dec 2012 00:35:23 +0000 (00:35 +0000)]
Increas number of iterations before a new libclang format object
is created to 1000.

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

11 years agoMake sure CodeGen uses a value of the correct type as the result of
Eli Friedman [Wed, 19 Dec 2012 00:26:58 +0000 (00:26 +0000)]
Make sure CodeGen uses a value of the correct type as the result of
of assignment to a bool bitfield.  PR14638.

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

11 years agoSome code refactoring per Dimitri's comment.
Fariborz Jahanian [Wed, 19 Dec 2012 00:01:48 +0000 (00:01 +0000)]
Some code refactoring per Dimitri's comment.

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

11 years agoFix a crash in diagnostic printing when a template class type is diff'ed
Eli Friedman [Tue, 18 Dec 2012 23:32:47 +0000 (23:32 +0000)]
Fix a crash in diagnostic printing when a template class type is diff'ed
against itself. PR14489.

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

11 years agoEnable the loop vectorizer in clang via -fvectorize
Nadav Rotem [Tue, 18 Dec 2012 23:10:16 +0000 (23:10 +0000)]
Enable the loop vectorizer in clang via -fvectorize

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

11 years agoFix the fvectorize testcase
Nadav Rotem [Tue, 18 Dec 2012 23:08:58 +0000 (23:08 +0000)]
Fix the fvectorize testcase

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

11 years agoHave clang_getSpellingLocation() use the same logic as DiagnosticRenderer for plowing...
Ted Kremenek [Tue, 18 Dec 2012 23:07:30 +0000 (23:07 +0000)]
Have clang_getSpellingLocation() use the same logic as DiagnosticRenderer for plowing through macros.

This fixes a subtle bug reported in <rdar://problem/12584554> where a double-nested
macro could lead to an incorrect fixit location with live issues.

This fix also uncovers a bunch of subtle bugs in our indexer test cases which
are now fixed (mostly around source ranges for attributes).

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

11 years agoThis is the libclang patch providing minimal API to
Fariborz Jahanian [Tue, 18 Dec 2012 23:02:59 +0000 (23:02 +0000)]
This is the libclang patch providing minimal API to
use clang's formatter. Currently, formatter is used
to format declaration tags for xml comments. Since formatter
is in flux and its change will break several of the clang comment
tests, only a single tests is formatted using this facility.
Doug has reviewed and approved it for check-in.

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

11 years agoBe defensive when printing module import locations; the diagnostic printer needs...
Douglas Gregor [Tue, 18 Dec 2012 23:02:07 +0000 (23:02 +0000)]
Be defensive when printing module import locations; the diagnostic printer needs to be robust

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

11 years agoSimilar to 170440 - fix build warning with gcc
Eli Bendersky [Tue, 18 Dec 2012 22:22:16 +0000 (22:22 +0000)]
Similar to 170440 - fix build warning with gcc

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

11 years agoAdd tests to check recent changes to some builtins.
Bill Wendling [Tue, 18 Dec 2012 21:09:25 +0000 (21:09 +0000)]
Add tests to check recent changes to some builtins.

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

11 years agoBetter support for constructor initializers.
Daniel Jasper [Tue, 18 Dec 2012 21:05:13 +0000 (21:05 +0000)]
Better support for constructor initializers.

We used to format initializers like this (with a sort of hacky implementation):
Constructor()
    : Val1(A),
      Val2(B) {

and now format like this (with a somewhat better solution):
Constructor()
    : Val1(A), Val2(B) {

assuming this would not fit on a single line. Also added tests.

As a side effect we now first analyze whether an UnwrappedLine needs to be
split at all. If not, not splitting it is the best solution by definition. As
this should be a very common case in normal code, not exploring the entire
solution space can provide significant speedup.

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

11 years agoCodeGen: Expand creal and cimag into complex field loads
Meador Inge [Tue, 18 Dec 2012 20:58:04 +0000 (20:58 +0000)]
CodeGen: Expand creal and cimag into complex field loads

PR 14529 was opened because neither Clang or LLVM was expanding
calls to creal* or cimag* into instructions that just load the
respective complex field.  After some discussion, it was not
considered realistic to do this in LLVM because of the platform
specific way complex types are expanded.  Thus a way to solve
this in Clang was pursued.  GCC does a similar expansion.

This patch adds the feature to Clang by making the creal* and
cimag* functions library builtins and modifying the builtin code
generator to look for the new builtin types.

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

11 years agoMake the format scrambler understand line comments.
Daniel Jasper [Tue, 18 Dec 2012 19:56:56 +0000 (19:56 +0000)]
Make the format scrambler understand line comments.

This allows for writing tests including line comments easier and more readable.
We will need more of those tests in the future and also line comments are
useful to force line breaks in tests.

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

11 years agoCMake: Make sure to detect LibXml2 when Clang is built standalone
Douglas Gregor [Tue, 18 Dec 2012 19:39:40 +0000 (19:39 +0000)]
CMake: Make sure to detect LibXml2 when Clang is built standalone

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

11 years agoFix a compilation warning with gcc 4.6
Eli Bendersky [Tue, 18 Dec 2012 18:53:14 +0000 (18:53 +0000)]
Fix a compilation warning with gcc 4.6

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

11 years agoRe-commit r170428 changes with Linux style file endings.
Guy Benyei [Tue, 18 Dec 2012 14:38:23 +0000 (14:38 +0000)]
Re-commit r170428 changes with Linux style file endings.

Add OpenCL images as clang builtin types.

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

11 years agoRevert changes from r170428, as I accidentally changed the line endings of these...
Guy Benyei [Tue, 18 Dec 2012 14:30:41 +0000 (14:30 +0000)]
Revert changes from r170428, as I accidentally changed the line endings of these files to Windows style.

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

11 years agoAdd OpenCL images as clang builtin types.
Guy Benyei [Tue, 18 Dec 2012 12:30:03 +0000 (12:30 +0000)]
Add OpenCL images as clang builtin types.

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

11 years agoRemove obsolete FIXMEs.
David Chisnall [Tue, 18 Dec 2012 10:24:07 +0000 (10:24 +0000)]
Remove obsolete FIXMEs.

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

11 years agotest/Misc/dev-fd-fs.c: Mark this as XFAIL:freebsd (since r169831).
NAKAMURA Takumi [Tue, 18 Dec 2012 05:14:30 +0000 (05:14 +0000)]
test/Misc/dev-fd-fs.c: Mark this as XFAIL:freebsd (since r169831).

I don't want to suppress this to be excluded with the feature "dev-fd-fs". This should work also on freebsd.

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

11 years agoInline hasAtomicCopyHelperAPI.
Rafael Espindola [Tue, 18 Dec 2012 04:29:34 +0000 (04:29 +0000)]
Inline hasAtomicCopyHelperAPI.

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

11 years agoMerge storage classes even when contexts don't match.
Rafael Espindola [Tue, 18 Dec 2012 04:18:55 +0000 (04:18 +0000)]
Merge storage classes even when contexts don't match.

This fixes the storage class of extern decls that are merged with file level
statics. The patch also fixes the linkage computation so that they are
considered internal.

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

11 years agoNow that the uninitialized variable has been fixed in llvm, add this test back,
Rafael Espindola [Tue, 18 Dec 2012 03:54:29 +0000 (03:54 +0000)]
Now that the uninitialized variable has been fixed in llvm, add this test back,
but remove unneeded options and fix the comment.

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

11 years agoFix typo (thanks to Jordan for spotting it!).
Richard Smith [Tue, 18 Dec 2012 03:04:38 +0000 (03:04 +0000)]
Fix typo (thanks to Jordan for spotting it!).

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

11 years agoThe underlying type for an enum should be an integer type, not another enum.
Eli Friedman [Tue, 18 Dec 2012 02:37:32 +0000 (02:37 +0000)]
The underlying type for an enum should be an integer type, not another enum.
(This change only affects ObjC.)

<rdar://problem/12857117>.

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

11 years agodocs: Nuke AnalyzerRegions.rst.
Sean Silva [Tue, 18 Dec 2012 02:15:05 +0000 (02:15 +0000)]
docs: Nuke AnalyzerRegions.rst.

As per Ted's advice. It can be brought back from version control if
needed.

This also fixes a Sphinx warning.

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

11 years agoWhen warning about a missing prototype because a function declaration is missing...
Anders Carlsson [Tue, 18 Dec 2012 01:29:20 +0000 (01:29 +0000)]
When warning about a missing prototype because a function declaration is missing 'void', insert a fixit to add the void.

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

11 years agoMore conservative fix for <rdar://problem/12847524> (a crash printing diagnostic...
Eli Friedman [Tue, 18 Dec 2012 00:52:36 +0000 (00:52 +0000)]
More conservative fix for <rdar://problem/12847524> (a crash printing diagnostic ranges).
I'm not really happy with this fix, but I'm confident it's correct.

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

11 years agoUse the correct return type (size_t) for these builtins.
Bill Wendling [Tue, 18 Dec 2012 00:37:10 +0000 (00:37 +0000)]
Use the correct return type (size_t) for these builtins.
<rdar://problem/12646344>

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

11 years agoAdd an expected parameter for the size of the destination.
Bill Wendling [Tue, 18 Dec 2012 00:34:49 +0000 (00:34 +0000)]
Add an expected parameter for the size of the destination.
<rdar://problem/12622659>

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

11 years agoAdd support for passing the main file name down to the assembler
Eric Christopher [Tue, 18 Dec 2012 00:31:10 +0000 (00:31 +0000)]
Add support for passing the main file name down to the assembler
for location information.

Part of PR14624

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

11 years agoRein ubsan's vptr sanitizer back a bit. Per core issue 453, binding a reference
Richard Smith [Tue, 18 Dec 2012 00:22:45 +0000 (00:22 +0000)]
Rein ubsan's vptr sanitizer back a bit. Per core issue 453, binding a reference
to an object outside its lifetime does not have undefined behavior.

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

11 years agoFix isThisDeclarationADefinition for extern following tentative.
Rafael Espindola [Mon, 17 Dec 2012 22:23:47 +0000 (22:23 +0000)]
Fix isThisDeclarationADefinition for extern following tentative.

An extern declaration following a tentative definition should not itself be
considered a tentative definition.
Fixes pr14614.

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

11 years agoFix PR14625 by teaching the driver to detect PWD for assembly files.
Chandler Carruth [Mon, 17 Dec 2012 21:40:04 +0000 (21:40 +0000)]
Fix PR14625 by teaching the driver to detect PWD for assembly files.

This also requires adding support to -cc1as for passing the detecting
PWD down through LLVM's debug info (which in turn required the LLVM
change in r170371).

The test case is weak (we only test the driver behavior) because there
is currently to infrastructure for running cc1as in the test suite. So
those four lines are untested (much like all other lines in that file),
but we have a test for the same pattern using llvm-mc in the LLVM
repository.

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

11 years ago[c-index-test] Fix warnings about unused results from chdir().
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:19:56 +0000 (20:19 +0000)]
[c-index-test] Fix warnings about unused results from chdir().
Patch from Edwin Vane!

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

11 years agoJust use begin()/end() instead of "&Vector[0], &Vector[0]+Vector.size()".
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:50 +0000 (20:10 +0000)]
Just use begin()/end() instead of "&Vector[0], &Vector[0]+Vector.size()".

No functionality change.

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

11 years agoDon't include the header outside the include guards, it defeats the purpose of the...
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:49 +0000 (20:10 +0000)]
Don't include the header outside the include guards, it defeats the purpose of the include guards.

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

11 years ago[parser] Push a semi token for recovery only when it is actually missing.
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:43 +0000 (20:10 +0000)]
[parser] Push a semi token for recovery only when it is actually missing.

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

11 years ago[analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful.
Anna Zaks [Mon, 17 Dec 2012 20:08:54 +0000 (20:08 +0000)]
[analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful.

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

11 years ago[analyzer] Implement "do not inline large functions many times"
Anna Zaks [Mon, 17 Dec 2012 20:08:51 +0000 (20:08 +0000)]
[analyzer] Implement "do not inline large functions many times"
performance heuristic

After inlining a function with more than 13 basic blocks 32 times, we
are not going to inline it anymore. The idea is that inlining large
functions leads to drastic performance implications. Since the function
has already been inlined, we know that we've analyzed it in many
contexts.

The following metrics are used:
 - Large function is a function with more than 13 basic blocks (we
should switch to another metric, like cyclomatic complexity)
 - We consider that we've inlined a function many times if it's been
inlined 32 times. This number is configurable with -analyzer-config
max-times-inline-large=xx

This heuristic addresses a performance regression introduced with
inlining on one benchmark. The analyzer on this benchmark became 60
times slower with inlining turned on. The heuristic allows us to analyze
it in 24% of the time. The performance improvements on the other
benchmarks I've tested with are much lower - under 10%, which is
expected.

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

11 years agoReapply r170344, this time without forgetting to commit the header changes.
David Chisnall [Mon, 17 Dec 2012 18:54:24 +0000 (18:54 +0000)]
Reapply r170344, this time without forgetting to commit the header changes.

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

11 years agoRevert "Added support for new property helpers (GNUstep runtime)."
Benjamin Kramer [Mon, 17 Dec 2012 18:02:43 +0000 (18:02 +0000)]
Revert "Added support for new property helpers (GNUstep runtime)."

This reverts commit r170344. Doesn't even compile.

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

11 years agoAdded support for new property helpers (GNUstep runtime).
David Chisnall [Mon, 17 Dec 2012 15:59:29 +0000 (15:59 +0000)]
Added support for new property helpers (GNUstep runtime).

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

11 years agoAdd basic support for splitting before function calls if it can't be
Daniel Jasper [Mon, 17 Dec 2012 14:34:14 +0000 (14:34 +0000)]
Add basic support for splitting before function calls if it can't be
avoided.

This required a minor modification of the memoization as now the
"CurrentPenalty" depends on whether or not we break before the current
token. Therefore, the CurrentPenalty should not be memoized but added
after retrieving a value from memory. This should not affect the runtime
behavior.

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

11 years agotsan: correct llvm libc++ name
Dmitry Vyukov [Mon, 17 Dec 2012 13:07:35 +0000 (13:07 +0000)]
tsan: correct llvm libc++ name

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

11 years agoFix several formatting problems.
Daniel Jasper [Mon, 17 Dec 2012 11:29:41 +0000 (11:29 +0000)]
Fix several formatting problems.

More specifically:
- Improve formatting of static initializers.
- Fix formatting of lines comments in enums.
- Fix formmating of trailing line comments.

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

11 years agotsan: add __has_feature(thread_sanitizer)
Dmitry Vyukov [Mon, 17 Dec 2012 08:52:05 +0000 (08:52 +0000)]
tsan: add __has_feature(thread_sanitizer)

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

11 years agotsan: update docs
Dmitry Vyukov [Mon, 17 Dec 2012 07:16:54 +0000 (07:16 +0000)]
tsan: update docs

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

11 years agoClean up a small (messy) section of Clang's release notes for 3.2.
Chandler Carruth [Mon, 17 Dec 2012 06:24:36 +0000 (06:24 +0000)]
Clean up a small (messy) section of Clang's release notes for 3.2.

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

11 years agoThis patch fixes PR13624, which notes a 64-bit PowerPC ELF ABI
Bill Schmidt [Mon, 17 Dec 2012 04:20:17 +0000 (04:20 +0000)]
This patch fixes PR13624, which notes a 64-bit PowerPC ELF ABI
incompatibility with how complex values are returned.  It is sufficient
to flag all complex types as direct rather than indirect.

A new test case is provided that checks correct IR generation for the
various supported flavors of _Complex.

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

11 years agoIdentifierResolver: Remove an unnecessary include and an unused parameter.
Nico Weber [Mon, 17 Dec 2012 03:51:09 +0000 (03:51 +0000)]
IdentifierResolver: Remove an unnecessary include and an unused parameter.

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

11 years agoDocumentation: add a missing word
Dmitri Gribenko [Sun, 16 Dec 2012 19:55:39 +0000 (19:55 +0000)]
Documentation: add a missing word

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

11 years agoClang ReleaseNotes: add information about documentation comments support
Dmitri Gribenko [Sun, 16 Dec 2012 17:38:09 +0000 (17:38 +0000)]
Clang ReleaseNotes: add information about documentation comments support

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

11 years agoDocumentation: AutomaticReferenceCounting.rst: use CSS section numbering.
Dmitri Gribenko [Sun, 16 Dec 2012 11:25:45 +0000 (11:25 +0000)]
Documentation: AutomaticReferenceCounting.rst: use CSS section numbering.
This enables us to use the same document structure as in other files.

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

11 years agoDon't use SourceLineCache in getColumnNumber if LastLineNoResult is past the end...
Craig Topper [Sun, 16 Dec 2012 05:58:32 +0000 (05:58 +0000)]
Don't use SourceLineCache in getColumnNumber if LastLineNoResult is past the end of the cache. Fixes PR14570.

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

11 years agodocs: Fix completely broken adornment structure.
Sean Silva [Sun, 16 Dec 2012 00:23:40 +0000 (00:23 +0000)]
docs: Fix completely broken adornment structure.

The adornment:

===
Foo
===

is for titles, not sections.

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

11 years agoDocumentation: random cleanups. Use monospaced font where appropriate,
Dmitri Gribenko [Sat, 15 Dec 2012 21:10:51 +0000 (21:10 +0000)]
Documentation: random cleanups.  Use monospaced font where appropriate,
highlight console output with "code-block:: console", etc.

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

11 years agoDocumentation: convert InternalsManual.html to reST
Dmitri Gribenko [Sat, 15 Dec 2012 20:41:17 +0000 (20:41 +0000)]
Documentation: convert InternalsManual.html to reST

Patch by Anastasi Voitova with with small fixes by me.

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

11 years agoDocumentation: LanguageExtensions.rst: convert link to :doc: style and fix up
Dmitri Gribenko [Sat, 15 Dec 2012 14:25:25 +0000 (14:25 +0000)]
Documentation: LanguageExtensions.rst: convert link to :doc: style and fix up
heading underline.

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

11 years ago[ubsan] Emit branch weight metadata to hint towards common case.
Will Dietz [Sat, 15 Dec 2012 01:39:14 +0000 (01:39 +0000)]
[ubsan] Emit branch weight metadata to hint towards common case.

Results in better block placement that helps close the
performance gap when making ubsan checks recoverable.

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

11 years agoDocs: redirect "static analysis extensions" section to the analyzer site.
Jordan Rose [Sat, 15 Dec 2012 00:37:01 +0000 (00:37 +0000)]
Docs: redirect "static analysis extensions" section to the analyzer site.

The notes on the objc_method_family and ns_returns_retained-type attributes
have been moved to the Objective-C section, since both are used by ARC.
The notes on analyzer_noreturn are now only on the analyzer site.

The inadequacy of these docs was noticed months ago by Jonathan Sauer;
I'm only just now getting around to cleaning them up.

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

11 years agoRemove old description of analyzer internals from public docs.
Jordan Rose [Sat, 15 Dec 2012 00:36:53 +0000 (00:36 +0000)]
Remove old description of analyzer internals from public docs.

The file still exists in docs/analyzer/, but it won't be linked to from
clang.llvm.org or processed as part of the default Sphinx doc-build.
RegionStore has changed a lot from what Ted and Zhongxing describe here!

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

11 years agofixed line endings
Anton Yartsev [Fri, 14 Dec 2012 20:28:48 +0000 (20:28 +0000)]
fixed line endings

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

11 years agoadded post-statement callback to CXXNewExpr and pre-statement callback to CXXDeleteExpr
Anton Yartsev [Fri, 14 Dec 2012 19:48:34 +0000 (19:48 +0000)]
added post-statement callback to CXXNewExpr and pre-statement callback to CXXDeleteExpr

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

11 years agoDon't hit an assertion failure when calculating the __PRETTY_FUNCTION__
Argyrios Kyrtzidis [Fri, 14 Dec 2012 19:44:11 +0000 (19:44 +0000)]
Don't hit an assertion failure when calculating the __PRETTY_FUNCTION__
of a member function with parenthesized declarator.

Like this test case:

class Foo {
  const char *(baz)() {
    return __PRETTY_FUNCTION__;
  }
};

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

11 years ago[analyzer] Propagate the checker's state from checkBranchCondition
Anna Zaks [Fri, 14 Dec 2012 19:08:20 +0000 (19:08 +0000)]
[analyzer] Propagate the checker's state from checkBranchCondition

Fixes a bug, where we were dropping the state modifications from the
checkBranchCondition checker callback.

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

11 years ago[analyzer] Refactor: Store visited Decls instead of CallGraphNodes.
Anna Zaks [Fri, 14 Dec 2012 19:08:17 +0000 (19:08 +0000)]
[analyzer] Refactor: Store visited Decls instead of CallGraphNodes.

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

11 years agoStyle and Doc fix for CommonOptionsParser
Edwin Vane [Fri, 14 Dec 2012 18:58:25 +0000 (18:58 +0000)]
Style and Doc fix for CommonOptionsParser

- Renaming GetCompilations() and GetSourcePathList() to follow LLVM
  style.
- Updating docs to reflect name change.
- Also updating help text to not mention clang-check since this class
  can be used by any tool.

Reviewed By: Alexander Kornienko

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

11 years ago[preprocessor] For errors at a function macro invocation, also include
Argyrios Kyrtzidis [Fri, 14 Dec 2012 18:53:47 +0000 (18:53 +0000)]
[preprocessor] For errors at a function macro invocation, also include
a note about where the macro is defined.

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

11 years ago[CMake] Move libxml2 stuff from clang to llvm/cmake.
NAKAMURA Takumi [Fri, 14 Dec 2012 18:30:20 +0000 (18:30 +0000)]
[CMake] Move libxml2 stuff from clang to llvm/cmake.

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

11 years agoDon't require a space between the two ">" in "vector<id<protocol>>" in objc++11.
Nico Weber [Fri, 14 Dec 2012 18:22:38 +0000 (18:22 +0000)]
Don't require a space between the two ">" in "vector<id<protocol>>" in objc++11.

C++11 allowed writing "vector<vector<int>>" without a space between the two ">".
This change allows this for protocols in template lists too in -std=c++11 mode,
and improves the diagnostic in c++98 mode.

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

11 years agoTargets.cpp: [cygwin] Add the predefined macro "_X86_", according to newer version...
NAKAMURA Takumi [Fri, 14 Dec 2012 10:17:26 +0000 (10:17 +0000)]
Targets.cpp: [cygwin] Add the predefined macro "_X86_", according to newer version of cygwin/w32api.

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