Commit Graph

42350 Commits

Author SHA1 Message Date
Rafael Espindola d2ecc139f2 Warn on unused auto variables.
To do so we have to wait until we know that the type of a variable has been
deduced. Sema::FinalizeDeclaration is the first callback that is used for
decl with or without initializers.

llvm-svn: 171458
2013-01-03 04:29:20 +00:00
Rafael Espindola 60470f1194 Use early returns to reduce indentation.
llvm-svn: 171457
2013-01-03 04:05:19 +00:00
Argyrios Kyrtzidis 6ba7afb8e1 [arcmt] Rewrite uses of Block_copy/Block_release macros.
c = Block_copy(b);
  Block_release(c);
 ---->
  c = [b copy];
  <removed>

rdar://9408211

llvm-svn: 171454
2013-01-03 03:17:17 +00:00
Ted Kremenek 1d6aac5b6a Fix capitalization of Objective-C in diagnostic.
llvm-svn: 171440
2013-01-03 01:30:20 +00:00
Ted Kremenek 6fcefb53e3 Make MallocChecker debug output useful.
llvm-svn: 171439
2013-01-03 01:30:12 +00:00
Eli Friedman 33accdf602 Don't assert/crash on reference variables in lambdas bound to a
static local variable from the parent scope.  PR14773.

llvm-svn: 171433
2013-01-03 00:39:26 +00:00
Anna Zaks 3fdcc0bda3 [analyzer] Rename callback EndPath -> EndFunction
This better reflects when callback is called and what the checkers
are relying on. (Both names meant the same pre-IPA.)

llvm-svn: 171432
2013-01-03 00:25:29 +00:00
Sean Silva ab3314f4d7 Add docs/README.txt to point to llvm/docs/README.txt.
llvm-svn: 171426
2013-01-02 23:25:41 +00:00
Sean Silva cd61d28c4a analyzer: add initial Sphinx configuration
This is just the output of sphinx-quickstart. Now all that is needed
to begin converting the analyzer docs to reST is the server-side setup.

The analyzer folks have asked me to keep this segregated from the other
clang docs since the analyzer is a logically separate project (and has
its own separate web page) even though it resides in the clang tree.

llvm-svn: 171425
2013-01-02 23:07:22 +00:00
Sean Silva 437db15978 Exclude docs/analyzer/ from the default Sphinx build.
This paves the way for converting the analyzer docs to Sphinx (by
setting up a nested Sphinx tree in this directory).

llvm-svn: 171424
2013-01-02 22:48:50 +00:00
Argyrios Kyrtzidis eedb5432c5 [python bindings] Expose cursor.referenced (clang_getCursorReferenced).
Patch by Matthew King!

llvm-svn: 171423
2013-01-02 22:31:57 +00:00
Dmitri Gribenko 1654035a3b hexagon-target-basic.c test: add REQUIRES line for hexagon target
llvm-svn: 171422
2013-01-02 22:30:14 +00:00
Argyrios Kyrtzidis f86e8cced6 DiagnosticIds: Fix offset/ID calculation, no impact outside this code.
Patch by Will Dietz:

Minor touchup so the values of Offset/ID reflect their intention.
Previously, the sum (Offset+ID) was correct, but Offset/ID
individually were wrong.

Caught by investigating unsigned overflow reported by -fsanitize=integer.

llvm-svn: 171421
2013-01-02 22:26:07 +00:00
Sean Silva b045514abf docs: Mark ReleaseNotes as "In-Progress"
Even though we do have a `.. warning::` directive on the page, hopefully
having "In-Progress" in the title will help to condition people's
expectations a bit for when they run into the extremely bare-bones
release notes.

Also, when release season comes around again, maybe this will get
people's attention and avoid confusion about what is going into the
upcoming release, and what is for changes to trunk for the next version.

llvm-svn: 171419
2013-01-02 22:05:33 +00:00
Sean Silva aaa78eefe7 docs: Take advantage of extra level of headings.
The way Sphinx treats the "top-level" adornments is weird. It usually
uses the first top-level adornment as the page title, even if the
top-level adornment is just one "section" out of many (i.e. if the first
section is "Introduction", then it will make the page title be
"Introduction"). This behavior can be overriden by using an explicit
`..  title::` directive to set the title.

Since the Sphinx stylesheet that Clang is currently using ('haiku')
nicely puts the document title at the top of the page in the header,
this weird default behavior was resulting in a redundant "title" in the
body content. Getting rid of this redundant level of headings
effectively "exposes" one more level of heading from the stylesheet to
which now makes the real "sections" more distinct.

llvm-svn: 171417
2013-01-02 21:50:48 +00:00
Anshuman Dasgupta 89730ce9ee Correct Hexagon DataLayout string. Fixes bug 14744.
Patch by Krzysztof Parzyszek!

llvm-svn: 171415
2013-01-02 21:25:57 +00:00
Dmitri Gribenko 154e6e53ad Type safety attributes: add tests for enumerations (users are actually doing
this, ensure we don't regress)

llvm-svn: 171412
2013-01-02 21:12:03 +00:00
Sean Silva 13d43feb11 docs: Curb excessive table-of-contents depth.
llvm-svn: 171410
2013-01-02 21:09:58 +00:00
Sean Silva f380e0e24b docs: Reorganize landing page.
Language extensions are highly relevant to using clang as a compiler, so
move LanguageExtensions up into `Using Clang as a Compiler` on the
landing page.

The other documents from the now-gone `Language Extensions and Specs`
section on the landing page nicely fit hierarchically under
LanguageExtensions.rst, so put them under LanguageExtensions.rst's
toctree instead of on the landing page.

Impetus from Jordan Rose.

llvm-svn: 171409
2013-01-02 21:03:11 +00:00
Sean Silva 29b7a60b12 docs: Fix spelling error.
Spotted by Nikola Smiljanic.

llvm-svn: 171407
2013-01-02 20:22:14 +00:00
Argyrios Kyrtzidis c32b022ef0 Remove the anonymous namespace from lib/Sema/TreeTransform.h
llvm-svn: 171402
2013-01-02 19:10:22 +00:00
Manuel Klimek b69e3c6201 Fixes multiple formatting bugs.
Fixes:
- incorrect handling of multiple consecutive preprocessor directives
- crash when trying to right align the escpaed newline for a line that
  is longer than the column limit
- using only ColumnLimit-1 columns when layouting with escaped newlines
  inside preprocessor directives

llvm-svn: 171401
2013-01-02 18:33:23 +00:00
Daniel Jasper 90e51fdbab Don't allow line breaks after template parameters.
This fixes llvm.org/PR14786.

We will need to split there as a last resort, but that should be done
consistently independent of whether the type is a template type or not.

Before:
template <typename T>
aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaa<T>
                    ::aaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
template <typename T>
aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaa,
                    aaaaaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaa,
                    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 171400
2013-01-02 18:30:06 +00:00
Daniel Jasper 3c0431c887 Format */& as binary operator if followed by a unary operator.
This fixes llvm.org/PR14687.
Also fixes segfault for lines starting with * or &.

Before:
a *~b;
*a = 1;  // <- this segfaulted

After:
a * ~b;
*a = 1;  // no segfault :-)

llvm-svn: 171396
2013-01-02 17:21:36 +00:00
Manuel Klimek a71e5d8115 Fixes use of unescaped newlines when formatting preprocessor directives.
This is the first step towards handling preprocessor directives. This
patch only fixes the most pressing issue, namely correctly escaping
newlines for tokens within a sequence of a preprocessor directive.

The next step will be to fix incorrect format decisions on #define
directives.

llvm-svn: 171393
2013-01-02 16:30:12 +00:00
Daniel Jasper 542de16e50 Correctly format pointers and references in casts.
This fixes llvm.org/PR14747.

Before: Type *A = (Type * ) P;
After:  Type *A = (Type *) P;
llvm-svn: 171390
2013-01-02 15:46:59 +00:00
Daniel Jasper da1c68ab71 Understand unary operators after "return" and "case".
This fixes llvm.org/PR14746.

Before: return - 1;
After:  return -1;
llvm-svn: 171389
2013-01-02 15:26:16 +00:00
Daniel Jasper ac5c1c286c Prefer splitting after "template <...>" and fix indentation.
This addresses llvm.org/PR14699

Before:
template <typename T>
    void looooooooooooooooooooooongFunction(int Param1, int Param2);
template <typename T> void looooooooooooooooooooongFunction(
    int Paaaaaaaaaaaaaaaaaaaaram1, int Paaaaaaaaaaaaaaaaaaaaram2);

After:
template <typename T>
void looooooooooooooooooooooongFunction(int Param1, int Param2);
template <typename T>
void looooooooooooooooooooongFunction(int Paaaaaaaaaaaaaaaaaaaaram1,
                                      int Paaaaaaaaaaaaaaaaaaaaram2);

llvm-svn: 171388
2013-01-02 15:08:56 +00:00
Daniel Jasper 3d0c75cc96 Prefer to break after operators over breaking after "(".
Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
                                 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 171386
2013-01-02 14:40:02 +00:00
Sean Silva 6d2be4a24d docs: `3.2` -> `3.3`
llvm-svn: 171384
2013-01-02 13:25:05 +00:00
Sean Silva ebf3a0e465 docs: Remove useless discussion.
The linked Makefile is always up to date, so there's no point in having
a rotting list of libraries.

llvm-svn: 171383
2013-01-02 13:23:37 +00:00
Sean Silva 173d252601 docs: Fix up HTML links to proper reST links.
llvm-svn: 171382
2013-01-02 13:07:47 +00:00
Sean Silva 8966c60cae docs: clang-format is coming down the pike, mention it
llvm-svn: 171380
2013-01-02 12:49:25 +00:00
Sean Silva dd9f40641c docs: Reorganize landing page.
I clustered the docs by some intuitive/fuzzy notion of "similarity", and
some reasonable categories seemed to materialize. I tried to give the
clusters useful names, but you may want to take a look at the landing
page (<http://clang.llvm.org/docs/> for the lazy) and share your
thoughts.

I have to say, this small change really gives the docs a whole new life!
It makes our documentation quite a bit easier to navigate and scope out.

llvm-svn: 171379
2013-01-02 12:41:24 +00:00
Sean Silva bb220f08e2 remove random spaces
llvm-svn: 171378
2013-01-02 12:40:31 +00:00
Sean Silva 2c58e5ed63 docs: Change title.
The core of this page is a set of pros/cons for the different ways to
use clang as a library. The title should reflect that the page helps you
choose between alternatives.

llvm-svn: 171377
2013-01-02 12:40:15 +00:00
Sean Silva d2a98e6dbb docs: Decrease toctree depth on landing page.
Having the table of contents there was making it hard to easily see at a
glance all the docs we have.

llvm-svn: 171376
2013-01-02 12:39:50 +00:00
Sean Silva ff15b34dda docs: Sphinx conversion is "done"
llvm-svn: 171375
2013-01-02 12:39:02 +00:00
Richard Smith 89645bc888 s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few nearby 'C++0x' comments.
llvm-svn: 171372
2013-01-02 12:01:23 +00:00
Chandler Carruth ffd5551bc7 Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
reflect the migration in r171366.

Re-sort the #include lines to reflect the new paths.

llvm-svn: 171369
2013-01-02 11:45:17 +00:00
Richard Smith 2bf7fdb723 s/CPlusPlus0x/CPlusPlus11/g
llvm-svn: 171367
2013-01-02 11:42:31 +00:00
Chandler Carruth 44eb4f66f4 Re-sort #include lines using the llvm/utils/sort_includes.py script.
Removes a duplicate #include as well as cleaning up some sort order
regressions since I last ran the script over Clang.

llvm-svn: 171364
2013-01-02 10:28:36 +00:00
Daniel Jasper 22bcf8a8eb Understand * and & in ternary expressions.
Before: "int a = b ? *c : * d;"
After: "int a = b ? *c : *d;
llvm-svn: 171358
2013-01-02 08:57:10 +00:00
Daniel Jasper d1926a3758 Don't break after pointer or reference specifier.
This fixes llvm.org/PR14717.
Buggy format:
TypeSpecDecl *
    TypeSpecDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
                         IdentifierInfo *II, Type *T) {

Now changed to:
TypeSpecDecl *TypeSpecDecl::Create(ASTContext &C, DeclContext *DC,
                                   SourceLocation L, IdentifierInfo *II,
                                   Type *T) {

llvm-svn: 171357
2013-01-02 08:44:14 +00:00
Rafael Espindola 6525f96f01 Convert an if that never happens to an assert.
llvm-svn: 171354
2013-01-02 04:19:07 +00:00
Benjamin Kramer 7a14bc0f4c Simplify vector splat code. No functionality change.
llvm-svn: 171350
2013-01-01 20:08:10 +00:00
NAKAMURA Takumi 43632a26a5 Update the copyright coredits -- Happy new year 2013!
llvm-svn: 171342
2013-01-01 10:00:19 +00:00
Rafael Espindola aadd30ec52 Silence some warnings and allow passing down some feature flags to the linker.
Patch by Brad Smith.

llvm-svn: 171329
2012-12-31 22:41:36 +00:00
Nico Weber 965368743e Fix minor copy-pasto. No functionality change.
llvm-svn: 171274
2012-12-31 02:59:14 +00:00
Nico Weber a7c7e60764 Remove some remnants of OwningExprResult / OwningStmtResult.
These got deleted late 2010 during the Actions/Sema unification.
No functionality change.

llvm-svn: 171269
2012-12-31 00:28:03 +00:00