Chris Lattner
5c9dc5ac75
Do an initial hack at replacing one of the incredibly inefficient
...
(but simple!) datastructures in the rewriter with a more complex but
more efficient one.
This replaces the Deltas vector with a specialized BTree that makes
delta lookups much more efficient. This speeds up -emit-html on a 500K
.i file from 157.154 to 27.127 seconds on my machine (5.8x).
While this code is functional, it isn't very pretty, I have much
refactoring planned for it, and will remove the USE_VECTOR ifdef.
Stay tuned.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 20:28:24 +00:00
Ted Kremenek
405cbb48a7
Update Xcode project with missing files.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49550 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 18:30:21 +00:00
Ted Kremenek
393be155a8
Add SemaDeclCXX.cpp to Xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49428 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 15:50:11 +00:00
Ted Kremenek
5dd18b7d56
Add HTMLRewrite.h to Xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 22:31:28 +00:00
Chris Lattner
c4e4059962
Simplify some objc compatibility testing, make interfaceTypesAreCompatible
...
a static function named isCompatibleInterfaceAssign.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 04:07:56 +00:00
Steve Naroff
8ace0d51ab
Add DeclBase.h to Xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49223 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 18:04:30 +00:00
Chris Lattner
be09ededdb
various bug fixes, add to xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49216 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 15:47:22 +00:00
Ted Kremenek
d45d268b29
Updated Xcode project to include BugReporter.[cpp,h].
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49128 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 04:43:40 +00:00
Ted Kremenek
bc8e016aed
Update Xcode project: add BasicObjCFoundationChecks.h
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:17:51 +00:00
Ted Kremenek
fb5610d016
Added AnnotatedPath.h, GRAuditor.h, GRSimpleAPICheck.h and BasicObjCFoundationChecks.cpp to Xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 07:26:42 +00:00
Ted Kremenek
50e58c1623
Updated Xcode project with HTMLDiagnostics.[h,cpp]
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48866 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 06:18:34 +00:00
Ted Kremenek
b8540c6e53
Added PathDiagnostic.[h,cpp] to Xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48862 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 03:50:10 +00:00
Nate Begeman
245f1b559e
Add missing files
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48783 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 18:31:12 +00:00
Chris Lattner
1e03a561f4
Split objc decl implementation out into DeclObjC.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48404 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 00:19:01 +00:00
Chris Lattner
8e25d86818
switch the rest of the C decl classes to do their
...
allocation through ASTContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 00:16:02 +00:00
Chris Lattner
bda0b626e7
Make a major restructuring of the clang tree: introduce a top-level
...
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15 23:59:48 +00:00
Chris Lattner
4f2d57cf44
Add PPLexerChange.cpp to the project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48081 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 04:14:55 +00:00
Chris Lattner
a3b605ef0d
split macro expansion support out of Preprocessor.cpp into PPMacroExpansion.cpp
...
Rename Directives.cpp -> PPDirectives.cpp since it implements part of the
Preprocessor class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48078 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 03:13:06 +00:00
Chris Lattner
e5c8ffe09f
split the MacroArgs class out of TokenLexer.cpp/h into
...
MacroArgs.cpp/h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48075 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 02:55:12 +00:00
Chris Lattner
5d75de0f82
Rename MacroExpander.cpp/h -> TokenLexer.cpp/h
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48072 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 02:22:57 +00:00
Nate Begeman
d28329222a
fix clang xcode build
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48069 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 01:55:39 +00:00
Chris Lattner
141e71fec6
split preprocesor directive handling out of Preprocessor.cpp into Directives.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48068 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 01:54:53 +00:00
Ted Kremenek
240f1f00dd
Renamed ValueManager to BasicValueFactory.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48025 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07 20:13:31 +00:00
Chris Lattner
631bf6c325
add analysis source files to project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47953 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05 18:22:36 +00:00
Chris Lattner
48b32440f7
Add the various pathsensitive headers to the project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47952 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05 18:20:02 +00:00
Chris Lattner
1b653432f0
ProgramEdge.h doesn't exist anymore.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47951 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05 18:18:31 +00:00
Chris Lattner
2b94fe35ed
Add codegen support for ObjC message expressions with the GNU runtime.
...
Patch by David Chisnall!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47789 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01 08:45:05 +00:00
Anders Carlsson
d429cd459a
Add Attr.h which is an AST-level class for GCC attributes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47112 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 07:14:34 +00:00
Chris Lattner
2ae34ed8ca
pass the astconsumer into Sema's ctor, clean up some stuff in
...
Sema::ActOnTranslationUnitScope. The various ObjC pieces at the top
of Sema.cpp should be moved into SemaObjC or something.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46787 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06 00:46:58 +00:00
Chris Lattner
e91c134d8f
rename ASTSTreamer.{h|cpp} -> ParseAST.{h|cpp}
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46786 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06 00:23:21 +00:00
Chris Lattner
dcbc5b0b07
Make rewriter::inserttext return a bool to indicate if it failed.
...
Add a RewriteTest::ReplaceStmt method to factor the 'checking for
rewrite failed + emitting diagnostic if so' code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46619 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 19:37:57 +00:00
Anders Carlsson
84005b4b6b
Tweaks to EmitLValue in CGExprConstant. Patch by Eli Friedman.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-26 04:30:23 +00:00
Steve Naroff
a15c15a193
Add Basic/Targets.cpp to the Xcode project...
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46182 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 23:34:17 +00:00
Fariborz Jahanian
33b9c4e4c6
Patch to rewrite ObjC2's foreach-stmt.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08 22:06:28 +00:00
Chris Lattner
85a932e26f
move objc expr sema to its own file.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45597 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-04 22:32:30 +00:00
Chris Lattner
8f925280ab
Fix a crash reported by Seo Sanghyeon.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45530 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03 06:36:51 +00:00
Chris Lattner
0fc53dfc7a
Compute the proper sourcerange for an CompoundLiteralExpr.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45504 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02 21:46:24 +00:00
Chris Lattner
c063e43618
move file to proper place in project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45379 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-28 05:27:01 +00:00
Chris Lattner
bfc7930db0
From Lucas Newman:
...
"Here's a tiny patch that lets the clang Xcode project build in any
location, so llvm doesn't have to be checked out in your home folder."
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45376 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-28 00:38:23 +00:00
Chris Lattner
1dc4304d65
alphabetize in project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45373 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-27 20:59:50 +00:00
Ted Kremenek
6af1753620
Updated Xcode project to be in sync with recent changes in file locations
...
introduced in r45292 (http://llvm.org/viewvc/llvm-project?rev=45292&view=rev )
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45293 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-21 21:48:31 +00:00
Ted Kremenek
9dadf5a3ff
Updated locations of TranslationUnit.[cpp,h] in XCode project.
...
Added AST/ASTConsumer.cpp to XCode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45206 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 18:07:54 +00:00
Chris Lattner
68cfd49ea3
reenable this code, fix the testcase.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45205 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 18:01:43 +00:00
Fariborz Jahanian
c569249ca0
Patch to implemented objective-c's dynamic object pointer qualified with
...
the protocol list (id<P,...> types).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45121 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 21:03:50 +00:00
Chris Lattner
2f6974a14c
Targets.cpp is gone.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45119 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 20:56:50 +00:00
Chris Lattner
3af66a9335
Sink getName into DirectoryLookup to simplify the client in clang.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45106 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 17:57:27 +00:00
Chris Lattner
0f441ab20c
add headermap.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45095 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 08:22:46 +00:00
Chris Lattner
822da61b74
Step #1 in adding headermap support to clang.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45089 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 06:36:45 +00:00
Steve Naroff
5e71124dab
Encode enumeral types.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44956 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 22:30:11 +00:00
Chris Lattner
4c52509ffb
unbreak the build. I'm still working on test failures.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 17:58:05 +00:00
Chris Lattner
4d3914836e
split objc pieces of SemaDecl.cpp out into SemaDeclObjC.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44925 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 07:09:47 +00:00
Chris Lattner
a9e6372208
Fix a codegen crash on test/CodeGen/cast.c, reported by Keith.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44908 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 04:13:20 +00:00
Chris Lattner
b3a99cd5bc
Add ObjC parser support for concatenated ObjC strings. Note that
...
this is passed to sema and ignored there, so the second part of the
string will not make it into the AST. Passing to Fariborz to finish
Sema + AST construction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44898 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 01:04:12 +00:00
Anders Carlsson
564f1de67d
Move target specific builtin IDs to TargetBuiltins.h so that they can be used by CGBuiltin.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44748 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 23:17:02 +00:00
Ted Kremenek
8b5f658031
Added Driver/TranslationUnit.h and Driver/TranslationUnit.cpp to the
...
XCode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44632 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 21:36:57 +00:00
Ted Kremenek
589fd42d71
Added Basic/LangOptions.cpp to XCode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44625 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 19:07:32 +00:00
Chris Lattner
1438b4918a
fix a couple switch codegen problems Oliver reported.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44484 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-01 05:27:33 +00:00
Chris Lattner
e365c50a21
pass diagnostics into the rewrite test client.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44468 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 22:25:36 +00:00
Steve Naroff
1f64432558
Several fixes/simplifications surrounding how we stream top-level decl AST's.
...
The following code...
typedef struct cssm_data {} CSSM_DATA, *CSSM_DATA_PTR;
struct Y { int A; };
struct X { int A; } D;
struct X E, F;
...now produces the following output...
> ../../Debug/bin/clang xx.c -ast-print
Read top-level tag decl: 'cssm_data'
typedef struct cssm_data CSSM_DATA;
typedef struct cssm_data *CSSM_DATA_PTR;
Read top-level tag decl: 'Y'
Read top-level tag decl: 'X'
Read top-level variable decl: 'D'
Read top-level variable decl: 'E'
Read top-level variable decl: 'F'
...which is much more accurate than the previous -ast-print output...
typedef struct cssm_data CSSM_DATA;
typedef struct cssm_data CSSM_DATA;
Read top-level variable decl: 'D'
Read top-level variable decl: 'E'
Read top-level variable decl: 'E'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44421 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 22:54:11 +00:00
Chris Lattner
b751c28a1a
Fix a bug checking for 'int foo(void)' that didn't look through typedefs of void.
...
Bug pointed out by Michael Zolda, thanks!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44408 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 18:51:29 +00:00
Ted Kremenek
588e5ebee2
Moved logic for -Wfloat-equal to SemaChecking.cpp.
...
Moved utility functions IgnoreParen and friends to be static inline functions
defined in SemaUtil.h.
Added SemaUtil.h to Xcode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44312 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 00:58:00 +00:00
Steve Naroff
f68a63f9cf
Fix a basic bug (having to do with typedefs) in Sema::UsualArithmeticConversions().
...
This resuled in the following crash below.
Also modified the usual-float.c test case to capture this case.
[steve-naroffs-imac:clang/test/Sema] snaroff% ../../../../Debug/bin/clang usual-float.c
Assertion failed: (0 && "Sema::UsualArithmeticConversions(): illegal float comparison"), function UsualArithmeticConversions, file SemaExpr.cpp, line 960.
0 clang 0x001ef9b9 _ZN40_GLOBAL__N_Signals.cpp_00000000_4E6DAF8315PrintStackTraceEv + 45
1 clang 0x001efd5f _ZN40_GLOBAL__N_Signals.cpp_00000000_4E6DAF8313SignalHandlerEi + 323
2 libSystem.B.dylib 0x90c6297b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 libSystem.B.dylib 0x90cdb782 raise + 26
5 libSystem.B.dylib 0x90cead3f abort + 73
6 libSystem.B.dylib 0x90cdc923 __assert_rtn + 101
7 clang 0x00077316 _ZN5clang4Sema26UsualArithmeticConversionsERPNS_4ExprES3_b + 1004
8 clang 0x000803cf _ZN5clang4Sema27CheckMultiplyDivideOperandsERPNS_4ExprES3_NS_14SourceLocationEb + 181
9 clang 0x0007a8e8 _ZN5clang4Sema10ActOnBinOpENS_14SourceLocationENS_3tok9TokenKindEPvS4_ + 472
10 clang 0x000cf058 _ZN5clang6Parser26ParseRHSOfBinaryExpressionENS_6Action12ActionResultILj0EEEj + 1286
11 clang 0x000cf2de _ZN5clang6Parser25ParseAssignmentExpressionEv + 86
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43985 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10 19:45:54 +00:00
Chris Lattner
b7489d8129
change source location to have two bits for macros, tracking
...
whether the location is the start and/or end of an expansion.
These are currently not set or used by anything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43968 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 23:52:16 +00:00
Steve Naroff
f3473a7e48
Rewrite global variable initializers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43947 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 15:20:18 +00:00
Chris Lattner
fab21b6d73
add a getAtOffset() member to simplify some code.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43905 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 20:51:02 +00:00
Chris Lattner
8b0c2f659d
Add a new RewriteRope data structure which is a smarter way to represent the text
...
backing a rewrite buffer than using an std::vector<char>. This class was hacked
together very quickly and needs to be cleaned up, but it seems to work. It speeds
up rewriting a a 7M file from 6.43s to 0.24s on my machine. The impl could also
be made to be a lot more algorithmically sound.
This produces identical output to using vector on this testcase, if it causes a
problems or bugs are encountered, it can be disabled by changing the
RewriteBuffer::Buffer typedef back.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43884 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 07:35:14 +00:00
Ted Kremenek
8c35a9b3b9
Added TypeSerialization.cpp and DeclSerialization.cpp to the XCode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43710 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05 17:04:40 +00:00
Chris Lattner
770951b5bb
add support for vector type compatibility checking. Patch by Nate Begeman.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43604 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 05:03:41 +00:00
Steve Naroff
6c6a2dbb4d
Tweak RewriteInterfaceDecl() to generate a typedef (if one hasn't already been generated).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43600 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 03:35:41 +00:00
Fariborz Jahanian
19d74e1494
More infrastructure to recognize objective-c's type qualifiers (in,inout, etc.)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43580 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 21:59:43 +00:00
Steve Naroff
8ee529b567
Implement a more sensible strategy for ObjC built-in types (addressing a long standing FIXME in Sema::GetObjcIdType()).
...
This removes several gross hacks to work around the previous "lazy" behavior.
Two notes:
- MinimalActions still needs to be taught about the built-in types (This breaks one of the -noop test cases). I started this, then added a FIXME.
- I didn't convert Sema::GetObjcProtoType() yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43567 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 18:42:27 +00:00
Fariborz Jahanian
dea84f82b2
After Anders check-in, we can now encode 'Class' type.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43556 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 16:00:13 +00:00
Steve Naroff
9165ad378f
Add some plumbing to help cope with rewriting "id<p>", "Class<p>*".
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43543 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 04:38:33 +00:00
Fariborz Jahanian
8be9d0a9cd
Added new type and bitfield fields in some decl types in preparation for objective-c's type qualifiers.
...
Added initialization of Class/SEMA types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43534 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 00:12:35 +00:00
Steve Naroff
09b266eb2a
Stop pre-defining objc_msgSend/objc_getClass in the preprocessor. Instead, I generate these declaration on the fly when rewriting a message expression.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43529 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 23:14:51 +00:00
Fariborz Jahanian
c2939bc82c
Added type encoding for 'id' type.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43504 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 17:06:23 +00:00
Steve Naroff
2feac5e559
Remove a couple FIXME's for rewriting ObjC interfaces (which are now being rewritten properly).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43494 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 03:43:13 +00:00
Fariborz Jahanian
33e1d64ab5
Encoding for objectiive-c methods.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43481 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 22:57:28 +00:00
Steve Naroff
60fcceeedb
This commit contains lot's of small tweaks to how we pass around and store SourceLocation's for interfaces/protocols/categories/implementations.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43475 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 21:38:07 +00:00
Anders Carlsson
e8c4953352
Address Chris's comments.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43445 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 06:33:42 +00:00
Chris Lattner
fe79595619
Implement *skeletal* support for representing GNU inline asm stmts in the AST,
...
resolving a crash on a .i file in PR1750. We now generate 49 errors on the
.i file in that bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43433 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 04:04:16 +00:00
Fariborz Jahanian
4d733d3288
Path to synthesize 'instance' size field of _objc_class metadata.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43409 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 23:09:28 +00:00
Steve Naroff
bef1185418
Start rewriting ObjC interfaces. As a start, we comment out all the methods. This involved refining how the parser/AST passes/manages SourceLocations for ObjcMethodDecl's.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43404 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 20:53:56 +00:00
Ted Kremenek
f152b2ee87
Added DeclSerialization.cpp to XCode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43362 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 21:39:10 +00:00
Fariborz Jahanian
ccd87b07a7
Refactored several meta data for reusability.
...
Changed the entire rewrite of metadata to write to std::string
object instead of stdout.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43360 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 20:55:25 +00:00
Chris Lattner
158ecb9767
Convert one type of metadata to use std::string instead of
...
printf as an example.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43346 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 17:07:24 +00:00
Ted Kremenek
a194bc6018
Added SourceLocation.cpp to XCode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43344 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 16:03:53 +00:00
Chris Lattner
27437caade
Add a new ChooseExpr::isConditionTrue method to unify
...
some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43322 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 00:29:32 +00:00
Fariborz Jahanian
2e6d935930
Refactord instance and class metadata emission. Refactored protocols metadata emission.
...
Implemented emission of category metadata,
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43308 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 19:23:36 +00:00
Steve Naroff
ebf2b56bce
Add some plumbing to rewrite message expressions (still under construction).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43274 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 23:50:29 +00:00
Steve Naroff
7e15891fc8
- Add rewrite rule for @class.
...
- Add setter/getter to ObjcClassDecl.
- Predefined key runtime functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43257 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 20:20:08 +00:00
Fariborz Jahanian
e887c09395
This patch generates protocol metadata and all its sub-metadata.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43233 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 21:41:37 +00:00
Steve Naroff
806a4ebcf5
Fix the previous (short lived:-) FIXME.
...
I didn't realize that GCC considers this a hard error (I thought it was built-in).
Since it's not, we should simply emit an error.
[dylan:~/llvm/tools/clang] admin% cc -c trivial.m
trivial.m:6: error: cannot find interface declaration for 'NSConstantString'
[administrators-powerbook59:~/llvm/tools/clang] admin% ../../Debug/bin/clang trivial.m
trivial.m:6:16: error: cannot find interface declaration for 'NSConstantString'
NSString *s = @"123";
^
1 diagnostic generated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43157 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 23:53:51 +00:00
Ted Kremenek
6acaabc91e
Added StmtIterator.cpp and StmtIterator.h to the XCode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43139 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 18:22:01 +00:00
Steve Naroff
fd8b4a4b29
Fix the following bug...
...
unsigned char asso_values[] = { 34 };
int legal2() {
return asso_values[0];
}
The code that creates the new constant array type was operating on the original type.
As a result, the constant type being generated was "unsigned char [1][]" (which is wrong).
The fix is to operate on the element type - in this case, the correct type is "unsigned char [1]"
I added this case to array-init.c, which clearly didn't catch this bogosity...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43112 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 03:27:23 +00:00
Ted Kremenek
5a59d92fb0
Added Driver/SerializationTest.cpp to the XCode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43054 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 23:40:12 +00:00
Fariborz Jahanian
2a35fa9b5e
Fix location processing of @selector: the range should include the @ sign.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43051 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 23:21:02 +00:00
Chris Lattner
311ff02fae
Add a new Rewriter::getRangeSize method.
...
Rename SourceRange::Begin()/End() to getBegin()/getEnd() for
consistency with other code.
Start building the rewriter towards handling @encode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43047 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 22:36:42 +00:00
Fariborz Jahanian
3e7fd152aa
Patch to diagnose duplicate method implementations.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43046 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 21:52:23 +00:00
Chris Lattner
2c64b7b938
Push the rewriter forward a bit more. Now it rewrites
...
#import to #include's as a test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43041 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 21:07:07 +00:00
Fariborz Jahanian
b62f681340
Patch to implement AST generation for objective-c's @selector expression.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43038 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 20:40:23 +00:00
Steve Naroff
a1fe1176a4
Bad cast...need to use dyn_cast_or_null. Also changed Sema::InitBuiltinVaListType (which had the same bug).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43023 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 00:00:18 +00:00
Fariborz Jahanian
a0818e3cd7
Patch to parse @selector expressions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 23:39:13 +00:00
Steve Naroff
ec0550fa36
Move type compatibility predicates from Type to ASTContext. In addition, the predicates are now instance methods (they were previously static class methods on Type).
...
This allowed me to fix the following hack from this weekend...
// FIXME: Devise a way to do this without using strcmp.
// Would like to say..."return getAsStructureType() == IdStructType;", but
// we don't have a pointer to ASTContext.
bool Type::isObjcIdType() const {
if (const RecordType *RT = getAsStructureType())
return !strcmp(RT->getDecl()->getName(), "objc_object");
return false;
}
...which is now...
bool isObjcIdType(QualType T) const {
return T->getAsStructureType() == IdStructType;
}
Side notes:
- I had to remove a convenience function from the TypesCompatibleExpr class.
int typesAreCompatible() const {return Type::typesAreCompatible(Type1,Type2);}
Which required a couple clients get a little more verbose...
- Result = TCE->typesAreCompatible();
+ Result = Ctx.typesAreCompatible(TCE->getArgType1(), TCE->getArgType2());
Overall, I think this change also makes sense for a couple reasons...
1) Since ASTContext vends types, it makes sense for the type compatibility API to be there.
2) This allows the type compatibility predeciates to refer to data not strictly present in the AST (which I have found problematic on several occasions).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43009 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 20:41:53 +00:00
Anders Carlsson
ee98ac5a13
Add support for Pascal strings.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42974 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 02:50:23 +00:00
Chris Lattner
88d0ed0c58
Woo, tab deletion now works. Next lets see if we can
...
insert stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42941 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 00:17:04 +00:00
Fariborz Jahanian
e7f64cc250
Check and diagnose that objective-c objects may not be statically allocated.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42936 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 22:10:42 +00:00
Steve Naroff
8f74476413
Replace one FIXME with another. We handle protocols just fine now. The ObjC decl will only be 0 when we have an error on the ObjC decl. I would prefer we pass in a decl that is marked as invalid. I don't think this is critical to fix now, however I'd like us to be consistent. There are currently many places that don't mark the decl as invalid (which need to be fixed)...
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42923 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 18:49:25 +00:00
Fariborz Jahanian
bece4ac257
Fixed a bug whereby, struct tag name matches a typedef/objc-class name
...
and hid them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42915 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 16:34:10 +00:00
Chris Lattner
88e0052dd8
add RewriterTest.cpp to xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42863 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 16:34:20 +00:00
Fariborz Jahanian
4b6c9051c6
Patch to create protocol conforming class types.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42856 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 00:55:41 +00:00
Steve Naroff
e21b573bbf
Refinements to Sema::GetObjcIdType()...
...
- Cache the typedef, not the type (avoids importing AST/Type.h).
- Emit an error if "id" cannot be found.
- Comment the routine and add a FIXME to reconsider how we emulate GCC's new fangled behavior. This isn't a priority for now, since almost no code depends on having "id" built-in.
- Add a test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42845 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 23:24:43 +00:00
Anders Carlsson
2d85f8ba62
Emit a warning when the body of an if block is a NullStmt.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42840 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 20:50:11 +00:00
Chris Lattner
d19144b244
resolve a fixme, by moving __builtin_va_list to a more logical
...
place and making it correctly parameterized on the target.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42830 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 17:48:53 +00:00
Steve Naroff
b216c8861c
Make sure methods with no return type default to "id".
...
This fixes a crasher in Sema::MatchTwoMethodDeclarations(), identified by selector-overload.m (just added).
Added Action::ActOnTranslationUnitScope() and renamed Action::PopScope to ActOnPopScope.
Added a Translation Unit Scope instance variable to Sema (will be very useful to ObjC-related actions, since ObjC declarations are always file-scoped).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42817 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 22:01:59 +00:00
Fariborz Jahanian
05672a0ce8
Remove addition of protocol names to declaration scopes, use a separate
...
DenseMap to keep track of such declarations and derive ObjcProtocolDecl
directyly from NamedScope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42801 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 18:03:53 +00:00
Chris Lattner
4e1d99a8a4
switch more code to use Token::is/isNot where possible.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42797 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:41:39 +00:00
Chris Lattner
b652cea7d7
rename some "Parse" actions to "ActOn". Move code around in
...
ParseFunctionDefinition so that ActOnFunctionDefBody is always
called if ActOnStartOfFunctionDef is called. This fixes a crash
reported by Nuno Lopes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42793 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:14:05 +00:00
Fariborz Jahanian
e37882ad33
Added a new class for Interfaces qualified by protocol list.
...
Protocols are now sorted and made unique in the list.
Enhanced pretty printer for @interface (So, I can see the protocol list).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 23:06:41 +00:00
Steve Naroff
22cdd239dc
Removed unused instance variable from FieldDecl.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42773 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:56:47 +00:00
Chris Lattner
8307adb684
Move identifierTable.h to the right folder.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42770 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:35:59 +00:00
Steve Naroff
eefc418b8e
Convert Selector Maps/Sets to use stronger typing (now that we have DenseMapInfo in IdentifierTable.h).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42767 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:05:34 +00:00
Fariborz Jahanian
6d4caf2694
Removed unnecessary base class from some of objective-c classes:
...
ObjcProtocolDecl is now derived from ScopedDecl. ObjcForwardProtocolDecl from Decl.
ObjcImplementationDecl fom NamedDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42756 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 17:35:11 +00:00
Chris Lattner
c7229c338c
move IdentifierTable.h from liblex to libbasic.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42730 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 08:58:51 +00:00
Chris Lattner
97e8b6f3c5
Rename ASTStreamers.* -> ASTConsumers.*
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42718 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 06:04:32 +00:00
Chris Lattner
eab7792031
speed up clang startup time by about 23% by avoiding lots of
...
stringmap operations when there are no secondary targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42688 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 06:29:41 +00:00
Ted Kremenek
d2d5fabf31
Modifications to XCode project:
...
- Added include/Analysis/ExprDeclBitVector.h
- Added include/Analysis/ProgramEdge.h
- Removed include/Analysis/Visitors/DataflowStmtVisitor.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42663 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 23:32:54 +00:00
Fariborz Jahanian
245f92a886
This is the first patch toward supporting protocol conforming
...
objective-c types. It also removes use of Scope* parameter in
getObjCProtocolDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42649 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 21:01:53 +00:00
Steve Naroff
29238a0bf7
Layering refinements for selectors (suggested by Chris). Specifics...
...
- Add SelectorTable, which enables us to remove MultiKeywordSelector from the public header.
- Remove FoldingSet from IdentifierInfo.h and Preprocessor.h.
- Remove Parser::ObjcGetUnarySelector and Parser::ObjcGetKeywordSelector, they are subsumed by SelectorTable.
- Add MultiKeywordSelector to IdentifierInfo.cpp.
- Move a bunch of selector related methods from ParseObjC.cpp to IdentifierInfo.cpp.
- Added some comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42643 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 18:42:47 +00:00
Fariborz Jahanian
85ff2646c1
Patch for 1) Checking for duplicate methods decls in intterface and category.
...
2) Use of the new DenseSet<t> abstractions instead of DenseMap<t,char>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42641 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 18:00:57 +00:00
Fariborz Jahanian
5951965a39
More tab removal activity.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42608 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 17:06:28 +00:00
Chris Lattner
0e2dfd3963
minor cleanups, make code more defensive, less branchy in Selector ctor.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42603 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 05:21:22 +00:00
Fariborz Jahanian
4b6df3fa95
Fixed all my recent test cases to have the RUN command and
...
fixed consequence of these changes in clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42600 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 00:22:33 +00:00
Chris Lattner
16533e5c29
move DeclObjc.h down to be alphabetically organized
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42594 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 21:56:39 +00:00
Steve Naroff
3a165b066e
Finish renaming ObjC declaration actions.
...
Add comments.
Switch to new indentation style for the Action class. Since many actions take many arguments, the new style will...
- make it easier to add/remove arguments without messing up the indentation...
- make it easier to add comments to each argument (see ActOnMethodDeclaration for an example)...
- in general, just makes it easier to see what is being passed.
The rest of Actions will be converted "lazily"...there is no immediate need to hack all the existing methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42587 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 21:00:46 +00:00
Fariborz Jahanian
79139a1217
Renamed getCatLoc() to getLocation() to be consistant for such
...
getter names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42577 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 16:23:52 +00:00
Steve Naroff
37e58d104d
Rename several ObjC action methods to use the "ActOn" prefix (still a few more to do).
...
Remove Action::ObjCStartCategoryInterface/ObjCFinishInterface - they are unused.
.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42559 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 22:39:18 +00:00
Fariborz Jahanian
7ed9e0f97f
Unified such names as protocol references, instance methods and class methods
...
and their accessors in a variety of objective-c classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42555 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 22:05:16 +00:00
Steve Naroff
6a8a9a41e9
- Add ObjcInterfaceDecl::lookupInstanceMethod(), lookupClassMethod().
...
- Add ObjcMessageExpr::getSelector(), getClassName().
- Change Sema::getObjCInterfaceDecl() to simply take an IdentifierInfo (no Scope needed).
- Remove FIXME for printing ObjCMessageExpr's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42543 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 20:01:56 +00:00
Fariborz Jahanian
8f3fde00ad
This patch introduces the ObjcCategoryImplDecl class and does the checking related to
...
unimplemented methods in category implementation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42531 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 16:38:50 +00:00
Steve Naroff
980e508ca7
Move ObjC decls to DeclObjC.h, a new AST header.
...
Update clients and add to project file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42494 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 19:00:59 +00:00
Fariborz Jahanian
9d048ff59f
Removed use of hash table for class decls and do a name look up directly.
...
There is still an issue if doing ScopedLookup is an overkill and we can
just access the decl using the identifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42463 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-29 00:54:24 +00:00
Steve Naroff
bcfb06ac6d
Yesterday I discovered that 78% of all selectors in "Cocoa.h" take 0/1 argument.
...
This motivated implementing a devious clattner inspired solution:-)
This approach uses a small value "Selector" class to point to an IdentifierInfo for the 0/1 case. For multi-keyword selectors, we instantiate a MultiKeywordSelector object (previously known as SelectorInfo). Now, the incremental cost for selectors is only 24,800 for Cocoa.h! This saves 156,592 bytes, or 86%!! The size reduction is also the result of getting rid of the AST slot, which was not strictly necessary (we will associate a selector with it's method using another table...most likely in Sema).
This change was critical to make now, before we have too many clients.
I still need to add some comments to the Selector class...will likely add later today/tomorrow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42452 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 22:22:11 +00:00
Fariborz Jahanian
d0b015461a
Patch for method implementation. It populates ObjcImplementationDecl object with method implementation declarations .
...
It checks and warns on those methods declared in class interface and not implemented.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42412 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 18:57:03 +00:00
Chris Lattner
a9c0102172
objc messages have side effects, return true from hasLocalSideEffect,
...
fixing:
VoidMethod.m:14:5: warning: expression result unused
[Greeter hello];
^~~~~~~~~~~~~~~
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42380 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 22:06:30 +00:00
Ted Kremenek
a68951260a
Updated XCode project to reflect that DataflowValues.h and DataflowSolver.h have
...
moved to include/clang/Analysis/FlowSensitive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42327 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 22:45:38 +00:00
Fariborz Jahanian
ccb4f31424
This patch introduces a new class to keep track of class implementation info. It also adds more
...
semantic checks for class and protocol declarations. Test cases are good indications of kind of
checking being done in this patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42311 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 18:38:09 +00:00
Chris Lattner
764a7ce521
Make case sorting deterministic by not depending on pointer
...
values. Patch mostly by Gabor Greif for PR1682.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42203 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-21 18:15:22 +00:00
Ted Kremenek
4f5a2abc40
Updated XCode project with locations of "Analysis" visitor header files.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42176 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20 21:47:32 +00:00
Ted Kremenek
80de08fc6f
Added support to clang driver to view ASTs using GraphViz. This
...
functionality is still preliminary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42152 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19 21:29:43 +00:00