]> granicus.if.org Git - clang/log
clang
13 years agoAdd .gitignore file.
Eric Christopher [Mon, 18 Jul 2011 23:05:36 +0000 (23:05 +0000)]
Add .gitignore file.

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

13 years agoCheck column number also.
Devang Patel [Mon, 18 Jul 2011 22:18:04 +0000 (22:18 +0000)]
Check column number also.

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

13 years agoMCContext now takes MCRegisterInfo.
Evan Cheng [Mon, 18 Jul 2011 20:57:51 +0000 (20:57 +0000)]
MCContext now takes MCRegisterInfo.

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

13 years agoThanks to Chandler for reminding me to update the documentation for the
Sean Hunt [Mon, 18 Jul 2011 17:22:33 +0000 (17:22 +0000)]
Thanks to Chandler for reminding me to update the documentation for the
__underlying_type feature.

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

13 years agoRemember to add a has_feature macro for __underlying_type now that it is
Sean Hunt [Mon, 18 Jul 2011 17:08:00 +0000 (17:08 +0000)]
Remember to add a has_feature macro for __underlying_type now that it is
correctly impelmented

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

13 years agoDefine DiagnosticBuilder<<APValue so it's easy to include APValues in
Jeffrey Yasskin [Mon, 18 Jul 2011 16:43:53 +0000 (16:43 +0000)]
Define DiagnosticBuilder<<APValue so it's easy to include APValues in
diagnostics.

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

13 years agoMigrate LLVM and Clang to use the new makeArrayRef(...) functions where previously...
Frits van Bommel [Mon, 18 Jul 2011 12:00:32 +0000 (12:00 +0000)]
Migrate LLVM and Clang to use the new makeArrayRef(...) functions where previously explicit non-default constructors were used.
Mostly mechanical with some manual reformatting.

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

13 years agolib/Headers/mm_malloc.h: Use __mingw_aligned_malloc() in _mm_malloc() on mingw.
NAKAMURA Takumi [Mon, 18 Jul 2011 11:13:50 +0000 (11:13 +0000)]
lib/Headers/mm_malloc.h: Use __mingw_aligned_malloc() in _mm_malloc() on mingw.

By default, mingw does not have _mm_alloc() nor _aligned_malloc().

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

13 years ago[arcmt] When a NSData's 'bytes' family of methods are used on a local var,
Argyrios Kyrtzidis [Mon, 18 Jul 2011 07:44:50 +0000 (07:44 +0000)]
[arcmt] When a NSData's 'bytes' family of methods are used on a local var,
add __attribute__((objc_precise_lifetime)) to make sure that the object
(and its data) will not get released before the var goes out-of-scope.

rdar://9206226

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

13 years ago[arcmt] NSInvocation's [get/set]ReturnValue and [get/set]Argument are only safe
Argyrios Kyrtzidis [Mon, 18 Jul 2011 07:44:45 +0000 (07:44 +0000)]
[arcmt] NSInvocation's [get/set]ReturnValue and [get/set]Argument are only safe
with __unsafe_unretained parameters. Emit error for strong/weak ones. rdar://9206226

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

13 years agoDon't crash when codegen'ing an empty redecl of a function in C99 mode, when
Nick Lewycky [Mon, 18 Jul 2011 07:11:55 +0000 (07:11 +0000)]
Don't crash when codegen'ing an empty redecl of a function in C99 mode, when
neither was inline. Fixes bug introduced in r135377.

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

13 years agoIn C99, emit an inline function when encountering an extern redeclaration.
Nick Lewycky [Mon, 18 Jul 2011 05:26:13 +0000 (05:26 +0000)]
In C99, emit an inline function when encountering an extern redeclaration.
Fixes PR10233!

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

13 years agode-constify llvm::Type, patch by David Blaikie!
Chris Lattner [Mon, 18 Jul 2011 04:24:23 +0000 (04:24 +0000)]
de-constify llvm::Type, patch by David Blaikie!

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

13 years agoUse the new llvm::TinyPtrVector class, which implements exactly what
Chris Lattner [Mon, 18 Jul 2011 01:54:02 +0000 (01:54 +0000)]
Use the new llvm::TinyPtrVector class, which implements exactly what
ShadowMapEntry was.

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

13 years agoRevert r135217, which wasn't the correct fix for PR10358. With this
Chandler Carruth [Sat, 16 Jul 2011 22:27:02 +0000 (22:27 +0000)]
Revert r135217, which wasn't the correct fix for PR10358. With this
patch, we actually move the state-machine for the value set backwards
one step. This can pretty easily lead to infinite loops where we
continually try to propagate a bit, succeed for one iteration, but then
back up because we find an uninitialized use.

A reduced test case from PR10379 is included.

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

13 years agoDo not modify string returned by getenv on Windows.
Francois Pichet [Sat, 16 Jul 2011 21:17:14 +0000 (21:17 +0000)]
Do not modify string returned by getenv on Windows.
Fixes PR9875, patch by Nikola Smiljanic!

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

13 years agoZero this struct in a way that neither depends on the size of the struct nor triggers...
Benjamin Kramer [Sat, 16 Jul 2011 20:13:06 +0000 (20:13 +0000)]
Zero this struct in a way that neither depends on the size of the struct nor triggers warnings from GCC.

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

13 years ago[analyzer] Per discussions with the Cocoa team, extend CF naming conventions to exten...
Ted Kremenek [Sat, 16 Jul 2011 19:50:36 +0000 (19:50 +0000)]
[analyzer] Per discussions with the Cocoa team, extend CF naming conventions to extend to camel case functions instead of just title case functions.  Fixes <rdar://problem/9732321>.

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

13 years ago[analyzer] Place checking for Core Foundation "Create" rule into a proper API. No...
Ted Kremenek [Sat, 16 Jul 2011 19:50:32 +0000 (19:50 +0000)]
[analyzer] Place checking for Core Foundation "Create" rule into a proper API.  No functionality change.

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

13 years agoRemove a gcc warning.
Fariborz Jahanian [Sat, 16 Jul 2011 18:31:33 +0000 (18:31 +0000)]
Remove a gcc warning.

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

13 years agoCorrectly handle sysroot prefix in -print-search-dirs. Makes libtool
Joerg Sonnenberger [Sat, 16 Jul 2011 10:50:05 +0000 (10:50 +0000)]
Correctly handle sysroot prefix in -print-search-dirs. Makes libtool
more happy on NetBSD.

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

13 years agoFix a typo.
Fariborz Jahanian [Sat, 16 Jul 2011 00:08:33 +0000 (00:08 +0000)]
Fix a typo.

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

13 years ago[arcmt] It's not safe to remove the -release on "[[someivar delegate] release];"...
Argyrios Kyrtzidis [Fri, 15 Jul 2011 23:48:56 +0000 (23:48 +0000)]
[arcmt] It's not safe to remove the -release on "[[someivar delegate] release];" since it's very likely
that, after migration, the object that was passed to 'setDelegate:' will not be properly retained, e.g:

-whatever {
  id x = [[MyDoHicky alloc] init];
  [someivar setDelegate: x]; // x won't get retained in ARC.
}
-dealloc {
  [[someivar delegate] release]; // give migration error here.
}

rdar://8858009

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

13 years agoThis handles the missing cases of opencl vector literals.
Tanya Lattner [Fri, 15 Jul 2011 23:07:01 +0000 (23:07 +0000)]
This handles the missing cases of opencl vector literals.
Test cases provided by Anton Lokhmot.

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

13 years agoUpdate retain-release.m to match updated warnings from r135310
Jordy Rose [Fri, 15 Jul 2011 22:38:26 +0000 (22:38 +0000)]
Update retain-release.m to match updated warnings from r135310

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

13 years ago[libclang] Map canonical decl of a category implementation to the category decl.
Argyrios Kyrtzidis [Fri, 15 Jul 2011 22:37:58 +0000 (22:37 +0000)]
[libclang] Map canonical decl of a category implementation to the category decl.

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

13 years agoRevert r135304 and apply fix in clang_getCanonicalCursor per Doug's, Fariborz's comments.
Argyrios Kyrtzidis [Fri, 15 Jul 2011 22:27:18 +0000 (22:27 +0000)]
Revert r135304 and apply fix in clang_getCanonicalCursor per Doug's, Fariborz's comments.

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

13 years agoAdd tests for CFRefReport's path notes, and fix a few typos and non-standard terminol...
Jordy Rose [Fri, 15 Jul 2011 22:17:54 +0000 (22:17 +0000)]
Add tests for CFRefReport's path notes, and fix a few typos and non-standard terminology ('+0 retain counts') caught by the tests.

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

13 years ago[arcmt] Rewrite to "foo = nil;" not "foo = 0;", as suggested by Jordy.
Argyrios Kyrtzidis [Fri, 15 Jul 2011 22:04:00 +0000 (22:04 +0000)]
[arcmt] Rewrite to "foo = nil;" not "foo = 0;", as suggested by Jordy.

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

13 years agoPrevent the -save-temps flag from modifying the input file if the input filename
Chad Rosier [Fri, 15 Jul 2011 21:54:29 +0000 (21:54 +0000)]
Prevent the -save-temps flag from modifying the input file if the input filename
conflicts with a to be produced temp filename.
rdar://9724657

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

13 years agoAugment the interface of ExternalASTSource::FindExternalLexicalDecls()
Douglas Gregor [Fri, 15 Jul 2011 21:46:17 +0000 (21:46 +0000)]
Augment the interface of ExternalASTSource::FindExternalLexicalDecls()
to allow clients to specify that they've already (correctly) loaded
declarations, and that no further action is needed.

Also, make sure that we clear the "has external lexical declarations"
bit before calling FindExternalLexicalDecls(), to avoid infinite
recursion.

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

13 years agoThe canonical decl for an ObjCImplDecl is it's interface class. Fixes rdar://8728637.
Argyrios Kyrtzidis [Fri, 15 Jul 2011 21:39:32 +0000 (21:39 +0000)]
The canonical decl for an ObjCImplDecl is it's interface class. Fixes rdar://8728637.

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

13 years ago[arcmt] For:
Argyrios Kyrtzidis [Fri, 15 Jul 2011 21:11:23 +0000 (21:11 +0000)]
[arcmt] For:

id x = ...
@try {
 ...
} @finally {
 [x release];
}

Migrator will drop the release. It's better to change it to "x = 0" in a @finally to avoid leak when exception is thrown.

rdar://9398256

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

13 years agoDon't refer to check.deps unless LLVM_INCLUDE_TESTS is enabled
Douglas Gregor [Fri, 15 Jul 2011 21:03:20 +0000 (21:03 +0000)]
Don't refer to check.deps unless LLVM_INCLUDE_TESTS is enabled

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

13 years ago[analyzer] GNU __null is a pointer-sized integer, not a pointer. Fixes PR10372.
Jordy Rose [Fri, 15 Jul 2011 20:29:02 +0000 (20:29 +0000)]
[analyzer] GNU __null is a pointer-sized integer, not a pointer. Fixes PR10372.

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

13 years agoFix typo
Joerg Sonnenberger [Fri, 15 Jul 2011 18:23:44 +0000 (18:23 +0000)]
Fix typo

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

13 years agoUse the new APFloat::convertToInt(APSInt) function to simplify uses of
Jeffrey Yasskin [Fri, 15 Jul 2011 17:03:07 +0000 (17:03 +0000)]
Use the new APFloat::convertToInt(APSInt) function to simplify uses of
convertToInt(integerParts*) and make them more reliable.

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

13 years agoStore bracket locations for array subscript expressions, from Erik Verbruggen!
Douglas Gregor [Fri, 15 Jul 2011 16:25:15 +0000 (16:25 +0000)]
Store bracket locations for array subscript expressions, from Erik Verbruggen!

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

13 years agoWhen creating a property in a class extension, make sure to check its
Douglas Gregor [Fri, 15 Jul 2011 15:30:21 +0000 (15:30 +0000)]
When creating a property in a class extension, make sure to check its
attributes. Fixes <rdar://problem/9561076>.

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

13 years agoConvert CallInst and InvokeInst APIs to use ArrayRef.
Jay Foad [Fri, 15 Jul 2011 08:37:34 +0000 (08:37 +0000)]
Convert CallInst and InvokeInst APIs to use ArrayRef.

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

13 years agoRestore the C-style cast hack for enum template arguments,
John McCall [Fri, 15 Jul 2011 07:47:58 +0000 (07:47 +0000)]
Restore the C-style cast hack for enum template arguments,
which is required given the current setup for template
argument deduction substitution validation, and add a test
case to make sure we don't break it in the future.

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

13 years agoMove the Serialization library from 'instantiation' to 'expansion', with
Chandler Carruth [Fri, 15 Jul 2011 07:25:21 +0000 (07:25 +0000)]
Move the Serialization library from 'instantiation' to 'expansion', with
the exception of its uses of SourceManager and SourceLocation APIs.

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

13 years agoAdd serialization support for SubstNonTypeTemplateParmExpr.
John McCall [Fri, 15 Jul 2011 07:00:14 +0000 (07:00 +0000)]
Add serialization support for SubstNonTypeTemplateParmExpr.
Also add the missing serialization support for SEHTryStmt,
SEHFinallyStmt, and SEHExceptStmt, and fix and finish the
serialization support for AsTypeExpr.  In addition, change
the code so that it will no longer link if a Stmt subclass
is missing serialization support.

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

13 years agoFix the definition of AsTypeExpr. I'm still not sure this
John McCall [Fri, 15 Jul 2011 06:56:33 +0000 (06:56 +0000)]
Fix the definition of AsTypeExpr.  I'm still not sure this
is right --- shouldn't there be a TypeLoc in here somewhere? ---
but at least it doesn't have a redundant QualType and a broken
children() method.

Noticed this while doing things in serialization.

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

13 years agoprotect some calls to ConvertType when a function info is under construction
Chris Lattner [Fri, 15 Jul 2011 06:41:05 +0000 (06:41 +0000)]
protect some calls to ConvertType when a function info is under construction
to prevent recursive compilation problems.  This fixes a failure of CodeGen/decl.c
on x86-32 targets that don't fill in the coerce-to type.

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

13 years agoClean up UnixAPIChecker, including switching its array of BugTypes to llvm::OwningPtr...
Jordy Rose [Fri, 15 Jul 2011 06:28:59 +0000 (06:28 +0000)]
Clean up UnixAPIChecker, including switching its array of BugTypes to llvm::OwningPtr<BugType> vars (the new convention). No functionality change.

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

13 years agoClean up MacOSXAPIChecker, including switching its array of BugTypes to a single...
Jordy Rose [Fri, 15 Jul 2011 06:02:19 +0000 (06:02 +0000)]
Clean up MacOSXAPIChecker, including switching its array of BugTypes to a single llvm::OwningPtr<BugType> (the new convention). No functionality change.

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

13 years agoEnhance the IR type lowering code to be much smarter about recursively lowering
Chris Lattner [Fri, 15 Jul 2011 05:16:14 +0000 (05:16 +0000)]
Enhance the IR type lowering code to be much smarter about recursively lowering
types.  Fore xample, we used to lower:

struct bar { int a; };
struct foo {
 void (*FP)(struct bar);
} G;

to:

%struct.foo = type { {}* }

since the function pointer would cause recursive translation of bar and
we didn't know if that would get us into trouble.  We are now smart enough
to know that it is fine, so we get this type instead:

%struct.foo = type { void (i32)* }

Codegen still needs to be prepared for uncooperative types at any place,
which is why I let the maximally uncooperative code sit around for awhile to
help shake out the bugs.

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

13 years agoCreate a new expression node, SubstNonTypeTemplateParmExpr,
John McCall [Fri, 15 Jul 2011 05:09:51 +0000 (05:09 +0000)]
Create a new expression node, SubstNonTypeTemplateParmExpr,
to represent a fully-substituted non-type template parameter.
This should improve source fidelity, as well as being generically
useful for diagnostics and such.

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

13 years agoAdd 'Contains()' method to GRStateTrait for ImmutableList. Patch by Rui Paulo.
Ted Kremenek [Fri, 15 Jul 2011 03:32:56 +0000 (03:32 +0000)]
Add 'Contains()' method to GRStateTrait for ImmutableList.  Patch by Rui Paulo.

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

13 years agoSwitch a comment in Rewrite from 'instantiation' to 'expansion'.
Chandler Carruth [Fri, 15 Jul 2011 00:04:40 +0000 (00:04 +0000)]
Switch a comment in Rewrite from 'instantiation' to 'expansion'.

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

13 years agoSwitch help text in the CC1 driver from 'instantiation' to 'expansion'.
Chandler Carruth [Fri, 15 Jul 2011 00:04:38 +0000 (00:04 +0000)]
Switch help text in the CC1 driver from 'instantiation' to 'expansion'.

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

13 years agoSwitch comments and assert text in AST from 'instantiation' to
Chandler Carruth [Fri, 15 Jul 2011 00:04:35 +0000 (00:04 +0000)]
Switch comments and assert text in AST from 'instantiation' to
'expansion'.

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

13 years agoSwitch comments about 'macro instantiation' to 'macro expansion' in
Chandler Carruth [Fri, 15 Jul 2011 00:04:31 +0000 (00:04 +0000)]
Switch comments about 'macro instantiation' to 'macro expansion' in
ARCMigrate.

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

13 years agoRemove warnings of constant operands of logical operators from template instantiation...
Richard Trieu [Fri, 15 Jul 2011 00:00:51 +0000 (00:00 +0000)]
Remove warnings of constant operands of logical operators from template instantiations.  Upon instantiation of template, value-dependent parameters are replaced by equivalent literals, so code like:

template<unsigned int A, unsigned int B> struct S {
  int foo() {
    int x = A && B;
  }
}

will not warn on A && B on every instantiation.  This will still warn on other cases inside templates, which will be caught on checking the template definition.

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

13 years agoMatch llvm API change.
Evan Cheng [Thu, 14 Jul 2011 23:50:56 +0000 (23:50 +0000)]
Match llvm API change.

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

13 years agoFix false negative reported in PR 10358 by using 'Unknown' in -Wuninitialized to...
Ted Kremenek [Thu, 14 Jul 2011 23:43:06 +0000 (23:43 +0000)]
Fix false negative reported in PR 10358 by using 'Unknown' in -Wuninitialized to avoid cascading warnings.  Patch by Kaelyn Uhrain.

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

13 years agoTweak the CMake build so that building a project just containing Clang
Douglas Gregor [Thu, 14 Jul 2011 23:42:32 +0000 (23:42 +0000)]
Tweak the CMake build so that building a project just containing Clang
(and linking to an already-build LLVM) works with Xcode. The resulting
Xcode project for Clang is quite a bit smaller and builds/loads faster.

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

13 years ago[arcmt] Don't remove retains/releases on a global variable, flag them with errors...
Argyrios Kyrtzidis [Thu, 14 Jul 2011 23:32:04 +0000 (23:32 +0000)]
[arcmt] Don't remove retains/releases on a global variable, flag them with errors. rdar://9402555.

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

13 years agoRevert 135177 to fix PR10363.
Rafael Espindola [Thu, 14 Jul 2011 22:58:04 +0000 (22:58 +0000)]
Revert 135177 to fix PR10363.

Revert "For C++11, do more checking of initializer lists up-front, enabling some subset of the final functionality. C just leaves the function early. C++98 runs through the same code path, but has no changed functionality either."

This reverts commit ac420c5053d6aa41d59f782caad9e46e5baaf2c2.

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

13 years ago[arcmt] Allow -retain of an __unsafe_unretained receiver if the result gets used.
Argyrios Kyrtzidis [Thu, 14 Jul 2011 22:46:12 +0000 (22:46 +0000)]
[arcmt] Allow -retain of an __unsafe_unretained receiver if the result gets used.
Keep the error if the result is unused. rdar://9552694.

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

13 years agoTeach -Wconversion, -Wsign-compare etc. about division and remainder.
John McCall [Thu, 14 Jul 2011 22:39:48 +0000 (22:39 +0000)]
Teach -Wconversion, -Wsign-compare etc. about division and remainder.

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

13 years agoPR10359: Template declarations which define classes are not permitted to also contain...
Richard Smith [Thu, 14 Jul 2011 21:35:26 +0000 (21:35 +0000)]
PR10359: Template declarations which define classes are not permitted to also contain declarators. Previously we would accept code like this:

  template<typename T> struct S { } f() { return 0; }

This case now produces a missing ';' diagnostic, since that seems like a much more likely error than an attempt to declare a function or variable in addition to the class template.

Treat this

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

13 years ago[arcmt] Emit an error for unused -autorelease messages.
Argyrios Kyrtzidis [Thu, 14 Jul 2011 21:26:49 +0000 (21:26 +0000)]
[arcmt] Emit an error for unused -autorelease messages.

An unused autorelease is badness. If we remove it the receiver
will likely die immediately while previously it was kept alive
by the autorelease pool. This is bad practice in general, so leave it
and emit an error to force the user to restructure his code.

rdar://9599884

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

13 years agoFor C++11, do more checking of initializer lists up-front, enabling some subset of...
Sebastian Redl [Thu, 14 Jul 2011 19:08:10 +0000 (19:08 +0000)]
For C++11, do more checking of initializer lists up-front, enabling some subset of the final functionality. C just leaves the function early. C++98 runs through the same code path, but has no changed functionality either.
This is a first baby step towards supporting generalized initializer lists. This also removes an aggregate
test case that was just plain wrong, assuming that non-aggregates couldn't be initialized with initializer lists
in C++11 mode.

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

13 years agoFix problems Johannes noticed, and extend test cases further.
Sebastian Redl [Thu, 14 Jul 2011 19:08:01 +0000 (19:08 +0000)]
Fix problems Johannes noticed, and extend test cases further.

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

13 years agoRemove InitializationSequence::ReferenceBinding, the last redundant sequence kind.
Sebastian Redl [Thu, 14 Jul 2011 19:07:55 +0000 (19:07 +0000)]
Remove InitializationSequence::ReferenceBinding, the last redundant sequence kind.

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

13 years agosimplify
Chris Lattner [Thu, 14 Jul 2011 18:45:41 +0000 (18:45 +0000)]
simplify

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

13 years agoStringMap::first() is about to start returning a StringRef, adapt.
Chris Lattner [Thu, 14 Jul 2011 18:24:21 +0000 (18:24 +0000)]
StringMap::first() is about to start returning a StringRef, adapt.

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

13 years agoChange intrinsic getter to take an ArrayRef, now that the underlying function in...
Benjamin Kramer [Thu, 14 Jul 2011 17:45:50 +0000 (17:45 +0000)]
Change intrinsic getter to take an ArrayRef, now that the underlying function in LLVM does.

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

13 years agoMoving one misplaced entry in the attribute enum in AttributeList.h into alphabetical...
Caitlin Sadowski [Thu, 14 Jul 2011 17:39:11 +0000 (17:39 +0000)]
Moving one misplaced entry in the attribute enum in AttributeList.h into alphabetical order.

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

13 years agoRevert r135147 and r135075. The consensus was that this wasn't the right thing to do.
Ted Kremenek [Thu, 14 Jul 2011 17:05:32 +0000 (17:05 +0000)]
Revert r135147 and r135075.  The consensus was that this wasn't the right thing to do.

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

13 years agoUpdate the remaining comments in Frontend to 'expansion'.
Chandler Carruth [Thu, 14 Jul 2011 16:14:52 +0000 (16:14 +0000)]
Update the remaining comments in Frontend to 'expansion'.

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

13 years agoClean up some comments I missed when switching from
Chandler Carruth [Thu, 14 Jul 2011 16:08:00 +0000 (16:08 +0000)]
Clean up some comments I missed when switching from
NestedMacroInstantiations -> NestedMacroExpansions.

With this change, libclang should be completely converted except for
uses of SourceManger and SourceLocation APIs, and the C bindings for
those APIs.

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

13 years agoClean up two lingering comments that mention 'instantiation' w.r.t.
Chandler Carruth [Thu, 14 Jul 2011 16:07:57 +0000 (16:07 +0000)]
Clean up two lingering comments that mention 'instantiation' w.r.t.
macros in libclang.

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

13 years agoAdd extra sanity checking in FormatString::matchesType() that we are comparing intege...
Ted Kremenek [Thu, 14 Jul 2011 15:43:21 +0000 (15:43 +0000)]
Add extra sanity checking in FormatString::matchesType() that we are comparing integers to integers.  This happens not to be an issue now, but the extra check helps future proof in case of future refactorings.

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

13 years agoNestedMacroInstantiations -> NestedMacroExpansions
Chandler Carruth [Thu, 14 Jul 2011 09:02:10 +0000 (09:02 +0000)]
NestedMacroInstantiations -> NestedMacroExpansions

This is switches all the interfaces points (and most of the commenst
/ local variables I saw on my way through) regarding the
NestedMacroInstantiations bit.

The libclang enums corresponding to this state were renamed, but
a legacy enum was added with the old name, and the same value to keep
existing clients working. I've added a documentation blurb for it, but
let me know if there is a canonical way to document legacy elemenst of
the libclang interface.

No functionality changed here, even in tests.

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

13 years agoUpdate all of the libclang code corresponding to the preprocessor
Chandler Carruth [Thu, 14 Jul 2011 08:41:15 +0000 (08:41 +0000)]
Update all of the libclang code corresponding to the preprocessor
MacroInstantiation -> MacroExpansion rename. Internally, everything is
switched.

Introduce a new cursor kind enum with the new name, but retain the old
name as an alias so that we don't break backwards compatibility.

Also update the debug printing routine to use 'macro expansions' as its
explicitly not guaranteed to be stable, and mechanically switch the test
cases over to that.

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

13 years agoMove the rest of the preprocessor terminology from 'instantiate' and
Chandler Carruth [Thu, 14 Jul 2011 08:20:46 +0000 (08:20 +0000)]
Move the rest of the preprocessor terminology from 'instantiate' and
variants to 'expand'. This changed a couple of public APIs, including
one public type "MacroInstantiation" which is now "MacroExpansion". The
rest of the codebase was updated to reflect this, especially the
libclang code. Two of the C++ (and thus easily changed) libclang APIs
were updated as well because they pertained directly to the old
MacroInstantiation class.

No functionality changed.

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

13 years agoConvert terminology in the Lexer from 'instantiate' and variants to
Chandler Carruth [Thu, 14 Jul 2011 08:20:40 +0000 (08:20 +0000)]
Convert terminology in the Lexer from 'instantiate' and variants to
'expand'. Also update the public API it provides to the new term, and
propagate that update to the various clients.

No functionality changed.

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

13 years agoSwitch the TokenLexer's terminology from various forms of 'instantiate'
Chandler Carruth [Thu, 14 Jul 2011 08:20:34 +0000 (08:20 +0000)]
Switch the TokenLexer's terminology from various forms of 'instantiate'
to 'expand' for macros. Only comments and uses local to the TokenLexer
are updated.

No functionality changed.

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

13 years agoSwitch all local code and comments from '[Ii]nstantiat(ion|ed)' to
Chandler Carruth [Thu, 14 Jul 2011 08:20:31 +0000 (08:20 +0000)]
Switch all local code and comments from '[Ii]nstantiat(ion|ed)' to
'[Ee]xpan(sion|ded)' in the TextDiagnosticPrinter.

No functionality changed.

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

13 years agoSwitch the diagnostic messages about macros to use the terms 'expanded'
Chandler Carruth [Thu, 14 Jul 2011 08:20:28 +0000 (08:20 +0000)]
Switch the diagnostic messages about macros to use the terms 'expanded'
and 'expansions' rather than 'instantiated' and 'contexts'.

This is the first of several patches migrating Clang's terminology
surrounding macros from 'instantiation' to 'expansion'.

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

13 years agoReapply r135075, but modify format-strings.c and format-strings-fixit.c test cases...
Ted Kremenek [Thu, 14 Jul 2011 06:49:52 +0000 (06:49 +0000)]
Reapply r135075, but modify format-strings.c and format-strings-fixit.c test cases to be more portable with an explicit target triple.

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

13 years agoRevert r135075, "format string checking: long and int have the same widths on 32...
NAKAMURA Takumi [Thu, 14 Jul 2011 05:16:18 +0000 (05:16 +0000)]
Revert r135075, "format string checking: long and int have the same widths on 32-bit, so we shouldn't warn about using"

It fails on freebsd, mingw and msvc10.

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

13 years agoAdd a hackaround to avoid the crash in PR10355. However, our recovery
Douglas Gregor [Thu, 14 Jul 2011 04:54:23 +0000 (04:54 +0000)]
Add a hackaround to avoid the crash in PR10355. However, our recovery
is still terrible here because typo correction is not behaving well in
the presence of overloaded functions.

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

13 years ago[arcmt] Make sure migrating to ARC works even if '-fobjc-arc' is included in command...
Argyrios Kyrtzidis [Thu, 14 Jul 2011 00:17:54 +0000 (00:17 +0000)]
[arcmt] Make sure migrating to ARC works even if '-fobjc-arc' is included in command-line flags. rdar://9567824

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

13 years agoDocument the behavior of property modifiers in ARC.
John McCall [Wed, 13 Jul 2011 23:15:32 +0000 (23:15 +0000)]
Document the behavior of property modifiers in ARC.

rdar://problem/9768338

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

13 years agoPR8800: When building a conversion to A& using a member operatorA&(), do not require...
Richard Smith [Wed, 13 Jul 2011 22:53:21 +0000 (22:53 +0000)]
PR8800: When building a conversion to A& using a member operatorA&(), do not require A to be a complete type.

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

13 years agoReapply r134946 with fixes. Tested on Benjamin testcase and other test-suite failures.
Bruno Cardoso Lopes [Wed, 13 Jul 2011 21:58:55 +0000 (21:58 +0000)]
Reapply r134946 with fixes. Tested on Benjamin testcase and other test-suite failures.

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

13 years agoAdd 'mutable' to the function declarator chunk, to be used when
Douglas Gregor [Wed, 13 Jul 2011 21:47:47 +0000 (21:47 +0000)]
Add 'mutable' to the function declarator chunk, to be used when
parsing lambda expressions, from John Freeman!

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

13 years agoFix an incorrect namespace typo-correction diagnostic, from Kaelyn
Douglas Gregor [Wed, 13 Jul 2011 21:36:26 +0000 (21:36 +0000)]
Fix an incorrect namespace typo-correction diagnostic, from Kaelyn
Uhrain! Fixes PR10318.

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

13 years agoEmit debug info for extended vectors.
Devang Patel [Wed, 13 Jul 2011 21:23:30 +0000 (21:23 +0000)]
Emit debug info for extended vectors.

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

13 years agoformat string checking: long and int have the same widths on 32-bit, so we shouldn...
Ted Kremenek [Wed, 13 Jul 2011 20:20:58 +0000 (20:20 +0000)]
format string checking: long and int have the same widths on 32-bit, so we shouldn't warn about using
an "int" format specifier with a "long" type in 32-bit.

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

13 years agoEnforce access control for the destructor in a new[] expression and mark
John McCall [Wed, 13 Jul 2011 20:12:57 +0000 (20:12 +0000)]
Enforce access control for the destructor in a new[] expression and mark
it as used.  Otherwise, we can fail to instantiate or validate the destructor,
which can lead to crashes in IR gen like PR10351.

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

13 years ago[arcmt] Add weak/unsafe_unretained for "@property (readonly)" when we are @synthesizi...
Argyrios Kyrtzidis [Wed, 13 Jul 2011 19:47:57 +0000 (19:47 +0000)]
[arcmt] Add weak/unsafe_unretained for "@property (readonly)" when we are @synthesizing it.

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

13 years ago[arcmt] For properties rewrite 'assign' -> 'weak or unsafe_unretained', 'retain'...
Argyrios Kyrtzidis [Wed, 13 Jul 2011 19:22:00 +0000 (19:22 +0000)]
[arcmt] For properties rewrite 'assign' -> 'weak or unsafe_unretained', 'retain' -> 'strong', and add
'weak or unsafe_unretained' when 'assign' is missing. rdar://9496219&9602589.

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

13 years agoWith -Wselector, don't warn about unimplemented optional method
Fariborz Jahanian [Wed, 13 Jul 2011 19:05:43 +0000 (19:05 +0000)]
With -Wselector, don't warn about unimplemented optional method
used in @selector expression because, well, their implementation
is optional. // rdar://9545564

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

13 years agoDon't crash if defining -dealloc in a category.
John McCall [Wed, 13 Jul 2011 18:26:47 +0000 (18:26 +0000)]
Don't crash if defining -dealloc in a category.

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

13 years agoIn debugger mode, make ObjC message sends to unknown selectors return
John McCall [Wed, 13 Jul 2011 17:56:40 +0000 (17:56 +0000)]
In debugger mode, make ObjC message sends to unknown selectors return
__unknown_anytype, and rewrite such message sends correctly.

I had to bite the bullet and actually add a debugger support mode for this
one, which is a bit unfortunate, but there really isn't anything else
I could imagine doing;  this is clearly just debugger-specific behavior.

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