Commit Graph

36148 Commits

Author SHA1 Message Date
Fariborz Jahanian 31ebebfb58 more tests for modern objc translator.
llvm-svn: 151201
2012-02-22 21:13:49 +00:00
Chad Rosier c41c5a8c39 Improve placement of clang crash diagnostics section.
llvm-svn: 151192
2012-02-22 20:26:10 +00:00
Anna Zaks 40a7eb3837 [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).

llvm-svn: 151188
2012-02-22 19:24:52 +00:00
Joerg Sonnenberger 17d7551e73 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.

llvm-svn: 151185
2012-02-22 19:15:16 +00:00
Chad Rosier 35d14d91c2 Add clang crash diagnostic info and associated flags to Clang user manual.
llvm-svn: 151184
2012-02-22 19:14:46 +00:00
Ted Kremenek d87cdd1d11 Update set-xcode-analyzer to work with Xcode repackaging in Xcode 4.3
llvm-svn: 151179
2012-02-22 18:44:35 +00:00
Chad Rosier 14f9cd8739 Add new driver warning from r151174 to a warning group. Please let me know if this isn't the appropriate grouping.
llvm-svn: 151177
2012-02-22 18:18:48 +00:00
Fariborz Jahanian 5e49eb95b5 modern objc translator. more writing of modern ivar access
abi.

llvm-svn: 151176
2012-02-22 18:13:25 +00:00
Chad Rosier ce975d9997 [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

llvm-svn: 151174
2012-02-22 17:55:22 +00:00
Sebastian Redl 74b173e5c8 Doug's review comments.
llvm-svn: 151173
2012-02-22 17:38:04 +00:00
Sebastian Redl 674c77e555 Unwind path cleanup for array new list initializers.
llvm-svn: 151172
2012-02-22 17:37:59 +00:00
Sebastian Redl f862eb6a9f CodeGen for array new list initializers. Doesn't correctly clean up in the face of exceptions yet.
llvm-svn: 151171
2012-02-22 17:37:52 +00:00
Douglas Gregor 2837aa2932 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.

llvm-svn: 151170
2012-02-22 17:32:19 +00:00
Sebastian Redl eef474ce1b Fix parsing and processing initializer lists in return statements and as direct member initializers.
llvm-svn: 151155
2012-02-22 10:50:08 +00:00
Hans Wennborg c9dd946852 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.)

llvm-svn: 151154
2012-02-22 10:17:01 +00:00
Bill Wendling 8eb771d4ca More ArrayRef-ification of methods.
llvm-svn: 151152
2012-02-22 09:51:33 +00:00
Bill Wendling 8ac06afa9b ArrayRef-icize the function arguments.
llvm-svn: 151151
2012-02-22 09:38:11 +00:00
Bill Wendling f1a3fcac0d Use an ArrayRef when we can instead of passing in a SmallVectorImpl reference.
llvm-svn: 151150
2012-02-22 09:30:11 +00:00
Sebastian Redl e7c31a9a22 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.

llvm-svn: 151146
2012-02-22 09:07:21 +00:00
Francois Pichet e6664762ec 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.

llvm-svn: 151140
2012-02-22 08:25:53 +00:00
Richard Smith 2a15b74605 Accept braced-init-lists in conditions, and, in passing, dramatically improve
the diagnostic for using a parenthesized direct-initializer in a condition.

llvm-svn: 151137
2012-02-22 06:49:09 +00:00
Eli Friedman 91d5bb1ee5 Make sure null initialization in arrays works correctly with ARC types. <rdar://problem/10907547>.
llvm-svn: 151133
2012-02-22 05:38:59 +00:00
Douglas Gregor ed90df3800 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.

llvm-svn: 151131
2012-02-22 05:02:47 +00:00
Eli Friedman 7cd4a9ba48 Improve diagnostics a bit for bad member initializers, and fix an obscure bug involving packs. Fixes PR12049.
llvm-svn: 151130
2012-02-22 04:49:04 +00:00
NAKAMURA Takumi 0716b50db6 test/CodeGenCXX/thiscall-struct-return.cpp: Relax expressions for -Asserts.
llvm-svn: 151126
2012-02-22 03:36:54 +00:00
Anna Zaks 199e8e585b [analyzer] Malloc checker: mark 'strdup' and 'strndup' as allocators.
llvm-svn: 151124
2012-02-22 03:14:20 +00:00
Aaron Ballman 3c42441b2c Adding support for Microsoft's thiscall calling convention. Clang side of the patch.
llvm-svn: 151122
2012-02-22 03:04:13 +00:00
Anna Zaks 4ca45b1d00 [analyzer] Malloc: fix another false positive.
, when we return a symbol reachable to the malloced one via pointer
arithmetic.

llvm-svn: 151121
2012-02-22 02:36:01 +00:00
Anna Zaks 3705a1ee10 [analyzer] Change naming in bug reports "tainted" -> "untrusted"
llvm-svn: 151120
2012-02-22 02:35:58 +00:00
Argyrios Kyrtzidis a1bed4cd96 [libclang] Index the field references of a designated initializer, rdar://10906206
llvm-svn: 151118
2012-02-22 02:10:41 +00:00
Richard Smith fd555f6b1f 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.

llvm-svn: 151117
2012-02-22 02:04:18 +00:00
Kaelyn Uhrain 0178200062 Fix typo correction of template arguments to once again allow type names.
llvm-svn: 151112
2012-02-22 01:03:07 +00:00
Chad Rosier 877c0a27f8 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

llvm-svn: 151109
2012-02-22 00:30:39 +00:00
Fariborz Jahanian 8e1118cbd5 modern objc translator: fixes a bug where a class declaration with not
any implementation in tu was not being translated.

llvm-svn: 151106
2012-02-21 23:58:41 +00:00
Fariborz Jahanian c481c0c0f5 objective-c modern translator. accessing ivars using modern abi - wip.
llvm-svn: 151103
2012-02-21 23:46:48 +00:00
Argyrios Kyrtzidis cd90e3d37b Make sure Stmt::dump() is included in libclang.
llvm-svn: 151102
2012-02-21 23:41:58 +00:00
Douglas Gregor b8389976b2 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.

llvm-svn: 151101
2012-02-21 22:51:27 +00:00
Eli Friedman ebea9aff0d Fix a crash in the diangostic code in EvalConstant. PR12043.
llvm-svn: 151100
2012-02-21 22:41:33 +00:00
Eric Christopher 8846b4db30 No need to go to object file, -emit-llvm is sufficient to see if clang
itself crashes.

llvm-svn: 151095
2012-02-21 22:25:20 +00:00
Chandler Carruth 85061b51d2 Skip testing the crtbegin.o, and resume using a single variable for the
prefixes. It seems only crtbegin.o uses the strange formatting.

llvm-svn: 151094
2012-02-21 22:21:50 +00:00
Chandler Carruth 286e0e0818 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.

llvm-svn: 151090
2012-02-21 21:51:40 +00:00
John McCall 24992371a5 Don't crash on attempts to synthesize an invalid property.
rdar://problem/10904479

llvm-svn: 151089
2012-02-21 21:48:05 +00:00
Richard Trieu bd61856d91 Redirect the output to /dev/null. This prevents the output from cluttering
up the build enviroment.

llvm-svn: 151087
2012-02-21 21:40:05 +00:00
Douglas Gregor 5dbc14f47e 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.

llvm-svn: 151082
2012-02-21 20:05:31 +00:00
Richard Smith 9a2b7e820c 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.

llvm-svn: 151081
2012-02-21 20:01:35 +00:00
Jean-Daniel Dupas 58dab6829a 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.
llvm-svn: 151080
2012-02-21 20:00:53 +00:00
Douglas Gregor 680e9e018d 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.

llvm-svn: 151076
2012-02-21 19:11:17 +00:00
Jeffrey Yasskin a09e62a042 Allow linux builds to take advantage of libunwind to get unwind.h if
that's installed.

llvm-svn: 151058
2012-02-21 16:20:12 +00:00
Argyrios Kyrtzidis 90c2e86b63 Also mark Type's dump() as 'used' to make it available in libclang.
llvm-svn: 151037
2012-02-21 06:12:38 +00:00
Craig Topper 90634c4d25 Remove comma from end of enum to silence build warning.
llvm-svn: 151036
2012-02-21 05:39:57 +00:00