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

35111 Коммитов

Автор SHA1 Сообщение Дата
Anna Zaks 87cb5bed50 [analyzer] Malloc cleanup:
- We should not evaluate strdup in the Malloc Checker, it's the job of
CString checker, so just update the RefState to reflect allocated
memory.

- Refactor to reduce LOC: remove some wrapper auxiliary functions, make
all functions return the state and add the transition in one place
(instead of in each auxiliary function).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151188 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 19:24:52 +00:00
Joerg Sonnenberger 8a988c32b8 Revert part of r148839 and keep DefaultTargetTriple in the form adjusted
by -target and similar options. As discussed in PR 12026, the change
broke support for target-prefixed tools, i.e. calling x86_64--linux-ld
when compiling for x86_64--linux. Improve the test cases added
originally in r149083 to not require execution, just executable files.
Document the hack with appropiate FIXME comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151185 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 19:15:16 +00:00
Chad Rosier b211a4b32a Add clang crash diagnostic info and associated flags to Clang user manual.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151184 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 19:14:46 +00:00
Ted Kremenek 2775b935fb Update set-xcode-analyzer to work with Xcode repackaging in Xcode 4.3
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151179 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 18:44:35 +00:00
Chad Rosier 61b83c0eae Add new driver warning from r151174 to a warning group. Please let me know if this isn't the appropriate grouping.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151177 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 18:18:48 +00:00
Fariborz Jahanian 72c88f13f7 modern objc translator. more writing of modern ivar access
abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151176 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 18:13:25 +00:00
Chad Rosier 2dd17a15dd [driver] Add a warning for when -mcpu= is specified without an argument. There
are likely many other OPT_xxxx_EQ options that could/should be added here.
rdar://10704648



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151174 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 17:55:22 +00:00
Sebastian Redl 5b38a0f98e Doug's review comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151173 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 17:38:04 +00:00
Sebastian Redl 0f5a1930cc Unwind path cleanup for array new list initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151172 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 17:37:59 +00:00
Sebastian Redl 9203647221 CodeGen for array new list initializers. Doesn't correctly clean up in the face of exceptions yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151171 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 17:37:52 +00:00
Douglas Gregor b734e2437d Teach overload resolution to prefer user-defined conversion via a
lambda closure type's function pointer conversion over user-defined
conversion via a lambda closure type's block pointer conversion,
always. This is a preference for more-standard code (since blocks
are an extension)  and a nod to efficiency, since function pointers
don't require any memory management. Fixes PR12063.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151170 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 17:32:19 +00:00
Sebastian Redl 33deb35535 Fix parsing and processing initializer lists in return statements and as direct member initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151155 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 10:50:08 +00:00
Hans Wennborg 76517426dc Warn about non-standard format strings (pr12017)
This adds the -Wformat-non-standard flag (off by default,
enabled by -pedantic), which warns about non-standard
things in format strings (such as the 'q' length modifier,
the 'S' conversion specifier, etc.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151154 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 10:17:01 +00:00
Bill Wendling 341785ec52 More ArrayRef-ification of methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151152 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 09:51:33 +00:00
Bill Wendling 4fe5be028b ArrayRef-icize the function arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151151 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 09:38:11 +00:00
Bill Wendling 795b10062c Use an ArrayRef when we can instead of passing in a SmallVectorImpl reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151150 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 09:30:11 +00:00
Sebastian Redl 428c620478 Throw away stray CXXDefaultArgExprs. Fixes PR12061.
I think there's a deeper problem here in the way TransformCXXConstructExpr works, but I won't tackle it now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151146 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 09:07:21 +00:00
Francois Pichet d77177a752 In -fdelayed-template-parsing mode, reenter every scope when late parsing a templated function; (Not just the template parameter scope as previously). Also enter the scope stack in the correct order.
Otherwise this breaks some invariant during name lookup especially when dealing with shadowed declaration

Fix PR11931.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151140 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 08:25:53 +00:00
Richard Smith 0635aa75ab Accept braced-init-lists in conditions, and, in passing, dramatically improve
the diagnostic for using a parenthesized direct-initializer in a condition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151137 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 06:49:09 +00:00
Eli Friedman b1e3f324b0 Make sure null initialization in arrays works correctly with ARC types. <rdar://problem/10907547>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151133 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 05:38:59 +00:00
Douglas Gregor ac1303eca6 Generate an AST for the conversion from a lambda closure type to a
block pointer that returns a block literal which captures (by copy)
the lambda closure itself. Some aspects of the block literal are left
unspecified, namely the capture variable (which doesn't actually
exist) and the body (which will be filled in by IRgen because it can't
be written as an AST).

Because we're switching to this model, this patch also eliminates
tracking the copy-initialization expression for the block capture of
the conversion function, since that information is now embedded in the
synthesized block literal. -1 side tables FTW.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151131 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 05:02:47 +00:00
Eli Friedman e9ee382c32 Improve diagnostics a bit for bad member initializers, and fix an obscure bug involving packs. Fixes PR12049.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151130 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 04:49:04 +00:00
NAKAMURA Takumi de40d3be58 test/CodeGenCXX/thiscall-struct-return.cpp: Relax expressions for -Asserts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151126 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 03:36:54 +00:00
Anna Zaks 60a1fa497b [analyzer] Malloc checker: mark 'strdup' and 'strndup' as allocators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151124 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 03:14:20 +00:00
Aaron Ballman 6c60c8d746 Adding support for Microsoft's thiscall calling convention. Clang side of the patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151122 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 03:04:13 +00:00
Anna Zaks d9ab7bbbd4 [analyzer] Malloc: fix another false positive.
, when we return a symbol reachable to the malloced one via pointer
arithmetic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151121 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 02:36:01 +00:00
Anna Zaks 5fdadf4b64 [analyzer] Change naming in bug reports "tainted" -> "untrusted"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151120 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 02:35:58 +00:00
Argyrios Kyrtzidis e0d92a4307 [libclang] Index the field references of a designated initializer, rdar://10906206
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151118 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 02:10:41 +00:00
Richard Smith 76f3f69db1 Implement C++11 [expr.call]p11: If the operand to a decltype-specifier is a
function call (or a comma expression with a function call on its right-hand
side), possibly parenthesized, then the return type is not required to be
complete and a temporary is not bound. Other subexpressions inside a decltype
expression do not get this treatment.

This is implemented by deferring the relevant checks for all calls immediately
within a decltype expression, then, when the expression is fully-parsed,
checking the relevant constraints and stripping off any top-level temporary
binding.

Deferring the completion of the return type exposed a bug in overload
resolution where completion of the argument types was not attempted, which
is also fixed by this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151117 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 02:04:18 +00:00
Kaelyn Uhrain e43fe993a0 Fix typo correction of template arguments to once again allow type names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151112 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 01:03:07 +00:00
Chad Rosier 2639ac628c Provide a way to disable auto-generation of preprocessed files during clang
crash.  This can speedup the process of generating a delta reduced test case.
rdar://10905465


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151109 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22 00:30:39 +00:00
Fariborz Jahanian 5731778828 modern objc translator: fixes a bug where a class declaration with not
any implementation in tu was not being translated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151106 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 23:58:41 +00:00
Fariborz Jahanian e7b3fa7359 objective-c modern translator. accessing ivars using modern abi - wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151103 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 23:46:48 +00:00
Argyrios Kyrtzidis f775c7b057 Make sure Stmt::dump() is included in libclang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151102 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 23:41:58 +00:00
Douglas Gregor fccfb625e3 In the conflict between C++11 [expr.prim.general]p4, which declares
that 'this' can be used in the brace-or-equal-initializer of a
non-static data member, and C++11 [expr.prim.lambda]p9, which says
that lambda expressions not in block scope can have no captures, side
fully with C++11 [expr.prim.general]p4 by allowing 'this' to be
captured within these initializers. This seems to be the intent of
non-static data member initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151101 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 22:51:27 +00:00
Eli Friedman 51e47df5a5 Fix a crash in the diangostic code in EvalConstant. PR12043.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151100 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 22:41:33 +00:00
Eric Christopher 2789d8e753 No need to go to object file, -emit-llvm is sufficient to see if clang
itself crashes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151095 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 22:25:20 +00:00
Chandler Carruth e3bab98b2c Skip testing the crtbegin.o, and resume using a single variable for the
prefixes. It seems only crtbegin.o uses the strange formatting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151094 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 22:21:50 +00:00
Chandler Carruth 6ce2341545 Clean up, add some documentation, and make this test return to checking
the linker toolchainness a bit more thoroughly. It used to work this
way, but hit buildbot issues. Hopefully subsequent fixes have addressed
those problems, but I'll be watching the bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151090 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 21:51:40 +00:00
John McCall 977ea7864a Don't crash on attempts to synthesize an invalid property.
rdar://problem/10904479

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151089 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 21:48:05 +00:00
Richard Trieu c95d01f838 Redirect the output to /dev/null. This prevents the output from cluttering
up the build enviroment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151087 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 21:40:05 +00:00
Douglas Gregor b09ab8c293 Only pop the expression evaluation context corresponding to a lambda
expression after we've finished the function body of the corresponding
function call operator. Otherwise, ActOnFinishFunctionBody() will see
the (unfinished) evaluation context of the lambda expression
itself. Fixes PR12031.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151082 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 20:05:31 +00:00
Richard Smith e38fa1866e Don't assume that a valid expression for the first part of a for-statement
is non-null when diagnosing a broken attempt to write a for-range-statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151081 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 20:01:35 +00:00
Jean-Daniel Dupas f57c413e44 When calling a non variadic format function(vprintf, vscanf, NSLogv, …), warn if the format string argument is a parameter that is not itself declared as a format string with compatible format.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151080 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 20:00:53 +00:00
Douglas Gregor f4b7de1cef Improve our handling of lambda expressions that occur within default
arguments. There are two aspects to this:

  - Make sure that when marking the declarations referenced in a
  default argument, we don't try to mark local variables, both because
  it's a waste of time and because the semantics are wrong: we're not
  in a place where we could capture these variables again even if it
  did make sense.
  - When a lambda expression occurs in a default argument of a
  function template, make sure that the corresponding closure type is
  considered dependent, so that it will get properly instantiated. The
  second bit is a bit of a hack; to fix it properly, we may have to
  rearchitect our handling of default arguments, parsing them only
  after creating the function definition. However, I'd like to
  separate that work from the lambdas work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151076 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 19:11:17 +00:00
Jeffrey Yasskin f18a87b1ce Allow linux builds to take advantage of libunwind to get unwind.h if
that's installed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 16:20:12 +00:00
Argyrios Kyrtzidis b5f2c41984 Also mark Type's dump() as 'used' to make it available in libclang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151037 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 06:12:38 +00:00
Craig Topper a7b07fd0e1 Remove comma from end of enum to silence build warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151036 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 05:39:57 +00:00
Argyrios Kyrtzidis 0ee7d94ece Mark a few 'dump' methods as 'used' to make sure they are included in libclang
and useable while debugging.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151033 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 05:04:44 +00:00
Douglas Gregor 5878cbcfaa Implement non-internal linkage for lambda closure types that need a
stable mangling, since these lambdas can end up in multiple
translation units. Sema is responsible for deciding when this is the
case, because it's already responsible for choosing the mangling
number.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151029 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 04:17:39 +00:00