Commit Graph

749 Commits

Author SHA1 Message Date
Matthijs Kooijman
0fb56e50b1 Make clang work on 32 bit powerpc linux.
Patch by Nick Lewycky!

llvm-svn: 52777
2008-06-26 08:39:30 +00:00
Matthijs Kooijman
70574af7d8 Link in LLVMAnalysis after LLVMCodeGen, since the latter depends on the former
since LLVM r52748.

llvm-svn: 52776
2008-06-26 08:37:29 +00:00
Chris Lattner
d46944d639 a temporary minimal hack to get clang building after the getStringValue changes in llvm mainline.
llvm-svn: 52753
2008-06-26 04:05:20 +00:00
Ted Kremenek
675a6e6dfa Patch by Anders Bergh:
'There's not much to say about this patch, it just adds the Arch Linux
gcc 4.3.1 header paths for i686 and amd64. The patch was generated
using "svn diff" with clang at revision 52660. The paths aren't
distribution-specific, so they should work for all Linux distributions
using the default(?) names like "i686-pc-linux-gnu".'

llvm-svn: 52665
2008-06-24 03:33:47 +00:00
Chris Lattner
0f2b471730 Implement printing for ObjCClassDecl's, patch by Jean-Daniel Dupas!
llvm-svn: 52598
2008-06-21 21:40:20 +00:00
Chris Lattner
a9b3cae8fd Switch 'super' from being a weird cast thing to being a predefined expr node.
Patch by David Chisnall with objc rewriter and stmtdumper updates from me.

llvm-svn: 52580
2008-06-21 18:04:54 +00:00
Ted Kremenek
c64511152a Updated call to dead stores to use proper arguments.
llvm-svn: 52560
2008-06-20 21:55:29 +00:00
Chris Lattner
5696e7badf Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.
Patch by David Chisnall!

llvm-svn: 52422
2008-06-17 18:05:57 +00:00
Argyrios Kyrtzidis
351008da17 Allow -parse-noop -verify options to be used together.
llvm-svn: 52249
2008-06-13 12:15:34 +00:00
Argyrios Kyrtzidis
554a07bab3 -Changes to TagDecl:
Added TagKind enum.
  Added getTagKind() method.
  Added convenience methods: isEnum(), isStruct(), isUnion(), isClass().
-RecordDecl/CXXRecordDecl::Create() accept a TagKind enum instead of a DeclKind one.

llvm-svn: 52160
2008-06-09 23:19:58 +00:00
Eli Friedman
8233993fc6 Get -serialize working again, plus a bit of minor cleanup.
llvm-svn: 52152
2008-06-09 20:02:51 +00:00
Ted Kremenek
92611db88f Use a common SourceManager when processing multiple files. This allows us to cache the contents of source files already loaded from disk.
llvm-svn: 52066
2008-06-06 22:42:39 +00:00
Ted Kremenek
3ad519441f Fix crash when running with multiple source files. This can be improved.
llvm-svn: 52032
2008-06-06 01:47:30 +00:00
Ted Kremenek
b147ad1051 Moved LangOptions from TranslationUnit to ASTContext. This induced a variety of cleanups in some ASTConsumers.
llvm-svn: 51943
2008-06-04 15:55:15 +00:00
Chris Lattner
f4fee9e1e5 make rewrite macros insert a space when commenting out macros where the token didn't
lead with a space.

llvm-svn: 51896
2008-06-03 06:10:17 +00:00
Steve Naroff
f611964230 Fix <rdar://problem/5976164> clang ObjC rewriter: for ... in enumeration inserts undeclared function (objc_enumerationMutation should be in preamble)
llvm-svn: 51880
2008-06-02 20:23:21 +00:00
Chris Lattner
d3f3231a07 Two identifiers are not the same unless they have the same identifier info.
llvm-svn: 51827
2008-05-31 22:01:01 +00:00
Ted Kremenek
380df93fd6 Added "InitializeTU" to ASTConsumer. This is used by Sema::ParseAST to pass a
TranslationUnit object instead of an ASTContext. By default it calls
Initialize(ASTConstext& Context) (to match with the current interface used by
most ASTConsumers).

Modified the ObjC-Rewriter to use InitializeTU, and to tell the TranslationUnit
to not free its Decls.  This is a workaround for: <rdar://problem/5966749>

llvm-svn: 51825
2008-05-31 20:11:04 +00:00
Steve Naroff
cd92aebd1f Fix <rdar://problem/5917992> clang ObjC rewriter: #end from #if statement lost in translation.
Some fancy footwork to accommodate embedded preprocessor directives within an interface.

llvm-svn: 51815
2008-05-31 14:15:04 +00:00
Steve Naroff
930e099b90 Fix <rdar://problem/5969777> clang ObjC rewriter: #imported file name mysteriously commented out
This fix involved tightening up needToScanForQualifiers(), which predated ObjCQualifiedIdType.
It also includes a minor tweak to the code that searches for the beginning of the qualified type. If the AST contained the correct beginning of the declaration (i.e. the beginning of the declaration specifiers), this code would be more robust. Since it doesn't, we apply an adhoc heuristic. Note that DeclSpec contains this info...we just don't propagate it to the AST (at present).

llvm-svn: 51812
2008-05-31 05:02:17 +00:00
Steve Naroff
a6141f0780 Hack RewriteObjC::RewriteObjCStringLiteral() to include the filename in the generated code (replacing any non-alphanumeric characters with "_"). This allows header files to contain ObjCStringLiterals.
llvm-svn: 51811
2008-05-31 03:35:42 +00:00
Ted Kremenek
a3774667d3 Correctly preserve the order between -F and -I options.
llvm-svn: 51803
2008-05-31 00:27:00 +00:00
Ted Kremenek
6bb6d9f197 Use llvm:🆑:desc for description of the -Wimplicit-function-declaration option.
Patch by Holger Schurig!

llvm-svn: 51774
2008-05-30 16:42:02 +00:00
Eli Friedman
35c01c6f2d Fix crash with -serialize (reported to cfe-dev). The issue was
essentially that we were destroying the declarations twice.

(Note that we don't use -serialize directly in the testsuite, only 
SerializeTest.)

llvm-svn: 51768
2008-05-30 11:28:30 +00:00
Chris Lattner
8c80070de2 Implement support for -w, which silences all warnings. PR2384.
llvm-svn: 51683
2008-05-29 15:36:45 +00:00
Chris Lattner
34873d2134 give location info to another paren expr.
llvm-svn: 51646
2008-05-28 16:38:23 +00:00
Chris Lattner
37f5b7d39c minor changes, collect the range of an expr before rewriting the subexprs
no functionality change.

llvm-svn: 51497
2008-05-23 20:40:52 +00:00
Steve Naroff
fd16687b9a Make sure method definitions get output with -ast-dump.
llvm-svn: 51494
2008-05-23 18:50:58 +00:00
Ted Kremenek
0954b4564e Update driver include paths to work on darwin10.
llvm-svn: 51431
2008-05-22 15:26:22 +00:00
Dan Gohman
1627ae7c48 Explicitly #include Support/Streams.h when using llvm::cout and friends.
llvm-svn: 51391
2008-05-21 20:19:16 +00:00
Eli Friedman
b158b4a47b Fix the destruction "properly" in the sense that we actually destroy the
ASTs.  This is a hack, but I haven't considered how we really 
want to do this.

llvm-svn: 51364
2008-05-21 05:33:10 +00:00
Steve Naroff
ad91868aa6 Fix rewriter bug <rdar://problem/5929344> clang ObjC rewriter: "extern int __CFConstantStringClassReference[];" should be extern "C".
Have clang predefine OBJC_NEW_PROPERTIES (which is what gcc does).

llvm-svn: 51163
2008-05-15 21:12:10 +00:00
Chris Lattner
14196c099f Implement -rewrite-macros, which is a crazy macro expander that expands
macros but doesn't expand #includes, remove comments, remove #defines
etc.

For example:

----
#include <stdio.h>

#define bbaa
#define funclike(x) x "a" x "b" x

bbaa  bbaa

#if 1 
funclike("gar")
foo /*blah*/  bar
bar
#endif

#if 0
funclike()
#endif
----


rewrites to:

----
#include <stdio.h>

#define bbaa
#define funclike(x) x "a" x "b" x 

/*bbaa  bbaa*/

#if 1
 "gar" "a" "gar" "b" "gar"/*funclike*//*("gar")*/
foo /*blah*/  bar
bar
#endif

#if 0
/*funclike()*/
#endif
----

llvm-svn: 50925
2008-05-10 00:02:33 +00:00
Chris Lattner
664ef65981 make #if 0 code compile, even though it still isn't very useful.
llvm-svn: 50920
2008-05-09 22:43:24 +00:00
Steve Naroff
d30f8c5b54 Fix <rdar://problem/5924225> clang ObjC rewriter: objc_exception_throw declaration in preamble does not match objc/objc-exception.h.
llvm-svn: 50915
2008-05-09 21:17:56 +00:00
Steve Naroff
2e4e385a58 Make sure the prototype for objc_msgSend_fpret() returns a double.
llvm-svn: 50873
2008-05-08 22:02:18 +00:00
Steve Naroff
b1c02371cd Fix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in structure generated for class
llvm-svn: 50862
2008-05-08 17:52:16 +00:00
Sanjiv Gupta
15cb669039 Added -g command line options to clang for generating source level debug information. This patch currently enables generation of line number debug information (stoppoints) and region begin/end debug information. The new files CGDebugInfo.h and CGDebugInfo.cpp implements the debug info manager class CGDebugInfo.
llvm-svn: 50848
2008-05-08 08:54:20 +00:00
Sanjiv Gupta
cd13ef01a2 Remove the ending "." from clang options descriptions.
llvm-svn: 50847
2008-05-08 08:28:14 +00:00
Chris Lattner
3c04ff00c2 start implementation of a macro rewriter, this is currently just stubbed out.
llvm-svn: 50845
2008-05-08 06:52:13 +00:00
Steve Naroff
30ac2225ee Fix <rdar://problem/5887874> clang ObjC rewriter: Use a different name for 'offsetof' macro
llvm-svn: 50832
2008-05-07 21:23:49 +00:00
Fariborz Jahanian
ec6e4c8096 This patch introduces declaration of getter methods for ObjC2's
properties. Couple of property tests will fail with this patch.
Will fix them next.

llvm-svn: 50818
2008-05-07 17:43:59 +00:00
Steve Naroff
cab93d58c3 Fix <rdar://problem/5908598> clang ObjC rewriter: typo in #pragma at end
llvm-svn: 50790
2008-05-07 00:06:16 +00:00
Ted Kremenek
e6d2419351 Improve HTMLDiagnostics by understanding the "Below" hint.
llvm-svn: 50783
2008-05-06 23:42:18 +00:00
Steve Naroff
29ce4e5d78 Fix <rdar://problem/5879237> clang objc rewriter: ivars not accessible in structure generated for class
llvm-svn: 50781
2008-05-06 23:20:07 +00:00
Fariborz Jahanian
eeb7fae063 Print ObjC methods of ObjC classes.
llvm-svn: 50779
2008-05-06 23:14:25 +00:00
Steve Naroff
ac81a5aad5 Fix <rdar://problem/5888515> clang ObjC rewriter: Use objc.h for declarations instead of putting them in the preamble?
llvm-svn: 50774
2008-05-06 22:45:19 +00:00
Steve Naroff
13e74879b0 Fix <rdar://problem/5881225> clang ObjC Rewriter: Protocol structure defined twice when two interfaces use it in same file
llvm-svn: 50767
2008-05-06 18:26:51 +00:00
Fariborz Jahanian
09367d68ff Patch to refactor setter/getter names of property attributes into Selector
(was IdentifierInfo * before). This will make method declartations whole
lot easier.

llvm-svn: 50747
2008-05-06 18:09:04 +00:00
Chris Lattner
00e2607de2 Add support for -Wimplicit-function-declaration, rdar://5907433
llvm-svn: 50672
2008-05-05 21:18:06 +00:00