Commit Graph

329 Commits

Author SHA1 Message Date
Fariborz Jahanian df79567796 objective-c translator. More stuff for modern meta-data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150767 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 00:06:14 +00:00
Fariborz Jahanian eeabf38186 fix the property list metadata name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150728 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 21:57:59 +00:00
Fariborz Jahanian 3f77c7b56d modern objective-c translator: write the root class meta-data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150726 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 21:37:05 +00:00
Fariborz Jahanian 6ade343d18 modern objc translator: meta-data generation for first
part of class meta-data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150714 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 18:54:09 +00:00
Fariborz Jahanian 4339bb3a71 objective-c translator: fixes an obscure rewriting bug
which attempted to rewrite the same meta-data twice.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150618 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 22:01:47 +00:00
Fariborz Jahanian f1c1d9a99d modern objective-c translator: start writing the main class
meta-data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150548 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 00:50:11 +00:00
Fariborz Jahanian 0a525340ad more objective-c translator for modern abi.
metadata for protocol definitions used on
class qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150498 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 19:31:35 +00:00
Fariborz Jahanian 90af4e22a8 more modern objc translator. Focusing on metadata for methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150490 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 17:19:02 +00:00
Fariborz Jahanian 07e5288c65 modern objc translator. More ivar rewrite work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150415 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 21:34:45 +00:00
Fariborz Jahanian db64923b25 objc modern translator. ivar offset symbols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150413 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 20:59:02 +00:00
Fariborz Jahanian 164d6f8c7e objective-c translator: more rewriting of ivar types
into a c-type which closely matches the objective-c type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150406 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 18:57:49 +00:00
Fariborz Jahanian 0b17b9a1b6 more of rewriting ivar types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150353 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 21:36:23 +00:00
Argyrios Kyrtzidis 9335df3249 Fix the rewriter that broke with r149987.
r149987 changed the way parsing happens inside an @implementation;
it aggregates the declarations inside and reports them together as a DeclGroup.
This had the side effect that function declarations were reported together with
their definition, while the rewriter expected for function declarations to be
reported immediately to the consumer and thus not have a body.

Fix this by having the rewriter actually check with isThisDeclarationADefinition()
to make sure the body comes from the current decl before rewriting it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150325 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 04:48:45 +00:00
Fariborz Jahanian 8f1fed036e objective-c translator. more modern abi stuff, focusing on ivar related
meta-data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150310 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 20:10:52 +00:00
Fariborz Jahanian a63b422eda objc translator: more modern metadata stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 23:18:24 +00:00
Fariborz Jahanian ae9329570b objctive-c translator: modern metadata for ivars. wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150275 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 20:47:10 +00:00
Fariborz Jahanian 42e9a35ce0 objc translator: mode modern abi stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150212 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 00:04:22 +00:00
Fariborz Jahanian e0adbd8386 last piece of metadata to complete modern metadata for
protocol definitions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150106 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 22:23:26 +00:00
Fariborz Jahanian da9624a773 More rewriting of objective-c moderin abi metadata.
All protocol related metadata is close to completion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150084 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 19:53:58 +00:00
Fariborz Jahanian 82848c26c8 modern objc rewriter: mode metadata stuff. wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150030 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 00:50:52 +00:00
Fariborz Jahanian da35eacc6e modern objc abi rewriter: mode protocol metadata
for modern objc abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150011 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 23:31:52 +00:00
Benjamin Kramer d7a3e2c5f6 Revert my patches which removed Diagnostic.h includes by moving some operator overloads out of line.
This seems to negatively affect compile time onsome ObjC tests
(which use a lot of partial diagnostics I assume). I have to come
up with a way to keep them inline without including Diagnostic.h
everywhere. Now adding a new diagnostic requires a full rebuild
of e.g. the static analyzer which doesn't even use those diagnostics.

This reverts commit 6496bd10dc.
This reverts commit 7af19b817b.
This reverts commit fdd15602a4.
This reverts commit 00bd44d567.
This reverts commit ef9b60ffed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150006 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 22:29:24 +00:00
Fariborz Jahanian 77e4bcacd5 objc rewriter: modern metadata for protocol decls. wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150002 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 20:15:08 +00:00
Fariborz Jahanian 64cb63a0cf objc rewriter: start supporting modern objective-c abi
in objective-c rewriter. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149989 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 17:11:38 +00:00
Dylan Noblesmith f7ccbad5d9 Basic: import SmallString<> into clang namespace
(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149799 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 02:13:05 +00:00
Dylan Noblesmith 6f42b62b61 Basic: import OwningPtr<> into clang namespace
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 02:12:40 +00:00
Benjamin Kramer 8fe83e1df9 Move a method from IdentifierTable.h out of line and remove the SmallString include.
Fix all the transitive include users.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149783 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 13:45:25 +00:00
Benjamin Kramer fdd15602a4 Remove Diagnostic.h include from Preprocessor.h.
- Move the offending methods out of line and fix transitive includers.
- This required changing an enum in the PPCallback API into an unsigned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149782 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 13:02:15 +00:00
Argyrios Kyrtzidis 97a9cf3b99 In FixItRecompile::BeginInvocation() reset the diagnostics before executing
the original action.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149120 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 06:15:37 +00:00
Argyrios Kyrtzidis 30ae84cfd1 In FixItRecompile::BeginInvocation(), check the return value of BeginSourceFile().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149107 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 01:00:47 +00:00
Argyrios Kyrtzidis 98b940b7fe Remove the headers now that ::close() is not used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149044 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 04:42:21 +00:00
Argyrios Kyrtzidis c8af9107fd In FixItRewriteToTemp::RewriteFilename don't try to close the file descriptor
with close(); return it instead.

Fixes mingw build and eliminates possible racing issues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149043 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 04:19:04 +00:00
NAKAMURA Takumi 0277039e94 Rewrite/FrontendActions.cpp: Tweak to unbreak msvc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149041 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 03:47:18 +00:00
Douglas Gregor 24466d8a90 Add missing include of <unistd.h>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149035 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 03:20:14 +00:00
Argyrios Kyrtzidis 61d679ab28 Introduce 3 new fixit options:
-fixit-recompile
	applies fixits and recompiles the result
-fixit-to-temporary
	applies fixits to temporary files
-fix-only-warnings">,
    applies fixits for warnings only, not errors

Combining "-fixit-recompile -fixit-to-temporary" allows testing the result of fixits
without touching the original sources.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149027 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 02:40:48 +00:00
Ted Kremenek 3eaaa99c7e Per PR 11814, use Monospace instead of Andale Mono.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148567 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 20:39:55 +00:00
David Blaikie 7530c034c0 Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148292 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 06:56:22 +00:00
Argyrios Kyrtzidis 746f5bcbfd Add IsImplicit field in ObjCMessageExpr that is true when the message
was constructed, e.g. for a property access.

This allows the selector identifier locations machinery for ObjCMessageExpr
to function correctly, in that there are not real locations to handle/report for
such a message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148013 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12 02:34:39 +00:00
Chad Rosier 0774ba7bb2 Fix uninitialized variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147678 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06 20:05:14 +00:00
Douglas Gregor 61cc296de6 Fix canonicalization of protocol-qualified types
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147421 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-02 02:00:30 +00:00
Douglas Gregor bd9482d859 Eliminate ObjCForwardProtocolDecl, which is redundant now that
ObjCProtocolDecl modules forward declarations properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147415 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 21:23:57 +00:00
Douglas Gregor 5e2a1ff9f2 Move the data that corresponds to the definition of a protocol into a
separately-allocated DefinitionData structure. Introduce various
functions that will help with the separation of declarations from
definitions (isThisDeclarationADefinition(), hasDefinition(),
getDefinition()).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147408 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 19:29:29 +00:00
Douglas Gregor 3fc73ee0c6 Use declaresSameEntity() when comparing ObjCProtocolDecls, and
getCanonicalDecl() when putting ObjCProtocolDecls into a set. This is
groundwork for making ObjCProtocolDecl redeclarable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147406 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-01 18:09:12 +00:00
Douglas Gregor 375bb1413c Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an
Objective-C class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147299 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-27 22:43:10 +00:00
Fariborz Jahanian 97bbab2df7 objc, objc rewriter. Fixes couple of bugs one
because of recent refactoring and one in the
rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147070 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 19:48:07 +00:00
Douglas Gregor 05c272fed8 Move ObjCInterfaceDecl's "EndLoc" into DefinitionData, since it only
applies to an actual definition. Plus, clarify the purpose of this
field and give the accessor a different name, since getLocEnd() is
supposed to be the same as getSourceRange().getEnd().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146694 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 22:34:59 +00:00
Douglas Gregor 7723fec9b4 Keep track of all declarations of an Objective-C class (both forward
declarations and definitions) as ObjCInterfaceDecls within the same
redeclaration chain. This new representation matches what we do for
C/C++ variables/functions/classes/templates/etc., and makes it
possible to answer the query "where are all of the declarations of
this class?"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146679 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 20:29:51 +00:00
Douglas Gregor 60ef308e51 Replace all comparisons between ObjCInterfaceDecl pointers with calls
to declaresSameEntity(), as a baby step toward tracking forward
declarations of Objective-C classes precisely. Part of
<rdar://problem/10583531>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146618 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 00:29:59 +00:00
Fariborz Jahanian d5c3fa29c6 More refactoring of objective-C rewriter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146160 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 18:25:15 +00:00
Fariborz Jahanian 02f8396a44 More refactoring of objc rewriter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145867 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05 22:59:54 +00:00