]>
granicus.if.org Git - clang/log
Manuel Klimek [Thu, 10 Jan 2013 10:05:08 +0000 (10:05 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172050
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 10 Jan 2013 09:26:47 +0000 (09:26 +0000)]
Do more error checking for '{}'.
This fixes llvm.org/PR14883, where clang-format would run into an
assertion on:
void f() { return } 42
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172049
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Tweed [Thu, 10 Jan 2013 09:11:33 +0000 (09:11 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172047
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 10 Jan 2013 02:12:38 +0000 (02:12 +0000)]
clang-c/Index.h: Clarify empty argument with (void) for C89.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172037
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 10 Jan 2013 02:04:18 +0000 (02:04 +0000)]
Be more careful about updating the failed-modules set
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172035
91177308 -0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 10 Jan 2013 01:46:29 +0000 (01:46 +0000)]
Don't assert in codegen on static data members which have NoLinkage. Fixes
PR14825!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172031
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 10 Jan 2013 01:43:00 +0000 (01:43 +0000)]
Rework the realpath nonsense for framework lookups to deal more
uniformly with symlinks between top-level and embedded frameworks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172030
91177308 -0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Thu, 10 Jan 2013 00:42:07 +0000 (00:42 +0000)]
Formatter: Remove unused @-formatting code.
@optional @property is put on two different unwrapped lines now, so this is no
longer necessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172024
91177308 -0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Thu, 10 Jan 2013 00:25:19 +0000 (00:25 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172023
91177308 -0d34-0410-b5e6-
96231b3b80d8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Daniel Jasper [Tue, 8 Jan 2013 20:03:18 +0000 (20:03 +0000)]
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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