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

102 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 81895a21a1 Add PCH test for C++ namespaces, missing from a previous commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 21:52:55 +00:00
Sam Weinig eb7f96141f Roll r95513 back in.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95515 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-07 06:32:43 +00:00
Sam Weinig a8ad5d4975 Roll out r95513, it seems to have broken self hosting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95514 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-07 05:26:25 +00:00
Sam Weinig 1eb1113b13 Add PCH support for CXXBoolLiteralExpr and CXXNullPtrLiteralExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-07 04:44:10 +00:00
Sam Weinig ce757a7a1e Add PCH support for CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr, CXXConstCastExpr and CXXFunctionalCastExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93658 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:21:01 +00:00
Douglas Gregor 9123666ed4 Serialize the NoReturn bit on FunctionTypes for precompiled headers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91911 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 18:11:50 +00:00
Daniel Dunbar 80737ad5e0 Update tests to use %clang instead of 'clang', and forcibly disable use of '
clang ' or ' clang -cc1 ' or ' clang-cc ' in test lines (by substituting them to
garbage).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 22:01:24 +00:00
Daniel Dunbar a5728872c7 Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 20:14:24 +00:00
Fariborz Jahanian 01ed063edb Make tests use the new clang -cc1 flag.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91303 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 18:00:56 +00:00
Daniel Dunbar 5c2609a1f9 Remove this test for now, it is flaky.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 00:27:30 +00:00
Daniel Dunbar 21a8bed504 Add a pretty horrible hack to prevent clang from crashing with inconsistent PCH
files.
 - The issue is that PCH uses a stat cache, which may reference files which have
   been deleted or moved. In such cases ContentCache::getBuffer was returning 0
   but most clients are incapable of dealing with this (i.e., they don't).

   For the time being, resolve this issue by just making up some invalid file
   contents and. Eventually we should detect that we are in an inconsistent
   situation and error out with a nice message that the PCH is out of date.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90699 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 05:43:36 +00:00
Daniel Dunbar fcb91afaf2 Add test case for PR5662.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 21:57:39 +00:00
Daniel Dunbar 8a90ac0e85 Normalize options to use '-FOO' instead of '--FOO'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 09:33:10 +00:00
Daniel Dunbar 682899db9a Use '-x' 'foo' instead of '-x=foo'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 09:32:31 +00:00
Daniel Dunbar 1ea52949b2 Fix PCH/preprocess test to be more useful, and unbreak -E mode with implicit
PCH, which I broke.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:36:20 +00:00
Daniel Dunbar 4fcfde4d5c Eliminate &&s in tests.
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 01:45:36 +00:00
Daniel Dunbar e584b6538a Fix tests to not depend on /dev/null existing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 17:56:18 +00:00
Daniel Dunbar f79ad5f491 Use %S, not `pwd`, and enable a line that *does* work.
- Doug, please check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01 05:57:38 +00:00
Mike Stump 3502deee1a Revert this, we can now avoid error cascades better.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:52:50 +00:00
Mike Stump e941d8ed27 Revert recent change, I now have a better way to solve this (thanks Chris).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:41:23 +00:00
Mike Stump 74bfeb39e7 Prep for new warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:54:02 +00:00
Argyrios Kyrtzidis 9bedef6ae1 Fixes for a couple of things:
- Declaration context of ParmVarDecls (that we got from the Declarator) was not their containing function.
- C++ out-of-line method definitions didn't get an access specifier.

Both were exposed by a crash when emitting a C++ method to a PCH file (assert at Decl::CheckAccessDeclContext()).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 03:18:53 +00:00
Steve Naroff 14108da7f7 This patch includes a conceptually simple, but very intrusive/pervasive change.
The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.

This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.

By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. 

Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 23:34:53 +00:00
Douglas Gregor c29f77b769 Make ASTContext explicitly keep track of the declaration for the C
FILE type, rather than using name lookup to find FILE within the
translation unit. Within precompiled headers, FILE is treated as yet
another "special type" (like __builtin_va_list).

This change should provide a performance improvement (not verified),
since the lookup into the translation unit declaration 
forces the (otherwise unneeded) construction of a large hash table.
More importantly, with precompiled headers, the construction
of that table requires deserializing most of the top-level
declarations from the precompiled header, which are then unused.

Fixes PR 4509.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74911 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 16:35:42 +00:00
Douglas Gregor e650c8c3bc Introduce the notion of "Relocatable" precompiled headers, which are built
with a particular system root directory and can be used with a different
system root directory when the headers it depends on have been installed.
Relocatable precompiled headers rewrite the file names of the headers used
when generating the PCH file into the corresponding file names of the 
headers available when using the PCH file.

Addresses <rdar://problem/7001604>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 00:12:59 +00:00
Douglas Gregor d89275bc86 Fix PR 4489, a crash in PCH loading that occurs when loading the name
of a top-level declaration loads another top-level declaration of the
same name whose type depends on the first declaration having been
completed. This commit breaks the circular dependency by delaying
loads of top-level declarations triggered by loading a name until we
are no longer recursively loading types or declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 18:54:52 +00:00
Douglas Gregor ae4df629dd Fix PR 4489, a PCH crash during de-serialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 23:29:14 +00:00
Douglas Gregor b64c19365d Make precompiled headers work with -E. When we're only preprocessing
(with -E), we turn the PCH include into an implicit include of the
file from which the PCH file was generated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71534 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 01:31:05 +00:00
Chris Lattner 5031c46ec4 Make this test portable to non-x86 hosts, patch by Mark Cianciosa!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71146 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 04:21:16 +00:00
Douglas Gregor 92b059ea94 Implement checking for macro definitions that occur on the command
line when using a PCH that were not provided when building the PCH
file. If those names were used as identifiers somewhere in the PCH
file, reject the PCH file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 20:33:11 +00:00
Douglas Gregor e721f95069 Allow some differences between the predefines buffer used to build a
PCH file and the predefines buffer used when including the PCH
file. We (explicitly) detect conflicting macro definitions (rejecting
the PCH file) and about missing macro definitions (they'll be
automatically pulled from the PCH file anyway).

We're missing some checking to make sure that new macro definitions
won't have any impact on the PCH file itself (e.g., #define'ing an
identifier that the PCH file used).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70316 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 18:58:38 +00:00
Douglas Gregor b81c170920 Add Sema::ExtVectorDecls and Sema::ObjCCategoryImpls to the PCH file. Since these vectors are very, very rarely used and, when used in headers, and even when used are relatively small, we load them eagerly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 20:06:05 +00:00
Douglas Gregor ce5148894c Fix a problem with the RUN line of one of the PCH tests
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 18:49:47 +00:00
Douglas Gregor f0aaf7a597 PCH support for the global method pool (= instance and factory method
pools, combined). The methods in the global method pool are lazily
loaded from an on-disk hash table when Sema looks into its version of
the hash tables.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69989 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24 21:10:55 +00:00
Steve Naroff 83d63c7881 Add PCH support for #import.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24 20:03:17 +00:00
Douglas Gregor 319ac896a0 PCH support for all of the predefined Objective-C types, such as id,
SEL, Class, Protocol, CFConstantString, and
__objcFastEnumerationState. With this, we can now run the Objective-C
methods and properties PCH tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69932 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 22:29:11 +00:00
Steve Naroff 8f06f84e8b More PushOnScopeChain() FIXME's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 16:00:56 +00:00
Steve Naroff a7503a735d Sema::ActOnStartClassInterface(): Use PushOnScopeChains().
This enables class recognition to work with PCH. I believe this means we can remove Sema::ObjCInterfaceDecls and it's usage within Sema::LookupName(). Will investigate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 15:15:40 +00:00
Steve Naroff 90cd1bb1ba Add PCH read/write support for Objective-C Selectors.
Note: This support is non-lazy. Once we get "Cocoa.h" humming, we can optimize this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 10:39:46 +00:00
Douglas Gregor 70e5a14c60 PCH support for Objective-C property declarations (UNTESTED!)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69843 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 23:20:34 +00:00
Douglas Gregor 14c22f20c0 Support locally-declared external declarations in PCH files
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 22:18:58 +00:00
Douglas Gregor 0838ba65ac Clean up and de-XFAIL-ify PCH test for external definitions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69831 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 22:09:39 +00:00
Douglas Gregor 4c0e86b392 Support tentative definitions in precompiled headers. This isn't likely
to happen (ever), but at least we'll do the right thing when it does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69829 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 22:02:47 +00:00
Chris Lattner c6fa4450b8 deserialization support for qualified interfaces
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69782 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 06:45:28 +00:00
Chris Lattner d7a3fcd48c pch support for protocol qualified id's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69781 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 06:40:03 +00:00
Chris Lattner 3a57a3765b add three new objc expression types. @selector doesn't work because we have no
way to serialize selectors yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 06:29:42 +00:00
Chris Lattner 4dcf151a55 implement serialization support for @encode,
fix a couple of bugs in reader support for ObjCInterfaceDecl,
and add support for reading ObjCInterfaceType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 05:57:30 +00:00
Chris Lattner f7830b6a9e rename methods.* -> objc_methods.*
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 05:31:53 +00:00
Douglas Gregor ba48d05c9c Test PCH support for VLAs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 00:21:21 +00:00
Douglas Gregor 0c8c455faa Eliminate a FIXME in one of the PCH test cases
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 00:17:41 +00:00