]> granicus.if.org Git - clang/log
clang
16 years agoIgnore XFAIL tests when checking for make failure in test/
Daniel Dunbar [Tue, 16 Sep 2008 23:43:13 +0000 (23:43 +0000)]
Ignore XFAIL tests when checking for make failure in test/

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

16 years agoFix copy-paste error in test case.
Ted Kremenek [Tue, 16 Sep 2008 23:25:28 +0000 (23:25 +0000)]
Fix copy-paste error in test case.

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

16 years agoMinor pass-sensitivity improvement:
Ted Kremenek [Tue, 16 Sep 2008 23:24:45 +0000 (23:24 +0000)]
Minor pass-sensitivity improvement:
  if we know that 'len != 0' and know that 'i == 0' then we know that
  'i < len' must evaluate to true and cannot evaluate to false

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

16 years agoUpdate Xcode project.
Ted Kremenek [Tue, 16 Sep 2008 23:21:45 +0000 (23:21 +0000)]
Update Xcode project.

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

16 years agoRemove support for BlockExprExpr. For example...
Steve Naroff [Tue, 16 Sep 2008 23:11:46 +0000 (23:11 +0000)]
Remove support for BlockExprExpr. For example...
 ^(expression) or ^(int arg1, float arg2)(expression)
...is no longer supported.
All block literals now require a compound statement.

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

16 years agoSema::ActOnBlockReturnStmt(): Need to perform the UsualUnaryConversions on the return...
Steve Naroff [Tue, 16 Sep 2008 22:25:10 +0000 (22:25 +0000)]
Sema::ActOnBlockReturnStmt(): Need to perform the UsualUnaryConversions on the return type.
Sema::CheckReturnStackAddr(): Make sure we skip over implicit casts.
Added some more test cases...

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

16 years agoProgramPoint now takes the space of two pointers instead of one. This change was
Ted Kremenek [Tue, 16 Sep 2008 18:44:52 +0000 (18:44 +0000)]
ProgramPoint now takes the space of two pointers instead of one. This change was
motivated because it became clear that the number of subclasses of ProgramPoint
would expand and we ran out of bits to represent a pointer variant. As a plus of
this change, BlockEdge program points can now be represented explicitly without
using a cache of CFGBlock* pairs in CFG.

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

16 years agoFixed an offset calculation error.
Zhongxing Xu [Tue, 16 Sep 2008 07:58:21 +0000 (07:58 +0000)]
Fixed an offset calculation error.

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

16 years agoPatch by Csaba Hruska!
Ted Kremenek [Sat, 13 Sep 2008 05:16:45 +0000 (05:16 +0000)]
Patch by Csaba Hruska!

"Here is a patch what replaces std::ostream with llvm::raw_ostream. This patch
covers the AST library, but ignores Analysis lib."

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

16 years agoUpdated checker build.
Ted Kremenek [Sat, 13 Sep 2008 00:23:41 +0000 (00:23 +0000)]
Updated checker build.

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

16 years agoInclude links to stderr output of clang in the table of files that clang rejects.
Ted Kremenek [Fri, 12 Sep 2008 22:49:36 +0000 (22:49 +0000)]
Include links to stderr output of clang in the table of files that clang rejects.

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

16 years agoAdd ccc support for -e and -sectorder.
Daniel Dunbar [Fri, 12 Sep 2008 19:42:28 +0000 (19:42 +0000)]
Add ccc support for -e and -sectorder.
    - llvmc2, save me!

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

16 years agoRound out object size checking builtins (fprintf ones disabled as we
Daniel Dunbar [Fri, 12 Sep 2008 18:39:42 +0000 (18:39 +0000)]
Round out object size checking builtins (fprintf ones disabled as we
have no mapping to FILE*). We are also missing printf format
attributes for the printf style ones.

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

16 years agoAdd website links to testing coverage & specification references.
Daniel Dunbar [Fri, 12 Sep 2008 18:33:44 +0000 (18:33 +0000)]
Add website links to testing coverage & specification references.

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

16 years agoAdd missing spaces in path diagnostics.
Ted Kremenek [Fri, 12 Sep 2008 18:17:46 +0000 (18:17 +0000)]
Add missing spaces in path diagnostics.

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

16 years agoTeach FindSpecRefs how to link to C++ spec.
Daniel Dunbar [Fri, 12 Sep 2008 18:10:49 +0000 (18:10 +0000)]
Teach FindSpecRefs how to link to C++ spec.

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

16 years agoAdd --suppress-system-warnings (on by default, use =0 to disable)
Daniel Dunbar [Fri, 12 Sep 2008 18:10:20 +0000 (18:10 +0000)]
Add --suppress-system-warnings (on by default, use =0 to disable)
 - For investigating warnings in system headers / builtins.
 - Currently also enables the behavior that allows silent redefinition
   of types in system headers. Conceptually these are separate but I
   didn't feel it was worth two options (or changing LangOptions).

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

16 years agoUpdated checker build.
Ted Kremenek [Fri, 12 Sep 2008 04:56:58 +0000 (04:56 +0000)]
Updated checker build.

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

16 years agoGive string literals const element typesin C++, and cope with the deprecated C++...
Douglas Gregor [Fri, 12 Sep 2008 00:47:35 +0000 (00:47 +0000)]
Give string literals const element typesin C++, and cope with the deprecated C++ conversion from a string literal to a pointer-to-non-const-character

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

16 years agoIterate on sema for :? in Objective-C:
Daniel Dunbar [Thu, 11 Sep 2008 23:12:46 +0000 (23:12 +0000)]
Iterate on sema for :? in Objective-C:
 - Follow C99 behavior of using other operand type when one of
   operands is a null pointer constant.
 - Fix overenthusiastic devolving of any Objective-C types to id:
   o If either operand has an Objective-C object type then:
     - If both operands are interfaces and either operand can be
       assigned to the other, use that type as the composite type.
     - Otherwise, if either type is id, use id as the composite type.
     - Otherwise, warn about incompatible types and use id as the
       composite type.
 - Return handling of qualified idea to separate test following
   general pointer type checking.
   o Upgraded from old code to allow devolving to id (without warning,
     which matches GCC).
 - <rdar://problem/6212771>

Add test case for issues fixed above, XFAIL though because it exposed
a new issue in property handling.

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

16 years agoAdd comments about C++ clause 3.3.2p4 that mentions that the condition declaration...
Argyrios Kyrtzidis [Thu, 11 Sep 2008 23:08:39 +0000 (23:08 +0000)]
Add comments about C++ clause 3.3.2p4 that mentions that the condition declaration should be local to an if/switch/while/for statement.

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

16 years agoEcho stderr/stdout from clang subprocess to both the stderr of ccc-analyzer and
Ted Kremenek [Thu, 11 Sep 2008 23:05:26 +0000 (23:05 +0000)]
Echo stderr/stdout from clang subprocess to both the stderr of ccc-analyzer and
to an output file. This way users can both see the output of 'clang' as well as
enable background logging of files that clang encounters problems on.

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

16 years agoBug fix: <rdar://problem/6164367>
Ted Kremenek [Thu, 11 Sep 2008 21:15:10 +0000 (21:15 +0000)]
Bug fix: <rdar://problem/6164367>

scan-build now correctly processes path prefixes that contain multiple '+'
characters or other regex control characters.

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

16 years agoAdded SSE41 pminsd, pmaxsd, roundps and a few others
Mon P Wang [Thu, 11 Sep 2008 19:22:31 +0000 (19:22 +0000)]
Added SSE41 pminsd, pmaxsd, roundps and a few others

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

16 years agoCheck if the environment variable TERM is defined before using it.
Ted Kremenek [Thu, 11 Sep 2008 18:17:51 +0000 (18:17 +0000)]
Check if the environment variable TERM is defined before using it.

This fixes: <rdar://problem/6164279> scan-build gives error when invoked without TERM variable

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

16 years agoUpdate Xcode project.
Ted Kremenek [Thu, 11 Sep 2008 18:14:22 +0000 (18:14 +0000)]
Update Xcode project.

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

16 years agoFix <rdar://problem/6210791> clang ObjC rewriter: @try / @catch block with no @finall...
Steve Naroff [Thu, 11 Sep 2008 15:29:03 +0000 (15:29 +0000)]
Fix <rdar://problem/6210791> clang ObjC rewriter: @try / @catch block with no @finally does not call objc_exception_try_exit.

Need a couple tweaks to RewriteObjCTryStmt(). Need to deal with implicit finally clauses (to make sure objc_exception_try_exit is called). Also fixed a related bug where we need to generate an implicit @catch else clause (to again make sure objc_exception_try_exit is called).

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

16 years agobool is not an extension in C++
Douglas Gregor [Thu, 11 Sep 2008 12:06:59 +0000 (12:06 +0000)]
bool is not an extension in C++

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

16 years agoMake sure to store the exception in the catch parameter.
Anders Carlsson [Thu, 11 Sep 2008 09:15:33 +0000 (09:15 +0000)]
Make sure to store the exception in the catch parameter.

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

16 years agoMake sure to emit the catch parameter as well as the catch body.
Anders Carlsson [Thu, 11 Sep 2008 08:21:54 +0000 (08:21 +0000)]
Make sure to emit the catch parameter as well as the catch body.

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

16 years agoFix stupid mistake I made in the exception handling code
Anders Carlsson [Thu, 11 Sep 2008 06:35:14 +0000 (06:35 +0000)]
Fix stupid mistake I made in the exception handling code

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

16 years agoDo implicit conversion to bool for the condition in a do-while statement.
Argyrios Kyrtzidis [Thu, 11 Sep 2008 05:16:22 +0000 (05:16 +0000)]
Do implicit conversion to bool for the condition in a do-while statement.

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

16 years agoFix do-while scoping in C++.
Argyrios Kyrtzidis [Thu, 11 Sep 2008 04:46:46 +0000 (04:46 +0000)]
Fix do-while scoping in C++.

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

16 years agoAllow array-to-pointer conversion for rvalues.
Argyrios Kyrtzidis [Thu, 11 Sep 2008 04:25:59 +0000 (04:25 +0000)]
Allow array-to-pointer conversion for rvalues.

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

16 years agoCXXConditionDeclExpr expression node is an lvalue.
Argyrios Kyrtzidis [Thu, 11 Sep 2008 04:22:26 +0000 (04:22 +0000)]
CXXConditionDeclExpr expression node is an lvalue.

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

16 years agoLangOptions.C99 should be false in C++.
Argyrios Kyrtzidis [Thu, 11 Sep 2008 04:21:06 +0000 (04:21 +0000)]
LangOptions.C99 should be false in C++.

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

16 years agoRevert r56078, getLang().C99 being true in C++ is a bug that will be fixed.
Argyrios Kyrtzidis [Thu, 11 Sep 2008 03:06:46 +0000 (03:06 +0000)]
Revert r56078, getLang().C99 being true in C++ is a bug that will be fixed.

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

16 years agoAdd support for expected-note to Clang's -verify option
Douglas Gregor [Thu, 11 Sep 2008 02:46:36 +0000 (02:46 +0000)]
Add support for expected-note to Clang's -verify option

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

16 years agoUse ABIArgInfo for decisions about function arguments (not just return
Daniel Dunbar [Thu, 11 Sep 2008 01:48:57 +0000 (01:48 +0000)]
Use ABIArgInfo for decisions about function arguments (not just return
value).
 - Added ABIArgInfo::ByVal (mostly supported) and ABIArgInfo::Expand
   (asserted out).

 - Added classifyArgumentType which currently just uses
   ABIArgInfo::Default or ByVal. This nearly matches old behavior, but
   we now set ByVal in a few situations we may have left it off before
   (on complex, for example).

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

16 years agoFix two bugs exposed by array passing assert:
Daniel Dunbar [Thu, 11 Sep 2008 00:50:25 +0000 (00:50 +0000)]
Fix two bugs exposed by array passing assert:
(1) Additional arguments to variadic methods should have default
promotions applied.

(2) Additional arguments to non-variadic methods were allowed.

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

16 years agoAdd ObjCMethodDecl::getSourceRange.
Daniel Dunbar [Thu, 11 Sep 2008 00:47:15 +0000 (00:47 +0000)]
Add ObjCMethodDecl::getSourceRange.

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

16 years agoFold Parser::ParseTag into Parser::ParseEnumSpecifier, as suggested in this post:
Argyrios Kyrtzidis [Thu, 11 Sep 2008 00:21:41 +0000 (00:21 +0000)]
Fold Parser::ParseTag into Parser::ParseEnumSpecifier, as suggested in this post:
  http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-September/002721.html

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

16 years agoBug fix, apply default argument promotion in message sends for which
Daniel Dunbar [Thu, 11 Sep 2008 00:04:36 +0000 (00:04 +0000)]
Bug fix, apply default argument promotion in message sends for which
no method declaration was found.
 - This was allowing arrays to pass "by value" among other things.

Add assert in CodeGen that arguments cannot have array type.

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

16 years agoRefactor common Obj-C message send checking code into
Daniel Dunbar [Thu, 11 Sep 2008 00:01:56 +0000 (00:01 +0000)]
Refactor common Obj-C message send checking code into
CheckMessageArgumentTypes.
 - No functionality change.

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

16 years ago-getLang().C99 is true in C++ too, remove the use of the C99orCXX variable.
Argyrios Kyrtzidis [Wed, 10 Sep 2008 23:46:08 +0000 (23:46 +0000)]
-getLang().C99 is true in C++ too, remove the use of the C99orCXX variable.
-Scoping in C99 works good for C++ too, remove the C++-specific comments.

If someone thinks that the C++-specific comments are necessary for clarification, let me know and I'll put them back on.

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

16 years agoIn the 'condition.cpp' test case, make sure that condition declarations are local...
Argyrios Kyrtzidis [Wed, 10 Sep 2008 23:34:50 +0000 (23:34 +0000)]
In the 'condition.cpp' test case, make sure that condition declarations are local to the statement.

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

16 years agoAdd XFAIL test case for:
Daniel Dunbar [Wed, 10 Sep 2008 23:11:23 +0000 (23:11 +0000)]
Add XFAIL test case for:
<rdar://problem/6211479> [sema] array type invalid for Obj-C property

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

16 years agoMore semantic analysis for blocks...
Steve Naroff [Wed, 10 Sep 2008 19:17:48 +0000 (19:17 +0000)]
More semantic analysis for blocks...

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

16 years agoSema::ActOnIdentifierExpr(): Lookup block arguments.
Steve Naroff [Wed, 10 Sep 2008 18:33:00 +0000 (18:33 +0000)]
Sema::ActOnIdentifierExpr(): Lookup block arguments.

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

16 years agoAdd some C++-specific comments in the parsing methods of if/switch/while/for.
Argyrios Kyrtzidis [Wed, 10 Sep 2008 17:38:35 +0000 (17:38 +0000)]
Add some C++-specific comments in the parsing methods of if/switch/while/for.

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

16 years agoImplement ABIArgType::Coerce support.
Daniel Dunbar [Wed, 10 Sep 2008 07:04:09 +0000 (07:04 +0000)]
Implement ABIArgType::Coerce support.
  - As a test, enable basic usage for some common x86-32 cases. This
    increases our x86-32 compliance (on other targets our compliance
    will just be broken in a different way).

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

16 years agoAdd CodeGenTypes::GetFunctionType overload for getting the effective
Daniel Dunbar [Wed, 10 Sep 2008 07:00:50 +0000 (07:00 +0000)]
Add CodeGenTypes::GetFunctionType overload for getting the effective
type of a call.

Change NeXT runtime to use this instead of trying to bitcasting
internally (which doesn't respect the ABI).

Fix subtle bug, use of ConvertTypeRecursive instead of ConvertType is
bad inside GetFunctionType.

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

16 years agoMove FunctionType conversion into CGCall.cpp:
Daniel Dunbar [Wed, 10 Sep 2008 04:01:49 +0000 (04:01 +0000)]
Move FunctionType conversion into CGCall.cpp:
 - Added CodeGenTypes::GetFunctionType, taking a CGFunctionInfo.
 - Updated Obj-C runtimes to use this instead of rolling the
   llvm::FunctionType by hand.
 - Killed CodeGenTypes::{ConvertReturnType, DecodeArgumentTypes}.

Add ABIArgInfo class to encapsulate ABI decision of how to lower types
to LLVM.
 - Will move to target sometime soon.

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

16 years agoAdd ABIArgInfo class to encapsulate ABI decision of how to lower types
Daniel Dunbar [Wed, 10 Sep 2008 02:41:04 +0000 (02:41 +0000)]
Add ABIArgInfo class to encapsulate ABI decision of how to lower types
to LLVM.
 - Will move to target sometime soon.

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

16 years agoImplement CodeGen support for the 'CXXConditionDeclExpr' expression node, which repre...
Argyrios Kyrtzidis [Wed, 10 Sep 2008 02:36:38 +0000 (02:36 +0000)]
Implement CodeGen support for the 'CXXConditionDeclExpr' expression node, which represents a 'condition' declaration, e.g: "if (int x=0) {...}".

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

16 years agoImplement Sema support for the 'condition' part of C++ selection-statements and itera...
Argyrios Kyrtzidis [Wed, 10 Sep 2008 02:17:11 +0000 (02:17 +0000)]
Implement Sema support for the 'condition' part of C++ selection-statements and iteration-statements (if/switch/while/for).

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

16 years agoChange line endings: CRLF -> LF
Argyrios Kyrtzidis [Wed, 10 Sep 2008 02:14:49 +0000 (02:14 +0000)]
Change line endings: CRLF -> LF

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

16 years agoUse Sema::isDeclInScope instead of IdentifierResolver::isDeclInScope.
Argyrios Kyrtzidis [Wed, 10 Sep 2008 02:11:07 +0000 (02:11 +0000)]
Use Sema::isDeclInScope instead of IdentifierResolver::isDeclInScope.

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

16 years agoTweak CGCall functions again:
Daniel Dunbar [Wed, 10 Sep 2008 00:41:16 +0000 (00:41 +0000)]
Tweak CGCall functions again:
 - Realized these functions will eventually need access to more data,
   moved to CodeGenModule. Eventually they should probably live
   together in some other helper class.

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

16 years agoTweak CGCall functions:
Daniel Dunbar [Wed, 10 Sep 2008 00:32:18 +0000 (00:32 +0000)]
Tweak CGCall functions:
 - Move actual param attr list creation to
   CodeGenFunction::ConstructParamAttrList.
 - Make ReturnTypeUsesSret static.

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

16 years agoAdd CodeGenFunction::ReturnTypeUsesSret
Daniel Dunbar [Tue, 9 Sep 2008 23:48:28 +0000 (23:48 +0000)]
Add CodeGenFunction::ReturnTypeUsesSret
 - Hook so NeXT runtime doesn't depend on ABI.

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

16 years agoAdd new 'CXXConditionDeclExpr' expression node used for a 'condition' declaration...
Argyrios Kyrtzidis [Tue, 9 Sep 2008 23:47:53 +0000 (23:47 +0000)]
Add new 'CXXConditionDeclExpr' expression node used for a 'condition' declaration, e.g: "if (int x=0) {...}".
It is a subclass of DeclRefExpr and the main difference is that CXXConditionDeclExpr owns the declaration that it references.

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

16 years agoMove ABI specific code for functions / calls to CGCall.cpp:
Daniel Dunbar [Tue, 9 Sep 2008 23:27:19 +0000 (23:27 +0000)]
Move ABI specific code for functions / calls to CGCall.cpp:
 - Factor out EmitFunction{Pro,Epi}log

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

16 years agoFactor CodeGenFunction::StartFunction out of GenerateCode and
Daniel Dunbar [Tue, 9 Sep 2008 23:14:03 +0000 (23:14 +0000)]
Factor CodeGenFunction::StartFunction out of GenerateCode and
StartObjCMethod.

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

16 years agoMake IdentifierResolver::isDeclInScope regard declarations of a parent 'control'...
Argyrios Kyrtzidis [Tue, 9 Sep 2008 21:57:58 +0000 (21:57 +0000)]
Make IdentifierResolver::isDeclInScope regard declarations of a parent 'control' scope as part of the current scope.
The 'control' scope is the 'condition' scope of if/switch/while statements and the scope that contains the for-init-statement and 'condition' of a for statement.

e.g:
if (int x = 0 /*'control' scope*/) {
  // x will be regarded as part of this substatement scope.
} else {
  // and as part of this substatement scope too.
}

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

16 years agoAdd a LangOptions member to IdentifierResolver.
Argyrios Kyrtzidis [Tue, 9 Sep 2008 21:32:02 +0000 (21:32 +0000)]
Add a LangOptions member to IdentifierResolver.
Make Sema pass the LangOptions to IdentifierResolver's constructor.

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

16 years agoAdd Sema::isDeclInScope which wraps IdentifierResolver::isDeclInScope.
Argyrios Kyrtzidis [Tue, 9 Sep 2008 21:18:04 +0000 (21:18 +0000)]
Add Sema::isDeclInScope which wraps IdentifierResolver::isDeclInScope.
No functionality change.

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

16 years agoUse a unified return block.
Daniel Dunbar [Tue, 9 Sep 2008 21:00:17 +0000 (21:00 +0000)]
Use a unified return block.
 - For the time being this means our emitted code is somewhat worse,
   especially for aggregates. This will be fixed.

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

16 years agoFix test case.
Argyrios Kyrtzidis [Tue, 9 Sep 2008 20:56:12 +0000 (20:56 +0000)]
Fix test case.

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

16 years agoMove EmitAggregate{Copy,Clear} into CodeGenFunction.
Daniel Dunbar [Tue, 9 Sep 2008 20:49:46 +0000 (20:49 +0000)]
Move EmitAggregate{Copy,Clear} into CodeGenFunction.
 - No functionality change.

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

16 years agoImplement parser support for the 'condition' part of C++ selection-statements and...
Argyrios Kyrtzidis [Tue, 9 Sep 2008 20:38:47 +0000 (20:38 +0000)]
Implement parser support for the 'condition' part of C++ selection-statements and iteration-statements (if/switch/while/for).
Add new 'ActOnCXXConditionDeclarationExpr' action, called when the 'condition' is a declaration instead of an expression.

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

16 years agoFix <rdar://problem/6197841> try, finally with no catch stops the exception from...
Steve Naroff [Tue, 9 Sep 2008 19:59:12 +0000 (19:59 +0000)]
Fix <rdar://problem/6197841> try, finally with no catch stops the exception from being propagated

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

16 years agoIdentifierResolver cleanup. Make some methods out-of-line.
Argyrios Kyrtzidis [Tue, 9 Sep 2008 19:28:27 +0000 (19:28 +0000)]
IdentifierResolver cleanup. Make some methods out-of-line.

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

16 years agoCheck in half-assed implementation of @try/@catch.
Anders Carlsson [Tue, 9 Sep 2008 17:59:25 +0000 (17:59 +0000)]
Check in half-assed implementation of @try/@catch.

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

16 years agoSimple @throw support.
Anders Carlsson [Tue, 9 Sep 2008 16:16:55 +0000 (16:16 +0000)]
Simple @throw support.

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

16 years agoTweak implementation for allowing ObjC builtin type redefinitions.
Steve Naroff [Tue, 9 Sep 2008 14:32:20 +0000 (14:32 +0000)]
Tweak implementation for allowing ObjC builtin type redefinitions.

- Replace string comparisons with pre-defined idents.
- Avoid calling isBuiltinObjCType() to avoid two checks.
- Remove isBuiltinObjCType(), since it was only used in Sema::MergeTypeDefDecl().
- Have Sema::MergeTypeDefDecl() set the new type.

This is a moidified version of an patch by David Chisnall.

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

16 years agoSimplify typesAreBlockCompatible().
Steve Naroff [Tue, 9 Sep 2008 13:47:19 +0000 (13:47 +0000)]
Simplify typesAreBlockCompatible().

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

16 years agoUpdate VC++ project files.
Argyrios Kyrtzidis [Tue, 9 Sep 2008 11:39:45 +0000 (11:39 +0000)]
Update VC++ project files.

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

16 years agoAdd types and functions related to exceptions.
Anders Carlsson [Tue, 9 Sep 2008 10:10:21 +0000 (10:10 +0000)]
Add types and functions related to exceptions.

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

16 years agoMove handling of @try and @throw to the runtime class.
Anders Carlsson [Tue, 9 Sep 2008 10:04:29 +0000 (10:04 +0000)]
Move handling of @try and @throw to the runtime class.

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

16 years agoAdded SSE4.1 packusdw
Mon P Wang [Tue, 9 Sep 2008 02:49:09 +0000 (02:49 +0000)]
Added SSE4.1 packusdw

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

16 years agoChange CodeGen to emit calls using (RValue,Type) list:
Daniel Dunbar [Tue, 9 Sep 2008 01:06:48 +0000 (01:06 +0000)]
Change CodeGen to emit calls using (RValue,Type) list:
 - Add CodeGenFunction::EmitAnyExprToTemp
   o Like EmitAnyExpr, but emits aggregates to a temporary location if
     none is available. Seems like this should be simpler (even aside
     from using first class aggregates).

 - Killed CodeGenFunction::EmitCallArg (just append the pair)

 - Conversion of RValues to actual call arguments is now isolated in
   CodeGenFunction::EmitCall.

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

16 years agoAdded SSE41 pmovsx pmovzx intrinsics
Mon P Wang [Tue, 9 Sep 2008 00:19:01 +0000 (00:19 +0000)]
Added SSE41 pmovsx pmovzx intrinsics

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

16 years agoFix a number of issues w.r.t. emission of global for functions and
Daniel Dunbar [Mon, 8 Sep 2008 23:44:31 +0000 (23:44 +0000)]
Fix a number of issues w.r.t. emission of global for functions and
aliases.
 - Attributes specific to a definition are only set when the
   definition is seen.
 - Alias generation is delayed until the end of the module; necessary
   since the alias may reference forward.
 - Fixes: PR2743, <rdr://6140807&6094512>
 - Improves: <rdr://6095112> (added XFAIL)

Also, print module on verification failures.

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

16 years agoRefactor parameter attribute handling:
Daniel Dunbar [Mon, 8 Sep 2008 21:33:45 +0000 (21:33 +0000)]
Refactor parameter attribute handling:
  - Add CGCall.h for dealing with ABI issues related to calls.
  - Add CGFunctionInfo and CGCallInfo for capturing ABI relevant
    information about functions and calls.
  - Isolate LLVM parameter attribute handling inside CGCall.cpp

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

16 years agoAdd ThreadSpecified bit to Decl.
Daniel Dunbar [Mon, 8 Sep 2008 20:05:47 +0000 (20:05 +0000)]
Add ThreadSpecified bit to Decl.
 - Patch from Kevin Tew.

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

16 years agoAdd missing RUN line
Daniel Dunbar [Mon, 8 Sep 2008 18:01:15 +0000 (18:01 +0000)]
Add missing RUN line

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

16 years agoSupport C++'s declaration-statement.
Argyrios Kyrtzidis [Sun, 7 Sep 2008 18:58:01 +0000 (18:58 +0000)]
Support C++'s declaration-statement.

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

16 years agorename libclangSEMA to libclangSema
Nico Weber [Sun, 7 Sep 2008 17:09:06 +0000 (17:09 +0000)]
rename libclangSEMA to libclangSema

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

16 years agoskip test if llvm-gcc is requires but not found on the path.
Nuno Lopes [Sat, 6 Sep 2008 16:42:14 +0000 (16:42 +0000)]
skip test if llvm-gcc is requires but not found on the path.
someone with llvm-gcc installed please test if the Codegen/function-attributes.c test isn't skip in your system. thanks.

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

16 years agoKey LLVM types for TagDecl's off of the clang Type, since there is now
Daniel Dunbar [Sat, 6 Sep 2008 02:26:43 +0000 (02:26 +0000)]
Key LLVM types for TagDecl's off of the clang Type, since there is now
a many-to-one relationship between TagDecl's and types.

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

16 years agoPer PR2773, define __USER_LABEL_PREFIX__ for x86-32 Linux and Windows.
Eli Friedman [Sat, 6 Sep 2008 01:37:51 +0000 (01:37 +0000)]
Per PR2773, define __USER_LABEL_PREFIX__ for x86-32 Linux and Windows.

If you're on some other platform, the correct definition for this macro
would be appreciated; to find the correct definition, just run the
following command:

echo | gcc -dM -E - | grep USER_LABEL_PREFIX

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

16 years agoMore type checking for blocks. Still incomplete (will hopefully finish up this weekend).
Steve Naroff [Fri, 5 Sep 2008 22:11:13 +0000 (22:11 +0000)]
More type checking for blocks. Still incomplete (will hopefully finish up this weekend).

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

16 years agoAdd comment back that Argiris pointed out that I mistakenly removed (the comments...
Ted Kremenek [Fri, 5 Sep 2008 17:39:33 +0000 (17:39 +0000)]
Add comment back that Argiris pointed out that I mistakenly removed (the comments below it were stale, so I accidently removed the whole thing).

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

16 years agoChange struct forward declarations and definitions to use unique RecordDecls, as...
Ted Kremenek [Fri, 5 Sep 2008 17:16:31 +0000 (17:16 +0000)]
Change struct forward declarations and definitions to use unique RecordDecls, as opposed to creating a single RecordDecl and reusing it.

This change effects both RecordDecls and CXXRecordDecls, but does not effect EnumDecls (yet).

The motivation of this patch is as follows:
- Capture more source information, necessary for refactoring/rewriting clients.

- Pave the way to resolve ownership issues with RecordDecls with the forthcoming
  addition of DeclGroups.

Current caveats:
- Until DeclGroups are in place, we will leak RecordDecls not explicitly
  referenced by the AST.  For example:

    typedef struct { ... } x;

  The RecordDecl for the struct will be leaked because the TypedefDecl doesn't
  refer to it.  This will be solved with DeclGroups.

- This patch also (temporarily) breaks CodeGen.  More below.

High-level changes:
- As before, TagType still refers to a TagDecl, but it doesn't own it.  When
  a struct/union/class is first referenced, a RecordType and RecordDecl are
  created for it, and the RecordType refers to that RecordDecl.  Later, if
  a new RecordDecl is created, the pointer to a RecordDecl in RecordType is
  updated to point to the RecordDecl that defines the struct/union/class.

- TagDecl and RecordDecl now how a method 'getDefinition()' to return the
  TagDecl*/RecordDecl* that refers to the TagDecl* that defines a particular
  enum/struct/class/union. This is useful from going from a RecordDecl* that
  defines a forward declaration to the RecordDecl* that provides the actual
  definition. Note that this also works for EnumDecls, except that in this case
  there is no distinction between forward declarations and definitions (yet).

- Clients should no longer assume that 'isDefinition()' returns true from a
  RecordDecl if the corresponding struct/union/class has been defined.
  isDefinition() only returns true if a particular RecordDecl is the defining
  Decl. Use 'getDefinition()' instead to determine if a struct has been defined.

- The main changes to Sema happen in ActOnTag. To make the changes more
  incremental, I split off the processing of enums and structs et al into two
  code paths. Enums use the original code path (which is in ActOnTag) and
  structs use the ActOnTagStruct. Eventually the two code paths will be merged,
  but the idea was to preserve the original logic both for comparison and not to
  change the logic for both enums and structs all at once.

- There is NO CHAINING of RecordDecls for the same RecordType. All RecordDecls
  that correspond to the same type simply have a pointer to that type. If we
  need to figure out what are all the RecordDecls for a given type we can build
  a backmap.

- The diff in CXXRecordDecl.[cpp,h] is actually very small; it just mimics the
  changes to RecordDecl. For some reason 'svn' marks the entire file as changed.

Why is CodeGen broken:
- Codegen assumes that there is an equivalence between RecordDecl* and
  RecordType*. This was true before because we only created one RecordDecl* for
  a given RecordType*, but it is no longer true. I believe this shouldn't be too
  hard to change, but the patch was big enough as it is.

I have tested this patch on both the clang test suite, and by running the static analyzer over Postgresql and a large Apple-internal project (mix of Objective-C and C).

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

16 years agoSupport "typeof unary-expression" (GNU C++ extension).
Argyrios Kyrtzidis [Fri, 5 Sep 2008 11:26:19 +0000 (11:26 +0000)]
Support "typeof unary-expression" (GNU C++ extension).

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

16 years agoSet different header search paths for the Windows platform.
Argyrios Kyrtzidis [Fri, 5 Sep 2008 09:41:20 +0000 (09:41 +0000)]
Set different header search paths for the Windows platform.

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

16 years agoAdd header search paths for Mingw32 (GCC version 4).
Argyrios Kyrtzidis [Fri, 5 Sep 2008 09:03:53 +0000 (09:03 +0000)]
Add header search paths for Mingw32 (GCC version 4).

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

16 years agoLine endings: CRLF -> LF
Argyrios Kyrtzidis [Fri, 5 Sep 2008 08:53:53 +0000 (08:53 +0000)]
Line endings: CRLF -> LF

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

16 years agoFix placement of const on a number of X86 builtins.
Daniel Dunbar [Fri, 5 Sep 2008 05:56:16 +0000 (05:56 +0000)]
Fix placement of const on a number of X86 builtins.

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