Chris Lattner
286e5e6c61
printing with an unspecified dest means to print to stdout.
...
llvm-svn: 54872
2008-08-17 07:09:08 +00:00
Chris Lattner
b52817bff0
don't delete a variable on the stack
...
llvm-svn: 54871
2008-08-17 07:07:01 +00:00
Chris Lattner
7459c86a29
simplify this code a bit more.
...
llvm-svn: 54864
2008-08-17 03:54:39 +00:00
Chris Lattner
068529a243
remove global variables for output stream.
...
llvm-svn: 54861
2008-08-17 03:12:02 +00:00
Chris Lattner
b5a92f8648
Switch to shared raw_ostream code instead of having it be clang specific.
...
This also helps the eventual distcc project.
llvm-svn: 54858
2008-08-17 01:47:12 +00:00
Ted Kremenek
e4d923383a
Fix typo.
...
llvm-svn: 54774
2008-08-14 03:45:07 +00:00
Daniel Dunbar
3ad53483fb
Add LangOptions::NeXTRuntime.
...
- Wired to -fnext-runtime and -fgnu-runtime options.
- Defaults to GNU, no autoselection for NeXT.
Emit NeXT OBJC_IMAGE_INFO marker.
llvm-svn: 54651
2008-08-11 21:35:06 +00:00
Daniel Dunbar
fb3043d627
Add -fexceptions to Driver
...
- Maps to LangOptions.Exceptions
- Currently always off, should autoselect based on language.
Update CodeGen to set unwind attribute on functions definitions based
on LangOptions.Exceptions.
- Still need to set attributes appropriately on calls.
llvm-svn: 54643
2008-08-11 17:36:14 +00:00
Daniel Dunbar
221fa94e40
More #include cleaning
...
- Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
SourceLocation.h)
- Move ASTContext constructor into implementation
llvm-svn: 54627
2008-08-11 04:54:23 +00:00
Nico Weber
4c3116437c
* Remove isInSystemHeader() from DiagClient, move it to SourceManager
...
* Move FormatError() from TextDiagnostic up to DiagClient, remove now
empty class TextDiagnostic
* Make DiagClient optional for Diagnostic
This fixes the following problems:
* -html-diags (and probably others) does now output the same set of
warnings as console clang does
* nothing crashes if one forgets to call setHeaderSearch() on
TextDiagnostic
* some code duplication is removed
llvm-svn: 54620
2008-08-10 19:59:06 +00:00
Nico Weber
e4919cc2bf
Do not crash with -serialize.
...
This happened because seralization was done in the constructor, and at that time the TranslationUnit is no longer valid.
llvm-svn: 54618
2008-08-10 19:20:05 +00:00
Chris Lattner
6307f19726
rename PreDefinedExpr -> PredefinedExpr
...
llvm-svn: 54605
2008-08-10 01:53:14 +00:00
Nico Weber
7094a5bfa8
do not serialize invalid asts. this fixes bug #2637
...
llvm-svn: 54590
2008-08-09 18:32:11 +00:00
Ted Kremenek
6231e7e4ec
Unbreak SerializationTest and the Rewriter by doing the work in HandleTranslationUnit instead of the destructor.
...
llvm-svn: 54513
2008-08-08 04:15:52 +00:00
Ted Kremenek
dcb5e38927
ParseAST now never releases the passed ASTConsumer. This is the responsibility of the client.
...
The motivation is that clients may either:
(a) query the ASTConsumer object after AST parsing to collect data/etc.
(b) reuse the ASTConsumer.
llvm-svn: 54502
2008-08-08 02:46:37 +00:00
Ted Kremenek
59f3553392
Remove unneeded #includes.
...
llvm-svn: 54478
2008-08-07 18:14:04 +00:00
Ted Kremenek
6b515b5b34
Micro cleanups.
...
llvm-svn: 54477
2008-08-07 18:13:12 +00:00
Ted Kremenek
31691ae862
Fix --html-diags in driver by delaying the construction of an HTMLDiagnosticClient until after we have created the Preprocessor object.
...
llvm-svn: 54472
2008-08-07 17:49:57 +00:00
Matthijs Kooijman
8dab3eec81
Let LLVMCodeGenWriter forward all the methods defined in ASTConsumer, to
...
prevent unexpected surprises later on.
llvm-svn: 54469
2008-08-07 16:04:15 +00:00
Steve Naroff
c884aa8e84
Fix for <rdar://problem/6113807> clang ObjC rewriter: crash rewriting attached file
...
While this is a safe rewriter fix, there is still a need for some discussion (see report for more info).
llvm-svn: 54412
2008-08-06 15:58:23 +00:00
Nico Weber
b5fc3c300a
add a libDriver, for now only move the text diangostics stuff from Driver to there
...
llvm-svn: 54383
2008-08-05 23:33:20 +00:00
Steve Naroff
dd514e01f2
Finish fixing <rdar://problem/5929344> clang ObjC rewriter: "extern int __CFConstantStringClassReference[];" should be extern "C"
...
llvm-svn: 54367
2008-08-05 20:04:48 +00:00
Nuno Lopes
d86aa9340d
fix crash when printing diagnostics with tokens that span through more than one line
...
llvm-svn: 54365
2008-08-05 19:40:20 +00:00
Ted Kremenek
2c674f6dbb
Refactored driver logic for CodeGen into LLVMCodeGenWriter. This ASTConsumer layers on top of LLVMCodeGen (another existing ASTConsumer) to emit bitcode files to disk. This layering takes this logic out of clang.cpp and puts it directly into the ASTConsumer interface. The benefit is that now --emit-llvm works with both serialized ASTs and regular source files.
...
llvm-svn: 54364
2008-08-05 18:50:11 +00:00
Steve Naroff
568bbf73b2
Fix <rdar://problem/6108119> clang ObjC rewriter: if no newline at end of input file, rewriter inserts #define on same line as closing brace
...
llvm-svn: 54363
2008-08-05 18:47:23 +00:00
Daniel Dunbar
1ff1d1fd51
Move AsmLabel into Declarator instead of just a parameter to
...
ActOnDeclarator.
llvm-svn: 54353
2008-08-05 16:28:08 +00:00
Daniel Dunbar
4983df37a7
Add more Parser/Sema support for GCC asm-label extension.
...
- ActOnDeclarator now takes an additional parameter which is the
AsmLabel if used. Its unfortunate that this bubbles up this high,
but we cannot just lump it in as an attribute without mistakenly
*accepting* it as an attribute.
- The actual asm-label itself is, however, encoded as an AsmLabelAttr
on the FunctionDecl.
- Slightly improved parser error recovery on malformed asm-labels.
- CodeGen support still missing...
llvm-svn: 54339
2008-08-05 01:35:17 +00:00
Ted Kremenek
9898028742
Fix regression when invoking the MissingDealloc analysis: disable this check when in -fobjc-gc-only mode.
...
llvm-svn: 54319
2008-08-04 17:14:10 +00:00
Daniel Dunbar
f4693e289a
Add more output to clang -parse-print-callbacks
...
- Just added prints for all the action functions. Ideally this would
be extended to print all the information for the actions.
llvm-svn: 54259
2008-08-01 00:41:12 +00:00
Ted Kremenek
8cf5045012
Fix regression in range highlighting in HTML output.
...
llvm-svn: 54181
2008-07-29 23:35:38 +00:00
Steve Naroff
873bd8497a
Fix incomplete implementation for rewriting protocol refs.
...
<rdar://problem/6108127> clang ObjC rewriter: no translation of id <proto>
llvm-svn: 54163
2008-07-29 18:15:38 +00:00
Chris Lattner
3f6cd0bc76
remove some unneeded calls to getCanonicalType
...
llvm-svn: 54106
2008-07-26 22:36:27 +00:00
Chris Lattner
f08932928c
comment out #pragma mark and #warning directives.
...
llvm-svn: 54020
2008-07-25 16:37:06 +00:00
Chris Lattner
b9c34de5c4
rewrite handling of the raw token stream in -rewrite-macros to lex
...
everything up front into a vector. This makes it easier to scan around
the stream when needed.
llvm-svn: 54019
2008-07-25 16:29:12 +00:00
Steve Naroff
29788347b2
Fix RewriteObjC::RewriteObjCThrowStmt() to respect whitespace between the @ and throw.
...
This fixes <rdar://problem/5988388> clang ObjC rewriter: mystery 'w' inserted in exception throw.
llvm-svn: 54017
2008-07-25 15:41:30 +00:00
Steve Naroff
6c79f97037
Fix Sema::ActOnClassMessage() to pass through the identifier for "super".
...
This fixes a critical rewriter bug (<rdar://problem/6096760> clang ObjC rewriter: 'self' not expected value in class method called with 'super').
Also added a couple FIXME's since I'm not happy with my fix to Sema. It would be nicer if the super handling for class/instance messages was the same (based on PreDefinedExpr).
llvm-svn: 53994
2008-07-24 19:44:33 +00:00
Ted Kremenek
1c0c06bb9c
"This patch adds paths for Fedora 9 in clang.cpp and support for two preprocessor options in ccc."
...
Patch by Zhongxing Xu!
llvm-svn: 53976
2008-07-24 03:49:15 +00:00
Ted Kremenek
c99332c5a6
Modified HTMLDiagnostics to also perform syntax highlighting for errors in header files.
...
llvm-svn: 53965
2008-07-23 23:18:15 +00:00
Ted Kremenek
3b28f4911c
Add prototype implementation of unused ivar check.
...
llvm-svn: 53942
2008-07-23 00:45:26 +00:00
Ted Kremenek
1f352db96a
Moved registration of basic path-sensitive checks from GRSimpleVals.cpp to GRExprEngineInternalChecks.cpp.
...
llvm-svn: 53909
2008-07-22 16:21:24 +00:00
Chris Lattner
388f6e97e1
unindent this function by using an early exit, not functionality change.
...
llvm-svn: 53877
2008-07-21 21:33:21 +00:00
Chris Lattner
390d39ac7e
move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,
...
simplifying code along the way and fixing a problem and memory leak or two.
llvm-svn: 53876
2008-07-21 21:32:27 +00:00
Steve Naroff
f0ff879881
RewriteObjC::RewriteObjCForCollectionStmt() needs to handle bodies with a single statement.
...
Fixes <rdar://problem/6084870> clang ObjC rewriter: for-in enumeration in 1 line produces output with error.
llvm-svn: 53858
2008-07-21 18:26:02 +00:00
Chris Lattner
d004505b74
introduce a new ObjCList templated class and start moving
...
various objc lists over to it. First up, the protocol list
on ObjCInterfaceDecl.
llvm-svn: 53856
2008-07-21 18:19:38 +00:00
Daniel Dunbar
155ed24359
Prevent clang from emitting output when input has errors
...
+ test case
<rdar://problem/6080040>
http://llvm.org/bugs/show_bug.cgi?id=2280
llvm-svn: 53756
2008-07-18 16:38:05 +00:00
Steve Naroff
97adf60418
RewriteObjC::SynthMessageExpr(): Fix super rewrite (a fairly recent regression).
...
Fixes <rdar://problem/6046663> clang ObjC rewriter: Regression in handling of 'super' in latest build.
llvm-svn: 53703
2008-07-16 22:35:27 +00:00
Steve Naroff
d7ebc05476
Remove a FIXME from RewriteObjC::RewriteObjCSynchronizedStmt().
...
llvm-svn: 53696
2008-07-16 19:47:39 +00:00
Steve Naroff
8dd1525b9a
RewriteObjC::Initialize(): add function decls used by @synchronized.
...
This fixes <rdar://problem/6040143> clang ObjC rewriter: @synchronized keyword inserts undeclared objc functions.
llvm-svn: 53695
2008-07-16 18:58:11 +00:00
Steve Naroff
de7d0f69ba
Two fixes:
...
- Make sure ObjCIvarDecl propagates the bitfield width.
- RewriteObjC::SynthesizeIvarOffsetComputation(): Avoid using the __OFFSETOF__ mumbo jumbo for bitfields (since it isn't legal C). This fixes <rdar://problem/5986079> clang ObjC rewriter: bitfields and ivar access don't mix.
llvm-svn: 53694
2008-07-16 18:22:22 +00:00
Steve Naroff
ce2dca186b
RewriteObjC::RewriteObjCTryStmt():Don't synthesize a catch begin if there are 0 catch clauses.
...
This fixes <rdar://problem/5987211> clang ObjC rewriter: @try / @finally block produces unbalanced output.
llvm-svn: 53679
2008-07-16 15:31:30 +00:00