Граф коммитов

41972 Коммитов

Автор SHA1 Сообщение Дата
Chandler Carruth 6ee777de8b Move an input header file under an Inputs directory to be consistent
with other auxilliary test inputs and simplify the identification of
inputs to tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172890 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 06:31:24 +00:00
Ted Kremenek 39371b8bbf Reapply r172878 with test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172888 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 04:33:14 +00:00
Richard Smith ba65f505b7 Fix five more cases of tokens which can legally follow a type specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172886 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 03:48:05 +00:00
Argyrios Kyrtzidis dc1088f620 [PCH/Modules] Revert r172843, it caused a module to fail building.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172884 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 03:14:56 +00:00
Anna Zaks 1dfebd9f99 [analyzer] Suppress warnings coming out of macros defined in sys/queue.h
Suppress the warning by just not emitting the report. The sink node
would get generated, which is fine since we did reach a bad state.

Motivation

Due to the way code is structured in some of these macros, we do not
reason correctly about it and report false positives. Specifically, the
following loop reports a use-after-free. Because of the way the code is
structured inside of the macro, the analyzer assumes that the list can
have cycles, so you end up with use-after-free in the loop, that is
safely deleting elements of the list. (The user does not have a way to
teach the analyzer about shape of data structures.)

SLIST_FOREACH_SAFE(item, &ctx->example_list, example_le, tmpitem) {
			if (item->index == 3) { // if you remove each time, no complaints
				assert((&ctx->example_list)->slh_first == item);
				SLIST_REMOVE(&ctx->example_list, item, example_s, example_le);
				free(item);
			}
		}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172883 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 02:18:15 +00:00
NAKAMURA Takumi f30527901f Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172881 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 01:54:35 +00:00
NAKAMURA Takumi 6adfff14ee Revert r172878, "Reword warning about using a *static* variable within its own initialization."
It broke, at least, linux, msvc and mingw bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172879 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 01:47:46 +00:00
Ted Kremenek 1bdac1d447 Reword warning about using a *static* variable within its own initialization.
The warning is still under -Wuninitialized (although technically this
is defined behavior), but under a subgroup -Wstatic-self-init.

This addresses PR 10265.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172878 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 00:49:00 +00:00
Ted Kremenek 77fd3c0d78 -Wuninitialized: warn about uninitialized values resulting from ?: that evaluate to lvalues (in C++).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172875 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 00:25:06 +00:00
David Blaikie 299adab3e2 Remove windows line endings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172865 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 23:03:15 +00:00
Matt Beaumont-Gay 8dc3c80c3f Remove unused variable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172862 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 22:34:17 +00:00
Jordan Rose 728bb4c418 Adopt llvm::hexDigitValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172861 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 22:33:58 +00:00
Jordan Rose cd6bfd0d02 Fix mismatched #endif.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172860 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 22:33:54 +00:00
Douglas Gregor 22eaced5ca Once we've collected the template arguments for a
partially-substituted parameter pack in a template, forget about the
partially-substituted parameter pack: it is now completed. Fixes
<rdar://problem/12176336>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172859 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 22:27:09 +00:00
DeLesley Hutchins 0ecc2e9ce8 Thread-safety analysis: ignore edges from throw expressions in CFG.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172858 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 22:15:45 +00:00
Richard Smith 79188aec47 Include ubsan runtime even when building a shared library. We don't require the executable to be linked with UBSan.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172856 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 22:09:26 +00:00
Akira Hatanaka dbee949171 [mips] Enable inlining of atomic ops on mips32 and mips64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172855 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 21:58:11 +00:00
Bill Wendling e67e4c93df Use the AttributeSet query method instead of the Attribute method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172849 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 21:26:07 +00:00
Argyrios Kyrtzidis f953276b61 [PCH/Modules] Re-apply r172620 and r172629, now with 100% less infinite loops!
Makes sure that a deserialized macro is only added to the preprocessor macro definitions only once.
Unfortunately I couldn't get a reduced test case.

rdar://13016031

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172843 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 20:59:01 +00:00
Nico Weber 55fc3a767b Fix parsing of class specifiers before '\n' 'operator'.
r159549 / r159164 regressed clang to reject

  struct s {};
  struct s
  operator++(struct s a)
  { return a; }

This fixes the regression. Richard, pleas check if this looks right.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172834 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 18:41:42 +00:00
Jordan Rose e02be97811 [analyzer] Special path notes for C++ special member functions.
Examples:
  Calling implicit default constructor for Foo
  Calling defaulted move constructor for Foo
  Calling copy constructor for Foo
  Calling implicit destructor for Foo
  Calling defaulted move assignment operator for Foo
  Calling copy assignment operator for Foo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172833 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 18:27:21 +00:00
Jordan Rose dc47c9a71c [analyzer] Do a better job describing C++ member functions in the call stack.
Examples:
  Calling constructor for 'Foo'
  Entered call from 'Foo::create'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172832 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 18:27:14 +00:00
Manuel Klimek ba287dc2fa Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172831 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 18:24:28 +00:00
Manuel Klimek 4c12812835 Fixes issues around pulling in the next line in simple if statements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172822 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 14:46:43 +00:00
NAKAMURA Takumi ea8bca7679 clang/test/CodeGen: Suppress a couple of tests on win32. It seems -fsanitize-blacklist doesn't accept DOSish pathnames.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172820 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 14:11:04 +00:00
Manuel Klimek 525fe168c2 Fixes problems with line merging in the face of preprocessor directives.
This patch prepares being able to test for and fix more problems (see
FIXME in the test for example).

Previously we would output unwrapped lines for preprocessor directives
at the point where we also parsed the hash token. Since often
projections only terminate (and thus output their own unwrapped line)
after peeking at the next token, this would lead to the formatter seeing
the preprocessor directives out-of-order (slightly earlier). To be able
to correctly identify lines to merge, the formatter needs a well-defined
order of unwrapped lines, which this patch introduces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172819 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 14:04:34 +00:00
NAKAMURA Takumi b8238b6f20 clang-check: Introduce llvm::sys::PrintStackTraceOnErrorSignal()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172818 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 13:46:48 +00:00
Will Dietz 4f45bc099f [ubsan] Add support for -fsanitize-blacklist
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172808 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 11:30:38 +00:00
Daniel Jasper c79afdae8a Reduce penalty for splitting between ")" and ".".
').' is likely part of a builder pattern statement.
This is based upon a patch developed by Nico Weber. Thank you!

Before:
int foo() {
  return llvm::StringSwitch<Reference::Kind>(name).StartsWith(
      ".eh_frame_hdr", ORDER_EH_FRAMEHDR).StartsWith(
      ".eh_frame", ORDER_EH_FRAME).StartsWith(".init", ORDER_INIT).StartsWith(
      ".fini", ORDER_FINI).StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);
}

After:
int foo() {
  return llvm::StringSwitch<Reference::Kind>(name)
         .StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
         .StartsWith(".eh_frame", ORDER_EH_FRAME)
         .StartsWith(".init", ORDER_INIT).StartsWith(".fini", ORDER_FINI)
         .StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);
}

Probably not ideal, but makes many cases much more readable.

The changes to overriding-ftemplate-comments.cpp don't seem better or
worse. We should address those soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172804 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 10:56:38 +00:00
Daniel Jasper 7d1185de44 Also align trailing line comments in include directives.
Before:
  #include <a> // for x
  #include <a/b/c> // for yz
After:
  #include <a>     // for x
  #include <a/b/c> // for yz

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172799 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 09:19:33 +00:00
Daniel Jasper dcc2a6269b Let the formatter align trailing line comments where possible.
Before:
int a; // comment
int bbbbb; // comment

After:
int a;     // comment
int bbbbb; // comment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172798 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 08:44:07 +00:00
Nico Weber 94fb72932c Formatter: After case blocks, "break" goes on the same line as the "}", PR14907.
Before:
switch (foo) {
case a: {
  int a = g();
  h(a);
}
  break;
}

Now:
switch (foo) {
case a: {
  int a = g();
  h(a);
} break;
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172789 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 05:50:57 +00:00
Nico Weber 5dfe9b47a5 Formatter: Enable @encode test.
This doesn't work right with pointers to pointers, but that's likely just a
dupe of PR14884.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172785 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 05:11:47 +00:00
Douglas Gregor d3b036efdf Revert Clang r172620 and r172629, which caused a hang when building
complicated modules (<rdar://problem/13038265>). Unfortunately, this
un-fixes <rdar://problem/13016031>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172783 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 04:34:14 +00:00
Nico Weber 6a21a556a7 Formatter: The contents of @selector() should be formatted as a selector.
Before: @selector(foo: )
Now: @selector(foo:)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172781 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 02:43:57 +00:00
Douglas Gregor f373c5d0b7 When checking the parameter types of an Objective-C method, don't
decay the parameter type immediately; let CheckParameter() do its
job. Fixes <rdar://problem/12071218>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172780 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 01:41:40 +00:00
Chad Rosier 96bd14bf58 [ms-inline asm] Test case for r172773.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172774 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 00:51:29 +00:00
Douglas Gregor 92d1387ca9 One can override an Objective-C ARC ownership qualifier that came from
a template parameter; make that also include one that came from
'auto'. Fixes <rdar://problem/12078752>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172770 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 23:59:28 +00:00
Richard Smith ba57183965 Some builtins do not evaluate their arguments. Teach EvaluatedExprVisitor not
to visit them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172769 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 23:46:04 +00:00
Douglas Gregor 02dd798309 In Objective-C ARC, completely ignore ownership qualifiers on the
return type of a function by canonicalizing them away. They are
useless anyway, and conflict with our rules for template argument
deduction and __strong. Fixes <rdar://problem/12367446>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172768 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 23:36:45 +00:00
Anna Zaks fa2b53c578 [analyzer] DirectIvarAssignment: allow suppression annotation on Ivars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172766 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 23:24:58 +00:00
Richard Smith 1a2dcd55a1 Defer checking for unsequenced operations on the RHS of && and || in order to
reduce stack usage and hopefully bring back the linux x86_64 buildbot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172765 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 23:18:09 +00:00
Jordan Rose cdbe1e0d85 Format strings: don't ever convert %+d to %lu.
Presumably, if the printf format has the sign explicitly requested, the user
wants to treat the data as signed.

This is a fix-up for r172739, and also includes several test changes that
didn't make it into that commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172762 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 22:34:10 +00:00
Richard Smith de03c15ad9 Parsing support for C11's _Noreturn keyword. No semantics yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172761 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 22:16:11 +00:00
Richard Smith 995e4a7530 -Wunsequenced: if the LHS of an &&, || or ?: is not constant, check for
unsequenced operations in the RHS. We don't compare the RHS with the rest of
the expression yet; such checks will need care to avoid diagnosing unsequenced
operations which are both in conditionally-evaluated subexpressions which
actually can't occur together, such as in '(b && ++x) + (!b && ++x)'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172760 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 22:06:26 +00:00
Kevin Enderby 0234179282 We want the dwarf AT_producer for assembly source files to match clang's
AT_producer.  Which includes clang's version information so we can tell
which version of the compiler was used.

This is second of the two steps to allow us to do this.  The first was a
change to llvm-mc with revision 172630 to provide a method to set the
AT_producer string.  This second step has the clang driver passing the value
of getClangFullVersion() via the new flag -dwarf-debug-producer when invoking
the integrated assembler on assembly source files.  Then using the new
setDwarfDebugProducer() method to set the AT_producer string.

rdar://12888242


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172758 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 21:38:06 +00:00
Peter Collingbourne 17d481fb97 Do not pass -pie flag to linker if -shared specified. This matches
the gcc driver and makes it possible to add -pie to $CC or similar and
have it apply in the right places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172753 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 20:17:16 +00:00
Chad Rosier 205ecf0193 [ms-inline asm] Updates and test case for r172743.
Part of rdar://12576868

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172744 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 19:22:48 +00:00
Chad Rosier b8b5cbc169 [ms-inline asm] Extend the Sema interface to get the size and length of a
VarDecl.
Part of rdar://12576868

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172742 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 19:21:24 +00:00
Jordan Rose 242ae3d680 Format strings: correct signedness if already correcting width (%d,%u).
It is valid to do this:
  printf("%u", (int)x);

But if we see this:
  printf("%lu", (int)x);

...our fixit should suggest %d, not %u.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172739 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 18:47:16 +00:00