]> granicus.if.org Git - clang/log
clang
16 years agoRemoved dependence on including iostream (use llvm/Support/Streams.h instead).
Ted Kremenek [Wed, 5 Dec 2007 22:21:13 +0000 (22:21 +0000)]
Removed dependence on including iostream (use llvm/Support/Streams.h instead).

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

16 years agoConverted SerializationTest (--test-pickling) to use the new TranslationUnit
Ted Kremenek [Wed, 5 Dec 2007 22:08:43 +0000 (22:08 +0000)]
Converted SerializationTest (--test-pickling) to use the new TranslationUnit
class to serialize and deserialize translation units.

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

16 years agoMake sure the class methods get attached to the metaclass object.
Steve Naroff [Wed, 5 Dec 2007 21:49:40 +0000 (21:49 +0000)]
Make sure the class methods get attached to the metaclass object.
Need to query the implementation, not the interface...

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

16 years agoAdded Driver/TranslationUnit.h and Driver/TranslationUnit.cpp to the
Ted Kremenek [Wed, 5 Dec 2007 21:36:57 +0000 (21:36 +0000)]
Added Driver/TranslationUnit.h and Driver/TranslationUnit.cpp to the
XCode project.

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

16 years agoAdded "TranslationUnit" class that will be used to provide an interface
Ted Kremenek [Wed, 5 Dec 2007 21:36:08 +0000 (21:36 +0000)]
Added "TranslationUnit" class that will be used to provide an interface
for serializing/deserializing ASTs that is decoupled from the logic
in SerializationTest (which will soon be rewritten to use this interface).

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

16 years agoModified: CreateTargetInfo(). Now takes Diagnostic* instead of Diagnostic&.
Ted Kremenek [Wed, 5 Dec 2007 21:34:36 +0000 (21:34 +0000)]
Modified: CreateTargetInfo().  Now takes Diagnostic* instead of Diagnostic&.
Modified: ctor of SerializationTest: Now takes LangOptions argument.  We
          will eventually serialize this as well.

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

16 years agoAdded Basic/LangOptions.cpp to XCode project.
Ted Kremenek [Wed, 5 Dec 2007 19:07:32 +0000 (19:07 +0000)]
Added Basic/LangOptions.cpp to XCode project.

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

16 years agoImplemented serialization of LangOptions.
Ted Kremenek [Wed, 5 Dec 2007 19:06:15 +0000 (19:06 +0000)]
Implemented serialization of LangOptions.

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

16 years agoI'm apparently the only sad lonely ppc user left :)
Chris Lattner [Wed, 5 Dec 2007 18:41:05 +0000 (18:41 +0000)]
I'm apparently the only sad lonely ppc user left :)

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

16 years agoMoved creation of ASTConsumers that can operate on both freshly-parsed and
Ted Kremenek [Wed, 5 Dec 2007 18:27:04 +0000 (18:27 +0000)]
Moved creation of ASTConsumers that can operate on both freshly-parsed and
deserialized ASTs into the function CreateASTConsumer().  This function
is called by ProcessInputFile, and soon the logic that processes deserialized
ASTs.

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

16 years agoPatch to prevent crash on use of objc2 syntax.
Fariborz Jahanian [Wed, 5 Dec 2007 18:16:33 +0000 (18:16 +0000)]
Patch to prevent crash on use of objc2 syntax.

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

16 years agoChanged type-cast of "struct objc_super"'s 2nd initializer to match definition of
Fariborz Jahanian [Wed, 5 Dec 2007 17:29:46 +0000 (17:29 +0000)]
Changed type-cast of "struct objc_super"'s 2nd initializer to match definition of
"struct objc_super".

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

16 years agofix some bogus code noticed by Kevin Andre
Chris Lattner [Wed, 5 Dec 2007 17:21:34 +0000 (17:21 +0000)]
fix some bogus code noticed by Kevin Andre

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

16 years agoImplement CodeGen for vectors. Don't create unnecessary conversion instructions if...
Anders Carlsson [Wed, 5 Dec 2007 07:36:10 +0000 (07:36 +0000)]
Implement CodeGen for vectors. Don't create unnecessary conversion instructions if the value to be converted is a constant.

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

16 years agoAdd sema checking for compound literal expressions.
Anders Carlsson [Wed, 5 Dec 2007 07:24:19 +0000 (07:24 +0000)]
Add sema checking for compound literal expressions.

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

16 years agoImplement codegen for builtin infinity functions.
Anders Carlsson [Wed, 5 Dec 2007 07:22:48 +0000 (07:22 +0000)]
Implement codegen for builtin infinity functions.

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

16 years agoRevert DidWarn change - It won't catch all cases anyway and GCC warns for every exces...
Anders Carlsson [Wed, 5 Dec 2007 04:57:06 +0000 (04:57 +0000)]
Revert DidWarn change - It won't catch all cases anyway and GCC warns for every excess element. Maybe later we can add back the limit and make it smarter.

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

16 years agoRecognize CompoundLiteralExpr's as valid lvalue's.
Steve Naroff [Wed, 5 Dec 2007 04:00:10 +0000 (04:00 +0000)]
Recognize CompoundLiteralExpr's as valid lvalue's.

Also updated a FIXME in Sema::CheckInitializer()...

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

16 years agoImplemented serialization of: ObjCEncodeExpr, ObjCSelectorExpr.
Ted Kremenek [Wed, 5 Dec 2007 00:43:08 +0000 (00:43 +0000)]
Implemented serialization of: ObjCEncodeExpr, ObjCSelectorExpr.

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

16 years agoAdded serialization support of SourceManager to the clang driver.
Ted Kremenek [Wed, 5 Dec 2007 00:26:13 +0000 (00:26 +0000)]
Added serialization support of SourceManager to the clang driver.

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

16 years agoRenamed SourceManager::Read to SourceManager::CreateAndRegister.
Ted Kremenek [Wed, 5 Dec 2007 00:19:51 +0000 (00:19 +0000)]
Renamed SourceManager::Read to SourceManager::CreateAndRegister.
Now sourcemanager deserializer automatically self-registers itself with
the deserializer.

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

16 years agoImplemented initial serialization support for SourceManager.
Ted Kremenek [Wed, 5 Dec 2007 00:14:18 +0000 (00:14 +0000)]
Implemented initial serialization support for SourceManager.

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

16 years agoAdd the definition of objc_super...
Steve Naroff [Tue, 4 Dec 2007 23:59:30 +0000 (23:59 +0000)]
Add the definition of objc_super...

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

16 years agoRemoved serialization of FileEntry and DirectoryEntry. This objects will
Ted Kremenek [Tue, 4 Dec 2007 22:42:20 +0000 (22:42 +0000)]
Removed serialization of FileEntry and DirectoryEntry.  This objects will
now be lazily recreated upon deserialization.

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

16 years agoType-cast initializers for "struct objc_super" parameter to avoid warning.
Fariborz Jahanian [Tue, 4 Dec 2007 22:32:58 +0000 (22:32 +0000)]
Type-cast initializers for "struct objc_super" parameter to avoid warning.

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

16 years agoTest case for my last patch.
Fariborz Jahanian [Tue, 4 Dec 2007 21:48:54 +0000 (21:48 +0000)]
Test case for my last patch.

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

16 years agoDon't assert if objc.h not declared when rewriting.
Fariborz Jahanian [Tue, 4 Dec 2007 21:47:40 +0000 (21:47 +0000)]
Don't assert if objc.h not declared when rewriting.

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

16 years agoImplemented serialization of SrcMgr::ContentCache.
Ted Kremenek [Tue, 4 Dec 2007 19:39:02 +0000 (19:39 +0000)]
Implemented serialization of SrcMgr::ContentCache.

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

16 years agoRemoved a "TODO" comment as objc1 runtime does not need to do the "TODO".
Fariborz Jahanian [Tue, 4 Dec 2007 19:31:56 +0000 (19:31 +0000)]
Removed a "TODO" comment as objc1 runtime does not need to do the "TODO".

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

16 years agoSimplified setting up Method's scope before generating AST for its nody.
Fariborz Jahanian [Tue, 4 Dec 2007 19:20:11 +0000 (19:20 +0000)]
Simplified setting up Method's scope before generating AST for its nody.

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

16 years agoFixed a few more comments to change "FileInfo" to "ContentCache."
Ted Kremenek [Tue, 4 Dec 2007 18:59:28 +0000 (18:59 +0000)]
Fixed a few more comments to change "FileInfo" to "ContentCache."

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

16 years agoImplemented serialization of FileEntry and DirectoryEntry.
Ted Kremenek [Tue, 4 Dec 2007 18:21:35 +0000 (18:21 +0000)]
Implemented serialization of FileEntry and DirectoryEntry.

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

16 years agoRemoved searching for "darwin" keyword in target triple. We don't really support
Ted Kremenek [Tue, 4 Dec 2007 17:07:35 +0000 (17:07 +0000)]
Removed searching for "darwin" keyword in target triple. We don't really support
any alternative targets at this point other than "darwin," so we now default to
Darwin targets (for now).

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

16 years agoRemoved IntrusiveSPtr. There are no clients of this class anymore, so it is
Ted Kremenek [Tue, 4 Dec 2007 16:54:09 +0000 (16:54 +0000)]
Removed IntrusiveSPtr.  There are no clients of this class anymore, so it is
not needed, and it was never extensively tested.  If we need an intrusive
reference-counting smart pointer, we can always import intrusive_ptr from
boost.

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

16 years agoImplemented serialization of ObjCStringLiteral.
Ted Kremenek [Tue, 4 Dec 2007 00:51:11 +0000 (00:51 +0000)]
Implemented serialization of ObjCStringLiteral.

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

16 years agoImplemented serialization for ObjcAtThrowStmt.
Ted Kremenek [Tue, 4 Dec 2007 00:40:49 +0000 (00:40 +0000)]
Implemented serialization for ObjcAtThrowStmt.

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

16 years agoImplemented serialization of ObjcAtTryStmt.
Ted Kremenek [Tue, 4 Dec 2007 00:38:30 +0000 (00:38 +0000)]
Implemented serialization of ObjcAtTryStmt.

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

16 years agoImplemented serialization for ObjcAtFinallyStmt.
Ted Kremenek [Tue, 4 Dec 2007 00:32:22 +0000 (00:32 +0000)]
Implemented serialization for ObjcAtFinallyStmt.

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

16 years agoImplemented serialization for ObjcAtCatchStmt.
Ted Kremenek [Tue, 4 Dec 2007 00:28:54 +0000 (00:28 +0000)]
Implemented serialization for ObjcAtCatchStmt.

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

16 years agoFixed order of operands to strstr call.
Ted Kremenek [Mon, 3 Dec 2007 23:25:59 +0000 (23:25 +0000)]
Fixed order of operands to strstr call.

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

16 years agoFor target processing, on non-Darwin systems instead of using the host triple,
Ted Kremenek [Mon, 3 Dec 2007 23:23:21 +0000 (23:23 +0000)]
For target processing, on non-Darwin systems instead of using the host triple,
we default to "i386-apple-darwin".  This is an interim solution.

Removed processing of "linux" triples from Targets.cpp, since we don't have
any sensical Linux target support (yet).

Cleaned up error processing of targets; added better diagnostics.

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

16 years agoChange <Objc/objc.h> to <objc/objc.h>
Fariborz Jahanian [Mon, 3 Dec 2007 23:04:29 +0000 (23:04 +0000)]
Change <Objc/objc.h> to <objc/objc.h>

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

16 years agoImplemented serialization of TargetInfo.
Ted Kremenek [Mon, 3 Dec 2007 22:48:14 +0000 (22:48 +0000)]
Implemented serialization of TargetInfo.
SerializationTest (subclass of ASTConsumer) now takes Diagnostics& in its ctor.

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

16 years agoAdded some notes on the -triple and -arch options.
Ted Kremenek [Mon, 3 Dec 2007 22:26:16 +0000 (22:26 +0000)]
Added some notes on the -triple and -arch options.

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

16 years agoFixed a bug exposed by referencing an ivar field using component reference syntax.
Fariborz Jahanian [Mon, 3 Dec 2007 22:25:42 +0000 (22:25 +0000)]
Fixed a bug exposed by referencing an ivar field using component reference syntax.

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

16 years agoFew cleanups to patch 44551:
Ted Kremenek [Mon, 3 Dec 2007 22:11:31 +0000 (22:11 +0000)]
Few cleanups to patch 44551:

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

Removed debugging fprintfs for printing targets.
Implemented error messages when processing invalid targets.

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

16 years agoImplemented initial support for "-triple" option to the clang driver. This
Ted Kremenek [Mon, 3 Dec 2007 22:06:55 +0000 (22:06 +0000)]
Implemented initial support for "-triple" option to the clang driver. This
replaces the functionality previously provided by just "-arch" (which is still
supported but has different semantics).

The new behavior is as follows:

(1) If the user does not specify -triple:

   (a) If no -arch options are specified, the target triple used is the host
   triple (in llvm/Config/config.h).

   (b) If one or more -arch's are specified (and no -triple), then there is
       one triple for each -arch, where the specified arch is substituted
       for the arch in the host triple.  Example:
          host triple = i686-apple-darwin9
          command: clang  -arch ppc -arch ppc64 ...
          triples used: ppc-apple-darwin9  ppc64-apple-darwin9

(2) The user does specify a -triple (only one allowed):

  (a) If no -arch options are specified, the triple specified by -triple
      is used.  E.g clang -triple i686-apple-darwin9

  (b) If one or more -arch options are specified, then the triple specified
      by -triple is used as the primary target, and the arch's specified
      by -arch are used to create secondary targets.  For example:

      clang -triple i686-apple-darwin9 -arch ppc -arch ppc64

      has the following targets:
         i686-apple-darwin9  (primary target)
         ppc-apple-darwin9
         ppc64-apple-darwin9

Other changes related to the changes to the driver:

- TargetInfoImpl now includes the triple string.

- TargetInfo::getTargetTriple returns the triple for its primary target.

- test case test/Parser/portability.c has been updated because "-arch linux" is
  no longer valid ("linux" is an OS, not an arch); instead we use a bogus
  architecture "bogusW16W16" where WCharWidth=16 and WCharAlign=16.

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

16 years agoFix an ast-print/ast-dump bug.
Chris Lattner [Mon, 3 Dec 2007 21:43:25 +0000 (21:43 +0000)]
Fix an ast-print/ast-dump bug.

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

16 years agoSupport for rewriteing of messaging of methods which return float.
Fariborz Jahanian [Mon, 3 Dec 2007 21:26:48 +0000 (21:26 +0000)]
Support for rewriteing of messaging of methods which return float.

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

16 years agoAdded support for messagings which return a structure-value.
Fariborz Jahanian [Mon, 3 Dec 2007 19:17:29 +0000 (19:17 +0000)]
Added support for messagings which return a structure-value.
(Also fixed a regression caused by recent changes to synthesis of structs).

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

16 years agoAdded getTrueExpr() and getFalseExpr() to ConditionalOperator. These methods
Ted Kremenek [Mon, 3 Dec 2007 17:09:21 +0000 (17:09 +0000)]
Added getTrueExpr() and getFalseExpr() to ConditionalOperator. These methods
provide handy accessors to the subexpressions of ConditionalOperator that
automatically take into account the GCC extension where the "LHS" expression is
omitted: e.g x ?: y;. When the LHS expression is available, getTrueExpr() is the
same as getLHS(); when LHS is NULL, getTrueExpr() returns the condition expression.

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

16 years agoFix for testcase that assigns a dereferenced reference to a pointer. The
Bill Wendling [Mon, 3 Dec 2007 07:33:35 +0000 (07:33 +0000)]
Fix for testcase that assigns a dereferenced reference to a pointer. The
standard says that we should adjust the "reference to T" type to "T"
before analysis.

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

16 years agoIgnore typedefs in pointer arithmetic codegen.
Seo Sanghyeon [Mon, 3 Dec 2007 06:23:43 +0000 (06:23 +0000)]
Ignore typedefs in pointer arithmetic codegen.

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

16 years agoHandle initializing vector elements correctly. Emit just one warning if there are...
Anders Carlsson [Mon, 3 Dec 2007 01:01:28 +0000 (01:01 +0000)]
Handle initializing vector elements correctly. Emit just one warning if there are excess initializers, instead of one per initializer.

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

16 years agoadd a fixme
Chris Lattner [Sun, 2 Dec 2007 23:05:46 +0000 (23:05 +0000)]
add a fixme

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

16 years agoImplement __builtin_bswap32 and __builtin_bswap64.
Anders Carlsson [Sun, 2 Dec 2007 21:58:10 +0000 (21:58 +0000)]
Implement __builtin_bswap32 and __builtin_bswap64.

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

16 years agofix logic for member expr codegen.
Chris Lattner [Sun, 2 Dec 2007 18:52:07 +0000 (18:52 +0000)]
fix logic for member expr codegen.

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

16 years agoFix isStructureType and isUnionType to ignore typedefs, as stated
Seo Sanghyeon [Sun, 2 Dec 2007 16:57:27 +0000 (16:57 +0000)]
Fix isStructureType and isUnionType to ignore typedefs, as stated
in the header. Patch by Cédric Venet.

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

16 years agoTreat discarding array initializer elements as an extwarn (so -pedantic-errors flags...
Christopher Lamb [Sun, 2 Dec 2007 08:49:54 +0000 (08:49 +0000)]
Treat discarding array initializer elements as an extwarn (so -pedantic-errors flags it). Allow CodeGen to truncate the initializer if needed.

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

16 years agorestore these lines, which fixes some regtest failures.
Chris Lattner [Sun, 2 Dec 2007 07:50:03 +0000 (07:50 +0000)]
restore these lines, which fixes some regtest failures.

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

16 years agoall filevar's have static storage. Previously a global with
Chris Lattner [Sun, 2 Dec 2007 07:47:49 +0000 (07:47 +0000)]
all filevar's have static storage.  Previously a global with
extern storage class was returning false from hasStaticStorage.
Ted, please review this.

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

16 years agoCommit test for CL 44440.
Christopher Lamb [Sun, 2 Dec 2007 07:47:19 +0000 (07:47 +0000)]
Commit test for CL 44440.

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

16 years agoFix buggy test
Chris Lattner [Sun, 2 Dec 2007 07:46:00 +0000 (07:46 +0000)]
Fix buggy test

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

16 years agoglobals can't be vla's
Chris Lattner [Sun, 2 Dec 2007 07:32:25 +0000 (07:32 +0000)]
globals can't be vla's

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

16 years agoadd codegen support for global inits that require array decay.
Chris Lattner [Sun, 2 Dec 2007 07:30:13 +0000 (07:30 +0000)]
add codegen support for global inits that require array decay.

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

16 years agowarn about unhandled initializers instead of crashing on them.
Chris Lattner [Sun, 2 Dec 2007 07:19:18 +0000 (07:19 +0000)]
warn about unhandled initializers instead of crashing on them.

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

16 years agoHandle global variable definitions which change the type of a definition, such as:
Chris Lattner [Sun, 2 Dec 2007 07:09:19 +0000 (07:09 +0000)]
Handle global variable definitions which change the type of a definition, such as:
extern int x[];
void foo() { x[0] = 1; }
int x[10];
void bar() { x[0] = 1; }

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

16 years agoremove the alloca insertion point inst, which is an internal helper.
Chris Lattner [Sun, 2 Dec 2007 06:32:24 +0000 (06:32 +0000)]
remove the alloca insertion point inst, which is an internal helper.

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

16 years agomerge the llvm global variable when there are multiple C decls.
Chris Lattner [Sun, 2 Dec 2007 06:30:46 +0000 (06:30 +0000)]
merge the llvm global variable when there are multiple C decls.

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

16 years agoimplement codegen for functions whose function body type don't match
Chris Lattner [Sun, 2 Dec 2007 06:27:33 +0000 (06:27 +0000)]
implement codegen for functions whose function body type don't match
their prototype.

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

16 years agomerge functions with multiple function decls if they have the same name.
Chris Lattner [Sun, 2 Dec 2007 05:56:05 +0000 (05:56 +0000)]
merge functions with multiple function decls if they have the same name.

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

16 years agoTeach clang the prototype for __builtin_alloca.
Chris Lattner [Sun, 2 Dec 2007 05:42:36 +0000 (05:42 +0000)]
Teach clang the prototype for __builtin_alloca.

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

16 years agoconvert the rest of the stderr users in codegen to use diagnostics.
Chris Lattner [Sun, 2 Dec 2007 01:49:16 +0000 (01:49 +0000)]
convert the rest of the stderr users in codegen to use diagnostics.

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

16 years agomove unsupported warning into a centralized place.
Chris Lattner [Sun, 2 Dec 2007 01:43:38 +0000 (01:43 +0000)]
move unsupported warning into a centralized place.

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

16 years agoWarn about unsupported codegen with the diags machinery, giving us:
Chris Lattner [Sun, 2 Dec 2007 01:40:18 +0000 (01:40 +0000)]
Warn about unsupported codegen with the diags machinery, giving us:

t.c:3322:5: warning: cannot codegen this yet
    __asm__ ("bswap   %0" : "+r" (_data));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

instead of:

Unimplemented stmt!
(AsmStmt 0x80eaa0 <t.c:3331:5, line:3334:28>)

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

16 years agoregister clz and ctz builtins.
Chris Lattner [Sun, 2 Dec 2007 01:20:23 +0000 (01:20 +0000)]
register clz and ctz builtins.

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

16 years agofix a crash when the rewriter would scan off the beginning of the file.
Chris Lattner [Sun, 2 Dec 2007 01:13:47 +0000 (01:13 +0000)]
fix a crash when the rewriter would scan off the beginning of the file.

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

16 years agoadd support for custom client-specific diagnostics. As a testcase, make the
Chris Lattner [Sun, 2 Dec 2007 01:09:57 +0000 (01:09 +0000)]
add support for custom client-specific diagnostics.  As a testcase, make the
rewriter emit this error if it fails to rewrite an @encode:

t.m:17:9: error: rewriter could not replace sub-expression due to macros
    c = ENC(char *)[2] + 4;
        ^~~~~~~~~~~

... where ENC is: #define ENC @encode

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

16 years agoAdd support for __builtin_expect which is needed for assert,
Oliver Hunt [Sun, 2 Dec 2007 01:03:24 +0000 (01:03 +0000)]
Add support for __builtin_expect which is needed for assert,
among other things.

Also change a codegen warning to dump to stderr so it doesn't
mess with -emit-llvm output

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

16 years agoimprove VC++ compatibility, patch by Cédric Venet.
Chris Lattner [Sun, 2 Dec 2007 00:47:03 +0000 (00:47 +0000)]
improve VC++ compatibility, patch by Cédric Venet.

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

16 years agoSupport initalisers for more than just int-typed static variables.
Oliver Hunt [Sun, 2 Dec 2007 00:11:25 +0000 (00:11 +0000)]
Support initalisers for more than just int-typed static variables.

We now use the CodeGenModule logic for generating the constant
initialiser expression, so happily further initialiser fixes should
automatically work for statics as well.

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

16 years agoCompute side-effect for conditional expression.
Fariborz Jahanian [Sat, 1 Dec 2007 19:58:28 +0000 (19:58 +0000)]
Compute side-effect for conditional expression.

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

16 years agoAdd #include, patch by Cédric Venet
Chris Lattner [Sat, 1 Dec 2007 18:59:50 +0000 (18:59 +0000)]
Add #include, patch by Cédric Venet

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

16 years agoBetter match llvm-gcc's behavior for CodeGen naming of anonymous structs and unions.
Christopher Lamb [Sat, 1 Dec 2007 09:20:34 +0000 (09:20 +0000)]
Better match llvm-gcc's behavior for CodeGen naming of anonymous structs and unions.

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

16 years agoWhen generating the CodeGen type name of a struct, union, enum use the typedef
Christopher Lamb [Sat, 1 Dec 2007 09:08:41 +0000 (09:08 +0000)]
When generating the CodeGen type name of a struct, union, enum use the typedef
name if a tag type name is not available for the type. This matches how llvm-gcc
chooses CodeGen type names.

This means that "typedef struct {...} foo" now results in a CodeGen name of
"struct.foo" rather than "struct."

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

16 years agoTest commit
Seo Sanghyeon [Sat, 1 Dec 2007 08:06:07 +0000 (08:06 +0000)]
Test commit

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

16 years agomake the unused expression warning less noisy by not warning about comma exprs whose
Chris Lattner [Sat, 1 Dec 2007 06:07:34 +0000 (06:07 +0000)]
make the unused expression warning less noisy by not warning about comma exprs whose
LHS and RHS both have side effects.

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

16 years agosimplify some code, add support for functions without a proto
Chris Lattner [Sat, 1 Dec 2007 05:58:21 +0000 (05:58 +0000)]
simplify some code, add support for functions without a proto

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

16 years agofix a couple switch codegen problems Oliver reported.
Chris Lattner [Sat, 1 Dec 2007 05:27:33 +0000 (05:27 +0000)]
fix a couple switch codegen problems Oliver reported.

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

16 years agoFixed bug in the serialization of SelectorTable where we did not register the
Ted Kremenek [Sat, 1 Dec 2007 04:43:17 +0000 (04:43 +0000)]
Fixed bug in the serialization of SelectorTable where we did not register the
pointer of MultiKeywordSelectors.

Added optimization to the serialization of SelectorTable where we only serialize
out MultiKeywordSelectors that are ever referenced by an object other than the
SelectorTable.

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

16 years agostart partitioning the diagnostics into two classes: those
Chris Lattner [Fri, 30 Nov 2007 22:53:43 +0000 (22:53 +0000)]
start partitioning the diagnostics into two classes: those
that are builtin and those that are aren't.  This is a bunch
of API refactoring that will make this possible, but there is
no functionality change yet.

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

16 years agoString literals are always valid LValues.
Anders Carlsson [Fri, 30 Nov 2007 22:47:59 +0000 (22:47 +0000)]
String literals are always valid LValues.

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

16 years agoImplemented serialization of SelectorTable and Selectors.
Ted Kremenek [Fri, 30 Nov 2007 22:46:56 +0000 (22:46 +0000)]
Implemented serialization of SelectorTable and Selectors.
Modified serialization of IdentifierTable to self-register itself with
the Deserializer.

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

16 years agopass diagnostics into the rewrite test client.
Chris Lattner [Fri, 30 Nov 2007 22:25:36 +0000 (22:25 +0000)]
pass diagnostics into the rewrite test client.

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

16 years agoInitialize CurMethodDecl to 0.
Anders Carlsson [Fri, 30 Nov 2007 20:01:38 +0000 (20:01 +0000)]
Initialize CurMethodDecl to 0.

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

16 years agoGCC has an extension where the left hand side of the ? : operator can be omitted...
Anders Carlsson [Fri, 30 Nov 2007 19:04:31 +0000 (19:04 +0000)]
GCC has an extension where the left hand side of the ? : operator can be omitted. Handle this in a few more places.

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

16 years agoInitialize LaxVectorConversions.
Anders Carlsson [Fri, 30 Nov 2007 18:29:41 +0000 (18:29 +0000)]
Initialize LaxVectorConversions.

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

16 years agofix a bug handling typedefs in member expr codegen. Patch
Chris Lattner [Fri, 30 Nov 2007 18:02:19 +0000 (18:02 +0000)]
fix a bug handling typedefs in member expr codegen.  Patch
by Seo Sanghyeon

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

16 years agoFix a codegen crash on void ?: reported by Oliver
Chris Lattner [Fri, 30 Nov 2007 17:56:23 +0000 (17:56 +0000)]
Fix a codegen crash on void ?: reported by Oliver

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

16 years agoSupport fully general case expressions, patch by Sanghyeon Seo!
Chris Lattner [Fri, 30 Nov 2007 17:44:57 +0000 (17:44 +0000)]
Support fully general case expressions, patch by Sanghyeon Seo!

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