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

881 Коммитов

Автор SHA1 Сообщение Дата
Steve Naroff 01f2ffacc4 Rename a local predicate to avoid confusion with Type::isBlockPointerType().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60899 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 21:05:33 +00:00
Steve Naroff 47a2422088 Fixup generated code for imported block decl refs.
Found while investigating <rdar://problem/6435837> clang ObjC rewriter: use Block_release instead of Block_destroy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60898 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 20:51:38 +00:00
Steve Naroff 9fa72ef7e8 Fix <rdar://problem/6435842> clang ObjC rewriter: #include Block.h, Block_private.h or come up with #define to prevent double-definition
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60890 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 19:43:14 +00:00
Steve Naroff f4312dc9b6 Fix <rdar://problem/6435382> clang ObjC rewriter: @property/@synthesize and blocks don't work together
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 19:29:16 +00:00
Douglas Gregor a4c46df1cd Actually distinguish between RecordDecl::field_iterator and RecordDecl::field_const_iterator, propagating the constness down to the FieldDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60883 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 17:59:21 +00:00
Douglas Gregor 44b4321fea Unifies the name-lookup mechanisms used in various parts of the AST
and separates lexical name lookup from qualified name lookup. In
particular:
  * Make DeclContext the central data structure for storing and
    looking up declarations within existing declarations, e.g., members
    of structs/unions/classes, enumerators in C++0x enums, members of
    C++ namespaces, and (later) members of Objective-C
    interfaces/implementations. DeclContext uses a lazily-constructed
    data structure optimized for fast lookup (array for small contexts,
    hash table for larger contexts). 

  * Implement C++ qualified name lookup in terms of lookup into
    DeclContext.

  * Implement C++ unqualified name lookup in terms of
    qualified+unqualified name lookup (since unqualified lookup is not
    purely lexical in C++!)

  * Limit the use of the chains of declarations stored in
    IdentifierInfo to those names declared lexically.

  * Eliminate CXXFieldDecl, collapsing its behavior into
    FieldDecl. (FieldDecl is now a ScopedDecl).

  * Make RecordDecl into a DeclContext and eliminates its
    Members/NumMembers fields (since one can just iterate through the
    DeclContext to get the fields).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 16:49:14 +00:00
Steve Naroff e58ee0ca7c Fix regression caused by fixing <rdar://problem/6429113> clang ObjC rewriter: crash rewriting file with Blocks and properties
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60839 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 14:53:27 +00:00
Steve Naroff b619d957b0 Fix <rdar://problem/6429113> clang ObjC rewriter: crash rewriting file with Blocks and properties
More fancy footwork to cope with rewriting property 'setters'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 12:56:34 +00:00
Ted Kremenek ca9bab0dcb Update Driver to new interface for LiveVariables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60732 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 00:17:51 +00:00
Steve Naroff 68272b86b3 Fix a couple uninitialized variables from my previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60713 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 20:01:41 +00:00
Dan Gohman 447e4c1e7b Remove the #include of ScheduleDAGSDNodes.h, which is no longer necessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60712 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 19:45:33 +00:00
Steve Naroff 4ebd716f26 Fix <rdar://problem/6423452> clang ObjC rewriter: Don't use __declspec(dllimport) for Blocks functions, as they are linked statically.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60704 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 17:30:33 +00:00
Steve Naroff 8599e7a394 Handle chained/nested property 'getters' (obj.p1.p2.p3).
This is a follow-up to fixing <rdar://problem/6213955> clang ObjC rewriter: rewriter doesn't appear to support @property and @synthesize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60700 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 16:43:47 +00:00
Douglas Gregor 5c37de7885 Add support for calls to dependent names within templates, e.g.,
template<typename T> void f(T x) {
    g(x); // g is a dependent name, so don't even bother to look it up
    g(); // error: g is not a dependent name
  }

Note that when we see "g(", we build a CXXDependentNameExpr. However,
if none of the call arguments are type-dependent, we will force the
resolution of the name "g" and replace the CXXDependentNameExpr with
its result.

GCC actually produces a nice error message when you make this
mistake, and even offers to compile your code with -fpermissive. I'll
do the former next, but I don't plan to do the latter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60618 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-06 00:22:45 +00:00
Steve Naroff 8c56515a0c Fixed <rdar://problem/6213808> clang ObjC rewriter: @finally is not always executed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60593 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 17:03:39 +00:00
Chris Lattner 802db9b4d5 -std=c99 defaults blocks to off even on darwin, but -fblocks overrides
even it. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60568 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 00:10:44 +00:00
Steve Naroff 4c3580e5f9 Finish up support for <rdar://problem/6213955> clang ObjC rewriter: rewriter doesn't appear to support @property and @synthesize.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60565 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 23:50:32 +00:00
Chris Lattner ae0ee03fd9 instead of forcing blocks on by default, make them default to off, but let
specific targets default them to on.  Default blocks to on on 10.6 and later.
Add a -fblocks option that allows the user to override the target's default.
Use -fblocks in the various testcases that use blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 23:20:07 +00:00
Chris Lattner 8fc4dfb30e replace useNeXTRuntimeAsDefault with a generic hook that allows targets
to specify their default language options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 22:54:33 +00:00
Ted Kremenek 8dffd9b988 Remove unneeded assertion. We already know that FE->getName() is an absolute path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60558 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 22:36:44 +00:00
Steve Naroff c77a636688 Several things...
- Implement RewritePropertySetter(). While the routine is simple, there were some tricky changes to RewriteFunctionBodyOrGlobalInitializer(), the main rewriter loop. It also required some additional instance data to distinguish setters from getters, as well as some changes to RewritePropertyGetter().

- Implement FIXME: for pretty printing ObjCPropertyRefExpr's.

- Changed ObjCPropertyRefExpr::getSourceRange() to point to the end of the property name (not the beginning). Also made a minor name change from "Loc"->"IdLoc" (to make it clear the Loc does not point to the ".").
 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 16:24:46 +00:00
Ted Kremenek 6183e4815a PTH:
Use an array instead of a DenseMap to cache persistent IDs -> IdentifierInfo*.  This leads to a 4% speedup at -fsyntax-only using PTH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60452 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 01:16:39 +00:00
Steve Naroff 15f081de2c More support for rewriting property getter/setters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60450 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 00:56:33 +00:00
Ted Kremenek c2e7299f26 Add "-token-cache" option for using pretokenized cache files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60440 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 19:57:31 +00:00
Ted Kremenek fc7e2ead43 PTH emission:
- Output 32 bit integers using bit-shifting + write of individual bytes.
  This is motivated because we aren't guaranteed to load 32-bit ints of the mmaped PTH file at 4-byte offsets.
- Don't emit flags for IdentifierInfos.  These are lazily populated by the Preprocessor/Parser.
- Only write out tokens for files with absolute paths.  This is potentially temporary, but simplifies things for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 19:44:08 +00:00
Steve Naroff 3539cdb98b Add a couple FIXME's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60427 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 17:54:50 +00:00
Steve Naroff a0876e88af Make sure synthesized properties get inserted into the classes/categories meta data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60426 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 17:36:43 +00:00
Steve Naroff dd2fdf13f1 Simplify previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60416 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 16:05:55 +00:00
Steve Naroff eb0646c8df More work to rewrite synthesize properties (<rdar://problem/6213955>)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60414 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 15:48:25 +00:00
Sebastian Redl cee63fbf0e Handle new by passing the Declaration to the Action, not a processed type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 14:43:59 +00:00
Steve Naroff d40910b581 -Add several ObjC types to Decl::getDeclKindName(), a useful debug hook.
-Start adding support for rewriting @synthesize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 20:33:01 +00:00
Daniel Dunbar c1571453de Add LangOptions marker for assembler-with-cpp mode and use to define
__ASSEMBLER__ properly. Patch from Roman Divacky (with minor
formatting changes). Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60362 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 18:55:22 +00:00
Douglas Gregor 5fd5468af4 Enable blocks in C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60361 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 18:34:47 +00:00
Zhongxing Xu 22438a8dfe Add support for pluggable components of static analyzer.
- Creator function pointers are saved in ManagerRegistry.
 - The Register* class is used to notify ManagerRegistry new module is 
   available.
 - AnalysisManager queries ManagerRegistry for configurable module. Then it
   passes them to GRExprEngine, in turn to GRStateManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 01:55:08 +00:00
Ted Kremenek fa59aad701 - Enhance PTH generation to write out IdentifierInfo table in two parts:
- a table including the IdentifierInfo data
  - an index from persistent IdentifierInfo IDs to indices within this file.
- Enhance PTH generation to write out file map information, mapping inodes to tokens.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60132 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 23:58:26 +00:00
Douglas Gregor cb7de523cc Implement implicit conversions for Objective-C specific types, e.g.,
converting a pointer to one Objective-C interface into a pointer to another
Objective-C interface, and conversions with 'id'. The semantics seems
to match GCC, although they seem somewhat ad hoc.

Fixed a few cases where we assumed the C++ definition of isObjectType,
but were getting the C definition, causing failures in trouble with
conversions to void pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60130 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 23:31:11 +00:00
Zhongxing Xu 2092236777 Add plugin loading for clang. This will be used to load alternative constraint manager for static analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60091 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 05:23:17 +00:00
Devang Patel 59db760c53 Disable -loop-index-split for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60089 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 05:01:52 +00:00
Ted Kremenek a3d764cf77 Re-apply r60071 now that raw_fd_ostream::tell has been committed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60086 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 03:36:26 +00:00
Daniel Dunbar 31309ab547 Revert 60071, depends on uncommitted LLVM changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60077 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 02:18:33 +00:00
Ted Kremenek 4008de8d6a Migrate token-cache generation logic from dummy harness in PPLexerChange.cpp to CacheTokens.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60071 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 00:57:55 +00:00
Ted Kremenek 8ffc8a571f Display the function we are analyzing before running LiveVariables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59983 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 20:53:32 +00:00
Chris Lattner d9d22dd9c9 Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName().  This upgrades a bunch of
diags to take DeclNames instead of std::strings.

This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 05:29:24 +00:00
Chris Lattner 8ec03f58c3 Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier.  Update callers to do the right
thing and avoid this method in unsafe cases.  This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:54:41 +00:00
Chris Lattner 077bf5e2f4 Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method.

Change uses of Selector::getName() to just pass in a Selector 
where possible (e.g. to diagnostics) instead of going through
an std::string.

This also adds new formatters for objcinstance and objcclass
as described in the dox.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59933 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:33:13 +00:00
Chris Lattner 0947b4e6c7 Rewrite FindDiagnostics to be more strict about the formatting of the
expected-foo strings.  Now the only allowed characters between 
expected-error and {{  is whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59925 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 01:28:17 +00:00
Chris Lattner b2c8c55d81 clean up -verify mode output. If the expected-error string is
mangled, report it using the diagnostics machinery instead of printf.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59924 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 23:38:26 +00:00
Ted Kremenek 3f0850e6f2 reverting this because it breaks some blocks cases, I'll send doug a testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59850 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 01:04:48 +00:00
Sebastian Redl 4c5d320a75 Implementation of new and delete parsing and sema.
This version uses VLAs to represent arrays. I'll try an alternative way next, but I want this safe first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59835 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 19:14:01 +00:00
Douglas Gregor dc518e2a0f Don't turn off blocks in C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 17:10:06 +00:00