]> granicus.if.org Git - clang/log
clang
15 years agofix PR2639
Chris Lattner [Mon, 2 Mar 2009 20:58:48 +0000 (20:58 +0000)]
fix PR2639

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

15 years agoStub out some structure for C++ driver.
Daniel Dunbar [Mon, 2 Mar 2009 19:59:07 +0000 (19:59 +0000)]
Stub out some structure for C++ driver.

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

15 years agoinline asm calls should be nounwind. Chris, please review.
Anders Carlsson [Mon, 2 Mar 2009 19:58:15 +0000 (19:58 +0000)]
inline asm calls should be nounwind. Chris, please review.

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

15 years agoFix name.
Daniel Dunbar [Mon, 2 Mar 2009 19:50:00 +0000 (19:50 +0000)]
Fix name.

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

15 years agoUpdate Xcode project.
Ted Kremenek [Mon, 2 Mar 2009 19:41:07 +0000 (19:41 +0000)]
Update Xcode project.

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

15 years agoAdd a 'kind' field to PathDiagnosticPieces.
Ted Kremenek [Mon, 2 Mar 2009 19:40:38 +0000 (19:40 +0000)]
Add a 'kind' field to PathDiagnosticPieces.

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

15 years agoFor now, do not output the 'DisplayHint' in plist files.
Ted Kremenek [Mon, 2 Mar 2009 19:40:15 +0000 (19:40 +0000)]
For now, do not output the 'DisplayHint' in plist files.

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

15 years agoFor now, do not output the 'DisplayHint' in plist files.
Ted Kremenek [Mon, 2 Mar 2009 19:39:50 +0000 (19:39 +0000)]
For now, do not output the 'DisplayHint' in plist files.

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

15 years agoFixed a typo.
Fariborz Jahanian [Mon, 2 Mar 2009 19:06:08 +0000 (19:06 +0000)]
Fixed a typo.

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

15 years agoCheck for duplicate declaration of method of a class
Fariborz Jahanian [Mon, 2 Mar 2009 19:05:07 +0000 (19:05 +0000)]
Check for duplicate declaration of method of a class
in its extension.

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

15 years agoNormalize .h guards.
Daniel Dunbar [Mon, 2 Mar 2009 18:59:45 +0000 (18:59 +0000)]
Normalize .h guards.

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

15 years agoAttempt to make test more robust (fails for users who put LLVM in
Daniel Dunbar [Mon, 2 Mar 2009 18:50:36 +0000 (18:50 +0000)]
Attempt to make test more robust (fails for users who put LLVM in
/path/with/store/in/it").

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

15 years agoEnable Objective-C interface debug info.
Devang Patel [Mon, 2 Mar 2009 17:58:28 +0000 (17:58 +0000)]
Enable Objective-C interface debug info.

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

15 years agoFix cmake builds.
Mike Stump [Mon, 2 Mar 2009 17:05:26 +0000 (17:05 +0000)]
Fix cmake builds.

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

15 years agoremove an implemented fixme.
Zhongxing Xu [Mon, 2 Mar 2009 08:25:09 +0000 (08:25 +0000)]
remove an implemented fixme.

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

15 years agoInitial support for pointer arithmetic. Only support concrete indexes and
Zhongxing Xu [Mon, 2 Mar 2009 07:52:23 +0000 (07:52 +0000)]
Initial support for pointer arithmetic. Only support concrete indexes and
offsets for now.

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

15 years agoAvoid crash when child iterator gives null result.
Daniel Dunbar [Mon, 2 Mar 2009 07:00:57 +0000 (07:00 +0000)]
Avoid crash when child iterator gives null result.

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

15 years agoRename lib/Driver (etc) to lib/Frontend in prep for the *actual*
Daniel Dunbar [Mon, 2 Mar 2009 06:16:29 +0000 (06:16 +0000)]
Rename lib/Driver (etc) to lib/Frontend in prep for the *actual*
driver taking lib/Driver.

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

15 years agoABITestGen: Add v2i16 and v16f32 as default vector types to generate.
Daniel Dunbar [Mon, 2 Mar 2009 06:14:33 +0000 (06:14 +0000)]
ABITestGen: Add v2i16 and v16f32 as default vector types to generate.

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

15 years agoFirst cut at zero-cost EH support.
Daniel Dunbar [Mon, 2 Mar 2009 06:08:11 +0000 (06:08 +0000)]
First cut at zero-cost EH support.
 - Still manually generates the EH code; the parts related to cleanup
   need to be integrated into the cleanup stack (for proper
   interaction with VLAs, etc.).

 - Some differences vs gcc in corner cases; I believe our behavior is
   correct but need to verify/file bugs vs gcc.

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

15 years agoMake sure to invoke (not call) to objc_exception_throw if necessary.
Daniel Dunbar [Mon, 2 Mar 2009 05:20:36 +0000 (05:20 +0000)]
Make sure to invoke (not call) to objc_exception_throw if necessary.

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

15 years agoFix completely broken thinko in GetClassGlobal.
Daniel Dunbar [Mon, 2 Mar 2009 05:18:14 +0000 (05:18 +0000)]
Fix completely broken thinko in GetClassGlobal.

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

15 years agoDon't set nounwind on functions when in using the new Obj-C ABI.
Daniel Dunbar [Mon, 2 Mar 2009 04:58:03 +0000 (04:58 +0000)]
Don't set nounwind on functions when in using the new Obj-C ABI.

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

15 years agoCleanup handling of function attributes in calls.
Daniel Dunbar [Mon, 2 Mar 2009 04:32:35 +0000 (04:32 +0000)]
Cleanup handling of function attributes in calls.
 - No intended functionality change.

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

15 years agoPush checking down, also, give the user a hit as to which part of the
Mike Stump [Mon, 2 Mar 2009 03:04:42 +0000 (03:04 +0000)]
Push checking down, also, give the user a hit as to which part of the
block literal is causing the problem, instead of the vague reference
to the entire block literal.

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

15 years agoRework the way we find locally-scoped external declarations when we
Douglas Gregor [Mon, 2 Mar 2009 00:19:53 +0000 (00:19 +0000)]
Rework the way we find locally-scoped external declarations when we
need them to evaluate redeclarations or call a function that hasn't
already been declared. We now keep a DenseMap of these locally-scoped
declarations so that they are not visible but can be quickly found,
e.g., when we're looking for previous declarations or before we go
ahead and implicitly declare a function that's being called. Fixes
PR3672.

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

15 years agoAdd BLOCK_HAS_DESCRIPTOR to global blocks.
Anders Carlsson [Sun, 1 Mar 2009 21:09:29 +0000 (21:09 +0000)]
Add BLOCK_HAS_DESCRIPTOR to global blocks.

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

15 years agoBe sure to mark blocks with no imports as being global.
Mike Stump [Sun, 1 Mar 2009 20:07:53 +0000 (20:07 +0000)]
Be sure to mark blocks with no imports as being global.

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

15 years agosimplify some code.
Chris Lattner [Sun, 1 Mar 2009 18:47:06 +0000 (18:47 +0000)]
simplify some code.

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

15 years agoFix <rdar://problem/6248764> parser rejects: bad receiver type 'CFStringRef'.
Steve Naroff [Sun, 1 Mar 2009 17:14:31 +0000 (17:14 +0000)]
Fix <rdar://problem/6248764> parser rejects: bad receiver type 'CFStringRef'.

Downgrade an error to a warning (for GCC compatibility).

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

15 years agoFix PR3509 by providing correct starting locations for initializer lists
Douglas Gregor [Sun, 1 Mar 2009 17:12:46 +0000 (17:12 +0000)]
Fix PR3509 by providing correct starting locations for initializer lists

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

15 years agoFix <rdar://problem/6619539> incompatible pointer types sending 'XCElementSpacer...
Steve Naroff [Sun, 1 Mar 2009 16:12:44 +0000 (16:12 +0000)]
Fix <rdar://problem/6619539> incompatible pointer types sending 'XCElementSpacer *', expected 'XCElement *' (not handling protocol signatures correctly?).

- Reworked ASTContext::canAssignObjCInterfaces().
- Added ObjCProtocolDecl::lookupProtocolNamed().

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

15 years agoRename AnonTypedRegion to TypedViewRegion.
Ted Kremenek [Sun, 1 Mar 2009 05:44:08 +0000 (05:44 +0000)]
Rename AnonTypedRegion to TypedViewRegion.

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

15 years agoAdjust wording of bug names.
Ted Kremenek [Sun, 1 Mar 2009 05:43:22 +0000 (05:43 +0000)]
Adjust wording of bug names.

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

15 years agoObj-C non fragile ABI: Use GetClassGlobal in one more instance I missed.
Daniel Dunbar [Sun, 1 Mar 2009 04:51:18 +0000 (04:51 +0000)]
Obj-C non fragile ABI: Use GetClassGlobal in one more instance I missed.

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

15 years agoObj-C non fragile ABI: Add GetInterfaceEHType for getting the Obj-C
Daniel Dunbar [Sun, 1 Mar 2009 04:46:24 +0000 (04:46 +0000)]
Obj-C non fragile ABI: Add GetInterfaceEHType for getting the Obj-C
exception typeinfo metadata, and a few other EH related types/functions.
 - No functionality change.

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

15 years agoNeXT: Unify code for creating a class global.
Daniel Dunbar [Sun, 1 Mar 2009 04:40:10 +0000 (04:40 +0000)]
NeXT: Unify code for creating a class global.
 - No functionality change.

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

15 years agoObjCAtCatchStmt's ParamStmt is always a DeclStmt.
Daniel Dunbar [Sun, 1 Mar 2009 04:28:32 +0000 (04:28 +0000)]
ObjCAtCatchStmt's ParamStmt is always a DeclStmt.

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

15 years agotestcase for mike's fix for PR3612
Chris Lattner [Sun, 1 Mar 2009 03:26:22 +0000 (03:26 +0000)]
testcase for mike's fix for PR3612

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

15 years agoThis test requires blocks.
Daniel Dunbar [Sun, 1 Mar 2009 02:20:08 +0000 (02:20 +0000)]
This test requires blocks.

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

15 years agoRemove debugging code.
Anders Carlsson [Sun, 1 Mar 2009 02:12:54 +0000 (02:12 +0000)]
Remove debugging code.

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

15 years agoEmit errors about unsupported blocks features.
Anders Carlsson [Sun, 1 Mar 2009 01:45:25 +0000 (01:45 +0000)]
Emit errors about unsupported blocks features.

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

15 years agoInitialize NSConcreteStackBlock
Anders Carlsson [Sun, 1 Mar 2009 01:17:11 +0000 (01:17 +0000)]
Initialize NSConcreteStackBlock

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

15 years agoDo some blocks cleanup and simplification. Fix a crash, and add a test case.
Anders Carlsson [Sun, 1 Mar 2009 01:09:12 +0000 (01:09 +0000)]
Do some blocks cleanup and simplification. Fix a crash, and add a test case.

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

15 years agoadjust to changes in the mainline llvm .ll printer.
Chris Lattner [Sun, 1 Mar 2009 00:59:19 +0000 (00:59 +0000)]
adjust to changes in the mainline llvm .ll printer.

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

15 years ago"This patch uses the new ObjCImplDecl class to merge Sema::ImplMethodsVsClassMethods...
Chris Lattner [Sun, 1 Mar 2009 00:56:52 +0000 (00:56 +0000)]
"This patch uses the new ObjCImplDecl class to merge  Sema::ImplMethodsVsClassMethods and Sema::ImplCategoryMethodsVsIntfMethods methods.
And now, when clang check a class implementation to find unimplemented methods, it also checks all methods from the class extensions (unnamed categories).

There is also a test case to check this warning.

This patch contains also a minor update for ObjCImplDecl . getNameAsCString and getNameAsString now returns an empty string instead of crashing for unnamed categories."

Patch by Jean-Daniel Dupas!

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

15 years agoWhoops, actually remove the VLA/VM check in FinalizeDeclaratorGroup.
Anders Carlsson [Sat, 28 Feb 2009 23:31:06 +0000 (23:31 +0000)]
Whoops, actually remove the VLA/VM check in FinalizeDeclaratorGroup.

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

15 years agoFix invalid VLAs/VMs in Sema::ActOnVariableDeclarator, so that the variable will...
Anders Carlsson [Sat, 28 Feb 2009 21:56:50 +0000 (21:56 +0000)]
Fix invalid VLAs/VMs in Sema::ActOnVariableDeclarator, so that the variable will have the right type by the time the initializer is checked. This ensures that code like

int a[(int)(1.0 / 1.0) = { 1 } will work.

Eli, please review.

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

15 years agoRemove PrevFunctionScope slot (it isn't needed)...use getParent() instead.
Steve Naroff [Sat, 28 Feb 2009 21:01:15 +0000 (21:01 +0000)]
Remove PrevFunctionScope slot (it isn't needed)...use getParent() instead.

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

15 years agoRevert 65707 (causes stack memory to be referenced after it is released).
Ted Kremenek [Sat, 28 Feb 2009 20:50:43 +0000 (20:50 +0000)]
Revert 65707 (causes stack memory to be referenced after it is released).

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

15 years agoObscure code gen bug related to sending
Fariborz Jahanian [Sat, 28 Feb 2009 20:07:56 +0000 (20:07 +0000)]
Obscure code gen bug related to sending
message to 'super' in a class method declared in
cateogy (darwin specific).

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

15 years agoFix a crash in test/Parser/control-scope.c that testrunner didn't
Chris Lattner [Sat, 28 Feb 2009 19:37:57 +0000 (19:37 +0000)]
Fix a crash in test/Parser/control-scope.c that testrunner didn't
notice because it was a negative test with a fix suggested by
Jean-Daniel Dupas.  Convert the test from a negative to a positive
test to catch stuff like this.

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

15 years agoremove static ctor.
Chris Lattner [Sat, 28 Feb 2009 19:37:06 +0000 (19:37 +0000)]
remove static ctor.

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

15 years agoimprove compatibility with the VC++'08 C++ compiler. Patch by
Chris Lattner [Sat, 28 Feb 2009 19:01:03 +0000 (19:01 +0000)]
improve compatibility with the VC++'08 C++ compiler.  Patch by
Niklas Larsson!

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

15 years agofix inverted conditional, rdar://6633188
Chris Lattner [Sat, 28 Feb 2009 18:53:33 +0000 (18:53 +0000)]
fix inverted conditional, rdar://6633188

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

15 years ago"This patch addresses two FIXME on ObjCCategoryImplDecl:
Chris Lattner [Sat, 28 Feb 2009 18:42:10 +0000 (18:42 +0000)]
"This patch addresses two FIXME on ObjCCategoryImplDecl:

/// FIXME: Like ObjCImplementationDecl, this should not be a NamedDecl!
/// FIXME: Introduce a new common base class for ObjCImplementationDecl and ObjCCategoryImplDecl

It adds an IndentifierInfo ivar to the ObjCCategoryImplDecl, so it can inherits from Decl and not NamedDecl (I'm not sure about the memory management of this ivar).

And now that both ObjCImplementationDecl and ObjCCategoryImplDecl have the same super classes, it allow creation of a common base class:  ObjCImplDecl"

Patch by Jean-Daniel Dupas!

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

15 years agobrain thinking memcpy, fingers thinking memset :)
Chris Lattner [Sat, 28 Feb 2009 18:31:01 +0000 (18:31 +0000)]
brain thinking memcpy, fingers thinking memset :)

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

15 years agoafter going around in circles a few times, finally cave and emit structure
Chris Lattner [Sat, 28 Feb 2009 18:18:58 +0000 (18:18 +0000)]
after going around in circles a few times, finally cave and emit structure
copies with memcpy instead of memmove.  This matches what GCC does and if it
causes a problem with a particular libc we can always fix it with a target
hook.

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

15 years agoTargetInfo::validateAsmConstraint now takes a reference to the full constraints strin...
Anders Carlsson [Sat, 28 Feb 2009 17:11:49 +0000 (17:11 +0000)]
TargetInfo::validateAsmConstraint now takes a reference to the full constraints string. This will make it possible to support multi-character constraints. No functionality change (for now).

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

15 years agoMinor name change (move the ObjC prefix to a more appropriate place).
Steve Naroff [Sat, 28 Feb 2009 16:59:13 +0000 (16:59 +0000)]
Minor name change (move the ObjC prefix to a more appropriate place).

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

15 years agoFix <rdar://problem/6451399> problems with labels and blocks.
Steve Naroff [Sat, 28 Feb 2009 16:48:43 +0000 (16:48 +0000)]
Fix <rdar://problem/6451399> problems with labels and blocks.

- Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with.
- Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr().
- Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope.
- Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions).

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

15 years agoAdapt help string to what the code is doing (default is lang_gnu99). Thanks rdivacky!
Gabor Greif [Sat, 28 Feb 2009 09:22:15 +0000 (09:22 +0000)]
Adapt help string to what the code is doing (default is lang_gnu99). Thanks rdivacky!

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

15 years agoFirst cut CodeGen support for __block variables.
Mike Stump [Sat, 28 Feb 2009 09:07:16 +0000 (09:07 +0000)]
First cut CodeGen support for __block variables.

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

15 years agoCheck a few more kinds of declarations that make a scope.
Eli Friedman [Sat, 28 Feb 2009 06:22:14 +0000 (06:22 +0000)]
Check a few more kinds of declarations that make a scope.

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

15 years agoStart of checking for gotos which jump to an illegal destination.
Eli Friedman [Sat, 28 Feb 2009 05:41:13 +0000 (05:41 +0000)]
Start of checking for gotos which jump to an illegal destination.
As far as I know, this catches all cases of jumping into the scope of a
variable with a variably modified type (excluding statement
expressions) in C.  This is missing some stuff we probably want to check
(other kinds of variably modified declarations, statement expressions,
indirect gotos/addresses of labels in a scope, ObjC @try/@finally, cleanup
attribute), the diagnostics aren't very good, and it's not particularly
efficient, but it's a decent start.

This patch is a slightly modified version of the patch I attached to
PR3259, and it fixes that bug.  I was sort of planning on improving
it, but I think it's okay as-is, especially since it looks like CodeGen
doesn't have any use for this sort of data structure.  The only
significant change I can think of from the version I attached to PR3259
is that this version skips running the checking code when a function
doesn't contain any labels.

This patch doesn't cover case statements, which also need similar
checking; I'm not sure how we should deal with that. Extending the goto
checking to also check case statements wouldn't be too hard; it's just a
matter of keeping track of the scope of the closest switch and checking that
the scope of every case is the same as the scope of the switch.  That said,
it would likely be a performance hit to run this check on every
function (it's an extra pass over the entire function), so we probably want
some other solution.

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

15 years agoFix obvious shortcoming in the implementations of Evaluate for
Eli Friedman [Sat, 28 Feb 2009 03:59:05 +0000 (03:59 +0000)]
Fix obvious shortcoming in the implementations of Evaluate for
integer __real__ and __imag__.  Not sure how I missed this.

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

15 years agoUpdate checker build.
Ted Kremenek [Sat, 28 Feb 2009 02:04:49 +0000 (02:04 +0000)]
Update checker build.

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

15 years agoEliminate CXXRecordType
Douglas Gregor [Sat, 28 Feb 2009 01:32:25 +0000 (01:32 +0000)]
Eliminate CXXRecordType

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

15 years agoAdd a FIXME for something I can't look at just yet
Douglas Gregor [Sat, 28 Feb 2009 01:09:26 +0000 (01:09 +0000)]
Add a FIXME for something I can't look at just yet

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

15 years agoTemplate instantiation for function types
Douglas Gregor [Sat, 28 Feb 2009 01:04:19 +0000 (01:04 +0000)]
Template instantiation for function types

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

15 years agoAlignment of pointers in __objc_classlist must be on their
Fariborz Jahanian [Sat, 28 Feb 2009 00:54:00 +0000 (00:54 +0000)]
Alignment of pointers in __objc_classlist must be on their
natural alignment. Otherwise, the excess hole confuses the
objc2 runtime (this is darwin specific).

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

15 years agoImplement template instantiation for pointer, reference, and (some)
Douglas Gregor [Sat, 28 Feb 2009 00:25:32 +0000 (00:25 +0000)]
Implement template instantiation for pointer, reference, and (some)
array types. Semantic checking for the construction of these types has
been factored out of GetTypeForDeclarator and into separate
subroutines (BuildPointerType, BuildReferenceType,
BuildArrayType). We'll be doing the same thing for all other types
(and declarations and expressions).

As part of this, moved the type-instantiation functions into a class
in an anonymous namespace.

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

15 years agoFix enumeration in switch warnings. No behavior change.
Eli Friedman [Fri, 27 Feb 2009 23:15:07 +0000 (23:15 +0000)]
Fix enumeration in switch warnings.  No behavior change.

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

15 years agoFix enumeration in switch warnings, plus misc comment changes. No
Eli Friedman [Fri, 27 Feb 2009 23:04:43 +0000 (23:04 +0000)]
Fix enumeration in switch warnings, plus misc comment changes. No
behavior change.

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

15 years agoFix PR3612. We ensure that we add builtins to the GlobalDeclMap and
Mike Stump [Fri, 27 Feb 2009 22:42:30 +0000 (22:42 +0000)]
Fix PR3612.  We ensure that we add builtins to the GlobalDeclMap and
we ensure that things added to the module can be found even when they
are not in GlobalDeclMap.  The later is for increased flexibility,
should someone want to do something tricky like extern "Ada" in the
same module.

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

15 years agoDiagnose gc attribute mismatch of property and its ivar.
Fariborz Jahanian [Fri, 27 Feb 2009 22:38:11 +0000 (22:38 +0000)]
Diagnose gc attribute mismatch of property and its ivar.

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

15 years agoGive a code insertion hint for how to fix 'implicit int' warnings and errors.
Chris Lattner [Fri, 27 Feb 2009 22:31:56 +0000 (22:31 +0000)]
Give a code insertion hint for how to fix 'implicit int' warnings and errors.

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

15 years agoFix a typo
Douglas Gregor [Fri, 27 Feb 2009 22:05:23 +0000 (22:05 +0000)]
Fix a typo

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

15 years agoWhen retrieving the location of a Node, for MemberExprs use the location of the
Ted Kremenek [Fri, 27 Feb 2009 20:05:10 +0000 (20:05 +0000)]
When retrieving the location of a Node, for MemberExprs use the location of the
'.' or '->'.

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

15 years agoIn BuildAnonymousStructUnionMemberReference, we shouldn't invalidate OpLoc when
Ted Kremenek [Fri, 27 Feb 2009 19:58:12 +0000 (19:58 +0000)]
In BuildAnonymousStructUnionMemberReference, we shouldn't invalidate OpLoc when
building nested member expressions. This location is used to determine the range
of the entire expression, and the expression itself already has its location
inherited from its Base.

This fixes <rdar://problem/6629829>.

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

15 years agoImplement the basic approach for instantiating types, with a lot of FIXME'd
Douglas Gregor [Fri, 27 Feb 2009 19:31:52 +0000 (19:31 +0000)]
Implement the basic approach for instantiating types, with a lot of FIXME'd
stubs for those types we don't yet know how to instantiate (everything
that isn't a template parameter!).

We now instantiate default arguments for template type parameters when
needed. This will be our testbed while I fill out the remaining
type-instantiation logic.

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

15 years agominor wording changes.
Chris Lattner [Fri, 27 Feb 2009 19:31:12 +0000 (19:31 +0000)]
minor wording changes.

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

15 years agoupgrade various 'implicit int' warnings from an ext-warn to warning when not
Chris Lattner [Fri, 27 Feb 2009 18:53:28 +0000 (18:53 +0000)]
upgrade various 'implicit int' warnings from an ext-warn to warning when not
in C89 mode.  This makes it enabled by default instead of only enabled with
-pedantic.  Clang defaults to c99 mode, so people will see this more often
than with GCC, but they can always use -std=c89 if they really want c89.

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

15 years agocleanup
Chris Lattner [Fri, 27 Feb 2009 18:38:20 +0000 (18:38 +0000)]
cleanup

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

15 years agocleanup
Chris Lattner [Fri, 27 Feb 2009 18:35:46 +0000 (18:35 +0000)]
cleanup

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

15 years agoSilence warnings.
Mike Stump [Fri, 27 Feb 2009 18:32:39 +0000 (18:32 +0000)]
Silence warnings.

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

15 years agoWhen checking printf-arguments for functions with '__attribute__ ((format (printf...
Ted Kremenek [Fri, 27 Feb 2009 17:58:43 +0000 (17:58 +0000)]
When checking printf-arguments for functions with '__attribute__ ((format (printf, X, Y)))'
set HasVAListArg to true when 'Y' is 0 (i.e., ignore the data arguments).

This fixes <rdar://problem/6623513>.

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

15 years agoClean up and document code modification hints.
Douglas Gregor [Fri, 27 Feb 2009 17:53:17 +0000 (17:53 +0000)]
Clean up and document code modification hints.

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

15 years agochange a diagnostic message from something pedantically correct but
Chris Lattner [Fri, 27 Feb 2009 17:15:01 +0000 (17:15 +0000)]
change a diagnostic message from something pedantically correct but
useless to something more vague but hopefully more clear.
rdar://6624173

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

15 years agoOops, Ted beat me to it. I'll just play angry god and remove his version!
Daniel Dunbar [Fri, 27 Feb 2009 17:10:38 +0000 (17:10 +0000)]
Oops, Ted beat me to it. I'll just play angry god and remove his version!

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

15 years agoAdd coverage of "member of anonymous union redeclares ..." diagnostic.
Daniel Dunbar [Fri, 27 Feb 2009 17:07:01 +0000 (17:07 +0000)]
Add coverage of "member of anonymous union redeclares ..." diagnostic.

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

15 years agoAdd test case for PR 3675.
Ted Kremenek [Fri, 27 Feb 2009 16:48:08 +0000 (16:48 +0000)]
Add test case for PR 3675.

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

15 years agoUpdate checker build.
Ted Kremenek [Fri, 27 Feb 2009 07:16:04 +0000 (07:16 +0000)]
Update checker build.

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

15 years agoChange the AST generated for offsetof a bit so that it looks like a
Eli Friedman [Fri, 27 Feb 2009 06:44:11 +0000 (06:44 +0000)]
Change the AST generated for offsetof a bit so that it looks like a
normal expression, and change Evaluate and IRGen to evaluate it like a
normal expression.  This simplifies the code significantly, and fixes
PR3396.

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

15 years agoDon't report 'Parser Rejects' for conftest files.
Ted Kremenek [Fri, 27 Feb 2009 06:17:38 +0000 (06:17 +0000)]
Don't report 'Parser Rejects' for conftest files.

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

15 years agoCorrectly check for ccc-analyzer in the same directory as scan-build.
Ted Kremenek [Fri, 27 Feb 2009 06:17:05 +0000 (06:17 +0000)]
Correctly check for ccc-analyzer in the same directory as scan-build.

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

15 years agoChange the way clang generates union types a bit so it plays well
Eli Friedman [Fri, 27 Feb 2009 04:53:40 +0000 (04:53 +0000)]
Change the way clang generates union types a bit so it plays well
with the LLVM C backend.

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

15 years agoSome additional ICE tests.
Eli Friedman [Fri, 27 Feb 2009 04:46:32 +0000 (04:46 +0000)]
Some additional ICE tests.

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

15 years agoSome minor improvements to Evaluate.
Eli Friedman [Fri, 27 Feb 2009 04:45:43 +0000 (04:45 +0000)]
Some minor improvements to Evaluate.

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

15 years agoFix minor memory leak. Add comment describing what we need to do for
Eli Friedman [Fri, 27 Feb 2009 04:17:12 +0000 (04:17 +0000)]
Fix minor memory leak.  Add comment describing what we need to do for
strict constant initializer checking.

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