Eli Friedman [Fri, 22 Aug 2008 00:56:42 +0000 (00:56 +0000)]
Rewrite type compatibility testing to do type merging rather than just
testing compatibility. This is necessary for some constructs, like merging
redeclarations.
Also, there are some ObjC changes to make sure that
typesAreCompatible(a,b) == typesAreCompatible(b,a). I don't have any
ObjC code beyond the testsuite, so please tell me if there are any cases
where this doesn't behave as expected.
Eli Friedman [Fri, 22 Aug 2008 00:06:13 +0000 (00:06 +0000)]
Initial implementation of floats in Expr::tryEvaluate; this doesn't
implement some things, like unary operators and casts, but it's enough
to fix PR2703 as filed.
Steve Naroff [Thu, 21 Aug 2008 13:03:03 +0000 (13:03 +0000)]
RewriteObjC::RewriteObjCSynchronizedStmt(): Make sure the sync expr is cast to "id".
This fixes <rdar://problem/6163088> clang ObjC rewriter: @synchronized ([foo class]) {} does not cast properly.
Daniel Dunbar [Thu, 21 Aug 2008 04:36:09 +0000 (04:36 +0000)]
Preliminary support for Obj-C classes in NeXT runtime.
- Functional for simple cases but there are some glaring omissions
(protocols, properties, and other language extensions).
- The code needs a fair bit of cleaning.
Daniel Dunbar [Thu, 21 Aug 2008 03:03:44 +0000 (03:03 +0000)]
Reorder the PATH used during testing so $(ToolDir) and the LLVM
scripts dir appear before the user path.
- This is an attempt to pick up the right executables. We should
probably be substituting the exact things we want for clang a la
the LLVM test script.
Daniel Dunbar [Thu, 21 Aug 2008 02:51:29 +0000 (02:51 +0000)]
Update a number of CodeGen tests to not create .ll files in the test
directory.
- Removed .ll from the svn:ignore lists to try and prevent this.
- Added svn:ignore on test/Misc/Output
Eli Friedman [Thu, 21 Aug 2008 01:40:19 +0000 (01:40 +0000)]
Initial implementation of Windows x86 target; at the moment, the only
difference from generic x86 is the defines. The rest is non-trivial to
implement.
I'm not planning on adding any more targets myself; if there are any
targets anyone is currently using that are missing, feel free to add
them, or ask me to add them.
This concludes the work I'm planning for the TargetInfo
implementations at the moment; all the other issues with TargetInfo require
some API changes, and I haven't really thought it through. Some of the
remaining issues: allowing targets to define size_t and wchar_t properly,
adding some sort of __builtin_type_info intrinsic so we can finish clang's
limits.h and float.h and get rid of a massive number of macro
definitions, allowing target-specific command-line options, allowing
target-specific defaults for certain command-line options like
-fms-extensions, exposing vector alignment outside of the description
string, exposing endianness outside of the description string, allowing
targets to expose special bit-field layout requirements, exposing some
sort of custom hook for call generation in CodeGen, and adding CPU
selection to control defines like __SSE__.
Eli Friedman [Thu, 21 Aug 2008 00:13:15 +0000 (00:13 +0000)]
First cut at OS detection, taking advantage of the new generic targets.
This approach allows adding OS-specific targets/defines/etc. without
completely breaking unknown subtargets. No new subtargets yet, although
I plan to add x86-Linux soon. Others can add targets that they use as
needed; adding a new subtarget takes very little code.
Also does some fixups for description strings; a lot of them were
unspecified. I think all the ones I added are correct, but
they're unverified; corrections are welcome.
Eli Friedman [Wed, 20 Aug 2008 07:28:14 +0000 (07:28 +0000)]
Class hierarchy reorg for Sparc architecture. While I was there, I
cleaned it up a bit, including fixing the definition of va_list; this
shouldn't break anything, but anyone using Sparc should watch for
regressions.
Daniel Dunbar [Wed, 20 Aug 2008 03:55:42 +0000 (03:55 +0000)]
Fix subtle bug introduced in r54852.
- UsualUnaryConversions takes an Expr *& and may modify its argument,
this broke when it was refactored into Sema::CheckCastTypes. This
meant that we were missing implicit casts in some places.
- Seems pretty sad that this got through our tests.
Ted Kremenek [Wed, 20 Aug 2008 03:26:33 +0000 (03:26 +0000)]
Added ObjCAtDefsFieldDecl to represent FieldDecls created by @defs.
This fixes an ownership issue where FieldDecls could be owned both by an ObjCInterfaceDecl and a RecordDecl.
Eli Friedman [Wed, 20 Aug 2008 02:34:37 +0000 (02:34 +0000)]
Reorganize the class hierarchy for x86 targets; shouldn't have any
visible effects, but this will significantly reduce the amount of
boilerplate code necessary to add subtargets.
If this looks okay, I'll do the rest of the processors (PPC, Sparc, ARM)
soon.
Daniel Dunbar [Wed, 20 Aug 2008 00:28:19 +0000 (00:28 +0000)]
Move all Obj-C runtime interaction into CodeGenFunction.
- Drop duplicate (and broken) code for sending messages.
- Add EmitObjCProtocolExpr to CodeGenFunction.
Eli Friedman [Wed, 20 Aug 2008 00:02:01 +0000 (00:02 +0000)]
Get rid of the bogus -depth +0 argument; I really have no clue what the
heck it does on Darwin, but it's not part of POSIX, and the GNU version
of find errors out on it.
On a side note, there are a couple of new failures due to tests
including OS X specific headers.
Ted Kremenek [Tue, 19 Aug 2008 16:51:45 +0000 (16:51 +0000)]
Patch by Zhongxing Xu!
This patch extends BasicStoreManager::getInitialStore() to include code that symbolicates input variables.
It also removes redundant handling of ImplicitParamDecl, since it is a subclass of VarDecl.
Steve Naroff [Tue, 19 Aug 2008 13:04:19 +0000 (13:04 +0000)]
Fix crasher in RewriteObjC::RewriteObjCSynchronizedStmt(). Can't depend on the source locations of the sync expression (since it may have been rewritten.
Fixes <rdar://problem/6156363> clang ObjC rewriter: rewriting attached file causes assertion failure: invalid FileID
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.
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.
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.
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.
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.
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).
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.
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, ...
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>