]> granicus.if.org Git - clang/log
clang
16 years agoremove global variables for output stream.
Chris Lattner [Sun, 17 Aug 2008 03:12:02 +0000 (03:12 +0000)]
remove global variables for output stream.

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

16 years agoMigrate GRState::ConstEqTy (map used from tracking constants for symbols) to use...
Ted Kremenek [Sun, 17 Aug 2008 03:10:22 +0000 (03:10 +0000)]
Migrate GRState::ConstEqTy (map used from tracking constants for symbols) to use the generic data map instead.

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

16 years agoAdded GRStateTrait.h, which includes boilerplate code for creating specializations...
Ted Kremenek [Sun, 17 Aug 2008 02:59:30 +0000 (02:59 +0000)]
Added GRStateTrait.h, which includes boilerplate code for creating specializations of GRStateTrait<>.
Modified GRStateTrait<ConstNotEq> in GRState to use the boilerplate in GRStateTrait<> for ImmutableMaps.

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

16 years agoSwitch to shared raw_ostream code instead of having it be clang specific.
Chris Lattner [Sun, 17 Aug 2008 01:47:12 +0000 (01:47 +0000)]
Switch to shared raw_ostream code instead of having it be clang specific.
This also helps the eventual distcc project.

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

16 years agohonor EscapeSpaces in 2nd overload of EscapeText()
Nico Weber [Sat, 16 Aug 2008 22:24:33 +0000 (22:24 +0000)]
honor EscapeSpaces in 2nd overload of EscapeText()

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

16 years agoMove the C++ Sema tests into a separate SemaCXX directory.
Argyrios Kyrtzidis [Sat, 16 Aug 2008 20:53:59 +0000 (20:53 +0000)]
Move the C++ Sema tests into a separate SemaCXX directory.

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

16 years agoMove the type checking that Sema::ActOnCastExpr does into a new Sema::CheckCastTypes...
Argyrios Kyrtzidis [Sat, 16 Aug 2008 20:27:34 +0000 (20:27 +0000)]
Move the type checking that Sema::ActOnCastExpr does into a new Sema::CheckCastTypes function so that it can be reused.

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

16 years agoPut (argument)-expression-list parsing in a separate function so that it can be re...
Argyrios Kyrtzidis [Sat, 16 Aug 2008 20:03:01 +0000 (20:03 +0000)]
Put (argument)-expression-list parsing in a separate function so that it can be re-used.

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

16 years agoC++ casts, (static_cast. dynamic_cast, etc.) can have postfix-expression pieces.
Argyrios Kyrtzidis [Sat, 16 Aug 2008 19:45:32 +0000 (19:45 +0000)]
C++ casts, (static_cast. dynamic_cast, etc.) can have postfix-expression pieces.

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

16 years agoMove handling of postfix-expression suffixes out of ParseCXXThis and into ParseCastEx...
Argyrios Kyrtzidis [Sat, 16 Aug 2008 19:34:46 +0000 (19:34 +0000)]
Move handling of postfix-expression suffixes out of ParseCXXThis and into ParseCastExpression.
No functionality change, this follows the convention of how postfix-expressions are handled.

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

16 years agoIt's spelt "uninitialized".
Nick Lewycky [Sat, 16 Aug 2008 17:46:53 +0000 (17:46 +0000)]
It's spelt "uninitialized".

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

16 years agoadd missing class declaration
Nico Weber [Sat, 16 Aug 2008 12:36:27 +0000 (12:36 +0000)]
add missing class declaration

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

16 years agoSet the SourceRange ending of DeclSpec, when Parser::ParseTypeofSpecifier finishes.
Argyrios Kyrtzidis [Sat, 16 Aug 2008 10:21:33 +0000 (10:21 +0000)]
Set the SourceRange ending of DeclSpec, when Parser::ParseTypeofSpecifier finishes.

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

16 years agoDeclarator class considers DeclSpec as immutable; Declarator::getMutableDeclSpec...
Argyrios Kyrtzidis [Sat, 16 Aug 2008 09:55:52 +0000 (09:55 +0000)]
Declarator class considers DeclSpec as immutable; Declarator::getMutableDeclSpec should be used rarely and with care.
Have Declarator accept and use a 'const DeclSpec &', instead of 'DeclSpec &', to make DeclSpec's immutability more explicit.
No functionality change.

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

16 years agoAdd NeXT runtime support for generating methods.
Daniel Dunbar [Sat, 16 Aug 2008 03:19:19 +0000 (03:19 +0000)]
Add NeXT runtime support for generating methods.

Change CodeGenFunction::EmitParmDecl to take either a ParmVarDecl or an
  ImplicitParamDecl.

Drop hasAggregateLLVMType from CodeGenModule.cpp (use version in
  CodeGenFunction).

Change the Objective-C method generation to use EmitParmDecl for
  implicit parameters.

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

16 years agoAdd CodeGen support for AddrLabelExpr in initializers.
Daniel Dunbar [Sat, 16 Aug 2008 01:41:47 +0000 (01:41 +0000)]
Add CodeGen support for AddrLabelExpr in initializers.

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

16 years agoChange WarnUnsupported to ErrorUnsupported (in name and in practice).
Daniel Dunbar [Sat, 16 Aug 2008 00:56:44 +0000 (00:56 +0000)]
Change WarnUnsupported to ErrorUnsupported (in name and in practice).
 - We are beyond the point where this shows up often and when it does
   generating miscompiled files is bad.

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

16 years agoGRState:
Ted Kremenek [Sat, 16 Aug 2008 00:49:49 +0000 (00:49 +0000)]
GRState:
- Remove ConstNotEq from GRState/GRStateManager (!= tracking uses GDM instead).
- GRStateManager now can book-keep "contexts" (e.g., factory objects) for uses
  with data elements stored into the GDM.
- Refactor pretty-printing of states to use GRState::Printer objects
  exclusively. This removed a huge amount of pretty-printing logic from
  GRExprEngine.

CFRefCount
- Simplified some API calls based on refinements to the GDM api.

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

16 years agoEnhance null-dereference checker test.
Ted Kremenek [Sat, 16 Aug 2008 00:45:40 +0000 (00:45 +0000)]
Enhance null-dereference checker test.

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

16 years agoChange ObjCRuntime::LookupClass -> GetClass, and now takes the
Daniel Dunbar [Sat, 16 Aug 2008 00:25:02 +0000 (00:25 +0000)]
Change ObjCRuntime::LookupClass -> GetClass, and now takes the
  ObjCInterfaceDecl.

Change ObjCRuntime::GenerateMessageSendSuper to take the
  ObjCInterfaceDecl for the super class, instead of just its name.

Change EmitObjCMessageExpr to make the right runtime calls for super
  sends in class methods (i.e. a super send with the class object as
  the receiver).

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

16 years agoUpdate Expr::{getIntegerConstantExprValue, isIntegerConstantExpr} to
Daniel Dunbar [Fri, 15 Aug 2008 23:29:09 +0000 (23:29 +0000)]
Update Expr::{getIntegerConstantExprValue, isIntegerConstantExpr} to
  use default APSInt constructor instead of embedding arbitrary
  constant.

Update OverloadExpr::getNumArgs to use getIntegerConstantExprValue.

Update OverloadExpr::getExpr to be const.

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

16 years agoClean up CodeGenModule interface.
Daniel Dunbar [Fri, 15 Aug 2008 23:26:23 +0000 (23:26 +0000)]
Clean up CodeGenModule interface.
 - Add CodeGenModule::EmitTopLevelDecl which uses switch on kind
   instead of ugly & slow dyn_cast chains.

 - Drop some simple forwarding methods into the ObjC runtime.

 - Privatize appropriate methods.

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

16 years agoIdent class tree in DeclBase properly.
Daniel Dunbar [Fri, 15 Aug 2008 23:18:35 +0000 (23:18 +0000)]
Ident class tree in DeclBase properly.

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

16 years agoChange CGObjCRuntime methods to take appropriate clang Decls.
Daniel Dunbar [Fri, 15 Aug 2008 22:20:32 +0000 (22:20 +0000)]
Change CGObjCRuntime methods to take appropriate clang Decls.
 - This is in prep for implementation class support for the NeXT
   runtime, for which the existing methods don't provide enough
   information (and additionally make too many assumptions about how
   things should be emitted).

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

16 years agoInfinite loops considered harmful.
Daniel Dunbar [Fri, 15 Aug 2008 18:29:12 +0000 (18:29 +0000)]
Infinite loops considered harmful.
 - Thanks Thomas

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

16 years agoUpdated latest checker build.
Ted Kremenek [Thu, 14 Aug 2008 23:35:31 +0000 (23:35 +0000)]
Updated latest checker build.

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

16 years agoDefault initialize only pointers and integer types (for now).
Ted Kremenek [Thu, 14 Aug 2008 22:11:13 +0000 (22:11 +0000)]
Default initialize only pointers and integer types (for now).

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

16 years agoChange Parser & Sema to use interned "super" for comparions.
Daniel Dunbar [Thu, 14 Aug 2008 22:04:54 +0000 (22:04 +0000)]
Change Parser & Sema to use interned "super" for comparions.
 - Added as private members for each because it is not clear where to
   put the common definition. Perhaps the IdentifierInfos all of these
   "pseudo-keywords" should be collected into one place (this would
   KnownFunctionIDs and Objective-C property IDs, for example).

Remove Token::isNamedIdentifier.
 - There isn't a good reason to use strcmp when we have interned
   strings, and there isn't a good reason to encourage clients to do
   so.

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

16 years agoMigrated retain/release checker to use the Generic Data Map in GRState (instead
Ted Kremenek [Thu, 14 Aug 2008 21:16:54 +0000 (21:16 +0000)]
Migrated retain/release checker to use the Generic Data Map in GRState (instead
of using CheckerState).

Removed CheckerState from GRState.

Added class GRStateRef which wraps GRState* and GRStateManager*. This is handy
for generating new states with a single handle.

Added member template set/get functions to GRStateRef/GRState/GRStateManager for
accessing the Generic Data Map.

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

16 years agoFix ASTContext::getObjCEncodingForType() to limit the type info for structure bodies...
Steve Naroff [Thu, 14 Aug 2008 15:00:38 +0000 (15:00 +0000)]
Fix ASTContext::getObjCEncodingForType() to limit the type info for structure bodies (mimics gcc's adhoc rules).
This fixes <rdar://problem/6140902> clang ObjC rewriter: If a class contains a struct ivar with a lot of members, ...

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

16 years agoMake diagnostics relating to the callee hilight just the callee
Chris Lattner [Thu, 14 Aug 2008 04:33:24 +0000 (04:33 +0000)]
Make diagnostics relating to the callee hilight just the callee
and put the caret on the ()'s.  e.g. produces:

t.c:13:9: error: called object is not a function or function pointer
  ((B)a)();
  ~~~~~~^

instead of:

t.c:13:3: error: called object is not a function or function pointer
  ((B)a)();
  ^~~~~~~~

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

16 years agoFix typo.
Ted Kremenek [Thu, 14 Aug 2008 03:45:07 +0000 (03:45 +0000)]
Fix typo.

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

16 years agoUpdate some isIntegerConstantExpr uses to use
Daniel Dunbar [Wed, 13 Aug 2008 23:47:13 +0000 (23:47 +0000)]
Update some isIntegerConstantExpr uses to use
  getIntegerConstantExprValue where appropriate.

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

16 years agomake sure the size of constant arrays is respected
Nuno Lopes [Wed, 13 Aug 2008 23:28:57 +0000 (23:28 +0000)]
make sure the size of constant arrays is respected

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

16 years agoAdd GetAddrOfConstantCString method
Daniel Dunbar [Wed, 13 Aug 2008 23:20:05 +0000 (23:20 +0000)]
Add GetAddrOfConstantCString method
 - Returns addr of constant for argument + '\0'.
 - I couldn't think of a better name.
 - Move appropriate users of GetAddrOfConstantString to this.

Rename getStringForStringLiteral to GetStringForStringLiteral.

Add GetAddrOfConstantStringFromLiteral
 - This combines GetAddrOfConstantString and
   GetStringForStringLiteral. This method can be, but is not yet, more
   efficient.

Change GetAddrOfConstantString to not add terminating '\0'
 - <rdar://problem/6140956>

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

16 years agoRenamed GRState::CheckerStatePrinter to GRState::Printer.
Ted Kremenek [Wed, 13 Aug 2008 21:24:49 +0000 (21:24 +0000)]
Renamed GRState::CheckerStatePrinter to GRState::Printer.
Updated checker state printer interface to allow transfer functions to return an arbitrary number of GRState::Printers.

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

16 years agoUpdate Xcode project.
Ted Kremenek [Wed, 13 Aug 2008 20:59:32 +0000 (20:59 +0000)]
Update Xcode project.

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

16 years agoUpdate Xcode project.
Ted Kremenek [Wed, 13 Aug 2008 20:43:54 +0000 (20:43 +0000)]
Update Xcode project.

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

16 years agoSema::ActOnStartProtocolInterface(): Make sure the protocol decl has a valid start...
Steve Naroff [Wed, 13 Aug 2008 16:39:22 +0000 (16:39 +0000)]
Sema::ActOnStartProtocolInterface(): Make sure the protocol decl has a valid start location.

The following case resulted in an invalid start location:

// start location not being set for ObjCProtocolDecl AST (when a forward reference is in scope).
@protocol Buggy;

@protocol Buggy
@optional
- whatever;
@end

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

16 years agoUpdate VS project file.
Ted Kremenek [Wed, 13 Aug 2008 04:45:09 +0000 (04:45 +0000)]
Update VS project file.

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

16 years agoRename ValueState.h -> GRState.h
Ted Kremenek [Wed, 13 Aug 2008 04:28:02 +0000 (04:28 +0000)]
Rename ValueState.h -> GRState.h
Rename ValueState.cpp -> GRState.cpp

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

16 years agoRename ValueState -> GRState.
Ted Kremenek [Wed, 13 Aug 2008 04:27:00 +0000 (04:27 +0000)]
Rename ValueState -> GRState.
Rename ValueStateManager -> GRStateManager.

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

16 years agoUpdated latest checker build.
Ted Kremenek [Wed, 13 Aug 2008 04:12:49 +0000 (04:12 +0000)]
Updated latest checker build.

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

16 years agoAdded test case.
Ted Kremenek [Wed, 13 Aug 2008 03:55:18 +0000 (03:55 +0000)]
Added test case.

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

16 years agoInitialize tracked local variables to undefined.
Ted Kremenek [Wed, 13 Aug 2008 03:28:04 +0000 (03:28 +0000)]
Initialize tracked local variables to undefined.

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

16 years agoImplement Obj-C protocol metadata generation for NeXT.
Daniel Dunbar [Wed, 13 Aug 2008 03:21:16 +0000 (03:21 +0000)]
Implement Obj-C protocol metadata generation for NeXT.
 - Near complete, only properties are missing.

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

16 years agoFix memory leak found by Sam Bishop: delete WList in the dstor of GRCoreEngineImpl.
Ted Kremenek [Wed, 13 Aug 2008 03:10:52 +0000 (03:10 +0000)]
Fix memory leak found by Sam Bishop: delete WList in the dstor of GRCoreEngineImpl.

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

16 years agoChange ObjCRuntime GenerateProtocol[Ref] methods to take
Daniel Dunbar [Wed, 13 Aug 2008 00:59:25 +0000 (00:59 +0000)]
Change ObjCRuntime GenerateProtocol[Ref] methods to take
    ObjCProtocolDecl directly.

Implement CodeGen support for forward protocol decls (no-ops are so
    nice to implement).

Also moved CGObjCRuntime.h out of CodeGenModule.h

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

16 years agoAdded GenericDataMap as a component of ValueState.
Ted Kremenek [Tue, 12 Aug 2008 21:49:24 +0000 (21:49 +0000)]
Added GenericDataMap as a component of ValueState.

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

16 years agoUpdate VS project files.
Ted Kremenek [Tue, 12 Aug 2008 21:05:43 +0000 (21:05 +0000)]
Update VS project files.

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

16 years agoMore cleanups. Add missing #include.
Ted Kremenek [Tue, 12 Aug 2008 20:41:56 +0000 (20:41 +0000)]
More cleanups.  Add missing #include.

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

16 years agoMore summary generation refactoring.
Ted Kremenek [Tue, 12 Aug 2008 18:48:50 +0000 (18:48 +0000)]
More summary generation refactoring.

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

16 years agoAdd variadic addInstMethSummary() and refactored addPanicSummary() to use this method...
Ted Kremenek [Tue, 12 Aug 2008 18:30:56 +0000 (18:30 +0000)]
Add variadic addInstMethSummary() and refactored addPanicSummary() to use this method. (code reduction).
Misc. cleanups.

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

16 years agoUpdate Xcode project.
Ted Kremenek [Tue, 12 Aug 2008 18:29:20 +0000 (18:29 +0000)]
Update Xcode project.

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

16 years agoEmit OBJC_MODULE_INFO and OBJC_SYMBOLS metadata
Daniel Dunbar [Tue, 12 Aug 2008 06:48:42 +0000 (06:48 +0000)]
Emit OBJC_MODULE_INFO and OBJC_SYMBOLS metadata
 - Matches llvm-gcc and seem to be expected by otool.

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

16 years agoDrop Sender from GenerateMessageSend*
Daniel Dunbar [Tue, 12 Aug 2008 05:40:10 +0000 (05:40 +0000)]
Drop Sender from GenerateMessageSend*
 - Was unused and generated a unnecessary load of self
(missed file)

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

16 years agoDrop Sender from GenerateMessageSend*
Daniel Dunbar [Tue, 12 Aug 2008 05:28:47 +0000 (05:28 +0000)]
Drop Sender from GenerateMessageSend*
 - Was unused and generated a unnecessary load of self

Update NeXT runtime to get proper object & selector types from
       ASTContext.

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

16 years agoProtocol related tweaks
Daniel Dunbar [Tue, 12 Aug 2008 05:08:18 +0000 (05:08 +0000)]
Protocol related tweaks
 - Implement type conversion of ObjCQualifiedIdType
 - Wire @protocol(...) to GenerateProtocolRef in ScalarExprEmitter

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

16 years agoAdd @selector(...) codegen support.
Daniel Dunbar [Tue, 12 Aug 2008 03:55:34 +0000 (03:55 +0000)]
Add @selector(...) codegen support.

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

16 years agoAdd NeXT support for (simple) message sends.
Daniel Dunbar [Tue, 12 Aug 2008 03:39:23 +0000 (03:39 +0000)]
Add NeXT support for (simple) message sends.

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

16 years agoUnbreak clang install.
Mike Stump [Tue, 12 Aug 2008 00:32:59 +0000 (00:32 +0000)]
Unbreak clang install.

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

16 years agoMove some ObjC preprocessor definitions into
Daniel Dunbar [Tue, 12 Aug 2008 00:21:46 +0000 (00:21 +0000)]
Move some ObjC preprocessor definitions into
     InitializePredefinedMacros().
 - Also now properly wired to -fobjc-gc, -fnext-runtime.

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

16 years agoAdd ObjC constant string support for NeXT.
Daniel Dunbar [Tue, 12 Aug 2008 00:12:39 +0000 (00:12 +0000)]
Add ObjC constant string support for NeXT.

Changed CGObjCRuntime::GenerateConstantString interface to take
       std::string instead of char* and size.

Change ObjC functions which call on GenerateConstantString to bitcast
       result to appropriate type.

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

16 years agoFix compilation warning with help from David Chisnall.
Mike Stump [Mon, 11 Aug 2008 23:16:18 +0000 (23:16 +0000)]
Fix compilation warning with help from David Chisnall.

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

16 years agoremove obsolete comment.
Chris Lattner [Mon, 11 Aug 2008 22:03:07 +0000 (22:03 +0000)]
remove obsolete comment.

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

16 years agoAdd LangOptions::NeXTRuntime.
Daniel Dunbar [Mon, 11 Aug 2008 21:35:06 +0000 (21:35 +0000)]
Add LangOptions::NeXTRuntime.
 - Wired to -fnext-runtime and -fgnu-runtime options.
 - Defaults to GNU, no autoselection for NeXT.

Emit NeXT OBJC_IMAGE_INFO marker.

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

16 years agoAdd test case for -fexceptions
Daniel Dunbar [Mon, 11 Aug 2008 18:40:47 +0000 (18:40 +0000)]
Add test case for -fexceptions

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

16 years agoChange CodeGenModule to only create ObjC runtime for ObjC files
Daniel Dunbar [Mon, 11 Aug 2008 18:12:00 +0000 (18:12 +0000)]
Change CodeGenModule to only create ObjC runtime for ObjC files
 - Changed CodeGenModule::getObjCRuntime to return reference.
 - Added CodeGenModule::hasObjCRuntime predicate.

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

16 years agoAdd -fexceptions to Driver
Daniel Dunbar [Mon, 11 Aug 2008 17:36:14 +0000 (17:36 +0000)]
Add -fexceptions to Driver
 - Maps to LangOptions.Exceptions
 - Currently always off, should autoselect based on language.

Update CodeGen to set unwind attribute on functions definitions based
       on LangOptions.Exceptions.
 - Still need to set attributes appropriately on calls.

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

16 years agoUpdate for IRBuilder template change (update LLVM!)
Daniel Dunbar [Mon, 11 Aug 2008 16:50:21 +0000 (16:50 +0000)]
Update for IRBuilder template change (update LLVM!)

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

16 years agoMore #include cleaning
Daniel Dunbar [Mon, 11 Aug 2008 06:23:49 +0000 (06:23 +0000)]
More #include cleaning
 - Kill unnecessary #includes in .cpp files. This is an automatic
   sweep so some things removed are actually used, but happen to be
   included by a previous header. I tried to get rid of the obvious
   examples and this was the easiest way to trim the #includes in one
   fell swoop.
 - We now return to regularly scheduled development.

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

16 years agoMore #include cleaning
Daniel Dunbar [Mon, 11 Aug 2008 05:35:13 +0000 (05:35 +0000)]
More #include cleaning
 - Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
 - Moved Sema::getCurMethodDecl() out of line (dependent on
   ObjCMethodDecl via dyn_cast).

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

16 years agoMore #include cleaning
Daniel Dunbar [Mon, 11 Aug 2008 05:00:27 +0000 (05:00 +0000)]
More #include cleaning
 - Remove internal uses of AST.h

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

16 years agoMore #include cleaning
Daniel Dunbar [Mon, 11 Aug 2008 04:54:23 +0000 (04:54 +0000)]
More #include cleaning
 - Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
   SourceLocation.h)
 - Move ASTContext constructor into implementation

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

16 years agoMore #include cleaning
Daniel Dunbar [Mon, 11 Aug 2008 03:45:03 +0000 (03:45 +0000)]
More #include cleaning
 - Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into
   implementation .cpp

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

16 years agoMinor #include cleaning
Daniel Dunbar [Mon, 11 Aug 2008 03:27:53 +0000 (03:27 +0000)]
Minor #include cleaning
 - Drop TokenKinds.h from Action.h
 - Move DeclSpec.h from Sema.h into individual Sema .cpp files

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

16 years agoAdd dummy Mac Objective-C runtime interface.
Daniel Dunbar [Mon, 11 Aug 2008 02:45:11 +0000 (02:45 +0000)]
Add dummy Mac Objective-C runtime interface.
  - Not currently accessible and completely non-functional.

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

16 years agofix linking with .so files specified in cmd line (this fixes some libtool usages)
Nuno Lopes [Sun, 10 Aug 2008 22:17:57 +0000 (22:17 +0000)]
fix linking with .so files specified in cmd line (this fixes some libtool usages)

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

16 years agopass -R arg to linker
Nuno Lopes [Sun, 10 Aug 2008 21:58:01 +0000 (21:58 +0000)]
pass -R arg to linker

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

16 years agoBack out r54608 (inline string literals were getting an extra '\0')
Daniel Dunbar [Sun, 10 Aug 2008 20:25:57 +0000 (20:25 +0000)]
Back out r54608 (inline string literals were getting an extra '\0')
  temporarily, I assumed GetAddrForConstantString literal was being
  used consistently but it doesn't look like it is.

Factored out a CodeGenModule::getStringForStringLiteral which handles
  extracting a std::string for the bytes of a StringLiteral, padded to
  match the type.

Update EmitLValue to use getStringForStringLiteral, this was
  previously not padding strings correctly. Good thing we only emit
  strings in 4 different places!

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

16 years ago* Remove isInSystemHeader() from DiagClient, move it to SourceManager
Nico Weber [Sun, 10 Aug 2008 19:59:06 +0000 (19:59 +0000)]
* Remove isInSystemHeader() from DiagClient, move it to SourceManager
* Move FormatError() from TextDiagnostic up to DiagClient, remove now
  empty class TextDiagnostic
* Make DiagClient optional for Diagnostic

This fixes the following problems:

* -html-diags (and probably others) does now output the same set of
  warnings as console clang does
* nothing crashes if one forgets to call setHeaderSearch() on
  TextDiagnostic
* some code duplication is removed

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

16 years agoForgot to modify LAST_EXPR (thanks Nuno).
Steve Naroff [Sun, 10 Aug 2008 19:28:37 +0000 (19:28 +0000)]
Forgot to modify LAST_EXPR (thanks Nuno).

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

16 years agoDo not crash with -serialize.
Nico Weber [Sun, 10 Aug 2008 19:20:05 +0000 (19:20 +0000)]
Do not crash with -serialize.

This happened because seralization was done in the constructor, and at that time the TranslationUnit is no longer valid.

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

16 years agoCleanup ObjCSuperRefExpr (remove last usage and AST node:-).
Steve Naroff [Sun, 10 Aug 2008 19:10:41 +0000 (19:10 +0000)]
Cleanup ObjCSuperRefExpr (remove last usage and AST node:-).

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

16 years agoAdd svn:ignore properties for Release-Asserts dirs
Daniel Dunbar [Sun, 10 Aug 2008 18:21:41 +0000 (18:21 +0000)]
Add svn:ignore properties for Release-Asserts dirs

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

16 years agoRemove the old evaluator code.
Anders Carlsson [Sun, 10 Aug 2008 17:03:01 +0000 (17:03 +0000)]
Remove the old evaluator code.

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

16 years agoInitListChecker::CheckListElementTypes(): Check for function types and issue an appro...
Steve Naroff [Sun, 10 Aug 2008 16:05:48 +0000 (16:05 +0000)]
InitListChecker::CheckListElementTypes(): Check for function types and issue an appropriate diagnostic.

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

16 years agoCleanup from yesterday...make isTentativeDefinition() a static helper function (no...
Steve Naroff [Sun, 10 Aug 2008 15:28:06 +0000 (15:28 +0000)]
Cleanup from yesterday...make isTentativeDefinition() a static helper function (no need for it to be part of the Sema API).

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

16 years agoSema::CheckForFileScopedRedefinitions(): Make sure tentative decls of incomplete...
Steve Naroff [Sun, 10 Aug 2008 15:20:13 +0000 (15:20 +0000)]
Sema::CheckForFileScopedRedefinitions(): Make sure tentative decls of incomplete array types are completed (and diagnosed properly).

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

16 years agoAllow the preprocessor to cache the lexed tokens, so that we can do efficient lookahe...
Argyrios Kyrtzidis [Sun, 10 Aug 2008 13:15:22 +0000 (13:15 +0000)]
Allow the preprocessor to cache the lexed tokens, so that we can do efficient lookahead and backtracking.

1) New public methods added:
  -EnableBacktrackAtThisPos
  -DisableBacktrack
  -Backtrack
  -isBacktrackEnabled

2) LookAhead() implementation is replaced with a more efficient one.
3) LookNext() is removed.

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

16 years agoFix crash during initialization of a bitfield which followed a zero
Daniel Dunbar [Sun, 10 Aug 2008 07:00:24 +0000 (07:00 +0000)]
Fix crash during initialization of a bitfield which followed a zero
  length element.

Fix some 80-col violations.

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

16 years agoUpdate ShuffeVectorExpr::getShuffleMaskIdx to use
Daniel Dunbar [Sun, 10 Aug 2008 06:58:01 +0000 (06:58 +0000)]
Update ShuffeVectorExpr::getShuffleMaskIdx to use
  getIntegerConstantExprValue.

Tweak getIntegerConstantExprValue to suppress warning in
  Release-Asserts mode.

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

16 years agoBug fix, inline string literals were getting an extra '\0'.
Daniel Dunbar [Sun, 10 Aug 2008 06:27:44 +0000 (06:27 +0000)]
Bug fix, inline string literals were getting an extra '\0'.

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

16 years agotighten up some code and some wording on diagnostics.
Chris Lattner [Sun, 10 Aug 2008 02:05:13 +0000 (02:05 +0000)]
tighten up some code and some wording on diagnostics.

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

16 years agowrap some long diagnostics, make 'initializer is not a constant' diagnostic
Chris Lattner [Sun, 10 Aug 2008 01:58:45 +0000 (01:58 +0000)]
wrap some long diagnostics, make 'initializer is not a constant' diagnostic
a bit more clear (rdar://5646070)

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

16 years agorename PreDefinedExpr -> PredefinedExpr
Chris Lattner [Sun, 10 Aug 2008 01:53:14 +0000 (01:53 +0000)]
rename PreDefinedExpr -> PredefinedExpr

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

16 years agoAdd some C++ Decl statistics.
Argyrios Kyrtzidis [Sun, 10 Aug 2008 01:47:31 +0000 (01:47 +0000)]
Add some C++ Decl statistics.

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

16 years agoMake sure to count the struct elements correctly; here, we want the
Eli Friedman [Sat, 9 Aug 2008 23:45:45 +0000 (23:45 +0000)]
Make sure to count the struct elements correctly; here, we want the
member count.  The count returned by numStructUnionElements is the
number of initializers that will be consumed, not the number of members
to iterate through.  Fixes PR2534.

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

16 years agoFix for PR2631; make va_arg work correctly on x86-64.
Eli Friedman [Sat, 9 Aug 2008 23:32:40 +0000 (23:32 +0000)]
Fix for PR2631; make va_arg work correctly on x86-64.

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

16 years ago80 cols
Nico Weber [Sat, 9 Aug 2008 23:08:17 +0000 (23:08 +0000)]
80 cols

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