Chris Lattner
b1537ebdd4
rewrite some of the type refinement code to eliminate dangling pointers
...
simplify the code and generally make it more robust.
llvm-svn: 46745
2008-02-05 08:06:13 +00:00
Chris Lattner
3ac9699c44
Fix PR1966 by ignoring non-error diagnostics from system headers even if they are
...
*mapped* onto errors.
llvm-svn: 46686
2008-02-03 09:00:04 +00:00
Steve Naroff
e6b7ffd073
Minor API cleanup...
...
llvm-svn: 46649
2008-02-01 22:08:12 +00:00
Steve Naroff
d9dc63f2c5
Remove temporary workaround (thanks to Ted for fixing ObjCAtCatchStmt so quickly:-).
...
llvm-svn: 46648
2008-02-01 21:51:39 +00:00
Steve Naroff
edb5bc6f09
Fix two rewriter bugs with @catch .
...
- Support @catch(...), rather than crash:-)
- Make sure all catch bodies get rewritten. This "fix" is really a workaround until the iterator for the "try" AST is fixed. Will fix this in a separate commit.
llvm-svn: 46644
2008-02-01 20:02:07 +00:00
Chris Lattner
9cc55f5b1f
add some helper methods for removing and replacing text, this makes the
...
rewriter more robust.
llvm-svn: 46622
2008-01-31 19:51:04 +00:00
Chris Lattner
1780a85602
Add a new InsertText method that does the check to see if the insertion was valid. This
...
fixes crashes where the insertion point was in a macro. Instead of crashing, we want
to emit a warning.
llvm-svn: 46621
2008-01-31 19:42:41 +00:00
Chris Lattner
187f626a7c
move a large method out of line
...
llvm-svn: 46620
2008-01-31 19:38:44 +00:00
Chris Lattner
2e0d2600a2
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.
llvm-svn: 46619
2008-01-31 19:37:57 +00:00
Chris Lattner
a779d69029
Fix a rewriter crash when the whole body of a foreach is itself
...
rewritten, as in Sema/rewrite-foreach-6.m. Fariborz/Steve,
please review this to see if it is sane.
llvm-svn: 46600
2008-01-31 05:10:40 +00:00
Steve Naroff
7b3579b8de
Abolish a bunch of Xcode inserted tabs.
...
llvm-svn: 46566
2008-01-30 19:17:43 +00:00
Fariborz Jahanian
284011b462
Rewriting of @synchronized. This has one FIXME in it. But this should allow @sychronized to be rewritten.
...
llvm-svn: 46533
2008-01-29 22:59:37 +00:00
Ted Kremenek
8ff7705a6c
Modified LiveVariables to perform all of its base initialization in the ctor,
...
and now we require a FunctionDecl* object so that we can also keep track of
all of the ParmDecls.
Modified clients of LiveVariables to conform to the new interface.
llvm-svn: 46490
2008-01-29 05:13:23 +00:00
Ted Kremenek
997d872375
Driver now passes the top-level FunctionDecl* to GRConstants.
...
Refactoring: for GREngine and GRConstants, pushed references to CFG, ASTContext,
and the top-level FunctionDecl into ExplodedGraphImpl.
llvm-svn: 46475
2008-01-29 00:33:40 +00:00
Steve Naroff
909651a6ed
Add -Wno-rewrite-macros to silence the following warning when using -rewrite-test:
...
xx.m:10:3: warning: rewriting sub-expression within a macro (may not be correct)
llvm-svn: 46462
2008-01-28 21:34:52 +00:00
Chris Lattner
02bf44436f
Make -o work with -E, patch contributed by Shantonu Sen!
...
llvm-svn: 46426
2008-01-27 23:55:11 +00:00
Chris Lattner
3efff5472b
Fix a bug recovering from broken code with a goto that Eli reported.
...
llvm-svn: 46336
2008-01-25 00:01:10 +00:00
Ted Kremenek
33d8285b8d
Added passing "ASTContext" to both GREngine and GRConstants.
...
Added initial support for integer casting operations to GRConstants.
llvm-svn: 46298
2008-01-24 02:02:54 +00:00
Fariborz Jahanian
60a901621f
Fixed a nasty bug which took a while to come up with a test case,
...
diagnose, and took even longer to fix. It has to do with rewriting of a message
receiver which is an 'ivar' reference. Fix, however, is to remove a code which
was not doing the right thing and no longer needed.
llvm-svn: 46279
2008-01-23 20:34:40 +00:00
Chris Lattner
7238225c28
add support for -Wundef.
...
llvm-svn: 46274
2008-01-23 17:19:46 +00:00
Fariborz Jahanian
0a71ad2e07
Problem with ObjC's type-encoding of nested structs causing infinit recursion.
...
llvm-svn: 46260
2008-01-22 22:44:46 +00:00
Lauro Ramos Venancio
111b3ba670
Add Ubuntu 7.10 include path.
...
llvm-svn: 46233
2008-01-21 23:08:35 +00:00
Fariborz Jahanian
eab81cd03f
Synthesize methods with va-arg list correctly.
...
llvm-svn: 46212
2008-01-21 20:14:23 +00:00
Fariborz Jahanian
137d693e09
Fixed comment.
...
llvm-svn: 46185
2008-01-19 01:03:17 +00:00
Steve Naroff
c7d2df23f8
Fix two bugs with an @throw that doesn't have a statement.
...
- ObjCAtThrowStmt::getSourceRange() needs to check if it has a statement (and not go "boom":-)
- RewriteTest::RewriteObjCThrowStmt() needs to generate refer to the current exception.
llvm-svn: 46184
2008-01-19 00:42:38 +00:00
Fariborz Jahanian
802583656e
Patch to replace #import with #include.
...
llvm-svn: 46183
2008-01-19 00:30:35 +00:00
Fariborz Jahanian
159ee39f4d
Insert #pragma once when rewriting a header file.
...
llvm-svn: 46155
2008-01-18 01:15:54 +00:00
Ted Kremenek
db0b651de9
Shortened driver option for running the GR-constants analysis to --grconstants.
...
llvm-svn: 46076
2008-01-16 18:21:49 +00:00
Ted Kremenek
2e12c2e790
Hooked up the GRConstants analysis to the driver.
...
Fixed some compilation errors with GREngine that showed up during
template instantiation.
llvm-svn: 46074
2008-01-16 18:18:48 +00:00
Fariborz Jahanian
19d42bf0a5
Typo.
...
llvm-svn: 46038
2008-01-16 00:09:11 +00:00
Fariborz Jahanian
b860cbf052
Added support for rewriting of continue/break statements inside ObjC2's foreach-stmt.
...
llvm-svn: 46037
2008-01-15 23:58:23 +00:00
Chris Lattner
15346fae70
avoid pasting L + "foo" into L"foo".
...
llvm-svn: 46000
2008-01-15 05:22:14 +00:00
Chris Lattner
877ca77420
avoid token pasting between identifiers and wide strings:
...
abc+L"foo" -> abc L"foo", not abcL"foo"
llvm-svn: 45999
2008-01-15 05:14:19 +00:00
Steve Naroff
d32419de0d
Record if a compound literal expression is @ file scope. This allows us to implement C99 6.5.2.5p6. This could have been done without modifying the AST (by checking the decl type and passing the info down to isContextExpr), however we concluded this is more desirable.
...
Bug/patch by Eli Friedman!
llvm-svn: 45966
2008-01-14 18:19:28 +00:00
Ted Kremenek
a0a3e9bb07
Change uses of std::cerr/std::cout to llvm::Lcerr/llvm::cout, and remove
...
#include<iostream>.
Patch provided by Sam Bishop.
llvm-svn: 45962
2008-01-14 16:44:48 +00:00
Chris Lattner
38376f1595
Add first pieces of support for parsing and representing
...
extern "C" in C++ mode. Patch by Mike Stump!
llvm-svn: 45904
2008-01-12 07:05:38 +00:00
Chris Lattner
177977ac19
When forming the squigly underline for a diagnostic, make sure to
...
verify that the source range corresponds to the current file, not
just the current line. This allows us to emit:
a.c:1:44: error: invalid operands to binary expression ('double' and 'int *')
double a; int *b; void f(void) { int c = a +
~ ^
instead of:
a.c:1:44: error: invalid operands to binary expression ('double' and 'int *')
double a; int *b; void f(void) { int c = a +
~ ~ ^
for PR1906 (note the leading ~).
Thanks to Neil for noticing this.
llvm-svn: 45901
2008-01-12 06:43:35 +00:00
Fariborz Jahanian
af5d80cba5
Avoid redefinition of __objcFastEnumerationState
...
llvm-svn: 45842
2008-01-10 23:04:06 +00:00
Chris Lattner
2cbf2f39ee
add support for the GCC -include option.
...
llvm-svn: 45810
2008-01-10 01:53:41 +00:00
Chris Lattner
bceeefdc9c
Fix some 80 col violations
...
llvm-svn: 45808
2008-01-10 01:43:14 +00:00
Chris Lattner
d2cdb97747
Ted apparently likes crazy whitespace at the end of line. Crush his spirit by
...
removing them, fitting the file into 80 columns. :)
llvm-svn: 45807
2008-01-10 01:41:55 +00:00
Fariborz Jahanian
7262fca0a6
Put return type of synthesize method on same line as method declaration, space after method declaration header.
...
llvm-svn: 45806
2008-01-10 01:39:52 +00:00
Fariborz Jahanian
82ae0152a7
Allow messaging expression as foreach's collection expression.
...
llvm-svn: 45793
2008-01-10 00:24:29 +00:00
Fariborz Jahanian
6fa7516bc9
Type-cast RHS of assignment to prevent warning compiling rewritten foreach code.
...
llvm-svn: 45777
2008-01-09 18:15:42 +00:00
Fariborz Jahanian
22f2347791
Fixed a bug whereby a parethesized collection expression was not being rewritten correctly.
...
llvm-svn: 45776
2008-01-09 17:50:00 +00:00
Fariborz Jahanian
b7e7ee9ff3
Typo fixed.
...
llvm-svn: 45771
2008-01-09 01:25:54 +00:00
Fariborz Jahanian
965a8961c7
Patch to rewrite ObjC2's foreach-stmt.
...
llvm-svn: 45760
2008-01-08 22:06:28 +00:00
Ted Kremenek
7e41c29a86
Added most of the boilerplate to the driver needed to run the graph-reachability
...
constant propagation analysis.
llvm-svn: 45747
2008-01-08 18:04:06 +00:00
Fariborz Jahanian
dc917b9e07
Patch to start rewriting of ObjC2's foreach statement (work in progress).
...
llvm-svn: 45721
2008-01-07 21:40:22 +00:00
Ted Kremenek
1b0ea82459
Substituted all instances of the string "Objc" for "ObjC". This fixes
...
some naming inconsistencies in the names of classes pertaining to Objective-C
support in clang.
llvm-svn: 45715
2008-01-07 19:49:32 +00:00
Chris Lattner
4899a6aa6a
Fix PR1897, patch by Wilhansen Li
...
llvm-svn: 45593
2008-01-04 19:12:28 +00:00
Chris Lattner
266a2ff3ac
Compute the proper sourcerange for an CompoundLiteralExpr.
...
llvm-svn: 45504
2008-01-02 21:46:24 +00:00
Chris Lattner
54bb810997
Refactor the decl printer, patch by Mike Stump!
...
llvm-svn: 45497
2008-01-02 21:04:16 +00:00
Nate Begeman
16a3a9d5f9
Rename stats to print-stats to avoid conflicting with llvm's
...
stats statistic when clang is built as a dylib.
llvm-svn: 45441
2007-12-30 01:38:50 +00:00
Chris Lattner
5b12ab8c93
Don't attribute in file headers anymore. See llvmdev for the
...
discussion of this change.
llvm-svn: 45410
2007-12-29 19:59:25 +00:00
Christopher Lamb
2b84813441
Make output files binary mode for -emit-llvm-bc
...
llvm-svn: 45348
2007-12-24 23:49:33 +00:00
Christopher Lamb
d01dea749e
Almost the best possible handling of stdin/stdout for llvm-emit-bc!
...
llvm-svn: 45346
2007-12-24 20:59:36 +00:00
Christopher Lamb
1c0f5d2436
Better handing of stdin/stdout for -emit-llvm-bc
...
llvm-svn: 45345
2007-12-24 20:56:07 +00:00
Christopher Lamb
5a3416409f
Allow bitcode output to be redirected to stdout.
...
llvm-svn: 45340
2007-12-24 03:23:55 +00:00
Seo Sanghyeon
76270e6be6
Implement -emit-llvm-bc option
...
llvm-svn: 45339
2007-12-24 01:52:34 +00:00
Chris Lattner
b907c3fca1
remove use of alloca.
...
llvm-svn: 45329
2007-12-23 01:40:15 +00:00
Anton Korobeynikov
03f8a3630d
Unbreak mingw build
...
llvm-svn: 45328
2007-12-23 01:19:32 +00:00
Ted Kremenek
bf593f81fa
Directory restructing of Analysis files.
...
Created include/clang/Analysis/Analyses directory.
- Moved LiveVariables.h and UninitializedValues.h into this dir.
Moved ExprDeclBitVector.h into Analysis/Support.
Updated all clients who use these headers to reflect the new paths.
llvm-svn: 45292
2007-12-21 21:42:19 +00:00
Ted Kremenek
71d643f8b1
Converted uses of scoped_ptr to OwningPtr.
...
llvm-svn: 45265
2007-12-20 19:47:16 +00:00
Ted Kremenek
371efafb94
Created initial implementation of "BuildSerializer", and ASTConsumer
...
which serializes ASTs to a common output directory. This ASTConsumer
is invoked using a combination of "-o" and "-serialize" from the driver.
llvm-svn: 45241
2007-12-20 00:34:58 +00:00
Ted Kremenek
ca07147851
Split serialization ASTConsumers into two consumers: SingleFileSerializer and
...
BuildSerializer. The former serializes a single translation unit to a
corresponding .ast file. The second serializes ASTs to a common emission
direction. The latter is not fully implemented yet.
llvm-svn: 45232
2007-12-19 23:49:37 +00:00
Ted Kremenek
96e05d4f31
Added methods createMainFileID() and createMainFileIDForMemBuffer() to
...
SourceManager to allow SourceManager to directly intern the MainFileID
when it is created. Removed setMainFileID().
llvm-svn: 45231
2007-12-19 23:48:45 +00:00
Ted Kremenek
230bd918b2
Interned MainFileID within SourceManager. Since SourceManager is referenced by
...
both Preprocessor and ASTContext, we no longer need to explicitly pass
MainFileID around in function calls that also pass either Preprocessor or
ASTContext. This resulted in some nice cleanups in the ASTConsumers and the
driver.
llvm-svn: 45228
2007-12-19 22:51:13 +00:00
Ted Kremenek
f7bfae6b45
Typo fix.
...
llvm-svn: 45227
2007-12-19 22:32:34 +00:00
Ted Kremenek
9a53275918
Added storage of the FileID of the the main source file of a translation unit
...
in SourceManager.
llvm-svn: 45225
2007-12-19 22:29:55 +00:00
Ted Kremenek
6c7807716b
Removed "SourceFile" from TranslationUnit. This same information will (soon)
...
be available by querying the SourceManager within the ASTContext referenced by
the TranslationUnit.
llvm-svn: 45223
2007-12-19 22:24:34 +00:00
Ted Kremenek
aff2343af3
Cleaned up "-o" option to print "-o=<path>" instead of "-o=<string>" when
...
doing clang --help.
llvm-svn: 45215
2007-12-19 19:50:41 +00:00
Ted Kremenek
6c0b224011
Added "-o" option to driver. ASTConsumers will need to be gradually
...
rewired to utilize this option.
Renamed option --serialize-ast --serialize.
llvm-svn: 45213
2007-12-19 19:47:59 +00:00
Ted Kremenek
0061aeb316
Removed storing inode and device number in TranslationUnit.
...
Added "SourceFile" string to TranslationUnit to record corresponding
source file.
Updated serialization of TranslationUnits and logic in the driver to
correctly pass the source file information to the serializer.
llvm-svn: 45211
2007-12-19 19:27:38 +00:00
Steve Naroff
7e718bb3fd
Soften the macro rewrite error to a warning (and change the text).
...
llvm-svn: 45209
2007-12-19 19:16:49 +00:00
Ted Kremenek
6c3777c319
Moved generation of the name of the serialized AST file into
...
CreateASTSerializer.
llvm-svn: 45201
2007-12-19 17:25:59 +00:00
Steve Naroff
55cb4be8ae
Emit errors when attempting to rewrite ObjC expressions that originate from a macro expansion.
...
We plan on fixing this and removing this restriction after the break...
llvm-svn: 45200
2007-12-19 14:32:56 +00:00
Ted Kremenek
f70d24d2ae
Moved ReadBitcodeFile and EmitBitcodeFile out of TranslationUnit and made them
...
the standalone functions ReadASTBitcodeFile and EmitASTBitcodeFile
respectively.
llvm-svn: 45180
2007-12-18 21:44:50 +00:00
Ted Kremenek
25dbd71a4c
Fixed broken includes introduced by recent (incomplete) patch to
...
TranslationUnit.
llvm-svn: 45177
2007-12-18 21:36:21 +00:00
Ted Kremenek
879b75018f
Moved TranslationUnit from Driver to AST library.
...
llvm-svn: 45175
2007-12-18 21:34:28 +00:00
Fariborz Jahanian
9f0e310861
Refactoring work. ObjcQualifiedIdType is now derived from 'Type'.
...
llvm-svn: 45174
2007-12-18 21:33:44 +00:00
Fariborz Jahanian
24cb52c9b0
Patch to implemented objective-c's dynamic object pointer qualified with
...
the protocol list (id<P,...> types).
llvm-svn: 45121
2007-12-17 21:03:50 +00:00
Chris Lattner
4ffe46cbdf
Start reading the headermap header, drop the 'errorstr' argument to
...
the create method.
llvm-svn: 45109
2007-12-17 18:34:53 +00:00
Fariborz Jahanian
77b713b5d3
Also fixed similar regression for class methods, as well as more indentations.
...
llvm-svn: 45107
2007-12-17 18:07:01 +00:00
Chris Lattner
8d720d083a
Sink getName into DirectoryLookup to simplify the client in clang.
...
llvm-svn: 45106
2007-12-17 17:57:27 +00:00
Fariborz Jahanian
5f6409532b
Fixed a regression caused by refactoring of some meta-data generation routines using iteratgors.
...
Also fixed indentation problems.
llvm-svn: 45105
2007-12-17 17:56:10 +00:00
Ted Kremenek
73e921fdf2
Fixed 80 col violation.
...
llvm-svn: 45104
2007-12-17 17:50:39 +00:00
Ted Kremenek
5aa66bdfd6
Added driver option -Wno-format-nonliteral to silence format string related
...
warnings. This flag is the inverse of to GCC's -Wformat-nonliteral option (in
the clang driver, these warnings are on by default).
Patch provided by Shantonu Sen.
llvm-svn: 45103
2007-12-17 17:50:07 +00:00
Chris Lattner
faebb62651
Unbreak -v with framework paths. Patch by Shantonu Sen.
...
llvm-svn: 45102
2007-12-17 17:42:26 +00:00
Chris Lattner
f62f75895f
as it turns out, frameworks and headermaps are orthogonal. Make this so in
...
the internal representation. This also fixes a bug where -I foo -F foo would
not search foo as both a normal and framework include dir.
llvm-svn: 45092
2007-12-17 07:52:39 +00:00
Chris Lattner
dd00e625d2
add a portability fixme.
...
llvm-svn: 45091
2007-12-17 06:51:34 +00:00
Chris Lattner
3e206b3a0e
teach RemoveDuplicates about header maps.
...
llvm-svn: 45090
2007-12-17 06:44:29 +00:00
Chris Lattner
c4ba38ed1e
Step #1 in adding headermap support to clang.
...
llvm-svn: 45089
2007-12-17 06:36:45 +00:00
Chris Lattner
899ff4a26d
rearrange some code and make it more efficient.
...
llvm-svn: 45087
2007-12-17 05:59:27 +00:00
Chris Lattner
39911a2258
swtich to smallptrset, which is more efficient than std::set.
...
llvm-svn: 45065
2007-12-15 23:20:07 +00:00
Chris Lattner
d6658d932b
make clang -v output more similar to gcc's -v output.
...
llvm-svn: 45064
2007-12-15 23:11:06 +00:00
Chris Lattner
60a288ab19
simplify the interfaces to ProcessInputFile and InitializePreprocessor
...
llvm-svn: 45060
2007-12-15 20:48:40 +00:00
Steve Naroff
3ce37a6b8e
- Remove getInstanceMethods/getClassMethods API on ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCategoryDecl. These methods are replaced by the respective iterators on each class.
...
- Add getInstanceMethodForSelector to ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCatgoryDecl. This hook will do a "shallow" lookup. This is a convenience method that reducing some of the iterator usage.
- Various changes to convert all clients to the above API's...
llvm-svn: 45046
2007-12-14 23:37:57 +00:00
Ted Kremenek
31dcdb312b
Add check in the driver to see if a serialized AST file has been successfully
...
deserialized.
llvm-svn: 45006
2007-12-13 18:11:11 +00:00
Ted Kremenek
685dc9b56e
Changed set of top-level decls from a list to a vector.
...
llvm-svn: 45005
2007-12-13 17:54:02 +00:00