Граф коммитов

4768 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner e96de3e913 remove global variables for output stream.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54861 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 03:12:02 +00:00
Ted Kremenek ffdbefd441 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
2008-08-17 03:10:22 +00:00
Ted Kremenek e7aa9a1364 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
2008-08-17 02:59:30 +00:00
Chris Lattner dceb6a7244 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
2008-08-17 01:47:12 +00:00
Nico Weber 63366303f6 honor EscapeSpaces in 2nd overload of EscapeText()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54854 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 22:24:33 +00:00
Argyrios Kyrtzidis 5e8840c7a6 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
2008-08-16 20:53:59 +00:00
Argyrios Kyrtzidis 6c2dc4d993 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
2008-08-16 20:27:34 +00:00
Argyrios Kyrtzidis 0cd5b429fa 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
2008-08-16 20:03:01 +00:00
Argyrios Kyrtzidis b348b810e7 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
2008-08-16 19:45:32 +00:00
Argyrios Kyrtzidis 289d77302a 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
2008-08-16 19:34:46 +00:00
Nick Lewycky 5d796aa789 It's spelt "uninitialized".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54848 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 17:46:53 +00:00
Nico Weber 7b802b7d94 add missing class declaration
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54841 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 12:36:27 +00:00
Argyrios Kyrtzidis 0919f9e800 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
2008-08-16 10:21:33 +00:00
Argyrios Kyrtzidis e1449e5101 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
2008-08-16 09:55:52 +00:00
Daniel Dunbar b7ec246872 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
2008-08-16 03:19:19 +00:00
Daniel Dunbar 54d19091a8 Add CodeGen support for AddrLabelExpr in initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54837 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 01:41:47 +00:00
Daniel Dunbar 488e993a13 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
2008-08-16 00:56:44 +00:00
Ted Kremenek 1c72ef092f 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
2008-08-16 00:49:49 +00:00
Ted Kremenek dd463b8db0 Enhance null-dereference checker test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 00:45:40 +00:00
Daniel Dunbar ddb2a3d55a 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
2008-08-16 00:25:02 +00:00
Daniel Dunbar 8070a8497c 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
2008-08-15 23:29:09 +00:00
Daniel Dunbar 41071debe9 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
2008-08-15 23:26:23 +00:00
Daniel Dunbar 226e04a9b7 Ident class tree in DeclBase properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54826 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-15 23:18:35 +00:00
Daniel Dunbar 7ded7f4983 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
2008-08-15 22:20:32 +00:00
Daniel Dunbar 9d9b09c86a Infinite loops considered harmful.
- Thanks Thomas


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-15 18:29:12 +00:00
Ted Kremenek 26bbb515a7 Updated latest checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54808 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 23:35:31 +00:00
Ted Kremenek fa07784e15 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
2008-08-14 22:11:13 +00:00
Daniel Dunbar 662e8b5647 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
2008-08-14 22:04:54 +00:00
Ted Kremenek 72cd17f0a4 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
2008-08-14 21:16:54 +00:00
Steve Naroff faf37e7d36 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
2008-08-14 15:00:38 +00:00
Chris Lattner ad2018f4cd 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
2008-08-14 04:33:24 +00:00
Ted Kremenek a9bc2d98a2 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54774 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 03:45:07 +00:00
Daniel Dunbar 32442bbc98 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
2008-08-13 23:47:13 +00:00
Nuno Lopes 3998d3fb8e 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
2008-08-13 23:28:57 +00:00
Daniel Dunbar 6143293fa4 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
2008-08-13 23:20:05 +00:00
Ted Kremenek ae6814efb6 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
2008-08-13 21:24:49 +00:00
Ted Kremenek 7ba378a928 Update Xcode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54759 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 20:59:32 +00:00
Ted Kremenek aae2b101c4 Update Xcode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54755 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 20:43:54 +00:00
Steve Naroff f11b5088ec 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
2008-08-13 16:39:22 +00:00
Ted Kremenek 298419aad5 Update VS project file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54723 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 04:45:09 +00:00
Ted Kremenek 62e1dcca86 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
2008-08-13 04:28:02 +00:00
Ted Kremenek 4adc81e540 Rename ValueState -> GRState.
Rename ValueStateManager -> GRStateManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54721 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 04:27:00 +00:00
Ted Kremenek 70ecb9b883 Updated latest checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54720 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 04:12:49 +00:00
Ted Kremenek 595c7ab8a4 Added test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54717 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 03:55:18 +00:00
Ted Kremenek 72c59d07a3 Initialize tracked local variables to undefined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54716 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 03:28:04 +00:00
Daniel Dunbar 6efc0c559b 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
2008-08-13 03:21:16 +00:00
Ted Kremenek 5c135b47d0 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
2008-08-13 03:10:52 +00:00
Daniel Dunbar af2f62ce32 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
2008-08-13 00:59:25 +00:00
Ted Kremenek 450202284e Added GenericDataMap as a component of ValueState.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54704 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 21:49:24 +00:00
Ted Kremenek 2aa7095baf Update VS project files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54701 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 21:05:43 +00:00