]> granicus.if.org Git - clang/log
clang
12 years agoTweak C++ status table:
Douglas Gregor [Thu, 23 Feb 2012 03:10:24 +0000 (03:10 +0000)]
Tweak C++ status table:
  - Apparently, SVN is yellow
  - Note that initializer lists are "in progress"

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

12 years agoClang now supports lambda expressions.
Douglas Gregor [Thu, 23 Feb 2012 03:02:32 +0000 (03:02 +0000)]
Clang now supports lambda expressions.

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

12 years agoTry to handle qualifiers more consistently for array InitListExprs. Fixes <rdar...
Eli Friedman [Thu, 23 Feb 2012 02:25:10 +0000 (02:25 +0000)]
Try to handle qualifiers more consistently for array InitListExprs.  Fixes <rdar://problem/10907510>, and makes the ASTs a bit more self-consistent.

(I've chosen to keep the qualifiers, but it isn't a strong preference; if anyone prefers removing them, please yell.)

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

12 years agoUpdate parser's disambiguation to cope with braced function-style casts in
Richard Smith [Thu, 23 Feb 2012 01:36:12 +0000 (01:36 +0000)]
Update parser's disambiguation to cope with braced function-style casts in
C++11, and with braced-init-list initializers in conditions. This exposed an
ambiguity with enum underlying types versus bitfields, which we resolve by
treating 'enum E : T {' as always defining an enumeration (even if it would
only successfully parse as a bitfield). This appears to be g++ compatible.

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

12 years agoTurned on support for __declspec(deprecated) in MS compatibility mode.
Aaron Ballman [Thu, 23 Feb 2012 01:19:31 +0000 (01:19 +0000)]
Turned on support for __declspec(deprecated) in MS compatibility mode.

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

12 years ago[analyzer] Invalidate the region passed to pthread_setspecific() call.
Anna Zaks [Thu, 23 Feb 2012 01:05:27 +0000 (01:05 +0000)]
[analyzer] Invalidate the region passed to pthread_setspecific() call.

Make this call an exception in ExprEngine::invalidateArguments:
'int pthread_setspecific(ptheread_key k, const void *)' stores
a value into thread local storage. The value can later be retrieved
with 'void *ptheread_getspecific(pthread_key)'. So even thought the
parameter is 'const void *', the region escapes through the
call.

(Here we just blacklist the call in the ExprEngine's default
logic. Another option would be to add a checker which evaluates
the call and triggers the call to invalidate regions.)

Teach the Malloc Checker, which treats all system calls as safe about
the API.

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

12 years agoTweak release note comments for checker build.
Ted Kremenek [Thu, 23 Feb 2012 00:48:17 +0000 (00:48 +0000)]
Tweak release note comments for checker build.

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

12 years agoUpdate checker build to checker-261.
Ted Kremenek [Thu, 23 Feb 2012 00:47:09 +0000 (00:47 +0000)]
Update checker build to checker-261.

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

12 years agoAdd a quick TODO.
Eric Christopher [Thu, 23 Feb 2012 00:43:12 +0000 (00:43 +0000)]
Add a quick TODO.

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

12 years agoFold debug scope emission into the cleanup scope.
Eric Christopher [Thu, 23 Feb 2012 00:43:07 +0000 (00:43 +0000)]
Fold debug scope emission into the cleanup scope.

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

12 years agoanother test for modern ivar access rewrite.
Fariborz Jahanian [Wed, 22 Feb 2012 22:32:05 +0000 (22:32 +0000)]
another test for modern ivar access rewrite.

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

12 years agoRevert r151172: Unwind path cleanup for array new list initializers.
Chad Rosier [Wed, 22 Feb 2012 21:36:06 +0000 (21:36 +0000)]
Revert r151172: Unwind path cleanup for array new list initializers.

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

12 years agomore tests for modern objc translator.
Fariborz Jahanian [Wed, 22 Feb 2012 21:13:49 +0000 (21:13 +0000)]
more tests for modern objc translator.

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

12 years agoImprove placement of clang crash diagnostics section.
Chad Rosier [Wed, 22 Feb 2012 20:26:10 +0000 (20:26 +0000)]
Improve placement of clang crash diagnostics section.

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

12 years ago[analyzer] Malloc cleanup:
Anna Zaks [Wed, 22 Feb 2012 19:24:52 +0000 (19:24 +0000)]
[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

12 years agoRevert part of r148839 and keep DefaultTargetTriple in the form adjusted
Joerg Sonnenberger [Wed, 22 Feb 2012 19:15:16 +0000 (19:15 +0000)]
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

12 years agoAdd clang crash diagnostic info and associated flags to Clang user manual.
Chad Rosier [Wed, 22 Feb 2012 19:14:46 +0000 (19:14 +0000)]
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

12 years agoUpdate set-xcode-analyzer to work with Xcode repackaging in Xcode 4.3
Ted Kremenek [Wed, 22 Feb 2012 18:44:35 +0000 (18:44 +0000)]
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

12 years agoAdd new driver warning from r151174 to a warning group. Please let me know if this...
Chad Rosier [Wed, 22 Feb 2012 18:18:48 +0000 (18:18 +0000)]
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

12 years agomodern objc translator. more writing of modern ivar access
Fariborz Jahanian [Wed, 22 Feb 2012 18:13:25 +0000 (18:13 +0000)]
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

12 years ago[driver] Add a warning for when -mcpu= is specified without an argument. There
Chad Rosier [Wed, 22 Feb 2012 17:55:22 +0000 (17:55 +0000)]
[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

12 years agoDoug's review comments.
Sebastian Redl [Wed, 22 Feb 2012 17:38:04 +0000 (17:38 +0000)]
Doug's review comments.

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

12 years agoUnwind path cleanup for array new list initializers.
Sebastian Redl [Wed, 22 Feb 2012 17:37:59 +0000 (17:37 +0000)]
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

12 years agoCodeGen for array new list initializers. Doesn't correctly clean up in the face of...
Sebastian Redl [Wed, 22 Feb 2012 17:37:52 +0000 (17:37 +0000)]
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

12 years agoTeach overload resolution to prefer user-defined conversion via a
Douglas Gregor [Wed, 22 Feb 2012 17:32:19 +0000 (17:32 +0000)]
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

12 years agoFix parsing and processing initializer lists in return statements and as direct membe...
Sebastian Redl [Wed, 22 Feb 2012 10:50:08 +0000 (10:50 +0000)]
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

12 years agoWarn about non-standard format strings (pr12017)
Hans Wennborg [Wed, 22 Feb 2012 10:17:01 +0000 (10:17 +0000)]
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

12 years agoMore ArrayRef-ification of methods.
Bill Wendling [Wed, 22 Feb 2012 09:51:33 +0000 (09:51 +0000)]
More ArrayRef-ification of methods.

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

12 years agoArrayRef-icize the function arguments.
Bill Wendling [Wed, 22 Feb 2012 09:38:11 +0000 (09:38 +0000)]
ArrayRef-icize the function arguments.

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

12 years agoUse an ArrayRef when we can instead of passing in a SmallVectorImpl reference.
Bill Wendling [Wed, 22 Feb 2012 09:30:11 +0000 (09:30 +0000)]
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

12 years agoThrow away stray CXXDefaultArgExprs. Fixes PR12061.
Sebastian Redl [Wed, 22 Feb 2012 09:07:21 +0000 (09:07 +0000)]
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

12 years agoIn -fdelayed-template-parsing mode, reenter every scope when late parsing a templated...
Francois Pichet [Wed, 22 Feb 2012 08:25:53 +0000 (08:25 +0000)]
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

12 years agoAccept braced-init-lists in conditions, and, in passing, dramatically improve
Richard Smith [Wed, 22 Feb 2012 06:49:09 +0000 (06:49 +0000)]
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

12 years agoMake sure null initialization in arrays works correctly with ARC types. <rdar:/...
Eli Friedman [Wed, 22 Feb 2012 05:38:59 +0000 (05:38 +0000)]
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

12 years agoGenerate an AST for the conversion from a lambda closure type to a
Douglas Gregor [Wed, 22 Feb 2012 05:02:47 +0000 (05:02 +0000)]
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

12 years agoImprove diagnostics a bit for bad member initializers, and fix an obscure bug involvi...
Eli Friedman [Wed, 22 Feb 2012 04:49:04 +0000 (04:49 +0000)]
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

12 years agotest/CodeGenCXX/thiscall-struct-return.cpp: Relax expressions for -Asserts.
NAKAMURA Takumi [Wed, 22 Feb 2012 03:36:54 +0000 (03:36 +0000)]
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

12 years ago[analyzer] Malloc checker: mark 'strdup' and 'strndup' as allocators.
Anna Zaks [Wed, 22 Feb 2012 03:14:20 +0000 (03:14 +0000)]
[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

12 years agoAdding support for Microsoft's thiscall calling convention. Clang side of the patch.
Aaron Ballman [Wed, 22 Feb 2012 03:04:13 +0000 (03:04 +0000)]
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

12 years ago[analyzer] Malloc: fix another false positive.
Anna Zaks [Wed, 22 Feb 2012 02:36:01 +0000 (02:36 +0000)]
[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

12 years ago[analyzer] Change naming in bug reports "tainted" -> "untrusted"
Anna Zaks [Wed, 22 Feb 2012 02:35:58 +0000 (02:35 +0000)]
[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

12 years ago[libclang] Index the field references of a designated initializer, rdar://10906206
Argyrios Kyrtzidis [Wed, 22 Feb 2012 02:10:41 +0000 (02:10 +0000)]
[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

12 years agoImplement C++11 [expr.call]p11: If the operand to a decltype-specifier is a
Richard Smith [Wed, 22 Feb 2012 02:04:18 +0000 (02:04 +0000)]
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

12 years agoFix typo correction of template arguments to once again allow type names.
Kaelyn Uhrain [Wed, 22 Feb 2012 01:03:07 +0000 (01:03 +0000)]
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

12 years agoProvide a way to disable auto-generation of preprocessed files during clang
Chad Rosier [Wed, 22 Feb 2012 00:30:39 +0000 (00:30 +0000)]
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

12 years agomodern objc translator: fixes a bug where a class declaration with not
Fariborz Jahanian [Tue, 21 Feb 2012 23:58:41 +0000 (23:58 +0000)]
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

12 years agoobjective-c modern translator. accessing ivars using modern abi - wip.
Fariborz Jahanian [Tue, 21 Feb 2012 23:46:48 +0000 (23:46 +0000)]
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

12 years agoMake sure Stmt::dump() is included in libclang.
Argyrios Kyrtzidis [Tue, 21 Feb 2012 23:41:58 +0000 (23:41 +0000)]
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

12 years agoIn the conflict between C++11 [expr.prim.general]p4, which declares
Douglas Gregor [Tue, 21 Feb 2012 22:51:27 +0000 (22:51 +0000)]
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

12 years agoFix a crash in the diangostic code in EvalConstant. PR12043.
Eli Friedman [Tue, 21 Feb 2012 22:41:33 +0000 (22:41 +0000)]
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

12 years agoNo need to go to object file, -emit-llvm is sufficient to see if clang
Eric Christopher [Tue, 21 Feb 2012 22:25:20 +0000 (22:25 +0000)]
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

12 years agoSkip testing the crtbegin.o, and resume using a single variable for the
Chandler Carruth [Tue, 21 Feb 2012 22:21:50 +0000 (22:21 +0000)]
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

12 years agoClean up, add some documentation, and make this test return to checking
Chandler Carruth [Tue, 21 Feb 2012 21:51:40 +0000 (21:51 +0000)]
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

12 years agoDon't crash on attempts to synthesize an invalid property.
John McCall [Tue, 21 Feb 2012 21:48:05 +0000 (21:48 +0000)]
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

12 years agoRedirect the output to /dev/null. This prevents the output from cluttering
Richard Trieu [Tue, 21 Feb 2012 21:40:05 +0000 (21:40 +0000)]
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

12 years agoOnly pop the expression evaluation context corresponding to a lambda
Douglas Gregor [Tue, 21 Feb 2012 20:05:31 +0000 (20:05 +0000)]
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

12 years agoDon't assume that a valid expression for the first part of a for-statement
Richard Smith [Tue, 21 Feb 2012 20:01:35 +0000 (20:01 +0000)]
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

12 years agoWhen calling a non variadic format function(vprintf, vscanf, NSLogv, …), warn if...
Jean-Daniel Dupas [Tue, 21 Feb 2012 20:00:53 +0000 (20:00 +0000)]
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

12 years agoImprove our handling of lambda expressions that occur within default
Douglas Gregor [Tue, 21 Feb 2012 19:11:17 +0000 (19:11 +0000)]
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

12 years agoAllow linux builds to take advantage of libunwind to get unwind.h if
Jeffrey Yasskin [Tue, 21 Feb 2012 16:20:12 +0000 (16:20 +0000)]
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

12 years agoAlso mark Type's dump() as 'used' to make it available in libclang.
Argyrios Kyrtzidis [Tue, 21 Feb 2012 06:12:38 +0000 (06:12 +0000)]
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

12 years agoRemove comma from end of enum to silence build warning.
Craig Topper [Tue, 21 Feb 2012 05:39:57 +0000 (05:39 +0000)]
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

12 years agoMark a few 'dump' methods as 'used' to make sure they are included in libclang
Argyrios Kyrtzidis [Tue, 21 Feb 2012 05:04:44 +0000 (05:04 +0000)]
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

12 years agoImplement non-internal linkage for lambda closure types that need a
Douglas Gregor [Tue, 21 Feb 2012 04:17:39 +0000 (04:17 +0000)]
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

12 years agoRemove svn:eol-style on the test I just added.
Nico Weber [Tue, 21 Feb 2012 03:52:52 +0000 (03:52 +0000)]
Remove svn:eol-style on the test I just added.

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

12 years agoAdd a test case for r150976.
Nico Weber [Tue, 21 Feb 2012 03:52:05 +0000 (03:52 +0000)]
Add a test case for r150976.

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

12 years agoImplement name mangling for lambda expressions that occur within the
Douglas Gregor [Tue, 21 Feb 2012 02:22:07 +0000 (02:22 +0000)]
Implement name mangling for lambda expressions that occur within the
initializers of data members (both static and non-static).

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

12 years agoAdding a test case for the working-directory fix
Aaron Ballman [Tue, 21 Feb 2012 00:56:50 +0000 (00:56 +0000)]
Adding a test case for the working-directory fix

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

12 years agoHave ScanReachableSymbols reported reachable regions. Fixes a false positive with...
Ted Kremenek [Tue, 21 Feb 2012 00:46:29 +0000 (00:46 +0000)]
Have ScanReachableSymbols reported reachable regions.  Fixes a false positive with nested array literals.  <rdar://problem/10686586>

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

12 years agoImplement name mangling for lambda expressions that occur within the
Douglas Gregor [Tue, 21 Feb 2012 00:37:24 +0000 (00:37 +0000)]
Implement name mangling for lambda expressions that occur within the
default arguments of function parameters. This simple-sounding task is
complicated greatly by two issues:

  (1) Default arguments aren't actually a real context, so we need to
  maintain extra state within lambda expressions to track when a
  lambda was actually in a default argument.
  (2) At the time that we parse a default argument, the FunctionDecl
  doesn't exist yet, so lambda closure types end up in the enclosing
  context. It's not clear that we ever want to change that, so instead
  we introduce the notion of the "effective" context of a declaration
  for the purposes of name mangling.

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

12 years agoEmit the exact size for the invariant intrinsics.
Nick Lewycky [Tue, 21 Feb 2012 00:26:58 +0000 (00:26 +0000)]
Emit the exact size for the invariant intrinsics.

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

12 years ago[analyzer] + a couple more malloc tests.
Anna Zaks [Tue, 21 Feb 2012 00:00:48 +0000 (00:00 +0000)]
[analyzer] + a couple more malloc tests.

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

12 years ago[analyzer] Make KeyChainAPI checker inlining-aware.
Anna Zaks [Tue, 21 Feb 2012 00:00:44 +0000 (00:00 +0000)]
[analyzer] Make KeyChainAPI checker inlining-aware.

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

12 years agoMake RequireLiteralType work correctly with incomplete array types. PR12037.
Eli Friedman [Mon, 20 Feb 2012 23:58:14 +0000 (23:58 +0000)]
Make RequireLiteralType work correctly with incomplete array types.  PR12037.

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

12 years ago[PCH] Recover gracefully if the ASTReader detects that a file is different
Argyrios Kyrtzidis [Mon, 20 Feb 2012 23:58:07 +0000 (23:58 +0000)]
[PCH] Recover gracefully if the ASTReader detects that a file is different
from the one stored in the PCH/AST, while trying to load a SLocEntry.

We verify that all files of the PCH did not change before loading it but this is not enough because:

- The AST may have been 1) kept around, 2) to do queries on it.
- We may have 1) verified the PCH and 2) started parsing.

Between 1) and 2) files may change and we are going to have crashes because the rest of clang
cannot deal with the ASTReader failing to read a SLocEntry.

Handle this by recovering gracefully in such a case, by initializing the SLocEntry
with the info from the PCH/AST as well as reporting failure by the ASTReader.

rdar://10888929

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

12 years agoFix a constexpr FIXME: When implicitly instantiating the primary template for an
Richard Smith [Mon, 20 Feb 2012 23:28:05 +0000 (23:28 +0000)]
Fix a constexpr FIXME: When implicitly instantiating the primary template for an
explicit specialization of a function template, mark the instantiation as
constexpr if the specialization is, rather than requiring them to match.

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

12 years agoFormatting.
Eric Christopher [Mon, 20 Feb 2012 23:02:36 +0000 (23:02 +0000)]
Formatting.

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

12 years agoMake PreprocessorOptions::DetailedRecordIncludesNestedMacroExpansions false by default.
Argyrios Kyrtzidis [Mon, 20 Feb 2012 22:54:39 +0000 (22:54 +0000)]
Make PreprocessorOptions::DetailedRecordIncludesNestedMacroExpansions false by default.

Recording nested macro expansions is not useful, plus it fixes rdar://10893630

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

12 years agoobjc IRGen: force CSE of load of ivar offsets by setting
Fariborz Jahanian [Mon, 20 Feb 2012 22:42:22 +0000 (22:42 +0000)]
objc IRGen: force CSE of load of ivar offsets by setting
the 'invariant.load' metadata tag onto those loads.
// rdar://10840980

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

12 years ago[analyzer] Make Malloc aware of inter-procedural execution + basic
Anna Zaks [Mon, 20 Feb 2012 22:25:23 +0000 (22:25 +0000)]
[analyzer] Make Malloc aware of inter-procedural execution + basic
tests.

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

12 years ago[analyzer] Testing: These checkers are not experimental anymore.
Anna Zaks [Mon, 20 Feb 2012 21:10:40 +0000 (21:10 +0000)]
[analyzer] Testing: These checkers are not experimental anymore.

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

12 years ago[analyzer] Turn on by default the Malloc Checker and a couple of CString
Anna Zaks [Mon, 20 Feb 2012 21:10:37 +0000 (21:10 +0000)]
[analyzer] Turn on by default the Malloc Checker and a couple of CString
checks:

- unix.Malloc - Checks for memory leaks, double free, use-after-free.
- unix.cstring.NullArg - Checks for null pointers passed as arguments to
CString functions + evaluates CString functions.
- unix.cstring.BadSizeArg - Checks for common anti-patterns in
strncat size argument.

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

12 years agoMake sure that we set up the right declaration contexts when creating
Douglas Gregor [Mon, 20 Feb 2012 20:47:06 +0000 (20:47 +0000)]
Make sure that we set up the right declaration contexts when creating
and introducing the lambda closure type and its function call
operator. Previously, we assumed that the lambda closure type would
land directly in the current context, and not some parent context (as
occurs with linkage specifications). Thanks to Richard for the test case.

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

12 years agomodern objc translator. Finish off first cut of the
Fariborz Jahanian [Mon, 20 Feb 2012 20:09:20 +0000 (20:09 +0000)]
modern objc translator. Finish off first cut of the
modern meta-data translation by commenting out private ivar
declarations in user source. Also, added several tests.

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

12 years agoWhen we resolve the type of an 'auto' variable, clear out the linkage
Douglas Gregor [Mon, 20 Feb 2012 20:05:29 +0000 (20:05 +0000)]
When we resolve the type of an 'auto' variable, clear out the linkage
of that variable; it will need to be recomputed with the resolved
type.

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

12 years agoMake test case less sensitive to metadata numbering.
Chad Rosier [Mon, 20 Feb 2012 19:51:44 +0000 (19:51 +0000)]
Make test case less sensitive to metadata numbering.

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

12 years agoBasic support for name mangling of C++11 lambda expressions. Because
Douglas Gregor [Mon, 20 Feb 2012 19:44:39 +0000 (19:44 +0000)]
Basic support for name mangling of C++11 lambda expressions. Because
name mangling in the Itanium C++ ABI for lambda expressions is so
dependent on context, we encode the number used to encode each lambda
as part of the lambda closure type, and maintain this value within
Sema.

Note that there are a several pieces still missing:
  - We still get the linkage of lambda expressions wrong
  - We aren't properly numbering or mangling lambda expressions that
  occur in default function arguments or in data member initializers.
  - We aren't (de-)serializing the lambda numbering tables

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

12 years agoRemove the type retaining from the clang frontend. This is now
Eric Christopher [Mon, 20 Feb 2012 18:05:24 +0000 (18:05 +0000)]
Remove the type retaining from the clang frontend. This is now
handled by the caching and rauw. Also fix one cache that wasn't
being added to highlighted by this patch. Update all testcases
accordingly.

This should fix the deall failure.

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

12 years agoMake forward declarations for objective-c types use the new
Eric Christopher [Mon, 20 Feb 2012 18:05:04 +0000 (18:05 +0000)]
Make forward declarations for objective-c types use the new
temporary forward declaration nodes. Fixes a problem building
Chrome.

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

12 years ago[clang.py] Format and add documention for Type
Gregory Szorc [Mon, 20 Feb 2012 17:58:40 +0000 (17:58 +0000)]
[clang.py] Format and add documention for Type

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

12 years ago[clang.py] Add tests for Type.is_volatile_qualified and Type.is_restrict_qualified
Gregory Szorc [Mon, 20 Feb 2012 17:58:02 +0000 (17:58 +0000)]
[clang.py] Add tests for Type.is_volatile_qualified and Type.is_restrict_qualified

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

12 years ago[clang.py] Implement Type.argument_types()
Gregory Szorc [Mon, 20 Feb 2012 17:45:30 +0000 (17:45 +0000)]
[clang.py] Implement Type.argument_types()

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

12 years ago[clang.py] Implement Type.__eq__ and Type.__ne__
Gregory Szorc [Mon, 20 Feb 2012 17:44:49 +0000 (17:44 +0000)]
[clang.py] Implement Type.__eq__ and Type.__ne__

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

12 years agoDeserialize the direct-initialization range of a "new" expression
Douglas Gregor [Mon, 20 Feb 2012 16:12:14 +0000 (16:12 +0000)]
Deserialize the direct-initialization range of a "new" expression
properly. Previously, we deserialized it but failed to set the
corresponding member in CXXNewExpr. Fixes <rdar://problem/10893600>.

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

12 years agoFixing the working-directory option so that it stores the proper directory.
Aaron Ballman [Mon, 20 Feb 2012 14:13:25 +0000 (14:13 +0000)]
Fixing the working-directory option so that it stores the proper directory.

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

12 years agoBasic: import IntrusiveRefCntPtr<> into clang namespace
Dylan Noblesmith [Mon, 20 Feb 2012 14:00:23 +0000 (14:00 +0000)]
Basic: import IntrusiveRefCntPtr<> into clang namespace

The class name is long enough without the llvm:: added.
Also bring in RefCountedBase and RefCountedBaseVPTR.

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

12 years agoAdd 3dNOW intrinsic header to x86intrin.h, conditioned on __3dNOW__ to
Chandler Carruth [Mon, 20 Feb 2012 07:35:45 +0000 (07:35 +0000)]
Add 3dNOW intrinsic header to x86intrin.h, conditioned on __3dNOW__ to
match the behavior of GCC. Also add a test for these intrinsics, which
apparently have *zero* tests. =[ Not surprisingly, Clang crashed when
compiling these.

Fix the bug in CodeGen where we failed to bitcast the argument type to
x86mmx prior to calling the LLVM intrinsic. This fixes an assert on the
new 3dnow-builtins.c test.

This is one issue impacting the efforts to get Clang to emulate the
Microsoft intrinsics headers -- 3dnow intrinsics are implictitly made
available there.

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

12 years agoObjCMessageExpr: Don't leave SelLocsKind uninitialized when the send is implicit.
Benjamin Kramer [Mon, 20 Feb 2012 00:20:48 +0000 (00:20 +0000)]
ObjCMessageExpr: Don't leave SelLocsKind uninitialized when the send is implicit.

Fixes PR11929. Found by valgrind.

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

12 years agoSet the location of the template keyword when allocating a new TemplateIdAnnotation.
Benjamin Kramer [Sun, 19 Feb 2012 23:37:39 +0000 (23:37 +0000)]
Set the location of the template keyword when allocating a new TemplateIdAnnotation.

Found by valgrind.

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

12 years agoMake the regular expressions in this test more narrow to ensure we're
Chandler Carruth [Sun, 19 Feb 2012 23:09:50 +0000 (23:09 +0000)]
Make the regular expressions in this test more narrow to ensure we're
actually matching the write substrings, and stop looking for a leading
'/' to try and finish fixing darwin and other hosts.

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