]> granicus.if.org Git - clang/log
clang
11 years agoFormatter: Add support for @implementation.
Nico Weber [Wed, 9 Jan 2013 23:25:37 +0000 (23:25 +0000)]
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.

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

11 years ago[PreprocessingRecord] A macro expansion can be reported out-of-order in cases when
Argyrios Kyrtzidis [Wed, 9 Jan 2013 23:22:20 +0000 (23:22 +0000)]
[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

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

11 years ago[utils/ClangDataFormat.py] Don't use lldb.frame directly, get the frame from the...
Argyrios Kyrtzidis [Wed, 9 Jan 2013 23:22:08 +0000 (23:22 +0000)]
[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.

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

11 years agoIssue warning when case value is too large to fit
Fariborz Jahanian [Wed, 9 Jan 2013 23:04:56 +0000 (23:04 +0000)]
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.

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

11 years agoClangTools.rst: spelling and formatting
Dmitri Gribenko [Wed, 9 Jan 2013 22:22:51 +0000 (22:22 +0000)]
ClangTools.rst: spelling and formatting

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

11 years agoClangFormat.rst: improve formatting
Dmitri Gribenko [Wed, 9 Jan 2013 22:18:55 +0000 (22:18 +0000)]
ClangFormat.rst: improve formatting

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

11 years agoRemove the unused Parser::ParseTranslationUnit function
Hal Finkel [Wed, 9 Jan 2013 21:49:51 +0000 (21:49 +0000)]
Remove the unused Parser::ParseTranslationUnit function

Parser::ParseTranslationUnit is now dead because the loop over
ParseTopLevelDecl is in ParseAST.

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

11 years agoAdd documentation for clang-format.
Daniel Jasper [Wed, 9 Jan 2013 21:49:28 +0000 (21:49 +0000)]
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.

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

11 years agoFormatter: Make parseObjCUntilAtEnd() actually work.
Nico Weber [Wed, 9 Jan 2013 21:42:32 +0000 (21:42 +0000)]
Formatter: Make parseObjCUntilAtEnd() actually work.

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

11 years agoFormatting: Add support for @protocol.
Nico Weber [Wed, 9 Jan 2013 21:15:03 +0000 (21:15 +0000)]
Formatting: Add support for @protocol.

Pull pieces of the @interface code into reusable methods.

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

11 years agoFix test after r171995.
Nico Weber [Wed, 9 Jan 2013 20:36:10 +0000 (20:36 +0000)]
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.

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

11 years agoFormatter: Add support for @interface.
Nico Weber [Wed, 9 Jan 2013 20:25:35 +0000 (20:25 +0000)]
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.

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

11 years agounwind.h: Add include guards and don't mess with visibility if HIDE_EXPORTS is specified.
Benjamin Kramer [Wed, 9 Jan 2013 19:54:57 +0000 (19:54 +0000)]
unwind.h: Add include guards and don't mess with visibility if HIDE_EXPORTS is specified.

For GCC compatibility.

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

11 years agoDo not model loads from complex types, since we don't accurately model the imaginary...
Ted Kremenek [Wed, 9 Jan 2013 18:46:17 +0000 (18:46 +0000)]
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>.

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

11 years agoSuppress GCC -Wreturn warning.
David Blaikie [Wed, 9 Jan 2013 17:48:41 +0000 (17:48 +0000)]
Suppress GCC -Wreturn warning.

Modified from a patch by David Greene.

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

11 years agoHandle static functions being redeclared in function scope.
Rafael Espindola [Wed, 9 Jan 2013 16:34:58 +0000 (16:34 +0000)]
Handle static functions being redeclared in function scope.

Fixes pr14861.

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

11 years agoEnables layouting unwrapped lines around preprocessor directives.
Manuel Klimek [Wed, 9 Jan 2013 15:25:02 +0000 (15:25 +0000)]
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.

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

11 years agoEnable intel_ocl_bicc for x86_64 target. This was missed in r171056.
Guy Benyei [Wed, 9 Jan 2013 12:21:44 +0000 (12:21 +0000)]
Enable intel_ocl_bicc for x86_64 target. This was missed in r171056.

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

11 years agoOnly align after assignments on the top level.
Daniel Jasper [Wed, 9 Jan 2013 10:40:23 +0000 (10:40 +0000)]
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.

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

11 years agoDon't simply give up when exceeding 80cols, choose an "ok" option.
Daniel Jasper [Wed, 9 Jan 2013 10:16:05 +0000 (10:16 +0000)]
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.

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

11 years agoCorrectly format wrapped function call parameters in templated functions.
Daniel Jasper [Wed, 9 Jan 2013 09:50:48 +0000 (09:50 +0000)]
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);

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

11 years agoFixes dump_ast_matchers to parse all matcher macros and updates the
Manuel Klimek [Wed, 9 Jan 2013 09:38:21 +0000 (09:38 +0000)]
Fixes dump_ast_matchers to parse all matcher macros and updates the
docs.

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

11 years agoAllow comments in the middle of statements to be on their own line.
Daniel Jasper [Wed, 9 Jan 2013 09:33:39 +0000 (09:33 +0000)]
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)) {
}

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

11 years agoFix ObjC block declarations.
Daniel Jasper [Wed, 9 Jan 2013 08:36:49 +0000 (08:36 +0000)]
Fix ObjC block declarations.

Before: int ( ^ Block1) (int, int) = ^ (int i, int j)
After:  int (^Block1) (int, int) = ^(int i, int j)

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

11 years agoImprove formatting of conditional operators.
Daniel Jasper [Wed, 9 Jan 2013 07:06:56 +0000 (07:06 +0000)]
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();

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

11 years agoDon't mention -fno-diagnostics-print-source-range-info in manual.
Nico Weber [Wed, 9 Jan 2013 05:06:41 +0000 (05:06 +0000)]
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.

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

11 years ago[ubsan] Make static check data non-const so it can be used for deduplication.
Will Dietz [Wed, 9 Jan 2013 03:39:41 +0000 (03:39 +0000)]
[ubsan] Make static check data non-const so it can be used for deduplication.

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

11 years agoMake sure clang puts tokens from different files on separate lines in "-E -P" mode...
Eli Friedman [Wed, 9 Jan 2013 03:16:42 +0000 (03:16 +0000)]
Make sure clang puts tokens from different files on separate lines in "-E -P" mode.  <rdar://problem/12774044>

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

11 years agoMake __has_include a bit more resilient in the presence of macros. <rdar://problem...
Eli Friedman [Wed, 9 Jan 2013 02:20:00 +0000 (02:20 +0000)]
Make __has_include a bit more resilient in the presence of macros.  <rdar://problem/12748859>.

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

11 years agoWhen name lookup for a redeclaration finds declarations that are known
Douglas Gregor [Wed, 9 Jan 2013 00:47:56 +0000 (00:47 +0000)]
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.

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

11 years agoput back diagnostics when flexible members are captured
Fariborz Jahanian [Wed, 9 Jan 2013 00:09:15 +0000 (00:09 +0000)]
put back diagnostics when flexible members are captured
in lambdas.

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

11 years agoRemoved extra "`" from ARC documentation.
Michael Gottesman [Tue, 8 Jan 2013 23:55:10 +0000 (23:55 +0000)]
Removed extra "`" from ARC documentation.

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

11 years ago[ms-inline asm] Add a test case for the offset operator where the operand is a
Chad Rosier [Tue, 8 Jan 2013 23:51:48 +0000 (23:51 +0000)]
[ms-inline asm] Add a test case for the offset operator where the operand is a
global variable.

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

11 years agoFix typo (again).
Fariborz Jahanian [Tue, 8 Jan 2013 23:48:48 +0000 (23:48 +0000)]
Fix typo (again).

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

11 years agoRemove lambda from my last patch.
Fariborz Jahanian [Tue, 8 Jan 2013 23:40:08 +0000 (23:40 +0000)]
Remove lambda from my last patch.

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

11 years agoFixes typo in comment.
Fariborz Jahanian [Tue, 8 Jan 2013 23:21:22 +0000 (23:21 +0000)]
Fixes typo in comment.

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

11 years agoobjectiveC blocks: It is impractical to capture
Fariborz Jahanian [Tue, 8 Jan 2013 23:17:51 +0000 (23:17 +0000)]
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

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

11 years agoPR14855: don't silently swallow a nested-name-specifier after a type name.
Richard Smith [Tue, 8 Jan 2013 22:43:49 +0000 (22:43 +0000)]
PR14855: don't silently swallow a nested-name-specifier after a type name.

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

11 years agoClear LV cache when dropping availability attributes.
Rafael Espindola [Tue, 8 Jan 2013 22:31:36 +0000 (22:31 +0000)]
Clear LV cache when dropping availability attributes.

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

11 years agoTighten types a bit. No functionality change.
Rafael Espindola [Tue, 8 Jan 2013 22:04:34 +0000 (22:04 +0000)]
Tighten types a bit. No functionality change.

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

11 years agoDon't crash when trying to apply the availability attribute to a block.
Rafael Espindola [Tue, 8 Jan 2013 21:30:32 +0000 (21:30 +0000)]
Don't crash when trying to apply the availability attribute to a block.

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

11 years agoTighten types a bit. No functionality change.
Rafael Espindola [Tue, 8 Jan 2013 21:00:12 +0000 (21:00 +0000)]
Tighten types a bit. No functionality change.

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

11 years agoTighten types a bit. No functionality change.
Rafael Espindola [Tue, 8 Jan 2013 20:44:06 +0000 (20:44 +0000)]
Tighten types a bit. No functionality change.

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

11 years agoRemove on-by-default warning from -Wmost.
David Blaikie [Tue, 8 Jan 2013 20:28:13 +0000 (20:28 +0000)]
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.

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

11 years agoFormatter: More tests for already-passing ObjC bits.
Nico Weber [Tue, 8 Jan 2013 20:16:23 +0000 (20:16 +0000)]
Formatter: More tests for already-passing ObjC bits.

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

11 years ago[analyzer] Bump down the max size of functions being analyzed.
Anna Zaks [Tue, 8 Jan 2013 20:09:00 +0000 (20:09 +0000)]
[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.)

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

11 years agoDon't break after unary operators.
Daniel Jasper [Tue, 8 Jan 2013 20:03:18 +0000 (20:03 +0000)]
Don't break after unary operators.

Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaa, *
                                                 aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaa, *aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

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

11 years agoMove loop variable update.
Rafael Espindola [Tue, 8 Jan 2013 19:58:34 +0000 (19:58 +0000)]
Move loop variable update.
Thanks to Dmitri Gribenko for the suggestion.

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

11 years agoMark all subsequent decls used.
Rafael Espindola [Tue, 8 Jan 2013 19:43:34 +0000 (19:43 +0000)]
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.

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

11 years agoFormatter: Format @ literals better. Array and dictionary literals need more work.
Nico Weber [Tue, 8 Jan 2013 19:40:21 +0000 (19:40 +0000)]
Formatter: Format @ literals better. Array and dictionary literals need more work.

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

11 years agoVarious tweaks and updates to the analyzer website.
Jordan Rose [Tue, 8 Jan 2013 19:29:37 +0000 (19:29 +0000)]
Various tweaks and updates to the analyzer website.

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

11 years ago[analyzer] Only include uniqueling location as issue_hash when available
Anna Zaks [Tue, 8 Jan 2013 19:19:46 +0000 (19:19 +0000)]
[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.

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

11 years agoFormatter: More ObjC tests.
Nico Weber [Tue, 8 Jan 2013 19:15:23 +0000 (19:15 +0000)]
Formatter: More ObjC tests.

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

11 years ago[libclang] In clang_equalCursors, clear out the "FirstInDeclGroup" part in a declarat...
Argyrios Kyrtzidis [Tue, 8 Jan 2013 18:23:28 +0000 (18:23 +0000)]
[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.

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

11 years agoUse Decl::getAvailability() rather than checking for the "unavailable"
Douglas Gregor [Tue, 8 Jan 2013 18:16:18 +0000 (18:16 +0000)]
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>.

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

11 years agoFormatter: Add tests for some ObjC bits that happen to be formatted correctly.
Nico Weber [Tue, 8 Jan 2013 17:56:31 +0000 (17:56 +0000)]
Formatter: Add tests for some ObjC bits that happen to be formatted correctly.

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

11 years agoRepost checker-270, which for some reason got deleted.
Ted Kremenek [Tue, 8 Jan 2013 17:33:58 +0000 (17:33 +0000)]
Repost checker-270, which for some reason got deleted.

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

11 years agoclang-format can now format #defines.
Manuel Klimek [Tue, 8 Jan 2013 16:33:20 +0000 (16:33 +0000)]
clang-format can now format #defines.

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

11 years agoDon't put spaces around ##.
Daniel Jasper [Tue, 8 Jan 2013 16:17:54 +0000 (16:17 +0000)]
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();

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

11 years agoAdd missing spaces. This doesn't cause problems in practice because we only warn
Rafael Espindola [Tue, 8 Jan 2013 16:09:04 +0000 (16:09 +0000)]
Add missing spaces. This doesn't cause problems in practice because we only warn
about _Static_assert with -pedantic.

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

11 years agoClear the LV cache when setting the instantiated from link.
Rafael Espindola [Tue, 8 Jan 2013 14:58:32 +0000 (14:58 +0000)]
Clear the LV cache when setting the instantiated from link.
Fixes pr14835.

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

11 years agoChange the data structure used in clang-format.
Daniel Jasper [Tue, 8 Jan 2013 14:56:18 +0000 (14:56 +0000)]
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.

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

11 years agoCodeGen/compound-assign-overflow.c: include stdint.h in freestanding mode
Dmitri Gribenko [Tue, 8 Jan 2013 14:47:41 +0000 (14:47 +0000)]
CodeGen/compound-assign-overflow.c: include stdint.h in freestanding mode

This hopefully fixes the ARM buildbot.

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

11 years agodocs: "clang tools" are not a different interface.
Sean Silva [Tue, 8 Jan 2013 04:42:09 +0000 (04:42 +0000)]
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.

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

11 years agoClear the LV cache when merging the availability attribute.
Rafael Espindola [Tue, 8 Jan 2013 04:04:30 +0000 (04:04 +0000)]
Clear the LV cache when merging the availability attribute.

The availability implies default visibility, so it can change the computed
visibility.

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

11 years agoAdd a test to make sure that vector output happens for debug info.
Eric Christopher [Tue, 8 Jan 2013 01:54:13 +0000 (01:54 +0000)]
Add a test to make sure that vector output happens for debug info.

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

11 years agoDon't warn about undefined varargs argument behavior in unreachable code.
Ted Kremenek [Tue, 8 Jan 2013 01:50:40 +0000 (01:50 +0000)]
Don't warn about undefined varargs argument behavior in unreachable code.

Fixes <rdar://problem/12322000>.

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

11 years agoAdd [artificial] debug info annotation to test matching r171826
David Blaikie [Tue, 8 Jan 2013 01:12:59 +0000 (01:12 +0000)]
Add [artificial] debug info annotation to test matching r171826

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

11 years ago[arcmt] Follow-up for r171484; make sure when adding brackets enclosing case statements,
Argyrios Kyrtzidis [Tue, 8 Jan 2013 00:58:25 +0000 (00:58 +0000)]
[arcmt] Follow-up for r171484; make sure when adding brackets enclosing case statements,
that the case does not "contain" a declaration that is referenced "outside" of it,
otherwise we will emit un-compilable code.

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

11 years agoMove ref qualifiers from Type bitfields into FunctionProtoType, stealing two
Richard Smith [Tue, 8 Jan 2013 00:50:27 +0000 (00:50 +0000)]
Move ref qualifiers from Type bitfields into FunctionProtoType, stealing two
bits from the number of parameters. This brings the bitfields down from 33 bits
to 32 bits, reducing the size of Types by 4 bytes on 32-bit systems.

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

11 years ago[analyzer] Include the bug uniqueing location in the issue_hash.
Anna Zaks [Tue, 8 Jan 2013 00:25:29 +0000 (00:25 +0000)]
[analyzer] Include the bug uniqueing location in the issue_hash.

The issue here is that if we have 2 leaks reported at the same line for
which we cannot print the corresponding region info, they will get
treated as the same by issue_hash+description. We need to AUGMENT the
issue_hash with the allocation info to differentiate the two issues.

Add the "hash" (offset from the beginning of a function) representing
allocation site to solve the issue.

We might want to generalize solution in the future when we decide to
track more than just the 2 locations from the diagnostics.

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

11 years ago[analyzer] Plist: change the type of issue_hash from int to string.
Anna Zaks [Tue, 8 Jan 2013 00:25:22 +0000 (00:25 +0000)]
[analyzer] Plist: change the type of issue_hash from int to string.

This gives more flexibility to what could be stored as issue_hash.

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

11 years ago[analyzer] Extend the Representing Values section of the dev manual.
Anna Zaks [Tue, 8 Jan 2013 00:25:14 +0000 (00:25 +0000)]
[analyzer] Extend the Representing Values section of the dev manual.

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

11 years agoclang/test/CodeGenOpenCL/shifts.cl: Fixup for -Asserts.
NAKAMURA Takumi [Tue, 8 Jan 2013 00:15:53 +0000 (00:15 +0000)]
clang/test/CodeGenOpenCL/shifts.cl: Fixup for -Asserts.

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

11 years agoPR14838: When a member reference is bound to a temporary, don't forget to
Richard Smith [Tue, 8 Jan 2013 00:08:23 +0000 (00:08 +0000)]
PR14838: When a member reference is bound to a temporary, don't forget to
perform the semantic checks associated with the destruction of that temporary.
It'll be destroyed at the end of the constructor.

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

11 years agoBack out my no-op change from r171783.
Douglas Gregor [Tue, 8 Jan 2013 00:01:45 +0000 (00:01 +0000)]
Back out my no-op change from r171783.

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

11 years agoCorrect OpenBSD profiling test
Dmitri Gribenko [Mon, 7 Jan 2013 23:55:47 +0000 (23:55 +0000)]
Correct OpenBSD profiling test

The test should be looking for gcrt0.o not crt0.o.  Clang was already printing
"gcrt0", but the test was looking for "{{.*}}crt0.o", and the .* regexp
consumed "g".

Patch by Brad Smith.

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

11 years agoExtract the instance-method case for debug info out into a separate function.
David Blaikie [Mon, 7 Jan 2013 23:06:35 +0000 (23:06 +0000)]
Extract the instance-method case for debug info out into a separate function.

This is in preparation for using this to construct the function type for
pointers to member functions to include the implicit/artificial 'this'
parameter in that case as well. (feedback from GDB indicates that this might be
all that's necessary to get it to behave well with Clang's pointer-to-member
function debug output)

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

11 years agoadd a triple
Rafael Espindola [Mon, 7 Jan 2013 23:04:04 +0000 (23:04 +0000)]
add a triple

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

11 years ago[ubsan] Use correct type for compound assignment ops.
Will Dietz [Mon, 7 Jan 2013 22:25:52 +0000 (22:25 +0000)]
[ubsan] Use correct type for compound assignment ops.

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

11 years agoSimplify computing debug info type for static member functions.
David Blaikie [Mon, 7 Jan 2013 22:24:59 +0000 (22:24 +0000)]
Simplify computing debug info type for static member functions.

No (intended) functional change.

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

11 years agoConverted Block-ABI-Apple.txt => Block-ABI-Apple.rst.
Michael Gottesman [Mon, 7 Jan 2013 22:24:45 +0000 (22:24 +0000)]
Converted Block-ABI-Apple.txt => Block-ABI-Apple.rst.

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

11 years agodocs: Fix inconsistent titles.
Sean Silva [Mon, 7 Jan 2013 21:46:47 +0000 (21:46 +0000)]
docs: Fix inconsistent titles.

Sphinx was whining about this.

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

11 years agodocs: Copy Block-ABI-Apple.txt to output.
Sean Silva [Mon, 7 Jan 2013 21:46:35 +0000 (21:46 +0000)]
docs: Copy Block-ABI-Apple.txt to output.

This fixes the URL permanence of that URL. This is a bit of a hack. See
the FIXME in the patch for what the "real" solution should be.

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

11 years agoMinor refactoring of my last patch
Fariborz Jahanian [Mon, 7 Jan 2013 21:31:08 +0000 (21:31 +0000)]
Minor refactoring of my last patch
related to // rdar://12958878

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

11 years ago[docs/analyzer] Test commit (for auto-update).
Daniel Dunbar [Mon, 7 Jan 2013 20:44:37 +0000 (20:44 +0000)]
[docs/analyzer] Test commit (for auto-update).

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

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