]> granicus.if.org Git - clang/log
clang
16 years agoAdd a couple more headers. stddef was discussed on cfe-dev, and
Eli Friedman [Tue, 20 May 2008 13:34:26 +0000 (13:34 +0000)]
Add a couple more headers.  stddef was discussed on cfe-dev, and
consensus was that it was fine; iso646 is trivial.

We actually don't need that many headers overall... on Ubuntu, at least,
all we need are stdint.h, stdarg.h, limits.h, and float.h to stop
depending on having gcc's headers around for normal code.

On a side note, the path searching needs some improvement; I had to
hardcode the path to my header directory into clang.cpp to get the
driver to use it consistently.

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

16 years agoTest from PR2332; bug already fixed by r51311.
Eli Friedman [Tue, 20 May 2008 12:55:29 +0000 (12:55 +0000)]
Test from PR2332; bug already fixed by r51311.

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

16 years agoDisable the function address cache; this doesn't have any ill effects,
Eli Friedman [Tue, 20 May 2008 09:21:07 +0000 (09:21 +0000)]
Disable the function address cache; this doesn't have any ill effects,
as far as I can tell, and it fixes code like test/CodeGen/functions.c.

(Whatever performance effect it might have, crashing on a
construct like this isn't really acceptable; I've run into this
multiple times.)

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

16 years agoFix the scope of K&R-style argument declarations so that they don't
Eli Friedman [Tue, 20 May 2008 09:10:20 +0000 (09:10 +0000)]
Fix the scope of K&R-style argument declarations so that they don't
extend beyond the end of the function.

I'm not completely sure this is the right way to fix this bug, so
someone familiar with the parser should double-check.

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

16 years agoFix test (it was incorrectly succeeding).
Eli Friedman [Tue, 20 May 2008 09:04:19 +0000 (09:04 +0000)]
Fix test (it was incorrectly succeeding).

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

16 years agoAdd codegen support for stack address intrinsics.
Eli Friedman [Tue, 20 May 2008 08:59:34 +0000 (08:59 +0000)]
Add codegen support for stack address intrinsics.

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

16 years agoFix typo in test.
Eli Friedman [Tue, 20 May 2008 08:27:04 +0000 (08:27 +0000)]
Fix typo in test.

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

16 years agoAdd __builtin_frame_address and __builtin_return_address gcc builtins to
Eli Friedman [Tue, 20 May 2008 08:23:37 +0000 (08:23 +0000)]
Add __builtin_frame_address and __builtin_return_address gcc builtins to
Sema. No codegen yet.

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

16 years agoImplement codegen for comma operator for structs.
Eli Friedman [Tue, 20 May 2008 07:56:31 +0000 (07:56 +0000)]
Implement codegen for comma operator for structs.

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

16 years agoBe a bit more defensive in SemaInit.
Eli Friedman [Tue, 20 May 2008 05:25:56 +0000 (05:25 +0000)]
Be a bit more defensive in SemaInit.

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

16 years agoAdd some more checking for compound literals.
Eli Friedman [Tue, 20 May 2008 05:22:08 +0000 (05:22 +0000)]
Add some more checking for compound literals.

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

16 years agoReclaim memory from chains of ScopedDecls, and reclaim memory for the initializers...
Ted Kremenek [Tue, 20 May 2008 04:49:55 +0000 (04:49 +0000)]
Reclaim memory from chains of ScopedDecls, and reclaim memory for the initializers of EnumConstantDecls.

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

16 years agoDelete AST nodes, not just Decls.
Ted Kremenek [Tue, 20 May 2008 04:10:52 +0000 (04:10 +0000)]
Delete AST nodes, not just Decls.

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

16 years agoReclaim memory allocated for ParmVarDecl's in FunctionDecl::Destroy.
Ted Kremenek [Tue, 20 May 2008 03:56:00 +0000 (03:56 +0000)]
Reclaim memory allocated for ParmVarDecl's in FunctionDecl::Destroy.

Fixed a bug in ParmVarDecl::param_end(): Handle the case where there are no
ParmVarDecls for a FunctionDecl, but its function prototype has formal arguments
(can happen with typedefs).

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

16 years agoWhen serializing FunctionDecl, serialize out a reference to the previous declaration.
Ted Kremenek [Tue, 20 May 2008 03:33:58 +0000 (03:33 +0000)]
When serializing FunctionDecl, serialize out a reference to the previous declaration.

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

16 years agoRemove unnecessary #include (introduced by a recent patch of mine).
Ted Kremenek [Tue, 20 May 2008 00:47:23 +0000 (00:47 +0000)]
Remove unnecessary #include (introduced by a recent patch of mine).

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

16 years agoTry to plug some memory leaks...
Ted Kremenek [Tue, 20 May 2008 00:43:19 +0000 (00:43 +0000)]
Try to plug some memory leaks...

1) Sema::ParseAST now constructs a TranslationUnit object to own the top-level Decls, which releases the top-level Decls upon exiting ParseAST.

2) Bug fix: TranslationUnit::~TranslationUnit handles the case where a Decl is added more than once as a top-level Decl.

3) Decl::Destroy is now a virtual method, obviating the need for a special dispatch based on DeclKind.

3) FunctionDecl::Destroy now releases its Body using its Destroy method.

4) Added Stmt::Destroy and Stmt::DestroyChildren, which recursively delete the child ASTs of a Stmt and call their dstors.  We may need to special case dstor/Destroy methods for particular Stmt subclasses that own other dynamically allocated objects besides AST nodes.

5) REGRESSION: We temporarily are not deallocating attributes; a FIXME is provided.

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

16 years agoRestructure constant structure init codegen so that it's possible to
Eli Friedman [Tue, 20 May 2008 00:11:07 +0000 (00:11 +0000)]
Restructure constant structure init codegen so that it's possible to
implement bitfield codegen (although I don't envy the person who
implements it).  This also prevents a crash on code like that from PR2309
(it's still broken, but it fails more gracefully).

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

16 years agoRemove code that shouldn't have any effect anymore.
Eli Friedman [Tue, 20 May 2008 00:04:21 +0000 (00:04 +0000)]
Remove code that shouldn't have any effect anymore.

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

16 years agoImplement CodeGen for __builtin_memcpy.
Eli Friedman [Mon, 19 May 2008 23:27:48 +0000 (23:27 +0000)]
Implement CodeGen for __builtin_memcpy.

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

16 years agoUpdated Xcode project.
Ted Kremenek [Mon, 19 May 2008 23:19:04 +0000 (23:19 +0000)]
Updated Xcode project.

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

16 years agoAdded Stmt::DestroyChildren, which will be used by the dstors of the subclasses of...
Ted Kremenek [Mon, 19 May 2008 22:02:12 +0000 (22:02 +0000)]
Added Stmt::DestroyChildren, which will be used by the dstors of the subclasses of Stmt to recursively delete their child AST nodes.

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

16 years agoMake the unused expression warning a bit less aggressive (found in PHP
Eli Friedman [Mon, 19 May 2008 21:24:43 +0000 (21:24 +0000)]
Make the unused expression warning a bit less aggressive (found in PHP
code).

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

16 years agoSwitch on SemaInit; this makes some code in SemaDecl dead, but I'll give
Eli Friedman [Mon, 19 May 2008 20:29:35 +0000 (20:29 +0000)]
Switch on SemaInit; this makes some code in SemaDecl dead, but I'll give
it a few days to make sure there aren't any significant regressions.

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

16 years agoAdjust warning so that it doesn't fire when there is an error.
Eli Friedman [Mon, 19 May 2008 20:20:43 +0000 (20:20 +0000)]
Adjust warning so that it doesn't fire when there is an error.

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

16 years agoRemove illegal test.
Eli Friedman [Mon, 19 May 2008 20:17:34 +0000 (20:17 +0000)]
Remove illegal test.

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

16 years agoAdd errors for some illegal constructs (specifically, "int a = {{3}};"
Eli Friedman [Mon, 19 May 2008 20:12:18 +0000 (20:12 +0000)]
Add errors for some illegal constructs (specifically, "int a = {{3}};"
and "int a = {};").  I'll adjust the tests in a bit.

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

16 years agoSome more SemaInit cleanup.
Eli Friedman [Mon, 19 May 2008 20:00:43 +0000 (20:00 +0000)]
Some more SemaInit cleanup.

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

16 years agoVarious fixes; solves (almost) all of the test regressions that would be
Eli Friedman [Mon, 19 May 2008 19:16:24 +0000 (19:16 +0000)]
Various fixes; solves (almost) all of the test regressions that would be
caused by enabling SemaInit.

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

16 years agoFix the emission of expressions like char a[10] = "asdf"; previously,
Eli Friedman [Mon, 19 May 2008 17:51:16 +0000 (17:51 +0000)]
Fix the emission of expressions like char a[10] = "asdf"; previously,
they were causing bad code to be emitted.  There are two fixes here: one
makes sure we emit a string that is long enough, and one makes sure we
properly handle string initialization in init lists.

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

16 years agoAdd proper type-checking for pointer additiion; before, we were accepting
Eli Friedman [Sun, 18 May 2008 18:08:51 +0000 (18:08 +0000)]
Add proper type-checking for pointer additiion; before, we were accepting
addition with a pointer and an integer even when it didn't make sense.

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

16 years agoFix support for _Bool bitfields. The issue is that the bitfield width
Eli Friedman [Sat, 17 May 2008 20:03:47 +0000 (20:03 +0000)]
Fix support for _Bool bitfields. The issue is that the bitfield width
used for _Bool is not the same as the primitive width (which for _Bool
is 1 bit).  The load and store changes add some casts to make the
types consistent.  The EmitLValue changes make sure that the pointer is
of an appropriate type for loading the bitfield.

This isn't perfect, but it's an improvement, and getting everything
right depends on actually laying out structs in an ABI-compliant way.

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

16 years agoMicro-optimization when checking for panic functions.
Ted Kremenek [Sat, 17 May 2008 00:42:01 +0000 (00:42 +0000)]
Micro-optimization when checking for panic functions.

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

16 years agoFix 80 col violation.
Ted Kremenek [Sat, 17 May 2008 00:40:45 +0000 (00:40 +0000)]
Fix 80 col violation.

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

16 years agoAdded panic function _XCAssertionFailureHandler.
Ted Kremenek [Sat, 17 May 2008 00:33:23 +0000 (00:33 +0000)]
Added panic function _XCAssertionFailureHandler.

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

16 years agoBackout of codegen-based fix to PR2334; this has been fixed differently
Eli Friedman [Fri, 16 May 2008 20:38:39 +0000 (20:38 +0000)]
Backout of codegen-based fix to PR2334; this has been fixed differently
at the Sema layer.

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

16 years agoSema-based fix for PR2334. The issue is that even if the two sides of
Eli Friedman [Fri, 16 May 2008 20:37:07 +0000 (20:37 +0000)]
Sema-based fix for PR2334.  The issue is that even if the two sides of
the condidtional have compatible types, they are not necessarily the
same type.  Therefore, we cast to the composite type.  As a hack, for
the moment we assume that the composite type is the type of the
left-hand expression; this isn't correct, but it's good enough for most
purposes.

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

16 years agoFix some prototypes, and implement some builtins until we have our header files compl...
Nate Begeman [Fri, 16 May 2008 18:59:42 +0000 (18:59 +0000)]
Fix some prototypes, and implement some builtins until we have our header files completed.

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

16 years agoCache leaks by the allocation site, not the leak location.
Ted Kremenek [Fri, 16 May 2008 18:33:44 +0000 (18:33 +0000)]
Cache leaks by the allocation site, not the leak location.

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

16 years agoPartitioned BugTypeCachedLocation::isCached() into two methods: one that accepts...
Ted Kremenek [Fri, 16 May 2008 18:33:14 +0000 (18:33 +0000)]
Partitioned BugTypeCachedLocation::isCached() into two methods: one that accepts and ExplodedNode, and the other that accepts a ProgramPoint.  The default behavior is to cache bug reports by the
location they occur (the end node).  Subclasses can override this behavior by providing a different ProgramPoint.

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

16 years agoReview nit.
Eli Friedman [Fri, 16 May 2008 17:54:49 +0000 (17:54 +0000)]
Review nit.

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

16 years agoClean up ownership per review comment.
Eli Friedman [Fri, 16 May 2008 17:51:27 +0000 (17:51 +0000)]
Clean up ownership per review comment.

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

16 years agoFix review nit.
Eli Friedman [Fri, 16 May 2008 17:44:00 +0000 (17:44 +0000)]
Fix review nit.

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

16 years agoPatch for PR2334, and a similar ObjC bug.
Eli Friedman [Fri, 16 May 2008 17:37:11 +0000 (17:37 +0000)]
Patch for PR2334, and a similar ObjC bug.

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

16 years agoAdded CFGBlock::hasBinaryBranchTerminator().
Ted Kremenek [Fri, 16 May 2008 16:06:00 +0000 (16:06 +0000)]
Added CFGBlock::hasBinaryBranchTerminator().

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

16 years agoMinor cleanup to isBuiltinConstantExpr.
Eli Friedman [Fri, 16 May 2008 13:28:37 +0000 (13:28 +0000)]
Minor cleanup to isBuiltinConstantExpr.

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

16 years agoFixed another regression introduced by r51113 caused by some refactoring
Ted Kremenek [Thu, 15 May 2008 22:24:49 +0000 (22:24 +0000)]
Fixed another regression introduced by r51113 caused by some refactoring
in Sema::CheckFunctionCall:

  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080512/005706.html

The bug was that the logic from the helper methods used by CheckFunctionCall
were being inverted (a subtle bug).  This would cause the parser to discard
any valid AST nodes involving several builtins (see patch).

This removes the last regression failure I'm seeing in the test suite: Analysis-Apple/NoReturn.

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

16 years agoRemoved bogus "return true" in Expr::isConstantExpr that returned true for all
Ted Kremenek [Thu, 15 May 2008 21:49:04 +0000 (21:49 +0000)]
Removed bogus "return true" in Expr::isConstantExpr that returned true for all
expressions. This appears to be a regression introduced in r51113 that caused
many test cases to fail (there is still a test case in the Analysis directory
that is failing):

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080512/005706.html

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

16 years agoFix rewriter bug <rdar://problem/5929344> clang ObjC rewriter: "extern int __CFConsta...
Steve Naroff [Thu, 15 May 2008 21:12:10 +0000 (21:12 +0000)]
Fix rewriter bug <rdar://problem/5929344> clang ObjC rewriter: "extern int __CFConstantStringClassReference[];" should be extern "C".

Have clang predefine OBJC_NEW_PROPERTIES (which is what gcc does).

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

16 years agoRevert...
Steve Naroff [Thu, 15 May 2008 19:53:06 +0000 (19:53 +0000)]
Revert...

Author: akirtzidis
Date: Wed May 14 05:00:15 2008
New Revision: 51101

URL: http://llvm.org/viewvc/llvm-project?rev=51101&view=rev
Log: Upgrading VC++ projects to VC++ 2008.

I really need to build with VC++ 2005.

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

16 years agoMake isFileVarDecl() return true when the VarDecl is in a C++ namespace.
Argyrios Kyrtzidis [Thu, 15 May 2008 17:53:43 +0000 (17:53 +0000)]
Make isFileVarDecl() return true when the VarDecl is in a C++ namespace.

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

16 years agoComments fix.
Argyrios Kyrtzidis [Thu, 15 May 2008 17:26:35 +0000 (17:26 +0000)]
Comments fix.

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

16 years agoHandle a couple missing builtins that will go away eventually when the various
Nate Begeman [Thu, 15 May 2008 07:38:03 +0000 (07:38 +0000)]
Handle a couple missing builtins that will go away eventually when the various
intrin.h files are finished

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

16 years agoAdd some of GCC's object checking builtin's.
Steve Naroff [Wed, 14 May 2008 22:12:15 +0000 (22:12 +0000)]
Add some of GCC's object checking builtin's.

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

16 years agoUse double-underscores in front of all non-keywords to protect against
Eli Friedman [Wed, 14 May 2008 20:32:22 +0000 (20:32 +0000)]
Use double-underscores in front of all non-keywords to protect against
#define pollution.

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

16 years agoDon't specify a -o option to clang when not using "-checker-cfref".
Ted Kremenek [Wed, 14 May 2008 20:26:52 +0000 (20:26 +0000)]
Don't specify a -o option to clang when not using "-checker-cfref".

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

16 years agoFix variable misspelling.
Ted Kremenek [Wed, 14 May 2008 20:20:46 +0000 (20:20 +0000)]
Fix variable misspelling.

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

16 years agoDon't run clang on .s files.
Ted Kremenek [Wed, 14 May 2008 20:17:17 +0000 (20:17 +0000)]
Don't run clang on .s files.

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

16 years agoMake header use the new __builtin_shufflevector builtin.
Eli Friedman [Wed, 14 May 2008 20:11:29 +0000 (20:11 +0000)]
Make header use the new __builtin_shufflevector builtin.

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

16 years agoAdded "-a" option to scan-build to select the analysis (ASTConsumer) used by clang...
Ted Kremenek [Wed, 14 May 2008 20:10:33 +0000 (20:10 +0000)]
Added "-a" option to scan-build to select the analysis (ASTConsumer) used by clang.  The default is -checker-cfref.

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

16 years agoImplementation of __builtin_shufflevector, a portable builtin capable of
Eli Friedman [Wed, 14 May 2008 19:38:39 +0000 (19:38 +0000)]
Implementation of __builtin_shufflevector, a portable builtin capable of
expressing the full flexibility of the LLVM shufflevector instruction.
The expected immediate usage is in *mmintrin.h, so that they don't
depend on the mess of gcc-inherited (and not completely implemented)
shuffle builtins.

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

16 years agoZero-pad the month and day fields in the output HTML directory.
Ted Kremenek [Wed, 14 May 2008 17:23:56 +0000 (17:23 +0000)]
Zero-pad the month and day fields in the output HTML directory.

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

16 years agoUpdate the clangSema VC++ project.
Argyrios Kyrtzidis [Wed, 14 May 2008 10:50:44 +0000 (10:50 +0000)]
Update the clangSema VC++ project.

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

16 years agoChange CRLF line endings to LF.
Argyrios Kyrtzidis [Wed, 14 May 2008 10:49:47 +0000 (10:49 +0000)]
Change CRLF line endings to LF.

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

16 years agoUpgrading VC++ projects to VC++ 2008.
Argyrios Kyrtzidis [Wed, 14 May 2008 10:00:15 +0000 (10:00 +0000)]
Upgrading VC++ projects to VC++ 2008.

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

16 years agoAn array of VLAs is a VLA. Shouldn't make any significant difference at
Eli Friedman [Wed, 14 May 2008 00:40:18 +0000 (00:40 +0000)]
An array of VLAs is a VLA.  Shouldn't make any significant difference at
the moment, but it what you'd expect in the AST from reading the
standard, and it should make VLA codegen a bit more strightforward.

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

16 years agoAdd codegen support for block-level compound literals.
Eli Friedman [Tue, 13 May 2008 23:18:27 +0000 (23:18 +0000)]
Add codegen support for block-level compound literals.

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

16 years agoAdd support for init lists for complex variables.
Eli Friedman [Tue, 13 May 2008 23:11:35 +0000 (23:11 +0000)]
Add support for init lists for complex variables.

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

16 years agoOutput #LINE for computing line counts.
Ted Kremenek [Tue, 13 May 2008 22:56:36 +0000 (22:56 +0000)]
Output #LINE for computing line counts.

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

16 years agoUse "-i" option with make when ignoring errors.
Ted Kremenek [Tue, 13 May 2008 21:28:02 +0000 (21:28 +0000)]
Use "-i" option with make when ignoring errors.

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

16 years agoRemove AST dependency on VMCore by switching ExtVectorElementExpr off Constant.
Nate Begeman [Tue, 13 May 2008 21:03:02 +0000 (21:03 +0000)]
Remove AST dependency on VMCore by switching ExtVectorElementExpr off Constant.

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

16 years agoBoth operands to && have to be scalars, not just one.
Eli Friedman [Tue, 13 May 2008 20:16:47 +0000 (20:16 +0000)]
Both operands to && have to be scalars, not just one.

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

16 years agoRe-enable the analyzer.
Ted Kremenek [Tue, 13 May 2008 17:10:28 +0000 (17:10 +0000)]
Re-enable the analyzer.

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

16 years agoDetabify.
Eli Friedman [Tue, 13 May 2008 14:40:48 +0000 (14:40 +0000)]
Detabify.

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

16 years agoPlace "-x" option before other analyzer options.
Ted Kremenek [Mon, 12 May 2008 23:56:50 +0000 (23:56 +0000)]
Place "-x" option before other analyzer options.

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

16 years agoDirectly invoke gcc immediately instead of before we process the command line arguments.
Ted Kremenek [Mon, 12 May 2008 23:47:41 +0000 (23:47 +0000)]
Directly invoke gcc immediately instead of before we process the command line arguments.

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

16 years agoFix <rdar://problem/5924576> clang -fsyntax-only generates "redefinition" errors...
Steve Naroff [Mon, 12 May 2008 22:36:43 +0000 (22:36 +0000)]
Fix <rdar://problem/5924576> clang -fsyntax-only generates "redefinition" errors when parsing AppKit that gcc does not.

Teach Sema::MergeVarDecl() about __private_extern__.

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

16 years agoAdded internal command logging.
Ted Kremenek [Mon, 12 May 2008 22:07:14 +0000 (22:07 +0000)]
Added internal command logging.

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

16 years agoFix <rdar://problem/5928590> clang -fsyntax-only: "incompatible operand types ('int...
Steve Naroff [Mon, 12 May 2008 21:44:38 +0000 (21:44 +0000)]
Fix <rdar://problem/5928590> clang -fsyntax-only: "incompatible operand types ('int' and 'void')" on input that 'gcc -fsyntax-only' eats

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

16 years agotestcase for PR2263, fixed by Nate's r50903 patch.
Chris Lattner [Mon, 12 May 2008 18:31:17 +0000 (18:31 +0000)]
testcase for PR2263, fixed by Nate's r50903 patch.

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

16 years agoUnbreak build.
Ted Kremenek [Mon, 12 May 2008 17:42:30 +0000 (17:42 +0000)]
Unbreak build.

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

16 years agoSupport StringLiteralVal when comparing LVal types.
Ted Kremenek [Mon, 12 May 2008 17:41:30 +0000 (17:41 +0000)]
Support StringLiteralVal when comparing LVal types.

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

16 years agoGrammar cleanup in comment.
Ted Kremenek [Mon, 12 May 2008 17:40:56 +0000 (17:40 +0000)]
Grammar cleanup in comment.
Remove redundant assignment.

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

16 years ago80 col violation fix.
Ted Kremenek [Mon, 12 May 2008 17:40:13 +0000 (17:40 +0000)]
80 col violation fix.

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

16 years agoWhen reading in the DeclCtx during deserialization, register the DeclCtx of the
Ted Kremenek [Mon, 12 May 2008 17:29:34 +0000 (17:29 +0000)]
When reading in the DeclCtx during deserialization, register the DeclCtx of the
ScopedDecl with the backpatcher, and *not* a local variable on the stack. The
value of DeclCtx gets filled in *later* by the backpatcher.

This fixes: http://llvm.org/bugs/show_bug.cgi?id=2308

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

16 years agoAdd Type::getAsTypedefType().
Ted Kremenek [Mon, 12 May 2008 16:22:53 +0000 (16:22 +0000)]
Add Type::getAsTypedefType().

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

16 years agoEmit basic block for switch body; fixes PR2307.
Eli Friedman [Mon, 12 May 2008 16:08:04 +0000 (16:08 +0000)]
Emit basic block for switch body; fixes PR2307.

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

16 years agoDon't try to take the address of a bitfield; fixes PR2310.
Eli Friedman [Mon, 12 May 2008 15:06:05 +0000 (15:06 +0000)]
Don't try to take the address of a bitfield; fixes PR2310.

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

16 years agofix free/delete mismatch problem in add/mergeProperties (found by valgrind)
Nuno Lopes [Sat, 10 May 2008 10:31:54 +0000 (10:31 +0000)]
fix free/delete mismatch problem in add/mergeProperties (found by valgrind)

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

16 years agoImplement -rewrite-macros, which is a crazy macro expander that expands
Chris Lattner [Sat, 10 May 2008 00:02:33 +0000 (00:02 +0000)]
Implement -rewrite-macros, which is a crazy macro expander that expands
macros but doesn't expand #includes, remove comments, remove #defines
etc.

For example:

----
#include <stdio.h>

#define bbaa
#define funclike(x) x "a" x "b" x

bbaa  bbaa

#if 1
funclike("gar")
foo /*blah*/  bar
bar
#endif

#if 0
funclike()
#endif
----

rewrites to:

----
#include <stdio.h>

#define bbaa
#define funclike(x) x "a" x "b" x

/*bbaa  bbaa*/

#if 1
 "gar" "a" "gar" "b" "gar"/*funclike*//*("gar")*/
foo /*blah*/  bar
bar
#endif

#if 0
/*funclike()*/
#endif
----

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

16 years agoRename IsPointerType to LVal::IsLValType, and update CFRefCount::EvalSummary to use...
Ted Kremenek [Fri, 9 May 2008 23:45:33 +0000 (23:45 +0000)]
Rename IsPointerType to LVal::IsLValType, and update CFRefCount::EvalSummary to use IsLValType when conjuring symbols for return values (this fixes a bug with an assertion firing in the analyzer when two qualified objective-c types were compared).

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

16 years ago-Implement proper name lookup for namespaces.
Argyrios Kyrtzidis [Fri, 9 May 2008 23:39:43 +0000 (23:39 +0000)]
-Implement proper name lookup for namespaces.
-identifierResolver exposes an iterator interface to get all decls through the scope chain.
-The semantic staff (checking IdentifierNamespace and Doug's checking for shadowed tags were moved out of IdentifierResolver and back into Sema. IdentifierResolver just gives an iterator for all reachable decls of an identifier.

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

16 years agomake #if 0 code compile, even though it still isn't very useful.
Chris Lattner [Fri, 9 May 2008 22:43:24 +0000 (22:43 +0000)]
make #if 0 code compile, even though it still isn't very useful.

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

16 years agoAdded support to generate some atomic operators (add, sub, and, or etc..)
Mon P Wang [Fri, 9 May 2008 22:40:52 +0000 (22:40 +0000)]
Added support to generate some atomic operators (add, sub, and, or etc..)

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

16 years agoFix <rdar://problem/5924225> clang ObjC rewriter: objc_exception_throw declaration...
Steve Naroff [Fri, 9 May 2008 21:17:56 +0000 (21:17 +0000)]
Fix <rdar://problem/5924225> clang ObjC rewriter: objc_exception_throw declaration in preamble does not match objc/objc-exception.h.

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

16 years agoDO NOT pre-defined __OBJC2__. The __OBJC2__ macro should only be defined when targeti...
Steve Naroff [Fri, 9 May 2008 20:52:28 +0000 (20:52 +0000)]
DO NOT pre-defined __OBJC2__. The __OBJC2__ macro should only be defined when targeting the new, Apple 2.0 *runtime ABI*. It is not intended to be used to #ifdef ObjC 2.0 langauge features. This is unfortunate (given it's name). In a perfect world, this defined would be named __OBJC2_RUNTIME_ABI__. Oh well.

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

16 years agoMore VC++ project file updates.
Steve Naroff [Fri, 9 May 2008 19:10:27 +0000 (19:10 +0000)]
More VC++ project file updates.

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

16 years agoRemove repeated word.
Ted Kremenek [Fri, 9 May 2008 17:53:57 +0000 (17:53 +0000)]
Remove repeated word.

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

16 years agoAdd attribute "format" support for typedefs of function pointers.
Ted Kremenek [Fri, 9 May 2008 17:36:24 +0000 (17:36 +0000)]
Add attribute "format" support for typedefs of function pointers.

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

16 years agoGrammar.
Ted Kremenek [Fri, 9 May 2008 17:13:18 +0000 (17:13 +0000)]
Grammar.

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