Commit Graph

42614 Commits

Author SHA1 Message Date
Nico Weber 35496eea98 Formatter: Land header change I forgot to land in r172099.
llvm-svn: 172101
2013-01-10 20:19:27 +00:00
Nico Weber d6f962f151 Formatter: Add test for template and protocol parameters in ObjC method declarations.
llvm-svn: 172100
2013-01-10 20:18:33 +00:00
Nico Weber a608775ba2 Formatting: In @implementation etc lines, put a space before protocol lists.
Don't do this in Google style though:
http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml#Protocols

Most other places (function declarations, variable declarations) still get
this wrong, and since this looks very similiar to template instantiations to
the lexer (`id <MyProtocol> a = ...`), it's going to be hard to fix in some
places.

llvm-svn: 172099
2013-01-10 20:12:55 +00:00
Manuel Klimek 51bd6ec142 Refactoring the outermost structure of the formatter.
This is the last step of pure shuffling stuff around, the next step will
be the actual feature.

llvm-svn: 172098
2013-01-10 19:49:59 +00:00
Argyrios Kyrtzidis 1489ed2b68 [libclang] Address some coding style issues pointed out by Dmitri.
llvm-svn: 172096
2013-01-10 19:43:44 +00:00
Nico Weber a1a5abd5b1 Formatter: Don't put a space in ObjC number literals like @+50
Before:
@ -4.5

Now:
@-4.5

llvm-svn: 172095
2013-01-10 19:36:35 +00:00
Ted Kremenek 4a800f876a ccc-analyzer: Forward -msse* options to the compiler.
llvm-svn: 172094
2013-01-10 19:29:31 +00:00
Nico Weber 2bb0074232 Formatter: Add space before '(' in @implemenation, @interface, @protocol lines
The first token in @implementation, @interface, and @protocol lines is now
marked TT_ObjCDecl, and lines starting with a TT_ObjCDecl token are now marked
LT_ObjCMethodDecl.

llvm-svn: 172093
2013-01-10 19:19:14 +00:00
Manuel Klimek b2c6dbec52 Pull calculation whether a line fits one level up.
This is the next step towards being able to configure multiple unwrapped
lines into one.

llvm-svn: 172092
2013-01-10 19:17:33 +00:00
Fariborz Jahanian 1eab052a7f objectiveC++: When throwing c++ exception of
an objectiveC object, use objc_exception_throw
to raise the exception. // rdar://12605907

llvm-svn: 172091
2013-01-10 19:02:56 +00:00
Argyrios Kyrtzidis f036f1a630 [libclang] Add missing header file
llvm-svn: 172090
2013-01-10 18:58:44 +00:00
Argyrios Kyrtzidis ea47435861 [libclang] Enhance logging capabilities of libclang.
-provide a "raw_ostream'ish" class to make it convenient to output logging info.
-use macros to automate a bit the logging functionality inside libclang functions
-when logging, print a stack trace if "LIBCLANG_LOGGING=2" environment is set.
-add logging to more functions.

llvm-svn: 172089
2013-01-10 18:54:52 +00:00
Jordan Rose d12618f6db Diagnostics: name all implicit groups used more than once.
This will be a new style requirement going forwards: a diagnostic can only
use the implicit InGroup<DiagGroup<"foo">> syntax if "foo" is not used by
any other diagnostics; as soon as it is, it needs an explicit group.

This also brings some stray "conversion" diagnostics into the
"Value Conversion Issue" category, instead of the more generic
"Semantic Issue" category. I consider this an improvement!
- warn_impcast_complex_scalar
- warn_impcast_float_integer
- warn_impcast_float_precision
- warn_impcast_integer_precision
- warn_impcast_vector_scalar

llvm-svn: 172088
2013-01-10 18:50:51 +00:00
Jordan Rose c3b23aa848 Error if an anonymous DiagGroup is referenced multiple times.
Not only is this inefficient for TableGen, it's annoying for maintenance
when renaming warning flags (unusual) or adding those flags to a group
(more likely).

This uses the new fix-it infrastructure for LLVM's SourceMgr/SMDiagnostic,
as well as a few changes to TableGen to track more source information.

llvm-svn: 172087
2013-01-10 18:50:46 +00:00
Manuel Klimek 0b689fd68d Pulling formatFirstToken one level up.
This prepares the code for single line optimizations and changes the
dependencies between single-line-formats to the indent of the first
token.

Conceptually, the first token is "between" the lines anyway, as the
whitespace for the first token includes the previous end-of-line, which
needs to be escaped when inside a preprocessor directive.

llvm-svn: 172083
2013-01-10 18:45:26 +00:00
Manuel Klimek 0ddd57a17b Fixes layout of right braces.
We now decide whether a newline should go before the closing brace
depending on whether a newline was inserted after the opening brace.

For example, we now insert a newline before '};' in:
static SomeClass WithALoooooooooooooooooooongName = {
  100000000, \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"
};
... while not inserting a newline here:
static SomeClass = { a, b, c, d, e, f, g, h, i, j,
                     looooooooooooooooooooooooooooooooooongname,
                     looooooooooooooooooooooooooooooong };

Also fixes the formating of (column limit 25):
int x = {
  avariable,
  b(alongervariable)
};

llvm-svn: 172076
2013-01-10 15:58:26 +00:00
Alexander Kornienko 5b7157ac8d Basic support for diagnostics.
Summary: Uses DiagnosticsEngine to output diagnostics.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D278

llvm-svn: 172071
2013-01-10 15:05:09 +00:00
Manuel Klimek 73a2fdf232 Fixes formatting of function calls etc inside an initializer list.
We're now formatting (column limit 25):
int x = {
  avariable,
  b(alongervariable) };

This also fixes:
Aaa({
  int i;
}, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
                                    ccccccccccccccccc));
... where we would previously break after the '},'.

Putting the closing curly into an extra line when there's a break
directly after the first curly will be done in a subsequent patch.

Paired with djasper.

llvm-svn: 172070
2013-01-10 14:36:46 +00:00
Manuel Klimek e7d10a1f50 Do not add newline in empty blocks.
void f() {}
now gets formatted in one line.

llvm-svn: 172067
2013-01-10 13:24:24 +00:00
Daniel Jasper c1fa281325 Improvements to function type and ObjC block formatting.
Before: int (^myBlock) (int) = ^(int num) {}
        A<void ()>;
	int (*b)(int);

After:  int (^myBlock)(int) = ^(int num) {}
        A<void()>;
	int(*b)(int);

For function types and function pointer types, this patch only makes
the behavior consistent (for types that are keywords and other types).
For the latter function pointer type declarations, we'll probably
want to add a space after "int".

Also added LangOpts.Bool = 1, so we handle "A<bool()>" appropriately
Moved the LangOpts-settings to a public place for use by tests
and clang-format binary.

llvm-svn: 172065
2013-01-10 13:08:12 +00:00
Simon Atanasyan 81c423cc97 [Mips] Pass a combination of +soft-float and -mips16-hard-float flags to
the backend if hard float ABI is selected under -mips16 mode.

llvm-svn: 172062
2013-01-10 12:36:19 +00:00
Manuel Klimek 8e07a1b64b Fix layout of blocks inside statements.
Previously, we would not indent:
SOME_MACRO({
  int i;
});
correctly. This is fixed by adding the trailing }); to the unwrapped
line starting with SOME_MACRO({, so the formatter can correctly match
the braces and indent accordingly.

Also fixes incorrect parsing of initializer lists, like:
int a[] = { 1 };

llvm-svn: 172058
2013-01-10 11:52:21 +00:00
Daniel Jasper 7194e1818e Improve clang-format's understanding of casts.
This fixes llvm.org/PR14684.

Before: int *pa = (int *) & a;
After:  int *pa = (int *)&a;

We still don't understand all kinds of casts. I added a FIXME to
address that.

llvm-svn: 172056
2013-01-10 11:14:08 +00:00
David Tweed c38f11de40 r172047 lacked a test (due to incomplete OpenCL support in clang). Use a modified
version of a test by Joey Gouly to use attributes to materialise the unsupported
types and test vector shifts.

llvm-svn: 172053
2013-01-10 10:42:08 +00:00
Guy Benyei 03e61960c8 Enable intel_ocl_bicc for x86_64 target only. Remove fix from 171969 that enabled this extension for multiple targets.
llvm-svn: 172052
2013-01-10 10:41:05 +00:00
Manuel Klimek fba4bb114b Introduce a define to switch on debug output.
After re-writing the same loop multiple times, we deicided it's time to
add this as an optional debugging help.

llvm-svn: 172050
2013-01-10 10:05:08 +00:00
Daniel Jasper 83a54d23d3 Do more error checking for '{}'.
This fixes llvm.org/PR14883, where clang-format would run into an
assertion on:

void f() { return } 42

llvm-svn: 172049
2013-01-10 09:26:47 +00:00
David Tweed 9fb566c076 Testing with a full OpenCL compiler (based on clang) reveals r71734 missed
difference between type widths of a vector and the width of one of its elements
in the case of vector shifts. Use correct witdth in the vector case.

llvm-svn: 172047
2013-01-10 09:11:33 +00:00
NAKAMURA Takumi eacd667238 clang-c/Index.h: Clarify empty argument with (void) for C89.
llvm-svn: 172037
2013-01-10 02:12:38 +00:00
Douglas Gregor 0f2b4635be Be more careful about updating the failed-modules set
llvm-svn: 172035
2013-01-10 02:04:18 +00:00
Nick Lewycky 230203c949 Don't assert in codegen on static data members which have NoLinkage. Fixes
PR14825!

llvm-svn: 172031
2013-01-10 01:46:29 +00:00
Douglas Gregor 4ddf2221b4 Rework the realpath nonsense for framework lookups to deal more
uniformly with symlinks between top-level and embedded frameworks.

llvm-svn: 172030
2013-01-10 01:43:00 +00:00
Nico Weber bbe28b3d80 Formatter: Remove unused @-formatting code.
@optional @property is put on two different unwrapped lines now, so this is no
longer necessary.

llvm-svn: 172024
2013-01-10 00:42:07 +00:00
Nico Weber 51306d232e Formatter: @optional and @required go on their own line.
Previously:
@protocol myProtocol
- (void)mandatoryWithInt:(int)i;
@optional - (void) optional;
@required - (void) required;
@end

Now:
@protocol myProtocol
- (void)mandatoryWithInt:(int)i;
@optional
- (void)optional;
@required
- (void)required;
@end

llvm-svn: 172023
2013-01-10 00:25:19 +00:00
Nico Weber 2ce0ac5a8c Formatter: Add support for @implementation.
Just reuse the @interface code for this. It accepts slightly more than
necessary (@implementation cannot have protocol lists), but that's ok.

llvm-svn: 172019
2013-01-09 23:25:37 +00:00
Argyrios Kyrtzidis eb994f4064 [PreprocessingRecord] A macro expansion can be reported out-of-order in cases when
there are macro expansions inside macro arguments where the arguments are
not expanded in the same order as listed; don't assert that all macro expansions
are in source order.

rdar://12397063

llvm-svn: 172018
2013-01-09 23:22:20 +00:00
Argyrios Kyrtzidis 9f89bffc25 [utils/ClangDataFormat.py] Don't use lldb.frame directly, get the frame from the value.
Some lldb changes made lldb.frame not set until a script is invoked, which made the
formatters not working after a restart.

llvm-svn: 172017
2013-01-09 23:22:08 +00:00
Fariborz Jahanian 8b115b7872 Issue warning when case value is too large to fit
in case condition type. // rdar://11577384.
Test is conditionalized on x86_64-apple triple as
I am not sure if the INT_MAX/LONG_MAX values in the test
will pass this test for other hosts.

llvm-svn: 172016
2013-01-09 23:04:56 +00:00
Dmitri Gribenko dd7d8a0f35 ClangTools.rst: spelling and formatting
llvm-svn: 172008
2013-01-09 22:22:51 +00:00
Dmitri Gribenko cb9ede9437 ClangFormat.rst: improve formatting
llvm-svn: 172007
2013-01-09 22:18:55 +00:00
Hal Finkel 6134a6e7b8 Remove the unused Parser::ParseTranslationUnit function
Parser::ParseTranslationUnit is now dead because the loop over
ParseTopLevelDecl is in ParseAST.

llvm-svn: 172005
2013-01-09 21:49:51 +00:00
Daniel Jasper 85a77c1609 Add documentation for clang-format.
This adds documentation for both LibFormat as well as the standalone
tools and integrations built on top of it. It slightly restructures
the ClangTools documentation.

llvm-svn: 172004
2013-01-09 21:49:28 +00:00
Nico Weber d8ffe75ad1 Formatter: Make parseObjCUntilAtEnd() actually work.
llvm-svn: 172003
2013-01-09 21:42:32 +00:00
Nico Weber 8696a8d9e3 Formatting: Add support for @protocol.
Pull pieces of the @interface code into reusable methods.

llvm-svn: 172001
2013-01-09 21:15:03 +00:00
Nico Weber 4d03055e70 Fix test after r171995.
I wasn't aware libFormat is used elsewhere already. Let me know if rebasing
is not the right thing to do here.

llvm-svn: 171996
2013-01-09 20:36:10 +00:00
Nico Weber 7eecf4b6e3 Formatter: Add support for @interface.
Previously:
@interface Foo + (id)init; @end

Now:
@interface Foo
+ (id)init;
@end

Some tweaking remains, but this is a good first step.

llvm-svn: 171995
2013-01-09 20:25:35 +00:00
Benjamin Kramer 696651429d unwind.h: Add include guards and don't mess with visibility if HIDE_EXPORTS is specified.
For GCC compatibility.

llvm-svn: 171991
2013-01-09 19:54:57 +00:00
Ted Kremenek 2f2edd3fb1 Do not model loads from complex types, since we don't accurately model the imaginary and real parts yet.
Fixes false positive reported in <rdar://problem/12964481>.

llvm-svn: 171987
2013-01-09 18:46:17 +00:00
David Blaikie 5a6a020d9b Suppress GCC -Wreturn warning.
Modified from a patch by David Greene.

llvm-svn: 171982
2013-01-09 17:48:41 +00:00
Rafael Espindola 3bd836a58e Handle static functions being redeclared in function scope.
Fixes pr14861.

llvm-svn: 171978
2013-01-09 16:34:58 +00:00
Manuel Klimek 52b1515405 Enables layouting unwrapped lines around preprocessor directives.
Previously, we'd always start at indent level 0 after a preprocessor
directive, now we layout the following snippet (column limit 69) as
follows:

functionCallTo(someOtherFunction(
    withSomeParameters, whichInSequence,
    areLongerThanALine(andAnotherCall,
  B
                       withMoreParamters,
                       whichStronglyInfluenceTheLayout),
    andMoreParameters),
               trailing);

Note that the different jumping indent is a different issue that will be
addressed separately.

This is the first step towards handling #ifdef->#else->#endif chains
correctly.

llvm-svn: 171974
2013-01-09 15:25:02 +00:00
Guy Benyei 6313f780e1 Enable intel_ocl_bicc for x86_64 target. This was missed in r171056.
llvm-svn: 171969
2013-01-09 12:21:44 +00:00
Daniel Jasper bcab430fee Only align after assignments on the top level.
This fixes llvm.org/PR14870 and we no longer mess up:
template <typename T1, typename T2 = char, typename T3 = char,
          typename T4 = char>
void f();

It removes the nice aligment for assignments inside other expressions,
but I am not sure those are actually practically relevant. If so, we can
fix those later.

llvm-svn: 171966
2013-01-09 10:40:23 +00:00
Daniel Jasper 2df93311da Don't simply give up when exceeding 80cols, choose an "ok" option.
This addresses llvm.org/PR14847.

We can now format something like:
int aaaaaaaaaaaaaaaaaaaaaaaaaaa =
    // aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;

clang-format unavoidably exceeds the column limit, but does not just
flush everything into a single line. Moreover, it tries to minimize the
number of characters beyond the column limit.

llvm-svn: 171964
2013-01-09 10:16:05 +00:00
Daniel Jasper 890589414b Correctly format wrapped function call parameters in templated functions.
This fixes llvm.org/PR14846.

Before:
template <typename T>
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
        int aaaaaaaaaaaaaaaaa);

After:
template <typename T>
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    int aaaaaaaaaaaaaaaaa);

llvm-svn: 171963
2013-01-09 09:50:48 +00:00
Manuel Klimek cdd5c2397a Fixes dump_ast_matchers to parse all matcher macros and updates the
docs.

llvm-svn: 171962
2013-01-09 09:38:21 +00:00
Daniel Jasper d8bb2db242 Allow comments in the middle of statements to be on their own line.
This fixes llvm.org/PR14860.

Before, we messed up the format of:
if (DeclaratorInfo.isFunctionDeclarator() &&
    //getDeclSpecContextFromDeclaratorContext(Context) == DSC_top_level &&
    Tok.is(tok::semi) && NextToken().is(tok::l_brace)) {
}

llvm-svn: 171961
2013-01-09 09:33:39 +00:00
Daniel Jasper fb3f2482e5 Fix ObjC block declarations.
Before: int ( ^ Block1) (int, int) = ^ (int i, int j)
After:  int (^Block1) (int, int) = ^(int i, int j)
llvm-svn: 171959
2013-01-09 08:36:49 +00:00
Daniel Jasper 399d24bc7d Improve formatting of conditional operators.
This addresses llvm.org/PR14864.

We used to completely mess this up and now format as:
Diag(NewFD->getLocation(),
     getLangOpts().MicrosoftExt ? diag::ext_function_specialization_in_class :
         diag::err_function_specialization_in_class)
    << NewFD->getDeclName();

llvm-svn: 171957
2013-01-09 07:06:56 +00:00
Nico Weber 69dce49c76 Don't mention -fno-diagnostics-print-source-range-info in manual.
Clang doesn't understand it.

If someone wants to teach clang about that flag instead, please also add
support for -fno-diagnostics-parseable-fixits for consistency.

Until then, let the documentation match the current behavior.

llvm-svn: 171952
2013-01-09 05:06:41 +00:00
Will Dietz 450f1a1f45 [ubsan] Make static check data non-const so it can be used for deduplication.
llvm-svn: 171947
2013-01-09 03:39:41 +00:00
Eli Friedman c52435b4a2 Make sure clang puts tokens from different files on separate lines in "-E -P" mode. <rdar://problem/12774044>
llvm-svn: 171944
2013-01-09 03:16:42 +00:00
Eli Friedman ec94b61745 Make __has_include a bit more resilient in the presence of macros. <rdar://problem/12748859>.
llvm-svn: 171939
2013-01-09 02:20:00 +00:00
Douglas Gregor 3552dabfe1 When name lookup for a redeclaration finds declarations that are known
(because they are part of some module) but have not been made visible
(because they are in a submodule that wasn't imported), filter out
those declarations unless both the old declaration and the new
declaration have external linkage. When one or both has internal
linkage, there should be no conflict unless both are imported.

llvm-svn: 171925
2013-01-09 00:47:56 +00:00
Fariborz Jahanian 14da440018 put back diagnostics when flexible members are captured
in lambdas.

llvm-svn: 171921
2013-01-09 00:09:15 +00:00
Michael Gottesman 675444d5de Removed extra "`" from ARC documentation.
llvm-svn: 171920
2013-01-08 23:55:10 +00:00
Chad Rosier d35ae732ac [ms-inline asm] Add a test case for the offset operator where the operand is a
global variable.

llvm-svn: 171919
2013-01-08 23:51:48 +00:00
Fariborz Jahanian 5eae4adf23 Fix typo (again).
llvm-svn: 171917
2013-01-08 23:48:48 +00:00
Fariborz Jahanian 7a83f04094 Remove lambda from my last patch.
llvm-svn: 171915
2013-01-08 23:40:08 +00:00
Fariborz Jahanian b68f7b2a77 Fixes typo in comment.
llvm-svn: 171913
2013-01-08 23:21:22 +00:00
Fariborz Jahanian a716a34527 objectiveC blocks: It is impractical to capture
struct variables with flexiable array members in
blocks (and lambdas). Issue error instead of
crashing in IRGen. // rdar://12655829

llvm-svn: 171912
2013-01-08 23:17:51 +00:00
Richard Smith 5f044ad5f0 PR14855: don't silently swallow a nested-name-specifier after a type name.
llvm-svn: 171908
2013-01-08 22:43:49 +00:00
Rafael Espindola b68dd4717e Clear LV cache when dropping availability attributes.
llvm-svn: 171906
2013-01-08 22:31:36 +00:00
Rafael Espindola a3aea433f8 Tighten types a bit. No functionality change.
llvm-svn: 171902
2013-01-08 22:04:34 +00:00
Rafael Espindola c231fab756 Don't crash when trying to apply the availability attribute to a block.
llvm-svn: 171899
2013-01-08 21:30:32 +00:00
Rafael Espindola c2453dd8f5 Tighten types a bit. No functionality change.
llvm-svn: 171895
2013-01-08 21:00:12 +00:00
Rafael Espindola 0a67e2fc8b Tighten types a bit. No functionality change.
llvm-svn: 171894
2013-01-08 20:44:06 +00:00
David Blaikie 9360953135 Remove on-by-default warning from -Wmost.
-Wint-to-pointer-cast, added to match GCC's warning by the same name, doesn't
need to be in any other groups (as it isn't in any groups in GCC either).

Found in post-commit review by Ted Kremenek.

llvm-svn: 171893
2013-01-08 20:28:13 +00:00
Nico Weber 4cc9874ff9 Formatter: More tests for already-passing ObjC bits.
llvm-svn: 171892
2013-01-08 20:16:23 +00:00
Anna Zaks efe76bc821 [analyzer] Bump down the max size of functions being analyzed.
With the new setting, we are not going to inline any functions that are
more than 50 basic blocks. (The analyzer is 20% faster on several
especially bad benchmarks with the new default.)

llvm-svn: 171891
2013-01-08 20:09:00 +00:00
Daniel Jasper 66dcb1ca86 Don't break after unary operators.
Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaa, *
                                                 aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaa, *aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 171890
2013-01-08 20:03:18 +00:00
Rafael Espindola f26d5391ab Move loop variable update.
Thanks to Dmitri Gribenko for the suggestion.

llvm-svn: 171889
2013-01-08 19:58:34 +00:00
Rafael Espindola 820fa707b1 Mark all subsequent decls used.
In the source

  static void f();
  static void f();
  template<typename T>
  static void g() {
    f();
  }
  static void f() {
  }
  void h() {
    g<int>();
  }

the call to f refers to the second decl, but it is only marked used at the end
of the translation unit during instantiation, after the third f decl has been
linked in.

With this patch we mark all subsequent decls used, so that it is easy to check
if a symbol is used or not.

llvm-svn: 171888
2013-01-08 19:43:34 +00:00
Nico Weber 77aa25090a Formatter: Format @ literals better. Array and dictionary literals need more work.
llvm-svn: 171887
2013-01-08 19:40:21 +00:00
Jordan Rose a2d5f0c742 Various tweaks and updates to the analyzer website.
llvm-svn: 171885
2013-01-08 19:29:37 +00:00
Anna Zaks 454a384e59 [analyzer] Only include uniqueling location as issue_hash when available
This makes us more optimistic when matching reports in a changing code
base. Addresses Jordan's feedback for r171825.

llvm-svn: 171884
2013-01-08 19:19:46 +00:00
Nico Weber d8cdb53e1d Formatter: More ObjC tests.
llvm-svn: 171883
2013-01-08 19:15:23 +00:00
Argyrios Kyrtzidis bf1be59dae [libclang] In clang_equalCursors, clear out the "FirstInDeclGroup" part in a declaration cursor
before doing the comparison.

This is because we can't set "FirstInDeclGroup" consistently; for example, when visiting a DeclStmt we will set
it but we don't set it on the result of clang_getCursorDefinition for a reference of the same declaration.

llvm-svn: 171878
2013-01-08 18:23:28 +00:00
Douglas Gregor c4c1fb39d8 Use Decl::getAvailability() rather than checking for the "unavailable"
attribute when determining whether we need to see an implementation of
a property. Fixes <rdar://problem/12958191>.

llvm-svn: 171877
2013-01-08 18:16:18 +00:00
Nico Weber 7e6a7a19e3 Formatter: Add tests for some ObjC bits that happen to be formatted correctly.
llvm-svn: 171875
2013-01-08 17:56:31 +00:00
Ted Kremenek 0ab78e622f Repost checker-270, which for some reason got deleted.
llvm-svn: 171870
2013-01-08 17:33:58 +00:00
Manuel Klimek 6e67bed48c clang-format can now format #defines.
llvm-svn: 171865
2013-01-08 16:33:20 +00:00
Daniel Jasper 4f397156c4 Don't put spaces around ##.
In Clang/LLVM this seems to be the more common formatting for ##s. There
might still be case that we miss, but we'll fix those as we go along.

Before:

  #define A(X)
    void function ## X();

After:

  #define A(X)
    void function##X();

llvm-svn: 171862
2013-01-08 16:17:54 +00:00
Rafael Espindola c8c61895be Add missing spaces. This doesn't cause problems in practice because we only warn
about _Static_assert with -pedantic.

llvm-svn: 171860
2013-01-08 16:09:04 +00:00
Rafael Espindola ef5ea1df4e Clear the LV cache when setting the instantiated from link.
Fixes pr14835.

llvm-svn: 171857
2013-01-08 14:58:32 +00:00
Daniel Jasper 7c85fde500 Change the data structure used in clang-format.
This is a first step towards supporting more complex structures such
as #ifs inside unwrapped lines. This patch mostly converts the array-based
UnwrappedLine into a linked-list-based UnwrappedLine. Future changes will
allow multiple children for each Token turning the UnwrappedLine into a
tree.

No functional changes intended.

llvm-svn: 171856
2013-01-08 14:56:18 +00:00
Dmitri Gribenko 7daa1a2201 CodeGen/compound-assign-overflow.c: include stdint.h in freestanding mode
This hopefully fixes the ARM buildbot.

llvm-svn: 171853
2013-01-08 14:47:41 +00:00
Sean Silva 3703823b89 docs: "clang tools" are not a different interface.
I spotted someone confused about this, so remove the heading to make it
clear that they really are a part of Tooling.

llvm-svn: 171841
2013-01-08 04:42:09 +00:00
Rafael Espindola 9a5a6dddf9 Clear the LV cache when merging the availability attribute.
The availability implies default visibility, so it can change the computed
visibility.

llvm-svn: 171840
2013-01-08 04:04:30 +00:00
Eric Christopher 9cf4480392 Add a test to make sure that vector output happens for debug info.
llvm-svn: 171834
2013-01-08 01:54:13 +00:00