]> granicus.if.org Git - clang/log
clang
11 years ago[docs] Fix an inconsistent title level, and a sphinx warning.
Daniel Dunbar [Mon, 7 Jan 2013 20:43:06 +0000 (20:43 +0000)]
[docs] Fix an inconsistent title level, and a sphinx warning.
 - We don't need any static files currently, so drop that dir.

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

11 years ago[docs/analyzer] Convert existing debug-checks document to Sphinx and link into doctree.
Daniel Dunbar [Mon, 7 Jan 2013 20:38:55 +0000 (20:38 +0000)]
[docs/analyzer] Convert existing debug-checks document to Sphinx and link into doctree.

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

11 years agoTest case for r171784.
Chad Rosier [Mon, 7 Jan 2013 20:34:40 +0000 (20:34 +0000)]
Test case for r171784.

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

11 years agoUse the C++11 POD definition in C++11 mode to determine whether one
Douglas Gregor [Mon, 7 Jan 2013 20:03:16 +0000 (20:03 +0000)]
Use the C++11 POD definition in C++11 mode to determine whether one
can create a VLA of class type. Fixes <rdar://problem/12151822>.

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

11 years agoUse getter. Fixes the build from a bad merge.
Rafael Espindola [Mon, 7 Jan 2013 20:01:57 +0000 (20:01 +0000)]
Use getter. Fixes the build from a bad merge.

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

11 years agoAdd support for attribute((mode(unwind_word))).
Rafael Espindola [Mon, 7 Jan 2013 19:58:54 +0000 (19:58 +0000)]
Add support for attribute((mode(unwind_word))).
Patch by Nick Lewycky. Fixes pr8703.

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

11 years agoobjective-C: when searching for declarations in protocol
Fariborz Jahanian [Mon, 7 Jan 2013 19:21:03 +0000 (19:21 +0000)]
objective-C: when searching for declarations in protocol
list of classes, etc., make sure to look into protocol
definitions. // rdar://12958878

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

11 years ago[libclang] When annotating preprocessor tokens, if we are in a macro definition,
Argyrios Kyrtzidis [Mon, 7 Jan 2013 19:16:32 +0000 (19:16 +0000)]
[libclang] When annotating preprocessor tokens, if we are in a macro definition,
check if the token was ever a macro name and annotate it if that's the case.

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

11 years ago[libclang] Simplify annotation of preprocessing tokens and remove the AnnotateTokensData
Argyrios Kyrtzidis [Mon, 7 Jan 2013 19:16:30 +0000 (19:16 +0000)]
[libclang] Simplify annotation of preprocessing tokens and remove the AnnotateTokensData
DenseMap and the lookups associated with it.

Instead of lexing for preprocessor tokens, associating the annotation with the location in a map,
and later lookup in the map in order to adjust the cursor annotation, just annotate the cursor
while lexing for preprocessor tokens.

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

11 years ago[libclang] Make token annotation of type/storage qualifiers accurate.
Argyrios Kyrtzidis [Mon, 7 Jan 2013 19:16:27 +0000 (19:16 +0000)]
[libclang] Make token annotation of type/storage qualifiers accurate.

Previously type/storage qualifiers would not be annotated as the declaration they belonged to.
Just use the resulting source range of getRawCursorExtent() which is more correct
than what AnnotateTokensWorker::Visit() was adjusting it to.

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

11 years ago[libclang] When getting the cursor for an identifier inside a macro definition, check if
Argyrios Kyrtzidis [Mon, 7 Jan 2013 19:16:25 +0000 (19:16 +0000)]
[libclang] When getting the cursor for an identifier inside a macro definition, check if
this was ever a macro name and return a specific CXCursor_MacroExpansion cursor in such a case,
instead of the generic CXCursor_MacroDefinition.

Checking for macro name makes sure the identifier is not part of the identifier list in a
function macro.
While, in general, resolving identifiers in macro definitions to other macros may not be completely accurate,
it greatly improves functionality such as give-me-the-definition-of-this, which was not working at all
inside macro definitions.

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

11 years ago[PCH] (De)serialize the end location of MacroInfo.
Argyrios Kyrtzidis [Mon, 7 Jan 2013 19:16:23 +0000 (19:16 +0000)]
[PCH] (De)serialize the end location of MacroInfo.

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

11 years agoPull the bulk of Lexer::MeasureTokenLength() out into a new function,
Argyrios Kyrtzidis [Mon, 7 Jan 2013 19:16:18 +0000 (19:16 +0000)]
Pull the bulk of Lexer::MeasureTokenLength() out into a new function,
Lexer::getRawToken().

No functionality change.

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

11 years ago[analyzer] Fix a false positive in Secure Keychain API checker.
Anna Zaks [Mon, 7 Jan 2013 19:13:00 +0000 (19:13 +0000)]
[analyzer] Fix a false positive in Secure Keychain API checker.

Better handle the blacklisting of known bad deallocators when symbol
escapes through a call to CFStringCreateWithBytesNoCopy.

Addresses radar://12702952.

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

11 years ago[analyzer] Fix a false positive in the ivar invalidation checker.
Anna Zaks [Mon, 7 Jan 2013 19:12:56 +0000 (19:12 +0000)]
[analyzer] Fix a false positive in the ivar invalidation checker.

When a property is "inherited" through both a parent class and directly
through a protocol, we should not require the child to invalidate it
since the backing ivar belongs to the parent class.
(Fixes radar://12913734)

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

11 years agoFixed a number of -Wcovered-switch-default diagnostics in tools/clang/include/clang...
Alexander Kornienko [Mon, 7 Jan 2013 19:09:15 +0000 (19:09 +0000)]
Fixed a number of -Wcovered-switch-default diagnostics in tools/clang/include/clang/AST/AttrDump.inc

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

11 years agoFormatter: Support @public/@protected/@package/@private.
Nico Weber [Mon, 7 Jan 2013 19:05:19 +0000 (19:05 +0000)]
Formatter: Support @public/@protected/@package/@private.

@package is an Objective-C 2 feature, so turn on ObjC2 as well.

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

11 years agoComment to XML conversion: no, we don't want to print instantiations for the
Dmitri Gribenko [Mon, 7 Jan 2013 18:45:48 +0000 (18:45 +0000)]
Comment to XML conversion: no, we don't want to print instantiations for the
<Declaration> tag

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

11 years agoFix parsing of variable declarations directly after a class / struct.
Manuel Klimek [Mon, 7 Jan 2013 18:10:23 +0000 (18:10 +0000)]
Fix parsing of variable declarations directly after a class / struct.

Previous indent:
class A {
}
a;
void f() {
};

With this patch:
class A {
} a;
void f() {
}
;

The patch introduces a production for classes and structs, and parses
the rest of the line to the semicolon after the class scope.
This allowed us to remove a long-standing wart in the parser that would
just much the semicolon after any block.
Due to this suboptimal formating some tests were broken.

Some unrelated formatting tests broke; those hit a bug in the ast
printing, and need to be fixed separately.

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

11 years agoImplement Attr dumping for -ast-dump.
Alexander Kornienko [Mon, 7 Jan 2013 17:53:08 +0000 (17:53 +0000)]
Implement Attr dumping for -ast-dump.
http://llvm-reviews.chandlerc.com/D234

Patch by Philip Craig!

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

11 years agoAdd fixit hints for misplaced C++11 attributes around class specifiers.
Michael Han [Mon, 7 Jan 2013 16:57:11 +0000 (16:57 +0000)]
Add fixit hints for misplaced C++11 attributes around class specifiers.

Following r168626, in class declaration or definition, there are a combination of syntactic locations
where C++11 attributes could appear, and among those the only valid location permitted by standard is
between class-key and class-name. So for those attributes appear at wrong locations, fixit is used to
move them to expected location and we recover by applying them to the class specifier.

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

11 years agoupdateOutOfDateIdentifier() can cause the identifier table to be
Douglas Gregor [Mon, 7 Jan 2013 16:56:53 +0000 (16:56 +0000)]
updateOutOfDateIdentifier() can cause the identifier table to be
rehashed, invaliding the iterator walking through the identifier
table. Separate out the identification of out-of-date identifiers from
updating them.

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

11 years agoScalar shifts in the OpenCL specification (as of v. 1.2) are defined to be
David Tweed [Mon, 7 Jan 2013 16:43:27 +0000 (16:43 +0000)]
Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to be
with respect to the lower "left-hand-side bitwidth" bits, even when negative);
see OpenCL spec 6.3j. This patch both implements this behaviour in the code
generator and "constant folding" bits of Sema, and also prevents tests
to detect undefinedness in terms of the weaker C99 or C++ specifications
from being applied.

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

11 years agoFormatter: Add tests for try/catch. Let 'throw' start an expression.
Nico Weber [Mon, 7 Jan 2013 16:36:17 +0000 (16:36 +0000)]
Formatter: Add tests for try/catch. Let 'throw' start an expression.

Before:
  throw a *b;

Now:
  throw a * b;

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

11 years agoFormatter: Don't put spaces betwen @ and objc keywords.
Nico Weber [Mon, 7 Jan 2013 16:14:28 +0000 (16:14 +0000)]
Formatter: Don't put spaces betwen @ and objc keywords.

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

11 years agoTest all @keywords. Turns out some of them are not formatted correctly yet.
Nico Weber [Mon, 7 Jan 2013 16:07:07 +0000 (16:07 +0000)]
Test all @keywords. Turns out some of them are not formatted correctly yet.

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

11 years agoSlightly expand the @ test to cover whitespace between @ and keyword.
Nico Weber [Mon, 7 Jan 2013 15:56:25 +0000 (15:56 +0000)]
Slightly expand the @ test to cover whitespace between @ and keyword.

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

11 years agolibclang/Makefile: Reorder USEDLIBS along driver/clang.
NAKAMURA Takumi [Mon, 7 Jan 2013 15:45:20 +0000 (15:45 +0000)]
libclang/Makefile: Reorder USEDLIBS along driver/clang.

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

11 years agoSmall refactoring of the formatter code.
Daniel Jasper [Mon, 7 Jan 2013 15:36:15 +0000 (15:36 +0000)]
Small refactoring of the formatter code.

This should make it slightly more readable as it more clearly separates
what happens where. No intended functional changes. More of this to
come..

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

11 years agoAdd a test that checks that the formatter doesn't discard '@' with ObjC1 set.
Nico Weber [Mon, 7 Jan 2013 15:17:23 +0000 (15:17 +0000)]
Add a test that checks that the formatter doesn't discard '@' with ObjC1 set.

Also set ObjC1 in the formatter tests.

The only effect of this flag in the lexer is that '@' now gets turned into
tok::at instead of tok::unknown.

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

11 years agoFix typo.
Nico Weber [Mon, 7 Jan 2013 15:15:29 +0000 (15:15 +0000)]
Fix typo.

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

11 years agos/parseStatement/parseStructuralElement/g in the UnwrappedLineParser.
Manuel Klimek [Mon, 7 Jan 2013 14:56:16 +0000 (14:56 +0000)]
s/parseStatement/parseStructuralElement/g in the UnwrappedLineParser.

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

11 years agoReformat clang-formats source code.
Daniel Jasper [Mon, 7 Jan 2013 13:26:07 +0000 (13:26 +0000)]
Reformat clang-formats source code.

All changes done by clang-format itself. No functional changes.

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

11 years agoPrefer not to break after assignments.
Daniel Jasper [Mon, 7 Jan 2013 13:08:40 +0000 (13:08 +0000)]
Prefer not to break after assignments.

This addresses llvm.org/PR14830.

Before:
unsigned Cost =
    TTI.getMemoryOpCost(I->getOpcode(), VectorTy, SI->getAlignment(),
                        SI->getPointerAddressSpace());
CharSourceRange LineRange =
    CharSourceRange::getTokenRange(TheLine.Tokens.front().Tok.getLocation(),
                                   TheLine.Tokens.back().Tok.getLocation());

After:
unsigned Cost = TTI.getMemoryOpCost(I->getOpcode(), VectorTy,
                                    SI->getAlignment(),
                                    SI->getPointerAddressSpace());
CharSourceRange LineRange = CharSourceRange::getTokenRange(
                                TheLine.Tokens.front().Tok.getLocation(),
                                TheLine.Tokens.back().Tok.getLocation());

This required rudimentary changes to static initializer lists, but we
are not yet formatting them in a reasonable way. That will be done in a
subsequent patch.

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

11 years agoAdd style option for number of spaces before trailing comments.
Daniel Jasper [Mon, 7 Jan 2013 11:09:06 +0000 (11:09 +0000)]
Add style option for number of spaces before trailing comments.

In LLVM style, a single space should be enough. In Google style, two
spaces are required.

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

11 years agoDo not break before "0" in pure virtual function declarations.
Daniel Jasper [Mon, 7 Jan 2013 10:48:50 +0000 (10:48 +0000)]
Do not break before "0" in pure virtual function declarations.

Before:
virtual void write(ELFWriter *writer, OwningPtr<FileOutputBuffer> &buffer) =
    0

After:
virtual void write(ELFWriter *writerrr,
                   OwningPtr<FileOutputBuffer> &buffer) = 0;

This addresses llvm.org/PR14815.

To implement this I introduced a line type during parsing and moved the
definition of TokenType out of the struct for increased readability.
Should have done the latter in a separate patch, but it would be hard to
pull apart now.

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

11 years agoFix incorrect FIXME.
Manuel Klimek [Mon, 7 Jan 2013 10:03:37 +0000 (10:03 +0000)]
Fix incorrect FIXME.

The case that we wanted to write a test for cannot happen, as the
UnwrappedLineParser already protects against it. Added an assert to
prevent regressions of that assumption.

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

11 years agoCFG.cpp: Fix wrapping logic when printing block preds/succs.
Will Dietz [Mon, 7 Jan 2013 09:51:17 +0000 (09:51 +0000)]
CFG.cpp: Fix wrapping logic when printing block preds/succs.

First check only wrapped with i==8, second wrapped at i==2,8,18,28,...
This fix restores the intended behavior: i==8,18,28,...

Found with -fsanitize=integer.

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

11 years agoRemove outdated FIXME and add explanation for error handling strategy
Manuel Klimek [Mon, 7 Jan 2013 09:34:28 +0000 (09:34 +0000)]
Remove outdated FIXME and add explanation for error handling strategy
while parsing #define's.

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

11 years agoRemove outdated fixme.
Manuel Klimek [Mon, 7 Jan 2013 09:25:37 +0000 (09:25 +0000)]
Remove outdated fixme.

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

11 years agoDo not ever allow using the full line in preprocessor directives.
Manuel Klimek [Mon, 7 Jan 2013 09:24:17 +0000 (09:24 +0000)]
Do not ever allow using the full line in preprocessor directives.

We would format:
  #define A \
    int f(a); int i;
as
  #define A \
    int f(a);\
    int i

The fix will break up macro definitions that could fit a line, but hit
the last column; fixing that is more involved, though, as it requires
looking at the following line.

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

11 years agoFix layouting of single-line-comments preceded by an escaped newline.
Manuel Klimek [Mon, 7 Jan 2013 08:54:53 +0000 (08:54 +0000)]
Fix layouting of single-line-comments preceded by an escaped newline.

Previously, we'd format
  int i;\
  // comment
as
  int i; // comment

The problem is that the escaped newline is part of the next token, and
thus the raw token text of the comment doesn't start with "//".

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

11 years agoFix layouting of tokens with a leading escaped newline.
Manuel Klimek [Mon, 7 Jan 2013 07:56:50 +0000 (07:56 +0000)]
Fix layouting of tokens with a leading escaped newline.

If a token follows directly on an escaped newline, the escaped newline
is stored with the token. Since we re-layout escaped newlines, we need
to treat them just like normal whitespace - thus, we need to increase
the whitespace-length of the token, while decreasing the token length
(otherwise the token length contains the length of the escaped newline
and we double-count it while indenting).

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

11 years agoPut a higher penalty on breaking before "." or "->".
Daniel Jasper [Mon, 7 Jan 2013 07:13:20 +0000 (07:13 +0000)]
Put a higher penalty on breaking before "." or "->".

This fixes llvm.org/PR14823.

Before:
    local_state->SetString(prefs::kApplicationLocale, parent_local_state
                                ->GetString(prefs::kApplicationLocale));
After:
    local_state->SetString(
        prefs::kApplicationLocale,
        parent_local_state->GetString(prefs::kApplicationLocale));

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

11 years agoPR14759: Improve/correct support for debug info for C++ member pointers.
David Blaikie [Mon, 7 Jan 2013 05:55:03 +0000 (05:55 +0000)]
PR14759: Improve/correct support for debug info for C++ member pointers.

Using added LLVM functionality in r171698. This works in GDB for member
variable pointers but not member function pointers. See the LLVM commit and
GDB bug 14998 for details.

Un-xfailing cases in the GDB 7.5 test suite will follow.

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

11 years agoSwitch to asking the target machine to add any relevant analysis passses
Chandler Carruth [Mon, 7 Jan 2013 01:38:01 +0000 (01:38 +0000)]
Switch to asking the target machine to add any relevant analysis passses
rather than doing it ourselves. This reflects the API changes in r171681.

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

11 years agoSimplify. No behavior change.
Nico Weber [Mon, 7 Jan 2013 01:21:02 +0000 (01:21 +0000)]
Simplify. No behavior change.

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

11 years agoClangTools doc: add ideas for new tools in clang-tools-extra to ensure that
Dmitri Gribenko [Sun, 6 Jan 2013 20:19:09 +0000 (20:19 +0000)]
ClangTools doc: add ideas for new tools in clang-tools-extra to ensure that
these ideas don't get lost

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

11 years agoFixes handling of unbalances braces.
Manuel Klimek [Sun, 6 Jan 2013 20:07:31 +0000 (20:07 +0000)]
Fixes handling of unbalances braces.

If we find an unexpected closing brace, we must not stop parsing, as
we'd otherwise not layout anything beyond that point.

If we find a structural error on the highest level we'll not re-indent
anyway, but we'll still want to format within unwrapped lines.

Needed to introduce a differentiation between an expected and unexpected
closing brace.

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

11 years agoClang docs: add some information about the difference between 'clang' and 'clang...
Dmitri Gribenko [Sun, 6 Jan 2013 13:38:34 +0000 (13:38 +0000)]
Clang docs: add some information about the difference between 'clang' and 'clang -cc1'

This is coming up again and again on the mailing list and IRC.

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

11 years agoPrepare for the upcoming version of Debian (jessie)
Sylvestre Ledru [Sun, 6 Jan 2013 08:09:29 +0000 (08:09 +0000)]
Prepare for the upcoming version of Debian (jessie)

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

11 years agouse early returns to simplify and de-nest
Sean Silva [Sun, 6 Jan 2013 07:49:41 +0000 (07:49 +0000)]
use early returns to simplify and de-nest

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

11 years agoFixes parsing of hash tokens in the middle of a line.
Manuel Klimek [Sat, 5 Jan 2013 22:56:06 +0000 (22:56 +0000)]
Fixes parsing of hash tokens in the middle of a line.

To parse # correctly, we need to know whether it is the first token in a
line - we can deduct this either from the whitespace or seeing that the
token is the first in the file - we already calculate this information.
This patch moves the identification of the first token into the
getNextToken method and stores it inside the FormatToken, so the
UnwrappedLineParser can stay independent of the SourceManager.

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

11 years agoFixes PR14801 - preprocessor directives shouldn't be indented
Manuel Klimek [Sat, 5 Jan 2013 22:14:16 +0000 (22:14 +0000)]
Fixes PR14801 - preprocessor directives shouldn't be indented

Uses indent 0 for macros for now and resets the indent state to the
level prior to the preprocessor directive.

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

11 years agoFixes a breakage in dejagnu++ test suite where it included
Fariborz Jahanian [Sat, 5 Jan 2013 21:54:55 +0000 (21:54 +0000)]
Fixes a breakage in dejagnu++ test suite where it included
<objc/Protocol.h>. Caused by my recent changes for
various builtin declarations of objc_msgSendSuper
variety. // rdar://12489098

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

11 years agoMake checking for 'protected' access in debug info more legible.
David Blaikie [Sat, 5 Jan 2013 21:41:59 +0000 (21:41 +0000)]
Make checking for 'protected' access in debug info more legible.

Based on code review feedback for r171604 from Chandler Carruth &
Eric Christopher. Enabled by improvements to LLVM made in r171636.

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

11 years agoFixes PR14811: Crash when formatting some macros
Manuel Klimek [Sat, 5 Jan 2013 21:34:55 +0000 (21:34 +0000)]
Fixes PR14811: Crash when formatting some macros

A preprocessor directive cannot be started while we're parsing one.

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

11 years agoPR14573: Unnamed parameters in debug info, Part 2
David Blaikie [Sat, 5 Jan 2013 20:03:07 +0000 (20:03 +0000)]
PR14573: Unnamed parameters in debug info, Part 2

Catch some cases I'd missed in r171605 related to unnamed parameters of record
type. This resolves all remaining cases of PR14573 suppression in the GDB 7.5
test suite. Fix to the test suite to follow.

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

11 years agoFileCheck-ize test/CodeGen/inline.c.
David Blaikie [Sat, 5 Jan 2013 18:22:42 +0000 (18:22 +0000)]
FileCheck-ize test/CodeGen/inline.c.

A rather egregious example of the grep-style checking of old that I randomly
came across.

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

11 years agoCompanion patch to r171621 which changed the interface for creating TTI
Chandler Carruth [Sat, 5 Jan 2013 11:45:12 +0000 (11:45 +0000)]
Companion patch to r171621 which changed the interface for creating TTI
passes to a create-pass function instead of a direct constructor call.

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

11 years agoFix set-xcode-analyzer to only modify the ExecPath for the analyzer when using -...
Ted Kremenek [Sat, 5 Jan 2013 07:31:54 +0000 (07:31 +0000)]
Fix set-xcode-analyzer to only modify the ExecPath for the analyzer when using --use-xcode-clang.

Turns out that the ExecPath for the ObjC migrator would also get set.

Fixes <rdar://problem/12961769>.

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

11 years agoEmit debug info for unnamed parameters.
David Blaikie [Sat, 5 Jan 2013 05:58:35 +0000 (05:58 +0000)]
Emit debug info for unnamed parameters.

LLVM ignores this data for now - patch for that to follow.

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

11 years agoChange test/CodeGenCXX/debug-info-method.cpp an IR (rather than asm) test.
David Blaikie [Sat, 5 Jan 2013 05:48:08 +0000 (05:48 +0000)]
Change test/CodeGenCXX/debug-info-method.cpp an IR (rather than asm) test.

Referring back to the original commit (r115090) which was a frontend only test
I adjusted this test to verify the frontend change that was made, to emit the
protected access value in the flags metadata field.

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

11 years agoFileCheck-ize test/CodeGenCXX/debug-info-method.cpp
David Blaikie [Sat, 5 Jan 2013 05:39:21 +0000 (05:39 +0000)]
FileCheck-ize test/CodeGenCXX/debug-info-method.cpp

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

11 years ago[mips] Fix data layout string. Add 64 to the list of native integer widths
Akira Hatanaka [Sat, 5 Jan 2013 02:04:34 +0000 (02:04 +0000)]
[mips] Fix data layout string. Add 64 to the list of native integer widths
and add stack alignment information.

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

11 years agoAssert that redeclarations have the same linkage.
Rafael Espindola [Sat, 5 Jan 2013 01:28:37 +0000 (01:28 +0000)]
Assert that redeclarations have the same linkage.

It is somewhat hard to test linkage, so I decided to try to add an assert. This
already found some interesting cases where there were different.

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

11 years agoIn my last patch initialize the destination to null (with a simple store) before...
Fariborz Jahanian [Sat, 5 Jan 2013 00:32:13 +0000 (00:32 +0000)]
In my last patch initialize the destination to null (with a simple store) before doing a storeStrong to it.
// rdar://12530881

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

11 years agoFix testing case for Release build (r171493)
Manman Ren [Sat, 5 Jan 2013 00:01:42 +0000 (00:01 +0000)]
Fix testing case for Release build (r171493)

rdar://11562117

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

11 years agoUpdate checker build to checker-270
Ted Kremenek [Fri, 4 Jan 2013 23:52:16 +0000 (23:52 +0000)]
Update checker build to checker-270

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

11 years agoVarious fixes to clang-format's macro handling.
Manuel Klimek [Fri, 4 Jan 2013 23:34:14 +0000 (23:34 +0000)]
Various fixes to clang-format's macro handling.

Some of this is still pretty rough (note the load of FIXMEs), but it is
strictly an improvement and fixes various bugs that were related to
macro processing but are also imporant in non-macro use cases.

Specific fixes:
- correctly puts espaced newlines at the end of the line
- fixes counting of white space before a token when escaped newlines are
  present
- fixes parsing of "trailing" tokens when eof() is hit
- puts macro parsing orthogonal to parsing other structure
- general support for parsing of macro definitions

Due to the fix to format trailing tokens, this change also includes a
bunch of fixes to the c-index tests.

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

11 years agoobjective-C arc: in copy helper function for
Fariborz Jahanian [Fri, 4 Jan 2013 23:32:24 +0000 (23:32 +0000)]
objective-C arc: in copy helper function for
__strong __block variables, perform objc_storeStrong on
source and destination instead of direct move. This
is done with -O0 and to improve some analysis.
// rdar://12530881

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

11 years agoFix indent and remove parameter with a matching default value.
Chad Rosier [Fri, 4 Jan 2013 22:40:33 +0000 (22:40 +0000)]
Fix indent and remove parameter with a matching default value.

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

11 years agoStyle fix: We don't use lowercase-and-underscored template parameter names.
Rafael Espindola [Fri, 4 Jan 2013 21:18:45 +0000 (21:18 +0000)]
Style fix: We don't use lowercase-and-underscored template parameter names.
Thanks for dgregor for noticing it.

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

11 years agoCorrectly format dereference and address of in array parameters.
Daniel Jasper [Fri, 4 Jan 2013 20:46:38 +0000 (20:46 +0000)]
Correctly format dereference and address of in array parameters.

Before: InvalidRegions[ &R] = 0;
After:  InvalidRegions[&R] = 0;

This fixes llvm.org/PR14793

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

11 years agoFix typo. Thanks to dgregor for noticing it.
Rafael Espindola [Fri, 4 Jan 2013 20:41:40 +0000 (20:41 +0000)]
Fix typo. Thanks to dgregor for noticing it.

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

11 years agoUnqualify the parameter type.
Rafael Espindola [Fri, 4 Jan 2013 20:34:32 +0000 (20:34 +0000)]
Unqualify the parameter type.
This fixes a regression from 168895.

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

11 years agorealpath'ify the mapping from header includes to module imports.
Douglas Gregor [Fri, 4 Jan 2013 19:44:26 +0000 (19:44 +0000)]
realpath'ify the mapping from header includes to module imports.

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

11 years agoUpdate CMakeLists.txt
Ted Kremenek [Fri, 4 Jan 2013 19:04:47 +0000 (19:04 +0000)]
Update CMakeLists.txt

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

11 years agoAdd __has_feature support to detect if clang supports the explicit "atomic" keyword...
Ted Kremenek [Fri, 4 Jan 2013 19:04:44 +0000 (19:04 +0000)]
Add __has_feature support to detect if clang supports the explicit "atomic" keyword for ObjC properties.

Fixes <rdar://problem/12953378>.

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

11 years agoRequire set-xcode-analyzer to run with Python 2.7 or later.
Ted Kremenek [Fri, 4 Jan 2013 19:04:42 +0000 (19:04 +0000)]
Require set-xcode-analyzer to run with Python 2.7 or later.

Addresses LLVM PR 11661.

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

11 years agoNSErrorChecker: remove quoting the parameter name in the diagnostic until we actually...
Ted Kremenek [Fri, 4 Jan 2013 19:04:40 +0000 (19:04 +0000)]
NSErrorChecker: remove quoting the parameter name in the diagnostic until we actually include it's name.

This is a possible regression of moving to using ImplicitNullDerefEvent.
Fixing this for real (including the parameter name) requires more
plumbing in ImplicitNullDerefEvent.  This is just a stop gap fix.

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

11 years agoTighten code. No functionality change.
Ted Kremenek [Fri, 4 Jan 2013 19:04:36 +0000 (19:04 +0000)]
Tighten code.  No functionality change.

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

11 years agoAdd the module name to the 'incomplete umbrella header' warning.
Douglas Gregor [Fri, 4 Jan 2013 18:58:28 +0000 (18:58 +0000)]
Add the module name to the 'incomplete umbrella header' warning.

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

11 years agoLet the formatter ignore UnwrappedLines containing errors.
Daniel Jasper [Fri, 4 Jan 2013 18:52:56 +0000 (18:52 +0000)]
Let the formatter ignore UnwrappedLines containing errors.

This prevents code like:

namespace {
class Foo {
  Foo(
  };
}  // comment

from causing segfaults (see llvm.org/PR14774).

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

11 years agoAdd file added in r171484 to CMakelists.txt.
Filipe Cabecinhas [Fri, 4 Jan 2013 18:52:29 +0000 (18:52 +0000)]
Add file added in r171484 to CMakelists.txt.

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

11 years agoDebug Info: fix the line location for cleanup code of a block function
Manman Ren [Fri, 4 Jan 2013 18:51:35 +0000 (18:51 +0000)]
Debug Info: fix the line location for cleanup code of a block function

The line information was changed when emitting debug information for all the
DeclRefExprs and we should change it back to get ready for PopClenupBlocks
called from FinishFunction.

rdar://11562117

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

11 years agoFix up various builtin declaration of objc_msgSend families
Fariborz Jahanian [Fri, 4 Jan 2013 18:45:40 +0000 (18:45 +0000)]
Fix up various builtin declaration of objc_msgSend families
to match those foung in objc.h an avoid spurious warnings.
// rdar://12489098

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

11 years ago[libclang] Introduce clang_getFileLocation.
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:13 +0000 (18:30 +0000)]
[libclang] Introduce clang_getFileLocation.

Uses of clang_getSpellingLocation should eventually move to calling
clang_getFileLocation, and clang_getSpellingLocation should do what
its name represents and actually point at the 'spelling' location, e.g.
inside a macro definition if the spelling of a token came from that.

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

11 years ago[arcmt] Allow removing an -autorelease of a variable initialized in the previous...
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:11 +0000 (18:30 +0000)]
[arcmt] Allow removing an -autorelease of a variable initialized in the previous statement.

rdar://11074996

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

11 years ago[arcmt] Adds brackets in case statements that "contain" initialization of retaining
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:08 +0000 (18:30 +0000)]
[arcmt] Adds brackets in case statements that "contain" initialization of retaining
variable, thus emitting the "switch case is in protected scope" error.

rdar://12952016

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

11 years agoMove the common source locations of CastStmt & DefaultStmt into their base class...
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:04 +0000 (18:30 +0000)]
Move the common source locations of CastStmt & DefaultStmt into their base class, SwitchCase.

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

11 years ago[arcmt] Don't error if an autoreleased variable is returned after the -autorelease.
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:29:59 +0000 (18:29 +0000)]
[arcmt] Don't error if an autoreleased variable is returned after the -autorelease.

rdar://12952025

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

11 years agoRemove -Wmodule-build; it was a dumb idea anyway. <rdar://problem/12957525>
Douglas Gregor [Fri, 4 Jan 2013 18:22:19 +0000 (18:22 +0000)]
Remove -Wmodule-build; it was a dumb idea anyway. <rdar://problem/12957525>

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

11 years agoFix fieldNo usage for lambdas. No behavior change since the
Eric Christopher [Fri, 4 Jan 2013 17:59:07 +0000 (17:59 +0000)]
Fix fieldNo usage for lambdas. No behavior change since the
field number was 0 anyhow.

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

11 years agoWarn on unused auto variables.
Rafael Espindola [Thu, 3 Jan 2013 04:29:20 +0000 (04:29 +0000)]
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.

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

11 years agoUse early returns to reduce indentation.
Rafael Espindola [Thu, 3 Jan 2013 04:05:19 +0000 (04:05 +0000)]
Use early returns to reduce indentation.

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

11 years ago[arcmt] Rewrite uses of Block_copy/Block_release macros.
Argyrios Kyrtzidis [Thu, 3 Jan 2013 03:17:17 +0000 (03:17 +0000)]
[arcmt] Rewrite uses of Block_copy/Block_release macros.

  c = Block_copy(b);
  Block_release(c);
 ---->
  c = [b copy];
  <removed>

rdar://9408211

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

11 years agoFix capitalization of Objective-C in diagnostic.
Ted Kremenek [Thu, 3 Jan 2013 01:30:20 +0000 (01:30 +0000)]
Fix capitalization of Objective-C in diagnostic.

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

11 years agoMake MallocChecker debug output useful.
Ted Kremenek [Thu, 3 Jan 2013 01:30:12 +0000 (01:30 +0000)]
Make MallocChecker debug output useful.

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

11 years agoDon't assert/crash on reference variables in lambdas bound to a
Eli Friedman [Thu, 3 Jan 2013 00:39:26 +0000 (00:39 +0000)]
Don't assert/crash on reference variables in lambdas bound to a
static local variable from the parent scope.  PR14773.

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