]> granicus.if.org Git - clang/log
clang
15 years agoSwitch to SmallString::str from SmallString::c_str.
Daniel Dunbar [Wed, 19 Aug 2009 20:04:03 +0000 (20:04 +0000)]
Switch to SmallString::str from SmallString::c_str.
 - Several FIXMEs due to non-Twinification of IRBuilder.

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

15 years agoConvert parts of Rewriter to StringRef based API.
Daniel Dunbar [Wed, 19 Aug 2009 19:10:30 +0000 (19:10 +0000)]
Convert parts of Rewriter to StringRef based API.
 - Please accept my sincere apologies for the gratuitous elimination of code
   duplication, manual string length counting, unnecessary strlen calls, etc.

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

15 years agoUse raw_svector_ostream for string concatenation.
Daniel Dunbar [Wed, 19 Aug 2009 18:30:37 +0000 (18:30 +0000)]
Use raw_svector_ostream for string concatenation.

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

15 years agoOne second thought, I think I want to limit this class to just vtable
Mike Stump [Wed, 19 Aug 2009 18:10:47 +0000 (18:10 +0000)]
One second thought, I think I want to limit this class to just vtable
building activities.

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

15 years agoCleanup: fold IndirectPrimary into builder.
Mike Stump [Wed, 19 Aug 2009 14:40:47 +0000 (14:40 +0000)]
Cleanup: fold IndirectPrimary into builder.

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

15 years agoWe don't want to confuse this layout with the BLayout from the builder.
Mike Stump [Wed, 19 Aug 2009 14:06:50 +0000 (14:06 +0000)]
We don't want to confuse this layout with the BLayout from the builder.

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

15 years agoUpdate for recent improvements.
Mike Stump [Wed, 19 Aug 2009 13:36:31 +0000 (13:36 +0000)]
Update for recent improvements.

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

15 years agoGet the Decl from the current ExplodedNode. Eventually the diagnostic client
Zhongxing Xu [Wed, 19 Aug 2009 12:50:00 +0000 (12:50 +0000)]
Get the Decl from the current ExplodedNode. Eventually the diagnostic client
and other core analysis logic will be untied to a particular Decl.

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

15 years agoUpdate CMakeLists.
Benjamin Kramer [Wed, 19 Aug 2009 12:02:15 +0000 (12:02 +0000)]
Update CMakeLists.

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

15 years agoMake integer promotions work correctly on PIC16 and other platforms
Eli Friedman [Wed, 19 Aug 2009 07:44:53 +0000 (07:44 +0000)]
Make integer promotions work correctly on PIC16 and other platforms
where sizeof(short) == sizeof(int).  Move UsualArithmeticConversionsType
out of Sema, since it was only there as a historical artifact.  Patch by
Enea Zaffanella.

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

15 years agoRestore vbase offsets for classes without a primary.
Mike Stump [Wed, 19 Aug 2009 02:53:08 +0000 (02:53 +0000)]
Restore vbase offsets for classes without a primary.

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

15 years agoRefine vcalls a little.
Mike Stump [Wed, 19 Aug 2009 02:06:38 +0000 (02:06 +0000)]
Refine vcalls a little.

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

15 years agoFix a comment and improve an assert message.
Argyrios Kyrtzidis [Wed, 19 Aug 2009 01:46:06 +0000 (01:46 +0000)]
Fix a comment and improve an assert message.

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

15 years agoStore/load type source info from/to PCH files.
Argyrios Kyrtzidis [Wed, 19 Aug 2009 01:28:35 +0000 (01:28 +0000)]
Store/load type source info from/to PCH files.

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

15 years agoUse Sema's LocInfoType to pass and preserve type source info through the Parser.
Argyrios Kyrtzidis [Wed, 19 Aug 2009 01:28:28 +0000 (01:28 +0000)]
Use Sema's LocInfoType to pass and preserve type source info through the Parser.

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

15 years agoIntroduce LocInfoType which is a Sema-specific implementation detail.
Argyrios Kyrtzidis [Wed, 19 Aug 2009 01:28:17 +0000 (01:28 +0000)]
Introduce LocInfoType which is a Sema-specific implementation detail.

This is a Type subclass that can hold a DeclaratorInfo* when we have type source info coming
out of a declarator that we want to preserve. This is used only at the "border" of Parser/Sema for
passing/getting QualTypes, it does not participate in the type system semantics in any way.

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

15 years agoCreate and instantiate a DeclaratorInfo using a newly introduced Sema::GetDeclaratorI...
Argyrios Kyrtzidis [Wed, 19 Aug 2009 01:28:06 +0000 (01:28 +0000)]
Create and instantiate a DeclaratorInfo using a newly introduced Sema::GetDeclaratorInfoForDeclarator().

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

15 years agoIntroduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.
Argyrios Kyrtzidis [Wed, 19 Aug 2009 01:27:57 +0000 (01:27 +0000)]
Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.

DeclaratorDecl contains a DeclaratorInfo* to keep type source info.
Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl.
EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo.

Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet.

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

15 years agoIntroduce DeclaratorInfo and TypeLoc, intended to be used for storing and reading...
Argyrios Kyrtzidis [Wed, 19 Aug 2009 01:27:32 +0000 (01:27 +0000)]
Introduce DeclaratorInfo and TypeLoc, intended to be used for storing and reading source information for types.

DeclaratorInfo will contain a flat memory block for source information about a type that came out of a declarator.
TypeLoc and its subclasses will be used by clients as wrappers to "traverse" the memory block and read the information.

Both DeclaratorInfo and TypeLoc are not utilized in this commit.

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

15 years agoUpdate Xcode project.
Anders Carlsson [Wed, 19 Aug 2009 01:17:32 +0000 (01:17 +0000)]
Update Xcode project.

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

15 years agoCleanup.
Mike Stump [Tue, 18 Aug 2009 22:04:08 +0000 (22:04 +0000)]
Cleanup.

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

15 years agoAdd some documentation.
Mike Stump [Tue, 18 Aug 2009 21:59:28 +0000 (21:59 +0000)]
Add some documentation.

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

15 years agoCleanups. Move GenerateRtti to CodeGenModule.
Mike Stump [Tue, 18 Aug 2009 21:49:00 +0000 (21:49 +0000)]
Cleanups.  Move GenerateRtti to CodeGenModule.

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

15 years agoRenamed ClassProp data member of ObjCImplctSetterGetterRefExpr
Fariborz Jahanian [Tue, 18 Aug 2009 21:37:33 +0000 (21:37 +0000)]
Renamed ClassProp data member of ObjCImplctSetterGetterRefExpr
to InterfaceDecl, as it is unrelated to any property and
holds the InterfaceDecl needed for accessing class getter/setter
methods using the dot-syntax.

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

15 years agoMove the rest of the vtable building code into the new builder.
Mike Stump [Tue, 18 Aug 2009 21:30:21 +0000 (21:30 +0000)]
Move the rest of the vtable building code into the new builder.

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

15 years agoSuck up method generation.
Mike Stump [Tue, 18 Aug 2009 21:03:28 +0000 (21:03 +0000)]
Suck up method generation.

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

15 years agoSplit out vtable bulding code into a builder.
Mike Stump [Tue, 18 Aug 2009 20:50:28 +0000 (20:50 +0000)]
Split out vtable bulding code into a builder.

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

15 years agoRenamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Fariborz Jahanian [Tue, 18 Aug 2009 20:50:23 +0000 (20:50 +0000)]
Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).

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

15 years agoChange ActOnReturnStmt to not take a FullExprArg. Instead, Sema will wrap the return...
Anders Carlsson [Tue, 18 Aug 2009 16:11:00 +0000 (16:11 +0000)]
Change ActOnReturnStmt to not take a FullExprArg. Instead, Sema will wrap the return expr inside a CXXExprWithTemporaries if needed.

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

15 years agoRemove unused parameter BugReporter due to previous patch.
Zhongxing Xu [Tue, 18 Aug 2009 08:58:41 +0000 (08:58 +0000)]
Remove unused parameter BugReporter due to previous patch.

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

15 years agoNow we can get the CFG from the ProgramPoint. No need to pass in the
Zhongxing Xu [Tue, 18 Aug 2009 08:46:04 +0000 (08:46 +0000)]
Now we can get the CFG from the ProgramPoint. No need to pass in the
BugReporter.

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

15 years agoAdd test for finding bfin backend.
Daniel Dunbar [Tue, 18 Aug 2009 07:07:14 +0000 (07:07 +0000)]
Add test for finding bfin backend.

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

15 years agoConvert CreateTargetInfo to use a Triple instead of manul string munging.
Daniel Dunbar [Tue, 18 Aug 2009 05:47:58 +0000 (05:47 +0000)]
Convert CreateTargetInfo to use a Triple instead of manul string munging.
 - Patch by Yonggang Luo (with some formatting tweaks by Eli and myself).

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

15 years agoFix some made up triples.
Daniel Dunbar [Tue, 18 Aug 2009 05:30:27 +0000 (05:30 +0000)]
Fix some made up triples.

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

15 years agoEnhance static analyzer diagnostics by introducing a new 'EnhancedBugReporter'
Ted Kremenek [Tue, 18 Aug 2009 01:05:30 +0000 (01:05 +0000)]
Enhance static analyzer diagnostics by introducing a new 'EnhancedBugReporter'
which allows custom checks to register callback creator functions for creating
BugReporterVisitor objects. This allows various checks to include diagnostics
such as 'assuming value is null' with little extra work. Eventually this API
should be refactored to be cleaner and more simple.

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

15 years agoTeach Sema how to pop out of friend function definitions in nested classes.
John McCall [Tue, 18 Aug 2009 00:00:49 +0000 (00:00 +0000)]
Teach Sema how to pop out of friend function definitions in nested classes.

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

15 years agoFixed typo in last commit pointed out by Anton.
David Chisnall [Mon, 17 Aug 2009 23:18:30 +0000 (23:18 +0000)]
Fixed typo in last commit pointed out by Anton.

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

15 years agoChanges to TargetABIInfo to (hopefully) select the correct calling convention. This...
David Chisnall [Mon, 17 Aug 2009 23:08:21 +0000 (23:08 +0000)]
Changes to TargetABIInfo to (hopefully) select the correct calling convention.  This has been tested on FreeBSD, and now correctly generates GCC-compatible code for functions returning small structures.  Please test it on other platforms!

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

15 years agoSupport compilation for the blackfin back-end
Jakob Stoklund Olesen [Mon, 17 Aug 2009 20:08:44 +0000 (20:08 +0000)]
Support compilation for the blackfin back-end

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

15 years agoPatch to 1) synthesizing non-trivial default destructor when
Fariborz Jahanian [Mon, 17 Aug 2009 19:04:50 +0000 (19:04 +0000)]
Patch to 1) synthesizing non-trivial default destructor when
one is not provided by user. 2) More complete
emission of ctor prologue when it has no initializer
list or when it is synthesized.

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

15 years agoRemove an ErrorUnsupported call.
Anders Carlsson [Mon, 17 Aug 2009 18:24:57 +0000 (18:24 +0000)]
Remove an ErrorUnsupported call.

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

15 years agoXFAIL this test for now. David/Steve, please sort out the correct fix.
Daniel Dunbar [Mon, 17 Aug 2009 18:01:54 +0000 (18:01 +0000)]
XFAIL this test for now. David/Steve, please sort out the correct fix.

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

15 years agoInitial patch to support definitions of id and Class from headers in Objective-C...
David Chisnall [Mon, 17 Aug 2009 16:35:33 +0000 (16:35 +0000)]
Initial patch to support definitions of id and Class from headers in Objective-C code.

This currently breaks test/SemaObjC/id-isa-ref.m and issues some spurious warnings when you attempt to assign a struct objc_class* value to a Class variable.  The test case probably should fail as it's written, because without the definition of Class the compiler should not assume struct objc_class* is a valid receiver type, but it's left broken because it would be nice if we could get that passing too for the special case of isa.

Approved by snaroff.

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

15 years agoadjust indentation.
Zhongxing Xu [Mon, 17 Aug 2009 14:13:14 +0000 (14:13 +0000)]
adjust indentation.

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

15 years agoRemove unused variable.
Zhongxing Xu [Mon, 17 Aug 2009 06:30:30 +0000 (06:30 +0000)]
Remove unused variable.

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

15 years agoTo make the analysis independent on the locally stored liveness and cfg
Zhongxing Xu [Mon, 17 Aug 2009 06:19:58 +0000 (06:19 +0000)]
To make the analysis independent on the locally stored liveness and cfg
of GRStateManager and GRExprEngine, pass the initial location context
to the getInitialState() method.

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

15 years agoUpdate lexer to work with the new APFloat string parsing.
Erick Tryzelaar [Sun, 16 Aug 2009 23:36:28 +0000 (23:36 +0000)]
Update lexer to work with the new APFloat string parsing.

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

15 years agoImprove handling of delete expressions.
Anders Carlsson [Sun, 16 Aug 2009 21:13:42 +0000 (21:13 +0000)]
Improve handling of delete expressions.

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

15 years agoWhoops, did not mean to commit this
Anders Carlsson [Sun, 16 Aug 2009 20:29:59 +0000 (20:29 +0000)]
Whoops, did not mean to commit this

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

15 years agoStore the delete operator for delete expressions.
Anders Carlsson [Sun, 16 Aug 2009 20:29:29 +0000 (20:29 +0000)]
Store the delete operator for delete expressions.

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

15 years agoPatch toward synthesizing non-trivial destructors. WIP
Fariborz Jahanian [Sun, 16 Aug 2009 19:36:17 +0000 (19:36 +0000)]
Patch toward synthesizing non-trivial destructors. WIP

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

15 years agoRefine vbase offset calculations. WIP.
Mike Stump [Sun, 16 Aug 2009 19:04:13 +0000 (19:04 +0000)]
Refine vbase offset calculations.  WIP.

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

15 years agoOnly do this for initializers of course.
Anders Carlsson [Sun, 16 Aug 2009 17:54:29 +0000 (17:54 +0000)]
Only do this for initializers of course.

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

15 years agoDestroy bound temporaries.
Anders Carlsson [Sun, 16 Aug 2009 17:50:25 +0000 (17:50 +0000)]
Destroy bound temporaries.

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

15 years agoImprove the diagnostic emitted when an unused ObjC property getter
Chris Lattner [Sun, 16 Aug 2009 16:57:27 +0000 (16:57 +0000)]
Improve the diagnostic emitted when an unused ObjC property getter
is found.  Instead of complaining about a generic "unused expr",
emit:
t.m:7:3: warning: property access result unused - getters should not have side effects

While objc property getters *could* have side effects, according to
the language best practices, they *shouldn't*.  Hopefully the
diagnostic now gets this across.

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

15 years agofix my previous commit.
Chris Lattner [Sun, 16 Aug 2009 16:51:50 +0000 (16:51 +0000)]
fix my previous commit.

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

15 years agoThis is an attempt to improve loc info for 'unused result' expression
Chris Lattner [Sun, 16 Aug 2009 16:45:18 +0000 (16:45 +0000)]
This is an attempt to improve loc info for 'unused result' expression
warnings, but it fails because we don't have the location of the .
and I don't understand ObjCKVCRefExpr.  I'll revisit this later.

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

15 years agoAdd an IsInitializer flag to EmitAnyExpr. This is used to prevent temporaries from...
Anders Carlsson [Sun, 16 Aug 2009 07:36:22 +0000 (07:36 +0000)]
Add an IsInitializer flag to EmitAnyExpr. This is used to prevent temporaries from being destroyed when they're bound to a reference variable.

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

15 years agoNo need to append extra padding now that we don't create packed structs for simple...
Anders Carlsson [Sun, 16 Aug 2009 05:55:31 +0000 (05:55 +0000)]
No need to append extra padding now that we don't create packed structs for simple cases like the constant string.

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

15 years agoAddInitializerToDecl can't take a FullExprArg. Make it take an ExprArg, and create...
Anders Carlsson [Sun, 16 Aug 2009 05:13:48 +0000 (05:13 +0000)]
AddInitializerToDecl can't take a FullExprArg. Make it take an ExprArg, and create the CXXExprWithTemporaries before setting the initializer on the VarDecl.

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

15 years agoCall MaybeBindToTemporary for overloaded binary and unary operators.
Anders Carlsson [Sun, 16 Aug 2009 04:11:06 +0000 (04:11 +0000)]
Call MaybeBindToTemporary for overloaded binary and unary operators.

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

15 years agoCall MaybeBindToTemporary when constructing functino call operator calls.
Anders Carlsson [Sun, 16 Aug 2009 03:53:54 +0000 (03:53 +0000)]
Call MaybeBindToTemporary when constructing functino call operator calls.

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

15 years agoAdd MaybeBindToTemporary calls for member call expressions.
Anders Carlsson [Sun, 16 Aug 2009 03:42:12 +0000 (03:42 +0000)]
Add MaybeBindToTemporary calls for member call expressions.

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

15 years agoMake sure to call MaybeBindToTemporary when creating CallExprs.
Anders Carlsson [Sun, 16 Aug 2009 03:06:32 +0000 (03:06 +0000)]
Make sure to call MaybeBindToTemporary when creating CallExprs.

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

15 years agoUse the -NEXT feature of FileCheck.
Mike Stump [Sun, 16 Aug 2009 02:40:14 +0000 (02:40 +0000)]
Use the -NEXT feature of FileCheck.

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

15 years agoMove builtin call checking out into a separate function, make CheckFunctionCall and...
Anders Carlsson [Sun, 16 Aug 2009 01:56:34 +0000 (01:56 +0000)]
Move builtin call checking out into a separate function, make CheckFunctionCall and CheckBlockCall return bool instead. No intended functionality change.

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

15 years agoCleanups and fixups for calculating the virtual base offsets. WIP.
Mike Stump [Sun, 16 Aug 2009 01:46:26 +0000 (01:46 +0000)]
Cleanups and fixups for calculating the virtual base offsets.  WIP.

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

15 years agoBuildCXXConstructExpr doesn't need to take an ASTContext.
Anders Carlsson [Sat, 15 Aug 2009 23:41:35 +0000 (23:41 +0000)]
BuildCXXConstructExpr doesn't need to take an ASTContext.

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

15 years agoAdd an explicit constructor to ActiveTemplateInstantiation which
Eli Friedman [Sat, 15 Aug 2009 22:50:33 +0000 (22:50 +0000)]
Add an explicit constructor to ActiveTemplateInstantiation which
initializes all the members; this fixes a valgrind error in the
regression tests.

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

15 years agoAdd a simple test for temporaries.
Anders Carlsson [Sat, 15 Aug 2009 22:30:50 +0000 (22:30 +0000)]
Add a simple test for temporaries.

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

15 years agoFix test failure due to uninitialized member.
Eli Friedman [Sat, 15 Aug 2009 22:23:00 +0000 (22:23 +0000)]
Fix test failure due to uninitialized member.

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

15 years agoImplement __is_empty. Patch by Sean Hunt.
Eli Friedman [Sat, 15 Aug 2009 21:55:26 +0000 (21:55 +0000)]
Implement __is_empty.  Patch by Sean Hunt.

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

15 years agoIgnore -Wno-import.
Eli Friedman [Sat, 15 Aug 2009 19:28:53 +0000 (19:28 +0000)]
Ignore -Wno-import.

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

15 years agoDon't perform integer promotions on the operand to a cast; this
Eli Friedman [Sat, 15 Aug 2009 19:02:19 +0000 (19:02 +0000)]
Don't perform integer promotions on the operand to a cast; this
simplifies the AST, and can matter in some rare cases involving
casts to vector types. Patch by Enea Zaffanella.

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

15 years agoImproved on ir-gen for synthesis of non-trivial default
Fariborz Jahanian [Sat, 15 Aug 2009 18:55:17 +0000 (18:55 +0000)]
Improved on ir-gen for synthesis of non-trivial default
constructor body whose class has non-static data-members which
required non-trivial construction.

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

15 years agoAdd an additional C++ hardcoded search path.
Eli Friedman [Sat, 15 Aug 2009 03:45:14 +0000 (03:45 +0000)]
Add an additional C++ hardcoded search path.

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

15 years agoMake test more precise.
Eli Friedman [Sat, 15 Aug 2009 03:40:49 +0000 (03:40 +0000)]
Make test more precise.

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

15 years agoMake test a bit more precise.
Eli Friedman [Sat, 15 Aug 2009 03:35:55 +0000 (03:35 +0000)]
Make test a bit more precise.

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

15 years agoExtend the ProgramPoint to include the context information LocationContext,
Zhongxing Xu [Sat, 15 Aug 2009 03:17:38 +0000 (03:17 +0000)]
Extend the ProgramPoint to include the context information LocationContext,
which is either a stack frame context of the function or a local scope
context.

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

15 years agoFix for PR4721: adjust CodeGen and ASTContext so that we have a
Eli Friedman [Sat, 15 Aug 2009 02:50:32 +0000 (02:50 +0000)]
Fix for PR4721: adjust CodeGen and ASTContext so that we have a
consistent model for handling size expressions for VLAs.

The model is essentially as follows: VLA types own their associated
expression.  In some cases, we need to create multiple VLA types to
represent a given VLA (for canonical types, or qualifiers on array types,
or type merging).  If we need to create multiple types based off of
the same VLA declaration, we use the new refcounting functionality so they can
all own the expression. The VLASizeMap in CodeGenFunction then uses the size
expression to identify the group of VLA types based off of the same original
declaration.

I'm not particularly attached to the VLA types owning the expression,
but we're stuck with at least until someone comes up with a way
to walk the VLA expressions for a declaration.

I did the parallel fix in ASTContext for DependentSizedArrayType, but I
haven't really looked closely at it, so there might still be issues
there.

I'll clean up the code duplication in ASTContext in a followup commit.

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

15 years agoDisable all recognition of main() in -ffreestanding. Addresses bug #4720.
John McCall [Sat, 15 Aug 2009 02:09:25 +0000 (02:09 +0000)]
Disable all recognition of main() in -ffreestanding.  Addresses bug #4720.

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

15 years agoChange handling of attribute 'malloc' to only accept the attribute on function
Ted Kremenek [Sat, 15 Aug 2009 00:51:46 +0000 (00:51 +0000)]
Change handling of attribute 'malloc' to only accept the attribute on function
declarations (and not function pointers). This is consistent with GCC. Accepting
this attribute on function pointers means that the attribute should be treated
as a type qualifier, which apparently is not what GCC does. We obviously can
change this later should we desire to enhance the 'malloc' attribute in this
way.

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

15 years agominor cleanups for VLA stuff.
Chris Lattner [Sat, 15 Aug 2009 00:03:43 +0000 (00:03 +0000)]
minor cleanups for VLA stuff.

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

15 years agouse GetVLASize instead of accessing VLASizeMap directly, this gets an assert if
Chris Lattner [Fri, 14 Aug 2009 23:43:22 +0000 (23:43 +0000)]
use GetVLASize instead of accessing VLASizeMap directly, this gets an assert if
VLASize isn't populated for the type yet.

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

15 years agolit: flush stdout in no-fancy-progress-bar mode as well.
Benjamin Kramer [Fri, 14 Aug 2009 23:34:45 +0000 (23:34 +0000)]
lit: flush stdout in no-fancy-progress-bar mode as well.

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

15 years agoAdd more attribute 'malloc' test cases involving function pointers.
Ted Kremenek [Fri, 14 Aug 2009 22:06:01 +0000 (22:06 +0000)]
Add more attribute 'malloc' test cases involving function pointers.

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

15 years agoPer Eli Friedman's feedback, handle attribute 'malloc' being applied to
Ted Kremenek [Fri, 14 Aug 2009 22:03:27 +0000 (22:03 +0000)]
Per Eli Friedman's feedback, handle attribute 'malloc' being applied to
declarations of function pointers.

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

15 years agoobjc2's foreach statement's selector type can be
Fariborz Jahanian [Fri, 14 Aug 2009 21:53:27 +0000 (21:53 +0000)]
objc2's foreach statement's selector type can be
a block pointer too.

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

15 years agoDo now overflow while calulating upper bound for zero sized array.
Devang Patel [Fri, 14 Aug 2009 20:57:45 +0000 (20:57 +0000)]
Do now overflow while calulating upper bound for zero sized array.

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

15 years agoThis test case does not need to include 'stdlib.h'.
Ted Kremenek [Fri, 14 Aug 2009 20:53:10 +0000 (20:53 +0000)]
This test case does not need to include 'stdlib.h'.

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

15 years agoUse 'dyn_cast' instead of a check for a function declaration followed by a
Ted Kremenek [Fri, 14 Aug 2009 20:51:58 +0000 (20:51 +0000)]
Use 'dyn_cast' instead of a check for a function declaration followed by a
'cast'.

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

15 years agoImprove Sema's handling of attribute 'malloc' to reject the attribute when
Ted Kremenek [Fri, 14 Aug 2009 20:49:40 +0000 (20:49 +0000)]
Improve Sema's handling of attribute 'malloc' to reject the attribute when
attaching to Objective-C methods (which mirrors GCC's behavior) and to allow the
return type of the function to be an Objective-C pointer or Block pointer (which
GCC also accepts).

Along the way, add 'const' to some of the pointer arguments of various utility
functions...

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

15 years agoir-gen for generation of trvial copy constructor
Fariborz Jahanian [Fri, 14 Aug 2009 20:11:43 +0000 (20:11 +0000)]
ir-gen for generation of trvial copy constructor
call.

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

15 years agoMake the CXXDefaultArgExpr constructor protected and add a static Create function.
Anders Carlsson [Fri, 14 Aug 2009 18:30:22 +0000 (18:30 +0000)]
Make the CXXDefaultArgExpr constructor protected and add a static Create function.

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

15 years agoPass '-Wno-' options to clang-cc. This fixes <rdar://problem/6943988>.
Ted Kremenek [Fri, 14 Aug 2009 18:20:50 +0000 (18:20 +0000)]
Pass '-Wno-' options to clang-cc.  This fixes <rdar://problem/6943988>.

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

15 years agoFixed a regression in deciding when to issue warning on properties which
Fariborz Jahanian [Fri, 14 Aug 2009 18:06:25 +0000 (18:06 +0000)]
Fixed a regression in deciding when to issue warning on properties which
implement NSCopying protocol in GC mode.

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

15 years agoUpdate/add links to developer meeting.
Ted Kremenek [Fri, 14 Aug 2009 17:11:34 +0000 (17:11 +0000)]
Update/add links to developer meeting.

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

15 years agoFix a few typos.
Daniel Dunbar [Fri, 14 Aug 2009 04:43:04 +0000 (04:43 +0000)]
Fix a few typos.

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

15 years agoPR4715
Shantonu Sen [Fri, 14 Aug 2009 04:07:15 +0000 (04:07 +0000)]
PR4715

-Wno-error disables WarningsAsErrors instead of
mistakenly being treated like -Werror

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

15 years agoFix spacing
Anders Carlsson [Fri, 14 Aug 2009 02:39:47 +0000 (02:39 +0000)]
Fix spacing

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