Commit Graph

42169 Commits

Author SHA1 Message Date
NAKAMURA Takumi df3cf71dd7 clang/test/Misc/ast-dump-decl.c: Add triple. __thread is not supported on all targets.
llvm-svn: 170645
2012-12-20 03:30:30 +00:00
Michael Gottesman 2799ad4cce Updated link in LanguageExtensions.rst to point to BlockLanguageSpec.rst instead of BlockLanguageSpec.txt.
Thanks to Jean-Daniel Dupas for comments!

llvm-svn: 170644
2012-12-20 03:23:52 +00:00
Michael Gottesman 5cf1f65dc9 Changed UTF-8 emdashes to --- ala Dmitri Gribenko's comments.
llvm-svn: 170643
2012-12-20 03:23:49 +00:00
Richard Smith da4de6c246 Fix another uninitialized bool member bug found by -fsanitize=bool. This one
appears to currently be benign (we happen to test the flags in the right
order, so we never depend on the uninitialized value).

llvm-svn: 170640
2012-12-20 02:47:01 +00:00
John McCall 393a78d4d3 Robustify the @encode code and add support for _Atomic.
Fixes PR14628.

llvm-svn: 170639
2012-12-20 02:45:14 +00:00
Richard Smith 5bb4cdfaa9 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.

llvm-svn: 170636
2012-12-20 02:22:15 +00:00
Fariborz Jahanian 4419449391 Provide couple of DeclPrint tests for my last patch.
llvm-svn: 170635
2012-12-20 02:20:09 +00:00
Alexander Kornienko 90ff607894 Implement AST dumper for Decls.
http://llvm-reviews.chandlerc.com/D52

Patch by Philip Craig!

llvm-svn: 170634
2012-12-20 02:09:13 +00:00
Anna Zaks dc15415da4 [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.

llvm-svn: 170625
2012-12-20 00:38:25 +00:00
Argyrios Kyrtzidis 5e14925a35 [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.

llvm-svn: 170616
2012-12-19 23:55:44 +00:00
Chad Rosier 567fcd7da2 Typo.
llvm-svn: 170613
2012-12-19 23:47:16 +00:00
Chad Rosier 6c2b11cc50 [driver] Have -isysroot warn on nonexistent paths.
rdar://12282267

llvm-svn: 170611
2012-12-19 23:41:50 +00:00
Fariborz Jahanian 0389e528ab 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.

llvm-svn: 170606
2012-12-19 23:36:00 +00:00
Argyrios Kyrtzidis 2810e9dee0 [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

llvm-svn: 170596
2012-12-19 22:21:18 +00:00
Dmitri Gribenko 1436ff2ef8 Documentation: UsersManual.rst: some cleanups after semi-automatic conversion
llvm-svn: 170590
2012-12-19 22:06:59 +00:00
Fariborz Jahanian a1f8571e84 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

llvm-svn: 170573
2012-12-19 18:58:55 +00:00
Michael Gottesman 42845efb2d Forgot to remove trailing whitespace when I converted the BlockLanguageSpec.txt => BlockLanguageSpec.rst. It has been eliminated.
llvm-svn: 170572
2012-12-19 18:42:42 +00:00
Michael Gottesman b166b92908 Converted BlockLanguageSpec.txt => BlockLanguageSpec.rst.
llvm-svn: 170571
2012-12-19 18:41:09 +00:00
Ted Kremenek 11d0b553bb Change test to dump Filecheck output to an intermediate file. This makes it easier to update this test.
llvm-svn: 170570
2012-12-19 18:30:38 +00:00
Dmitri Gribenko c55c6fc6e3 Fix PR14591: Windows newlines in doxygen comments cause failed assertion in
TextDiagnostic

Patch by Janusz Chorko.

llvm-svn: 170566
2012-12-19 17:34:55 +00:00
Dmitri Gribenko 909eebc9ac 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.

llvm-svn: 170565
2012-12-19 17:29:30 +00:00
Dmitri Gribenko 696d7226d6 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.

llvm-svn: 170563
2012-12-19 17:17:09 +00:00
Fariborz Jahanian ae9d8aeb2b Improve on header comment suggested by James Dennet.
llvm-svn: 170555
2012-12-19 17:03:46 +00:00
Bill Wendling 7967fc14b9 Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.
llvm-svn: 170500
2012-12-19 07:18:12 +00:00
Richard Smith 4efa77fde4 Attempt to clarify a vexing-parse diagnostic.
llvm-svn: 170492
2012-12-19 03:15:32 +00:00
Richard Smith 503053a737 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.

llvm-svn: 170490
2012-12-19 02:27:38 +00:00
Richard Smith d59b832320 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.

llvm-svn: 170489
2012-12-19 01:39:02 +00:00
Ted Kremenek 3a081a0339 Pass AnalyzerOptions to PathDiagnosticConsumer to make analyzer options accessible there.
This is plumbing needed for later functionality changes.

llvm-svn: 170488
2012-12-19 01:35:35 +00:00
Ted Kremenek 372735f342 Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.
llvm-svn: 170487
2012-12-19 01:16:49 +00:00
Fariborz Jahanian 799d96b8b8 fixes a doxygen comment.
llvm-svn: 170485
2012-12-19 01:00:36 +00:00
NAKAMURA Takumi 710c18329b test/Index/preamble_macro_template.cpp: Suppress this probably due to Lit/win32 issue. Investigating.
llvm-svn: 170484
2012-12-19 00:57:48 +00:00
David Blaikie ff7d47a354 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)

llvm-svn: 170482
2012-12-19 00:45:41 +00:00
Fariborz Jahanian bbdb9f2653 Increas number of iterations before a new libclang format object
is created to 1000.

llvm-svn: 170481
2012-12-19 00:35:23 +00:00
Eli Friedman 39b685e4d1 Make sure CodeGen uses a value of the correct type as the result of
of assignment to a bool bitfield.  PR14638.

llvm-svn: 170480
2012-12-19 00:26:58 +00:00
Fariborz Jahanian b67908a07b Some code refactoring per Dimitri's comment.
llvm-svn: 170478
2012-12-19 00:01:48 +00:00
Eli Friedman 40ea264c25 Fix a crash in diagnostic printing when a template class type is diff'ed
against itself. PR14489.

llvm-svn: 170474
2012-12-18 23:32:47 +00:00
Nadav Rotem 1cd71a771c Enable the loop vectorizer in clang via -fvectorize
llvm-svn: 170472
2012-12-18 23:10:16 +00:00
Nadav Rotem b2b8d5bc86 Fix the fvectorize testcase
llvm-svn: 170469
2012-12-18 23:08:58 +00:00
Ted Kremenek e3713d3025 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).

llvm-svn: 170468
2012-12-18 23:07:30 +00:00
Fariborz Jahanian 9b7ab87738 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. 

llvm-svn: 170467
2012-12-18 23:02:59 +00:00
Douglas Gregor dfc9430bc7 Be defensive when printing module import locations; the diagnostic printer needs to be robust
llvm-svn: 170466
2012-12-18 23:02:07 +00:00
Eli Bendersky 03b913d539 Similar to 170440 - fix build warning with gcc
llvm-svn: 170461
2012-12-18 22:22:16 +00:00
Bill Wendling f1c3191188 Add tests to check recent changes to some builtins.
llvm-svn: 170458
2012-12-18 21:09:25 +00:00
Daniel Jasper 2af6bbe7e0 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.

llvm-svn: 170457
2012-12-18 21:05:13 +00:00
Meador Inge b97878a235 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.

llvm-svn: 170455
2012-12-18 20:58:04 +00:00
Daniel Jasper 3f69a1b860 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.

llvm-svn: 170446
2012-12-18 19:56:56 +00:00
Douglas Gregor 4d65bbd509 CMake: Make sure to detect LibXml2 when Clang is built standalone
llvm-svn: 170444
2012-12-18 19:39:40 +00:00
Eli Bendersky 76bd3d8599 Fix a compilation warning with gcc 4.6
llvm-svn: 170440
2012-12-18 18:53:14 +00:00
Guy Benyei d8a08ea98d Re-commit r170428 changes with Linux style file endings.
Add OpenCL images as clang builtin types.

llvm-svn: 170432
2012-12-18 14:38:23 +00:00
Guy Benyei 11169dded0 Revert changes from r170428, as I accidentally changed the line endings of these files to Windows style.
llvm-svn: 170431
2012-12-18 14:30:41 +00:00