]> granicus.if.org Git - clang/log
clang
16 years agoAdd builtin type signature support for vector types. Add correct type signatures...
Anders Carlsson [Tue, 27 Nov 2007 07:22:09 +0000 (07:22 +0000)]
Add builtin type signature support for vector types. Add correct type signatures for a bunch of MMX builtins. We now parse all the intrinsics in mmintrin.h

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

16 years agoAdd comment to CheckVectorCast.h
Anders Carlsson [Tue, 27 Nov 2007 07:16:40 +0000 (07:16 +0000)]
Add comment to CheckVectorCast.h

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

16 years agotake an initial stab at setting function linkage right. Handle
Chris Lattner [Tue, 27 Nov 2007 06:46:51 +0000 (06:46 +0000)]
take an initial stab at setting function linkage right.  Handle
static and inline at least.

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

16 years agoReport errors for invalid casts from/to vectors.
Anders Carlsson [Tue, 27 Nov 2007 05:51:55 +0000 (05:51 +0000)]
Report errors for invalid casts from/to vectors.

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

16 years agoAdd more semantic analysis for inline asm statements.
Anders Carlsson [Tue, 27 Nov 2007 04:11:28 +0000 (04:11 +0000)]
Add more semantic analysis for inline asm statements.

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

16 years agoAdded optional pass-by-reference argument "isExact" to
Ted Kremenek [Mon, 26 Nov 2007 23:12:30 +0000 (23:12 +0000)]
Added optional pass-by-reference argument "isExact" to
NumericLiteralParser::GetFloatValue(). Upon method return, this flag has the value
true if the returned APFloat can exactly represent the number in the parsed text,
and false otherwise.

Modified the implementation of GetFloatValue() to parse literals using APFloat's
convertFromString method (which allows us to set the value of isExact).

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

16 years agoRemoved dependence on #including iostream.
Ted Kremenek [Mon, 26 Nov 2007 22:50:46 +0000 (22:50 +0000)]
Removed dependence on #including iostream.

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

16 years agoFixed #include of objc/objc.h so that it works on case-sensitive filesystems.
Ted Kremenek [Mon, 26 Nov 2007 22:49:09 +0000 (22:49 +0000)]
Fixed #include of objc/objc.h so that it works on case-sensitive filesystems.

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

16 years agoReverted changed to getTagDeclType() introduced in patch 44089:
Ted Kremenek [Mon, 26 Nov 2007 21:16:01 +0000 (21:16 +0000)]
Reverted changed to getTagDeclType() introduced in patch 44089:

http://llvm.org/viewvc/llvm-project?view=rev&revision=44089

"Decl" once again can no longer be NULL, so the NULL checks are not needed.

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

16 years agoFixed a rewrite bug in class synthesis (which I first thought was a rewrite API bug).
Fariborz Jahanian [Mon, 26 Nov 2007 20:59:57 +0000 (20:59 +0000)]
Fixed a rewrite bug in class synthesis (which I first thought was a rewrite API bug).

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

16 years agoRemoves link to status page till the info gets added. Someone put us on Reddit;...
Kevin [Mon, 26 Nov 2007 20:47:14 +0000 (20:47 +0000)]
Removes link to status page till the info gets added.  Someone put us on Reddit; Don't want it to look bad on the project. :)
http://programming.reddit.com/info/61f8g/comments/

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

16 years agoPatch to fix a regression caused by recent rewrite changes.
Fariborz Jahanian [Mon, 26 Nov 2007 19:52:57 +0000 (19:52 +0000)]
Patch to fix a regression caused by recent rewrite changes.
A potential API bug in ReplaceText pending (A FIXME is added).

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

16 years agoFixed StmtPrinter to handle GCC extension to the ternary operator "?:" where
Ted Kremenek [Mon, 26 Nov 2007 18:27:54 +0000 (18:27 +0000)]
Fixed StmtPrinter to handle GCC extension to the ternary operator "?:" where
the LHS subexpression can be NULL.  Patch provided by Nuno Lopes!

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

16 years agoFixed bug in CFG construction where we did not properly handle the GCC
Ted Kremenek [Mon, 26 Nov 2007 18:20:26 +0000 (18:20 +0000)]
Fixed bug in CFG construction where we did not properly handle the GCC
extension "?:" for the ternary operator, e.g.: x ?: y; This expression is
represented in the clang ASTs as a ConditionalOperator whose LHS expression is
NULL. Now we handle this special case, causing the block containing the
condition to be a predecessor to the block that "merges" the values of the
ternary operator.

Thanks to Nuno Lopes for identifying and diagnosing this bug!

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

16 years agoThe checking for the delimiters of expected error/warning messages was
Bill Wendling [Mon, 26 Nov 2007 08:26:20 +0000 (08:26 +0000)]
The checking for the delimiters of expected error/warning messages was
looking only for { and } instead of {{ and }}. Changed it to check for
this explicitly.

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

16 years agoFix sema support for the gnu ?: expression with a
Chris Lattner [Mon, 26 Nov 2007 01:40:58 +0000 (01:40 +0000)]
Fix sema support for the gnu ?: expression with a
missing middle expression, and fix a codegen bug where
we didn't correctly promote the condition to the right
result type.  This fixes PR1824.

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

16 years agothis works.
Chris Lattner [Mon, 26 Nov 2007 01:39:17 +0000 (01:39 +0000)]
this works.

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

16 years agosizeof() return size in bytes, not bits, patch by Nuno Lopes!
Chris Lattner [Sun, 25 Nov 2007 17:48:21 +0000 (17:48 +0000)]
sizeof() return size in bytes, not bits, patch by Nuno Lopes!

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

16 years agoMoved logic for -Wfloat-equal to SemaChecking.cpp.
Ted Kremenek [Sun, 25 Nov 2007 00:58:00 +0000 (00:58 +0000)]
Moved logic for -Wfloat-equal to SemaChecking.cpp.

Moved utility functions IgnoreParen and friends to be static inline functions
defined in SemaUtil.h.

Added SemaUtil.h to Xcode project.

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

16 years agoCheck that the clobber registers are valid.
Anders Carlsson [Sun, 25 Nov 2007 00:25:21 +0000 (00:25 +0000)]
Check that the clobber registers are valid.

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

16 years agoForgot some X86 registers
Anders Carlsson [Sun, 25 Nov 2007 00:23:10 +0000 (00:23 +0000)]
Forgot some X86 registers

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

16 years agoAdd tables for GCC register names and aliases. This will be used for inline asm
Anders Carlsson [Sat, 24 Nov 2007 23:38:12 +0000 (23:38 +0000)]
Add tables for GCC register names and aliases. This will be used for inline asm

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

16 years agoAdded more test cases for uninitialized values checker.
Ted Kremenek [Sat, 24 Nov 2007 23:06:58 +0000 (23:06 +0000)]
Added more test cases for uninitialized values checker.

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

16 years agoFixed bogus culling of uninitialized-values "taint" propagation during assignments.
Ted Kremenek [Sat, 24 Nov 2007 20:07:36 +0000 (20:07 +0000)]
Fixed bogus culling of uninitialized-values "taint" propagation during assignments.
We accidentally were throttling the propagation of uninitialized state across
assignments (e.g. x = y).  Thanks to Anders Carlsson for spotting this problem.

Added test cases to test suite to provide regression testing for the
uninitialized values analysis.

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

16 years agoMoved dead-stores test cast to a new test suite subdirectory: Analysis.
Ted Kremenek [Sat, 24 Nov 2007 19:49:35 +0000 (19:49 +0000)]
Moved dead-stores test cast to a new test suite subdirectory: Analysis.

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

16 years agoKeep track of whether the asm is volatile or not.
Anders Carlsson [Fri, 23 Nov 2007 23:12:25 +0000 (23:12 +0000)]
Keep track of whether the asm is volatile or not.

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

16 years agoimprove codegen for global variable initializers, implementing
Chris Lattner [Fri, 23 Nov 2007 22:07:55 +0000 (22:07 +0000)]
improve codegen for global variable initializers, implementing
test/CodeGen/global-with-initialiser.c

Patch by Oliver Hunt!

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

16 years agoCheck asm input and output expressions.
Anders Carlsson [Fri, 23 Nov 2007 19:43:50 +0000 (19:43 +0000)]
Check asm input and output expressions.

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

16 years agoFix PR1820, an incredibly subtle macro expansion bug that Neil discovered.
Chris Lattner [Fri, 23 Nov 2007 06:50:21 +0000 (06:50 +0000)]
Fix PR1820, an incredibly subtle macro expansion bug that Neil discovered.

Neil, please review this fix.

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

16 years agoStore output and input operands as well as clobber information in the AsmStmt. Ted...
Anders Carlsson [Thu, 22 Nov 2007 01:36:19 +0000 (01:36 +0000)]
Store output and input operands as well as clobber information in the AsmStmt. Ted, could you please review the serialization/deserialization code?

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

16 years agoGCC fails if there is a trailing colon but no clobbers.
Anders Carlsson [Wed, 21 Nov 2007 23:27:34 +0000 (23:27 +0000)]
GCC fails if there is a trailing colon but no clobbers.

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

16 years agoStore inline asm code in the AST.
Anders Carlsson [Tue, 20 Nov 2007 19:21:03 +0000 (19:21 +0000)]
Store inline asm code in the AST.

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

16 years agoAdd __builtin_abs
Anders Carlsson [Tue, 20 Nov 2007 19:05:17 +0000 (19:05 +0000)]
Add __builtin_abs

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

16 years agoImprove function decl merging, patch by Oliver Hunt!
Chris Lattner [Tue, 20 Nov 2007 19:04:50 +0000 (19:04 +0000)]
Improve function decl merging, patch by Oliver Hunt!

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

16 years agoAdded another test case for the Dead Stores checker that tests that
Ted Kremenek [Tue, 20 Nov 2007 03:03:00 +0000 (03:03 +0000)]
Added another test case for the Dead Stores checker that tests that
block-level expressions are evaluated the same as regular expressions. Test
case provided by Nuno Lopes.

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

16 years agoUpdated CFGStmtVisitor and CFGRecStmtVisitor to have a notion of
Ted Kremenek [Tue, 20 Nov 2007 03:01:58 +0000 (03:01 +0000)]
Updated CFGStmtVisitor and CFGRecStmtVisitor to have a notion of
"block-expressions" when visiting arbitrary expressions (via calls to
"Visit()").  This results in a refactoring where a dataflow analysis no
longer needs to always special case when handling block-expressions versus
non-block expressions.

Updated LiveVariables and UninitializedValues to conform to the slightly
altered interface of these visitor classes.

Thanks to Nuno Lopes for providing a test case that illustrated some
fundamental problems in the current design of the CFGXXXStmtVisitor classes
and how they were used.

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

16 years agoRemoved PersistentMap. It is now superseded in every way by the ImmutableMap
Ted Kremenek [Mon, 19 Nov 2007 17:25:30 +0000 (17:25 +0000)]
Removed PersistentMap.  It is now superseded in every way by the ImmutableMap
and ImmutableSet classes in the main LLVM libraries.

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

16 years agoAdded test case for dead stores checker (live variables analysis) that tests
Ted Kremenek [Mon, 19 Nov 2007 06:38:23 +0000 (06:38 +0000)]
Added test case for dead stores checker (live variables analysis) that tests
for correct propagation/update of liveness information within subexpressions
of Block-Level expressions.  Test case provided by Nuno Lopes.

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

16 years agoFixed bug where LiveVariables was not properly propagating updates to liveness
Ted Kremenek [Mon, 19 Nov 2007 06:36:49 +0000 (06:36 +0000)]
Fixed bug where LiveVariables was not properly propagating updates to liveness
state that occurred in subexpressions of Block-Level expressions. Bug and fix
provided by Nuno Lopes.

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

16 years agoPut back the flags field in the constant CF string type.
Anders Carlsson [Mon, 19 Nov 2007 00:25:30 +0000 (00:25 +0000)]
Put back the flags field in the constant CF string type.

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

16 years agoAdded test case for dead-stores checker. Test case provided by Nuno Lopes.
Ted Kremenek [Sun, 18 Nov 2007 20:06:35 +0000 (20:06 +0000)]
Added test case for dead-stores checker.  Test case provided by Nuno Lopes.

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

16 years agoFixed bug in WalkaST_VisitDeclSubExprs where we failed to properly check if
Ted Kremenek [Sun, 18 Nov 2007 20:06:01 +0000 (20:06 +0000)]
Fixed bug in WalkaST_VisitDeclSubExprs where we failed to properly check if
the StmtIterator referring to the initializers of a chain of Decls was equal
to the "end" iterator. The particular bug manifested when an iterator was
created on a chain of decls with no initializers.

Thanks to Nuno Lopes for reporting this bug and providing a patch.

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

16 years agoNow that we are passing back "free standing decls", make sure -ast-dump works like...
Steve Naroff [Sat, 17 Nov 2007 21:37:36 +0000 (21:37 +0000)]
Now that we are passing back "free standing decls", make sure -ast-dump works like -ast-print.
Also added a cast to be safe...

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

16 years agoMake sure Sema::ParsedFreeStandingDeclSpec() returns a decl representing the type.
Steve Naroff [Sat, 17 Nov 2007 21:21:01 +0000 (21:21 +0000)]
Make sure Sema::ParsedFreeStandingDeclSpec() returns a decl representing the type.
Adding basic printing to StmtPrinter::PrintRawDecl().

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

16 years agoAdded assertion in serialization of DeclRefExprs. DeclRefExprs can only
Ted Kremenek [Fri, 16 Nov 2007 19:00:35 +0000 (19:00 +0000)]
Added assertion in serialization of DeclRefExprs.  DeclRefExprs can only
own the decl they reference if it is a FunctionDecl.  Note that his
ownership property is still considered a hack, and should be fixed.

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

16 years agoFixed bug in the serialization of FunctionDecls. We would incorrectly
Ted Kremenek [Fri, 16 Nov 2007 18:11:10 +0000 (18:11 +0000)]
Fixed bug in the serialization of FunctionDecls.  We would incorrectly
query for the number of parameters for FunctionDecls that had type
FunctionTypeNoProto.

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

16 years agoTighten up address-of checking, implementing test/Sema/expr-address-of.c.
Chris Lattner [Fri, 16 Nov 2007 17:46:48 +0000 (17:46 +0000)]
Tighten up address-of checking, implementing test/Sema/expr-address-of.c.
This fixes a bug reported by Seo Sanghyeon.

This was meant to be committed yesterday, but the commit failed.  doh.

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

16 years agoFix transient failure on Lex/c90.c due to an uninit variable.
Chris Lattner [Thu, 15 Nov 2007 19:22:40 +0000 (19:22 +0000)]
Fix transient failure on Lex/c90.c due to an uninit variable.

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

16 years agoadd header file I forgot to check in
Chris Lattner [Thu, 15 Nov 2007 19:22:18 +0000 (19:22 +0000)]
add header file I forgot to check in

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

16 years agofix a bug Steve noticed, where a #import of the main file itself would fail.
Chris Lattner [Thu, 15 Nov 2007 19:07:47 +0000 (19:07 +0000)]
fix a bug Steve noticed, where a #import of the main file itself would fail.

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

16 years agoAdded hack when serializing DeclRefExprs. This should probably be fixed.
Ted Kremenek [Thu, 15 Nov 2007 18:26:39 +0000 (18:26 +0000)]
Added hack when serializing DeclRefExprs.  This should probably be fixed.

Some FunctionDecls do not appear at the top-level or are owned by a DeclStmt.
In calls to implicitly defined functions, a FunctionDecl is created, but only
the DeclRefExprs reference them. Since an implicitly defined function may be
called multiple times, there is no clear ownership model for such objects.

Temporary solution: when serializing out DeclRefExprs, emit an ownership bit
for the Decl. This bit is determined by querying the serializer to see if the
Decl has already been serialized. If it hasn't, emit the Decl as an owned
pointer.

I repeat: this is a hack.  This should be fixed.

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

16 years agoStarted separate section for method definitions for ObjC serialization.
Ted Kremenek [Thu, 15 Nov 2007 18:10:29 +0000 (18:10 +0000)]
Started separate section for method definitions for ObjC serialization.
Added missing deserialization case in Stmt::Create() switch statement.

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

16 years agoNo need to forward declare definition of objc_super...
Steve Naroff [Thu, 15 Nov 2007 17:06:21 +0000 (17:06 +0000)]
No need to forward declare definition of objc_super...

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

16 years agoFinish up variadic methods/messages.
Steve Naroff [Thu, 15 Nov 2007 13:05:42 +0000 (13:05 +0000)]
Finish up variadic methods/messages.

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

16 years agoImplement support for variadic methods (work in progress).
Steve Naroff [Thu, 15 Nov 2007 12:35:21 +0000 (12:35 +0000)]
Implement support for variadic methods (work in progress).

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

16 years agoExtend RewriteTest::RewriteObjCIvarRefExpr() to cope with static typing (when using...
Steve Naroff [Thu, 15 Nov 2007 11:33:00 +0000 (11:33 +0000)]
Extend RewriteTest::RewriteObjCIvarRefExpr() to cope with static typing (when using -> on a type which corresponds to the implementation type).

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

16 years agoTweak funky cast to accommodate messaging 'super'. This removes any spurious warnings.
Steve Naroff [Thu, 15 Nov 2007 10:43:57 +0000 (10:43 +0000)]
Tweak funky cast to accommodate messaging 'super'. This removes any spurious warnings.

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

16 years agoRewrite for messaging 'super'.
Steve Naroff [Thu, 15 Nov 2007 10:28:18 +0000 (10:28 +0000)]
Rewrite for messaging 'super'.

The code gen. results in some spurious warnings...a cast is forthcoming.

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

16 years agoBreak out bool/true/false support into a LangOption
Nate Begeman [Thu, 15 Nov 2007 07:30:50 +0000 (07:30 +0000)]
Break out bool/true/false support into a LangOption

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

16 years agoImplement codegen of CXX Bool
Nate Begeman [Thu, 15 Nov 2007 05:40:03 +0000 (05:40 +0000)]
Implement codegen of CXX Bool

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

16 years agoHandle "bool" in all places that touch _Bool.
Chris Lattner [Thu, 15 Nov 2007 05:25:19 +0000 (05:25 +0000)]
Handle "bool" in all places that touch _Bool.
This fixes code like "if((bool)x) {}" for example.

Patch by Nate Begeman.

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

16 years ago- Implement ivar rewrite (patch by Fariborz).
Steve Naroff [Thu, 15 Nov 2007 02:58:25 +0000 (02:58 +0000)]
- Implement ivar rewrite (patch by Fariborz).
- RewriteMessageExpr()...make implicit casts explicit with synthesizing call (removing warnings when calling objc_msgSend()).

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

17 years agoRefinement to previous commit. Always cast the first argument to "id"...no need to...
Steve Naroff [Thu, 15 Nov 2007 00:00:21 +0000 (00:00 +0000)]
Refinement to previous commit. Always cast the first argument to "id"...no need to special case self.

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

17 years agoCast implicit "self" argument to "id". This removes all warnings associated with...
Steve Naroff [Wed, 14 Nov 2007 23:54:14 +0000 (23:54 +0000)]
Cast implicit "self" argument to "id". This removes all warnings associated with implicit references to self. It doesn't yet deal withexplicit references to self...

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

17 years agoFixed bug in serialization of EnumConstantDecl where we improperly
Ted Kremenek [Wed, 14 Nov 2007 23:38:09 +0000 (23:38 +0000)]
Fixed bug in serialization of EnumConstantDecl where we improperly
"default constructed" an APSInt.  Fixed another bug in the same method
where we did not allow the NextDeclarator to be NULL.

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

17 years agoFixed bug when serializing QualTypes where we were serializing in the
Ted Kremenek [Wed, 14 Nov 2007 23:35:01 +0000 (23:35 +0000)]
Fixed bug when serializing QualTypes where we were serializing in the
qualifiers as part of the pointer address.

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

17 years agoAlways generate a typedef for @class. The typedef removal logic that I'm removing...
Steve Naroff [Wed, 14 Nov 2007 23:02:56 +0000 (23:02 +0000)]
Always generate a typedef for @class. The typedef removal logic that I'm removing only made sense when we were operating on preprocess files without typedef guards. Now that we have guards, it is incorrect to ever remove one (since it may increase the likelihood that the rewritten header can't be included stand alone).

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

17 years agoFix a rewriter bug that steve noticed. Don't skip arbitrary things
Chris Lattner [Wed, 14 Nov 2007 22:57:51 +0000 (22:57 +0000)]
Fix a rewriter bug that steve noticed.   Don't skip arbitrary things
between an @ and a p, just skip whitespace.

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

17 years agoAdded QualType::ReadBackpatch to allow QualType initialization with
Ted Kremenek [Wed, 14 Nov 2007 22:51:02 +0000 (22:51 +0000)]
Added QualType::ReadBackpatch to allow QualType initialization with
backpatching. This original was available, but then we removed it. It is back
again to help with deserialization of FieldDecls. Because FieldDecls are
currently owned by RecordDecls, which are owned by a TagType, the type of the
FieldDecl may not be deserialized prior to deserializing the FieldDecl. Thus
backpatching solves the problem of constructing a FieldDecl that references a
type that has not yet been deserialized.

Simplified serialization of TagType to not require passing in the
SerializedPtrID. Registration of the materialized type object is done after
the CreateImpl method returns (as with other types).

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

17 years agoPatch to comment out use of protocol qualifiers when rewriting ivars.
Fariborz Jahanian [Wed, 14 Nov 2007 22:26:25 +0000 (22:26 +0000)]
Patch to comment out use of protocol qualifiers when rewriting ivars.

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

17 years agoImplemented serialization of InitListExpr.
Ted Kremenek [Wed, 14 Nov 2007 21:31:46 +0000 (21:31 +0000)]
Implemented serialization of InitListExpr.

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

17 years agoImplemented serialization of CompoundLiteralExpr.
Ted Kremenek [Wed, 14 Nov 2007 21:18:36 +0000 (21:18 +0000)]
Implemented serialization of CompoundLiteralExpr.

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

17 years agoAdded serialization of Union decls.
Ted Kremenek [Wed, 14 Nov 2007 21:15:42 +0000 (21:15 +0000)]
Added serialization of Union decls.

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

17 years agoRemoved assertion inserted only for temporary debugging.
Ted Kremenek [Wed, 14 Nov 2007 19:36:11 +0000 (19:36 +0000)]
Removed assertion inserted only for temporary debugging.

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

17 years agoAdded missing break statement.
Ted Kremenek [Wed, 14 Nov 2007 19:33:01 +0000 (19:33 +0000)]
Added missing break statement.

Reordered serialization methods for FunctionTypeProto and FunctionTypeNoProto
to be alphabetical by serialized type name.

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

17 years agoFairly major surgery to RewriteTest::SynthesizeObjcInternalStruct().
Steve Naroff [Wed, 14 Nov 2007 19:25:57 +0000 (19:25 +0000)]
Fairly major surgery to RewriteTest::SynthesizeObjcInternalStruct().

This allows us to handle funky stuff like...

#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
@interface NSLayoutManager : NSObject <NSCoding, NSGlyphStorage> {
#else /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */
@interface NSLayoutManager : NSObject <NSCoding> {
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */

...which now rewrites to...

#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
#ifndef _REWRITER_typedef_NSLayoutManager
#define _REWRITER_typedef_NSLayoutManager
typedef struct objc_object NSLayoutManager;
#endif

struct NSLayoutManager {
    struct NSObject _NSObject;

#else /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */
// @interface NSLayoutManager : NSObject <NSCoding> {
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */

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

17 years agoImplemented serialization of EnumDecl and EnumConstantDecl.
Ted Kremenek [Wed, 14 Nov 2007 18:12:19 +0000 (18:12 +0000)]
Implemented serialization of EnumDecl and EnumConstantDecl.

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

17 years agoImplemented serialization of FieldDecls.
Ted Kremenek [Wed, 14 Nov 2007 17:47:01 +0000 (17:47 +0000)]
Implemented serialization of FieldDecls.

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

17 years agoSourceManager, IdentifierTable, Selectors are now serialized in their own
Ted Kremenek [Wed, 14 Nov 2007 17:46:35 +0000 (17:46 +0000)]
SourceManager, IdentifierTable, Selectors are now serialized in their own
block separate from ASTContext. This block is serialized out AFTER writing out
ASTContext, but deserialized BEFORE reading in ASTContext. This permits the
optimization of the serialization of the IdentifierTable where we only write
out identifiers that are used.

This was needed because TagDecls are owned by Types, and TagDecls contain
identifiers. Thus types need to be written out first to register with the
serializer any identifiers they refer to (and hence need to be serialized out
with IdentifierTable).

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

17 years agoRemoved unused variabel.
Fariborz Jahanian [Wed, 14 Nov 2007 17:35:46 +0000 (17:35 +0000)]
Removed unused variabel.

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

17 years agoFix a bug handling hex floats in c90 mode, pointed out by Neil.
Chris Lattner [Wed, 14 Nov 2007 16:14:50 +0000 (16:14 +0000)]
Fix a bug handling hex floats in c90 mode, pointed out by Neil.

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

17 years agoFix yesterday's regression with rewriting @optional/@required.
Steve Naroff [Wed, 14 Nov 2007 15:03:57 +0000 (15:03 +0000)]
Fix yesterday's regression with rewriting @optional/@required.

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

17 years agoRewrite methods that span multiple lines.
Steve Naroff [Wed, 14 Nov 2007 14:34:23 +0000 (14:34 +0000)]
Rewrite methods that span multiple lines.

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

17 years agoAllow properties within a protocol. The case below was asserting...now it works fine.
Steve Naroff [Wed, 14 Nov 2007 14:15:31 +0000 (14:15 +0000)]
Allow properties within a protocol. The case below was asserting...now it works fine.

@protocol CAMediaTiming

@property int beginTime;

@end

Comments in the code tell the rest of the story...

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

17 years agoImplemented serialization of RecordDecls. Changed serialization of TagType to
Ted Kremenek [Wed, 14 Nov 2007 08:06:37 +0000 (08:06 +0000)]
Implemented serialization of RecordDecls. Changed serialization of TagType to
have an owning pointer to the referred TagDecl. This should hopefully fix a
bug where TagDecls (including decls from structs, etc.) were not serialized.

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

17 years agoimplement test/Sema/typedef-prototype.c, allowing code
Chris Lattner [Wed, 14 Nov 2007 06:34:38 +0000 (06:34 +0000)]
implement test/Sema/typedef-prototype.c, allowing code
to declare a function with a typedef:

typedef int unary_int_func(int arg);
unary_int_func add_one;

This patch contributed by Seo Sanghyeon!

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

17 years agoComment out recent regression r44096.
Steve Naroff [Wed, 14 Nov 2007 03:37:28 +0000 (03:37 +0000)]
Comment out recent regression r44096.

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

17 years agoRewrite @optional/@required directives used inside protocol definitions.
Fariborz Jahanian [Wed, 14 Nov 2007 01:37:46 +0000 (01:37 +0000)]
Rewrite @optional/@required directives used inside protocol definitions.

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

17 years agoRewrite of forward protocol declaration.
Fariborz Jahanian [Wed, 14 Nov 2007 00:42:16 +0000 (00:42 +0000)]
Rewrite of forward protocol declaration.

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

17 years agoImplemented serialization of FunctionTypeNoProto.
Ted Kremenek [Wed, 14 Nov 2007 00:38:50 +0000 (00:38 +0000)]
Implemented serialization of FunctionTypeNoProto.

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

17 years agoImplemented serialization of VariableArrayTypes.
Ted Kremenek [Wed, 14 Nov 2007 00:31:36 +0000 (00:31 +0000)]
Implemented serialization of VariableArrayTypes.

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

17 years agoImplemented serialization of TypedefType.
Ted Kremenek [Wed, 14 Nov 2007 00:27:46 +0000 (00:27 +0000)]
Implemented serialization of TypedefType.

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

17 years agoImplemented serialization of ConstantArrayType.
Ted Kremenek [Wed, 14 Nov 2007 00:17:21 +0000 (00:17 +0000)]
Implemented serialization of ConstantArrayType.

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

17 years agoImplemented serialization of TagTypes.
Ted Kremenek [Wed, 14 Nov 2007 00:03:56 +0000 (00:03 +0000)]
Implemented serialization of TagTypes.

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

17 years agoModified ASTContext::getTagDeclType() to accept a NULL pointer for the passed
Ted Kremenek [Wed, 14 Nov 2007 00:03:20 +0000 (00:03 +0000)]
Modified ASTContext::getTagDeclType() to accept a NULL pointer for the passed
in TagDecl*. This allows the deserializer to use ASTContext to create the
TagTypes. Deserialize TagTypes then rely on pointer-backpatching to resolve
the decls.

This may not be the interface that we want, but as the implementation of
TagTypes will potentially change significantly in the future, I'm leaving this
for now. An appropriate FIXME is in place.

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

17 years agoFix regression with ObjC method definitions and -ast-print
Steve Naroff [Tue, 13 Nov 2007 23:48:03 +0000 (23:48 +0000)]
Fix regression with ObjC method definitions and -ast-print

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

17 years agoType encoding for structs.
Fariborz Jahanian [Tue, 13 Nov 2007 23:21:38 +0000 (23:21 +0000)]
Type encoding for structs.

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

17 years agoRewrite method definition bodies. Also renamed a method to distinguish between method...
Steve Naroff [Tue, 13 Nov 2007 23:01:27 +0000 (23:01 +0000)]
Rewrite method definition bodies. Also renamed a method to distinguish between method declarations and definitions.

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

17 years agoRemoved line with typo (declared friendship with ASTContext). Line was
Ted Kremenek [Tue, 13 Nov 2007 22:57:59 +0000 (22:57 +0000)]
Removed line with typo (declared friendship with ASTContext).  Line was
not needed since friendship is declared elsewhere.

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

17 years agoAdded pretty-printing of statements during serialization.
Ted Kremenek [Tue, 13 Nov 2007 22:56:10 +0000 (22:56 +0000)]
Added pretty-printing of statements during serialization.

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