Commit Graph

42150 Commits

Author SHA1 Message Date
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
Guy Benyei b13abb952a Add OpenCL images as clang builtin types.
llvm-svn: 170428
2012-12-18 12:30:03 +00:00
David Chisnall d499f8244b Remove obsolete FIXMEs.
llvm-svn: 170425
2012-12-18 10:24:07 +00:00
NAKAMURA Takumi 7174e90078 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.

llvm-svn: 170411
2012-12-18 05:14:30 +00:00
Rafael Espindola d727d3db08 Inline hasAtomicCopyHelperAPI.
llvm-svn: 170408
2012-12-18 04:29:34 +00:00
Rafael Espindola 74a133fa9a 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.

llvm-svn: 170406
2012-12-18 04:18:55 +00:00
Rafael Espindola 8522ba845f Now that the uninitialized variable has been fixed in llvm, add this test back,
but remove unneeded options and fix the comment.

llvm-svn: 170405
2012-12-18 03:54:29 +00:00
Richard Smith 8b731ea100 Fix typo (thanks to Jordan for spotting it!).
llvm-svn: 170403
2012-12-18 03:04:38 +00:00
Eli Friedman 52f32b9b2b The underlying type for an enum should be an integer type, not another enum.
(This change only affects ObjC.)

<rdar://problem/12857117>.

llvm-svn: 170402
2012-12-18 02:37:32 +00:00
Sean Silva 62737b65b1 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.

llvm-svn: 170401
2012-12-18 02:15:05 +00:00
Anders Carlsson 2a45e409a8 When warning about a missing prototype because a function declaration is missing 'void', insert a fixit to add the void.
llvm-svn: 170399
2012-12-18 01:29:20 +00:00
Eli Friedman 672845bcde 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.

llvm-svn: 170397
2012-12-18 00:52:36 +00:00
Bill Wendling 707021a90f Use the correct return type (size_t) for these builtins.
<rdar://problem/12646344>

llvm-svn: 170393
2012-12-18 00:37:10 +00:00
Bill Wendling 5d4e6a6a10 Add an expected parameter for the size of the destination.
<rdar://problem/12622659>

llvm-svn: 170392
2012-12-18 00:34:49 +00:00
Eric Christopher 45f2e71571 Add support for passing the main file name down to the assembler
for location information.

Part of PR14624

llvm-svn: 170391
2012-12-18 00:31:10 +00:00
Richard Smith be024a8150 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.

llvm-svn: 170387
2012-12-18 00:22:45 +00:00
Rafael Espindola 7581f3269a Fix isThisDeclarationADefinition for extern following tentative.
An extern declaration following a tentative definition should not itself be
considered a tentative definition.
Fixes pr14614.

llvm-svn: 170377
2012-12-17 22:23:47 +00:00
Chandler Carruth 4d5e1a9b34 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.

llvm-svn: 170373
2012-12-17 21:40:04 +00:00
Argyrios Kyrtzidis fdea813c4a [c-index-test] Fix warnings about unused results from chdir().
Patch from Edwin Vane!

llvm-svn: 170366
2012-12-17 20:19:56 +00:00
Argyrios Kyrtzidis 40f6c2ac9c Just use begin()/end() instead of "&Vector[0], &Vector[0]+Vector.size()".
No functionality change.

llvm-svn: 170365
2012-12-17 20:10:50 +00:00