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
Fariborz Jahanian
8d91686b0d
percolate @optional/@required protocols down to ASTs for
...
properties declared in the protocol.
llvm-svn: 50662
2008-05-05 18:51:55 +00:00
Chris Lattner
de977c0a5c
Fix PR2281: these two warnings should be promoted to error on
...
pedantic error. Perhaps I should add a class of 'extension' that is
'extension that warns by default', which would be cleaner.
llvm-svn: 50633
2008-05-04 23:52:02 +00:00
Ted Kremenek
5f56cbbf7d
Output better paths to display in bug reports and compute a common
...
prefix for all files.
llvm-svn: 50592
2008-05-02 22:04:53 +00:00
Ted Kremenek
789942cfda
When running the reference count checker twice (GC and non-GC mode), only emit
...
basic warnings (dead stores, null dereferences) on the first pass.
llvm-svn: 50584
2008-05-02 18:01:49 +00:00
Ted Kremenek
b0f87c48cb
added preliminary diagnostics in scan-build results to denote whether
...
a CF memory leak occurred with GC enabled, etc.
llvm-svn: 50507
2008-04-30 23:47:44 +00:00
Ted Kremenek
4d1f422c6f
Provide the option to run the CF-retain checker in GC enabled mode.
...
The transfer functions for the checker don't do anything special yet in GC mode.
llvm-svn: 50394
2008-04-29 05:13:59 +00:00
Ted Kremenek
d796c18d7b
Add -fobjc-gc and -fobjc-gc-only options to the driver.
...
Add corresponding enum in LangOptions.
llvm-svn: 50387
2008-04-29 04:37:03 +00:00
Ted Kremenek
64fa3beccc
Better handling for directory names in HTML diagnostics. Work in progress.
...
llvm-svn: 50234
2008-04-24 23:37:03 +00:00
Ted Kremenek
467297ab48
TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects
...
when it is constructed via deserialization. This is done by recording a flag
indicating that this is the case, and it deletes these objects by getting
the references stored in the ASTContext object. This fixes some memory
leaks that occurs when we deserialize translation units from bitcode files.
The rationale between having TranslationUnit sometimes own these objects and
sometimes not is that a TranslationUnit object can be constructed from
state generated by the parser (Preprocessor; semantic analyzer, etc.), and thus
in these cases won't own the IdentifierTable or Selectors, etc. During
deserialization, there is no Preprocessor, so somebody needs to own these
objects in order for them to be properly reclaimed.
llvm-svn: 50149
2008-04-23 16:25:39 +00:00
Fariborz Jahanian
6efdf1ddab
Patch to build AST for property implementation declarations and
...
to print declaration from its AST.
llvm-svn: 50117
2008-04-23 00:06:01 +00:00
Ted Kremenek
9718c9e8ee
PathDiagnosticClients now retain ownership of passed PathDiagnostics, requiring
...
them to not be stack-allocated.
HTMLDiagnostics now batches PathDiagnostics before emitting HTML in its dtor.
This is a workaround for a problem when we trampled the Preprocessor state
when highlighting macros (sometimes resulting in an assertion failure).
llvm-svn: 50102
2008-04-22 16:15:03 +00:00
Ted Kremenek
076d13387d
html::EscapeText (using the Rewriter) now replaces tabs by default.
...
llvm-svn: 49982
2008-04-20 01:02:33 +00:00
Chris Lattner
1a44f7fce9
simplify the return of InitializePreprocessor to be bool instead of a fileid
...
llvm-svn: 49974
2008-04-19 23:25:44 +00:00
Chris Lattner
ba1f37bfdf
simplify ownership of the predefines buffer.
...
llvm-svn: 49973
2008-04-19 23:09:31 +00:00
Steve Naroff
472cf88ef2
Remove bogus cast (<rdar://problem/5874848> clang objc-rewriter: structure with list of protocols has wrong cast).
...
llvm-svn: 49935
2008-04-18 22:15:15 +00:00
Steve Naroff
24840f6748
Implement FIXME discoved by <rdar://problem/5874876> Rewriter: Explicit ivar refs outside a method are being rewritten
...
llvm-svn: 49932
2008-04-18 21:55:08 +00:00
Steve Naroff
dcdcdcdfef
Fix <rdar://problem/5874697> Rewriter: method arguments with complex types not being rewritten properly.
...
llvm-svn: 49925
2008-04-18 21:13:19 +00:00
Ted Kremenek
71c41d9561
Restore macro expansion for HTMLPrint by using the original Preprocessor.
...
This is a workaround until we figure out why a freshly create Preprocessor
doesn't expand macros from headers.
llvm-svn: 49897
2008-04-18 05:35:23 +00:00
Ted Kremenek
9e48b0c4ed
Fixed range highlighting bug in HTML diagnostics.
...
llvm-svn: 49893
2008-04-18 05:01:33 +00:00
Ted Kremenek
f42f3fb47d
class Preprocessor: Now owns the "predefines" char*; it deletes [] it in its dstor.
...
clang.cpp: InitializePreprocessor now makes a copy of the contents of PredefinesBuffer and
passes it to the preprocessor object.
clang.cpp: DriverPreprocessorFactory now calls "InitializePreprocessor" instead of this being done in main().
html::HighlightMacros() now takes a PreprocessorFactory, allowing it to conjure up a new
Preprocessor to highlight macros.
class HTMLDiagnostics now takes a PreprocessorFactory* that it can use for html::HighlightMacros().
Updated clients of HTMLDiagnostics to use this new interface.
llvm-svn: 49875
2008-04-17 22:31:54 +00:00
Chris Lattner
7c7e9b3bbe
Handle text escaping (e.g. & -> &) last, to avoid interactions between 'replace' operations and insert operations. This fixes a problem with "&;&" on line 666 of the gcc.c example I sent out.
...
llvm-svn: 49874
2008-04-17 22:24:51 +00:00
Ted Kremenek
306492d8cb
Generate the Preprocessor using a local PreprocessorFactory object.
...
While this adds no extra functionality now, we will soon pass the
PreprocessorFactory object to some ASTConsumers.
llvm-svn: 49873
2008-04-17 21:38:34 +00:00
Ted Kremenek
aabc986766
Temporarily disable macro expansion in the HTML output of HTMLDiagnostics to
...
avoid corrupting Preprocessor state. Working on a fix.
llvm-svn: 49864
2008-04-17 18:39:57 +00:00
Ted Kremenek
8bb90b8152
HAve HTMLDiagnostics use html::HighlightRange to highlight message ranges.
...
llvm-svn: 49863
2008-04-17 18:37:23 +00:00
Fariborz Jahanian
8e36cddde0
Added property decl support for protocols.
...
Added assertion if unexpected property decls are found where they don't belong.
Consolidated property decl. printing by using a helper function.
llvm-svn: 49862
2008-04-17 18:25:18 +00:00
Nate Begeman
36c49278b5
Allow redirecting text diagnostic printer output to any llvm::OStream, rather
...
than hard coding llvm::cerr.
llvm-svn: 49860
2008-04-17 18:06:57 +00:00
Argyrios Kyrtzidis
c3b69ae815
Addition of TranslationUnitDecl to the AST:
...
-Added TranslationUnitDecl class to serve as top declaration context
-ASTContext gets a TUDecl member and a getTranslationUnitDecl() function
-All ScopedDecls get the TUDecl as DeclContext when declared at global scope
llvm-svn: 49855
2008-04-17 14:40:12 +00:00
Fariborz Jahanian
9d981eb9ae
This patch adds support for declaraing properties in categories,
...
just as they are declared in objc classes.
llvm-svn: 49817
2008-04-16 21:08:45 +00:00
Ted Kremenek
2e4d0ecaa3
Added fixme.
...
llvm-svn: 49797
2008-04-16 16:53:18 +00:00
Ted Kremenek
f2e6fcf3bf
Hook up HTMLDiagnostics to use Chris's new syntax highlighting. --html-diags
...
currently doesn't pass in the Preprocessor from the driver, so we don't get
syntax highlighting when we create HTMLDiagnostics in that way.
llvm-svn: 49796
2008-04-16 16:39:56 +00:00
Chris Lattner
a5a75e7a10
split syntax highlighting of macros from keywords and comments,
...
allowing us to use a cheaper means to highlight keywords and making
it so that comments won't foul up macro expansions.
Start highlighting macro expansions.
llvm-svn: 49779
2008-04-16 06:32:08 +00:00
Chris Lattner
060d8aa2ed
Add a mode of hackily syntax highlighting comments. This has a number of
...
problems, including the fact that it doesn't work well with multi-line
comments due to Ted's crazy table. However, that could be fixed, and it
does work with single-line ones :).
llvm-svn: 49778
2008-04-16 06:11:58 +00:00
Chris Lattner
dffe0f7db5
Add -o support for -emit-html, make it not produce a file on an error.
...
llvm-svn: 49777
2008-04-16 05:21:09 +00:00
Ted Kremenek
088d12e741
Remove "--html-test" driver option and its corresponding code; all of this
...
functionality has been migrated into "--emit-html" and "--html-diags".
llvm-svn: 49776
2008-04-16 04:38:45 +00:00
Chris Lattner
e4dd37ce0a
speed up -emit-html in a release build by 6.5% by avoiding std::string.
...
llvm-svn: 49764
2008-04-16 03:46:57 +00:00
Steve Naroff
08899ff85d
Remove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl().
...
This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it).
llvm-svn: 49748
2008-04-15 22:42:06 +00:00
Ted Kremenek
7d6219f501
For HTML diagnostics, output more information about a bug report.
...
llvm-svn: 49742
2008-04-15 21:25:08 +00:00
Ted Kremenek
044eb055af
Handle "__private_extern__" storage class when printing FunctionDecls.
...
llvm-svn: 49706
2008-04-15 03:57:09 +00:00
Fariborz Jahanian
0152a1a5db
New AST representation for each objc2's property declaration.
...
llvm-svn: 49699
2008-04-14 23:36:35 +00:00
Steve Naroff
c5e5b38a8f
Remove bogus token...
...
llvm-svn: 49695
2008-04-14 22:53:48 +00:00
Steve Naroff
a8f0d12e81
Rename a file and update the Xcode project.
...
llvm-svn: 49693
2008-04-14 22:05:54 +00:00
Steve Naroff
1dc53ef494
Rename RewriteTest->RewriteObjC.
...
llvm-svn: 49692
2008-04-14 22:03:09 +00:00
Steve Naroff
4fff2a08aa
Fix comment.
...
llvm-svn: 49688
2008-04-14 21:39:16 +00:00
Ted Kremenek
d61ed3b6cb
Use isFromMainFile instead of comparing FileIDs directly.
...
llvm-svn: 49687
2008-04-14 21:24:13 +00:00
Ted Kremenek
9569e57a50
Use SourceManager::isFromMainFile()
...
llvm-svn: 49685
2008-04-14 21:14:41 +00:00
Ted Kremenek
13ad6e1234
Convert over to new SourceManager::isFromMainFile() instead of doing direct
...
FileID comparison (fixes insidious corner case with chunks).
llvm-svn: 49684
2008-04-14 21:14:03 +00:00
Ted Kremenek
bb2b224159
HTMLDiagnostics now uses the new "getCanonicalID()", "isFromMainFileID()" methods from
...
SourceManager when doing HTML pretty-printing. This resolves an insidious bug when
presenting error reports that only occurred in large source files.
llvm-svn: 49683
2008-04-14 21:06:04 +00:00
Ted Kremenek
751d4d2d60
Added driver option "-checker-opt-analyze-headers" to force the static
...
analyzer to analyze functions declared in header files.
llvm-svn: 49675
2008-04-14 18:40:58 +00:00
Sam Bishop
cb1a37b145
Handle -D and -U options in order, so that they can cancel each other out when
...
intermixed.
llvm-svn: 49645
2008-04-14 14:41:57 +00:00
Fariborz Jahanian
4572b45574
AST generation for objc2's property declarations.
...
llvm-svn: 49565
2008-04-11 23:40:25 +00:00
Chris Lattner
47fb9efa5d
Fix rdar://5843510 don't assert and die when an invalid output
...
file is specified, print a happy little error message.
llvm-svn: 49518
2008-04-11 06:14:11 +00:00
Ted Kremenek
22bd628056
Fix some bonehead bugs in summary generation in CFRefCount.
...
llvm-svn: 49503
2008-04-10 22:58:08 +00:00
Ted Kremenek
4a78c3ae11
Refactored all logic to run the GRSimpleVals and CFRef checker into a common
...
code path in the clang driver.
Renamed options --grsimple to -checker-simple and -check-cfref to -checker-cfref.
llvm-svn: 49500
2008-04-10 22:16:52 +00:00
Ted Kremenek
d4db4fa359
For -emit-html, use the Rewriter to expand tabs.
...
llvm-svn: 49409
2008-04-08 23:25:54 +00:00
Ted Kremenek
5f7ece0bff
Don't expand tabs in EscapeText, but rather expand them when writing out
...
the HTML file. This should reduce the amount of memory pressure on the
rewriter for files that have a lot of tabs.
llvm-svn: 49406
2008-04-08 22:37:58 +00:00
Ted Kremenek
d8256ed2fe
Improve range highlighting in HTMLDiagnostic to correctly highlight ranges
...
that span multiple lines by inserting multiple "</span>" and "<span>" tags.
llvm-svn: 49403
2008-04-08 21:29:14 +00:00
Chris Lattner
4fdfbf7b89
silence some warnings when assertions are disabled.
...
llvm-svn: 49372
2008-04-08 05:52:18 +00:00
Chris Lattner
aa9c7aed0f
Add support for C++ default arguments, and rework Parse-Sema
...
interaction for function parameters, fixing PR2046.
Patch by Doug Gregor!
llvm-svn: 49369
2008-04-08 04:40:51 +00:00
Chris Lattner
2163265b53
Fix rdar://5846705: "clang -E foo.c -o foo.i" should remove foo.i on error.
...
llvm-svn: 49368
2008-04-08 04:16:20 +00:00
Chris Lattner
0a5ff0d34a
This patch contains these changes:
...
-Renamed ContextDecl -> DeclContext
-Removed DeclContext pointer from FieldDecl
-EnumDecl inherits from DeclContext, instead of TagDecl
Patch by Argiris Kirtzidis!
llvm-svn: 49261
2008-04-06 04:47:34 +00:00
Chris Lattner
9d51f2b9d4
Fix handling of implicit int, resolving PR2012 and reverting (and
...
subsuming) my patch for PR1999.
llvm-svn: 49251
2008-04-05 06:32:51 +00:00
Steve Naroff
4dbab8a49d
Avoid implicitly including any header files (requested by ckane).
...
llvm-svn: 49241
2008-04-04 22:58:22 +00:00
Steve Naroff
af91b9ae13
Rewrite @package (an ObjC 2.0 idiom).
...
llvm-svn: 49238
2008-04-04 22:34:24 +00:00
Steve Naroff
eae91700de
Fix MS-specific bug in RewriteTest::RewriteObjCMethodDecl().
...
llvm-svn: 49237
2008-04-04 22:23:44 +00:00
Chris Lattner
c5ffed4a66
Introduce ContextDecl, patch by Argiris Kirtzidis!
...
-Added ContextDecl (no TranslationUnitDecl)
-ScopedDecl class has a ContextDecl member
-FieldDecl class has a ContextDecl member, so that a Field or a ObjCIvar can be traced back to their RecordDecl/ObjCInterfaceDecl easily
-FunctionDecl, ObjCMethodDecl, TagDecl, ObjCInterfaceDecl inherit from ContextDecl. With TagDecl as ContextDecl, enum constants have a EnumDecl as their context.
-Moved Decl class to a "DeclBase.h" along with ContextDecl class
-CurContext is handled by Sema
llvm-svn: 49208
2008-04-04 06:12:32 +00:00
Ted Kremenek
b5c8225320
Use logical line number for BUGLINE.
...
llvm-svn: 49178
2008-04-03 17:55:57 +00:00
Ted Kremenek
b73d6dda84
Added guard for printing out PathDiagnostics whose last element ends with
...
a piece with a SourceLocation that does not have a FileID.
llvm-svn: 49151
2008-04-03 07:13:10 +00:00
Sam Bishop
03e662d5be
Call delete on the deserialized TranslationUnit object.
...
llvm-svn: 49136
2008-04-03 05:03:34 +00:00
Ted Kremenek
258493c188
Added path sequence numbers in HTML output of PathDiagnostics.
...
llvm-svn: 49116
2008-04-02 21:04:20 +00:00
Ted Kremenek
3276af4c1a
Embed BUGLINE, BUGFILE, BUGPATHLENGTH in the emitted HTML file.
...
llvm-svn: 49114
2008-04-02 20:44:16 +00:00
Ted Kremenek
13c0885a8d
Put "BUGDESC" comment tag on its own line.
...
llvm-svn: 49103
2008-04-02 18:03:20 +00:00
Ted Kremenek
e6eed29125
Embed "DESC" tag in HTML reports.
...
llvm-svn: 49084
2008-04-02 07:04:46 +00:00
Chris Lattner
595cf9ff81
Update to match simplified llvm MemoryBuffer interfaces for files.
...
llvm-svn: 49042
2008-04-01 18:04:30 +00:00
Ted Kremenek
a9590d1c0d
Embed linkable IDs in message bubbles.
...
llvm-svn: 49005
2008-03-31 23:30:12 +00:00
Ted Kremenek
3bcfc6edc0
Better handling for tabs with message bubbles.
...
llvm-svn: 49001
2008-03-31 23:14:05 +00:00
Ted Kremenek
01fa5d2a1e
When emitting HTML messages, take into account margin fusing due to tabs.
...
llvm-svn: 48998
2008-03-31 21:40:14 +00:00
Ted Kremenek
c27815ca82
Inlined clang/Analysis/Analyses/GRSimpleVals.h into LocalCheckers.h and removed
...
GRSimpleVals.h
Added a PathDiagnosticClient option to the driver functions for the
CFRefCountChecker and the GRSimpleVals analysis. Both analyses now accept a "-o"
argument from the driver that specifies where HTML reports should be dumped.
llvm-svn: 48989
2008-03-31 18:26:32 +00:00
Ted Kremenek
9c7deb8d25
Disable timing diagnostics for GRSimpleVals.
...
llvm-svn: 48981
2008-03-31 16:00:32 +00:00
Steve Naroff
f9e7c90129
Only have the rewriter produce a file when there are no errors.
...
llvm-svn: 48926
2008-03-28 22:26:09 +00:00
Steve Naroff
60a9ef67e2
Add some of Ted's recent work to the VC++ project file.
...
Fix a couple bozo bugs in the rewriter.
llvm-svn: 48903
2008-03-27 22:59:54 +00:00
Steve Naroff
00a317694b
Collect all the preamble code and don't insert it until the end.
...
llvm-svn: 48899
2008-03-27 22:29:16 +00:00
Ted Kremenek
30560caa3d
For HTMLDiagnostics, when emitting the name of the directory, substitute the current working directory for "."
...
llvm-svn: 48888
2008-03-27 17:25:28 +00:00
Ted Kremenek
561dfe3153
Add html::EscapeText for std::string; use this function to escape text in message bubbles.
...
llvm-svn: 48884
2008-03-27 17:15:29 +00:00
Ted Kremenek
ed9f054a9c
Don't emit any timings for GRSimple if the CFG is not going to be built.
...
llvm-svn: 48882
2008-03-27 17:14:42 +00:00
Ted Kremenek
8d5491f40c
Output directory as well as file name.
...
llvm-svn: 48870
2008-03-27 07:39:04 +00:00
Ted Kremenek
8cc4842a76
Added <h3> tag in HTML file output that contains the name of the source file.
...
llvm-svn: 48869
2008-03-27 07:35:49 +00:00
Ted Kremenek
6efb026623
Added "HTMLDiagnostic", a generic DiagnosticClient (that also implements PathDiagnostic)
...
so that all diagnostics can be piped to HTML files instead of as text diagnostics using --html-diags.
llvm-svn: 48865
2008-03-27 06:17:42 +00:00
Ted Kremenek
c875201ee1
Fixed copy-paste error.
...
llvm-svn: 48863
2008-03-27 05:52:45 +00:00
Steve Naroff
65838bb2d5
Add a couple files to VC++ project and cleanup an "#if 0".
...
llvm-svn: 48748
2008-03-24 22:03:25 +00:00
Andrew Lenharth
10051b97fd
debian amd64 testing
...
llvm-svn: 48745
2008-03-24 21:39:05 +00:00
Andrew Lenharth
d8cde6f45d
debian ia32 testing
...
llvm-svn: 48742
2008-03-24 21:25:48 +00:00
Chris Lattner
97d496c182
Teach the rewriter how to respect the -o option.
...
llvm-svn: 48669
2008-03-22 00:08:40 +00:00
Ted Kremenek
bc24962566
Added HTML highlighting for ranges.
...
llvm-svn: 48572
2008-03-19 23:55:53 +00:00
Ted Kremenek
1651b7cd2d
Misc. cleanups to HTML printing: make code rendered using tables; add
...
better div positioning for messages.
llvm-svn: 48555
2008-03-19 21:59:05 +00:00
Ted Kremenek
216624ce58
Initial experimentation with adding boxed "annotations" to HTMLized source.
...
llvm-svn: 48540
2008-03-19 07:53:42 +00:00
Ted Kremenek
966da4acc3
Moved generation of html header/footer with builtin CSS to the rewriter library.
...
llvm-svn: 48537
2008-03-19 06:14:37 +00:00
Ted Kremenek
3f8392626b
More cleanups to the HTML rewriter (with line formatting), with better
...
pretty-printing of line numbers.
llvm-svn: 48533
2008-03-19 05:07:26 +00:00
Ted Kremenek
5ddff02861
More cleanups to HTML rewriter API: remove the InsertTag method; was too complicated
...
and clients can achieve a cleaner design just by inserting tags directly. Reserve
the "html" namespace for meta-level operations (e.g., escaping text, etc.)
llvm-svn: 48524
2008-03-19 01:30:02 +00:00
Ted Kremenek
8800ae68a0
More HTML rewriter cleanups. Preliminary CSS support in code pretty-printing.
...
llvm-svn: 48518
2008-03-18 23:55:46 +00:00
Ted Kremenek
5792cebb08
Some cleanups to the HTMLRewrite API. Added support for printing out line
...
numbers (more work to be done on aesthetics).
llvm-svn: 48512
2008-03-18 23:08:51 +00:00
Ted Kremenek
b0c409a235
Added HTML pretty-printer.
...
llvm-svn: 48507
2008-03-18 22:21:07 +00:00
Ted Kremenek
7dcc82220e
Added the beginning of a set of rewriter functions for pretty-printing source
...
code as HTML. Added a new driver option "--emit-html" to dump the source
of the main input file as HTML.
llvm-svn: 48505
2008-03-18 21:19:49 +00:00
Steve Naroff
327f0f4c3a
Fix <rdar://problem/5716940> rewriter generates invalid C code when no selector found.
...
llvm-svn: 48479
2008-03-18 02:02:04 +00:00
Steve Naroff
034bcb5bfa
Wrap up __NSConstantStringImpl (the replacement for __builtin___CFStringMakeConstantString).
...
llvm-svn: 48477
2008-03-18 01:47:18 +00:00
Chris Lattner
5bb4ee20cd
clean up iteration over propertydecls.
...
llvm-svn: 48435
2008-03-17 01:24:41 +00:00
Chris Lattner
ed0e16404c
clean up property memory allocation to move it into the ast classes
...
like the rest of the classes.
llvm-svn: 48434
2008-03-17 01:19:02 +00:00
Chris Lattner
41eec3d097
make property addition work list all other "add" methods. Do
...
the allocation in the class, not in sema.
llvm-svn: 48433
2008-03-16 21:23:50 +00:00
Chris Lattner
8d1c04f53a
Convert more counts to be zero based instead of -1 based, make them unsigned.
...
llvm-svn: 48429
2008-03-16 21:08:55 +00:00
Chris Lattner
acc04a9261
minor cleanups, make getNumInstanceMethods always return unsigned.
...
llvm-svn: 48423
2008-03-16 20:19:15 +00:00
Chris Lattner
011b0f5c5a
Make the parameter count of ObjCMethodDecl unsigned, you
...
can't have negative arguments.
llvm-svn: 48407
2008-03-16 01:07:14 +00:00
Chris Lattner
ee1284a6e2
switch the rest of the C decl classes to do their
...
allocation through ASTContext.
llvm-svn: 48403
2008-03-16 00:16:02 +00:00
Chris Lattner
96c460d142
move the ASTContext argument to be first in the argument list of
...
all Create methods.
llvm-svn: 48398
2008-03-15 21:32:50 +00:00
Chris Lattner
5072bae709
Switch over functiondecl. This makes it obvious that the ASTContext
...
argument to Create should be first, not last.
llvm-svn: 48397
2008-03-15 21:24:04 +00:00
Chris Lattner
4b08ca8f2e
switch the VarDecl allocation model to go through ASTContext.
...
llvm-svn: 48396
2008-03-15 21:10:16 +00:00
Chris Lattner
a7b3287760
start switching decls over to using an allocator controlled by ASTContext.
...
Right now only some ctors are switched over. I need to switch them all
over so I can change the dtor over.
This lets us experiment with region allocation and other things in the
future.
llvm-svn: 48390
2008-03-15 06:12:44 +00:00
Steve Naroff
dad80ba9b1
Link against the correct ObjC string class (__CFConstantStringClassReference) and fix length computation (removing a FIXME).
...
llvm-svn: 48384
2008-03-15 01:36:04 +00:00
Steve Naroff
ce8e886731
Remove ObjC rewriter dependency on GCC's __builtin___CFStringMakeConstantString.
...
llvm-svn: 48383
2008-03-15 00:55:56 +00:00
Ted Kremenek
9abb59f9cc
Emit warnings for undefined control-flow.
...
llvm-svn: 48368
2008-03-14 18:14:50 +00:00
Ted Kremenek
7b00d15bc5
Path-sensitive analyses no longer take a FunctionDecl, but any Decl representing
...
a block of "code".
Patched various ASTConsumers (such as ASTDumper) to have more support for
processing ObjCMethodDecl. CFGVisitor now builds CFGs for ObjCMethodDecls.
llvm-svn: 48363
2008-03-14 17:31:00 +00:00
Chris Lattner
e8ec280627
Only compute targetinfo once and don't leak it. Patch by Sam Bishop!
...
llvm-svn: 48358
2008-03-14 06:12:05 +00:00
Ted Kremenek
1fdd0a480e
The LiveVariables analysis no longer requires a FunctionDecl&; this allows it
...
to be run on other declarations of blocks of code (e.g., Objective-C methods.)
llvm-svn: 48339
2008-03-13 16:55:07 +00:00
Ted Kremenek
b64d183803
Added bandaid support in CFG construction for ObjCForEachStmt and ObjCAtTryStmt:
...
we gracefully back out and return NULL for the CFG, allowing clients to skip
analyzing functions with these CFGs. We will add support later.
Modified base ASTConsumer "CFGVisitor" to detect when a CFG is not constructed
and to emit a warning.
llvm-svn: 48322
2008-03-13 03:04:22 +00:00
Steve Naroff
35cb7960e3
Two fixes to RewriteTest::RewriteObjCIvarRefExpr():
...
- For explicit ivar refers, make sure the cast is propagated to the AST.
- Don't free the base (since it is still in use).
This fixes the recent regression to test/Rewriter/objc-ivar-receiver-1.m.
llvm-svn: 48309
2008-03-12 23:15:19 +00:00
Steve Naroff
ffb5f9ad93
Minor aesthetic improvement (after I reviewed my last commit).
...
llvm-svn: 48304
2008-03-12 21:22:52 +00:00
Steve Naroff
9f33bd2c34
Avoid using the "unnamed struct field" extension (enabled with -fms-extensions). This feature/extension silently does the wrong thing in g++. As far as I can tell, g++ simply throws the field away entirely (note that it works fine with gcc). Since I am now always casting the object (for other reasons), accessing protected/public fields simply requires the cast refer to the defining class. This solution is simpler all around (thanks to Chris for suggesting it).
...
llvm-svn: 48302
2008-03-12 21:09:20 +00:00
Steve Naroff
b327e49047
Use the "used" attribute. Without it, g++ removes all the meta-data:-( This doesn't happen when compiling straight C code.
...
llvm-svn: 48287
2008-03-12 17:18:30 +00:00
Steve Naroff
5d5efca405
-Add missing visitor for ObjCIvarRefExpr.
...
-Wrap objc runtime calls with "extern "C"" (for now).
llvm-svn: 48284
2008-03-12 13:19:12 +00:00
Steve Naroff
251084d03e
Remove more dependencies on C "flexible array member" idiom (when generating meta-data).
...
llvm-svn: 48271
2008-03-12 01:06:30 +00:00
Steve Naroff
dc5b6b2e5d
Make ivar rewrite C++ friendly (since C++ forces a unified namespace for typedefs/structures). The previous version of the rewriter generated both a type def and structure def for each class (which doesn't fly in C++).
...
llvm-svn: 48266
2008-03-12 00:25:36 +00:00
Steve Naroff
0b844f053f
Make "super" rewrite for class methods C++ friendly (follow-up from last commit).
...
llvm-svn: 48235
2008-03-11 18:14:26 +00:00
Steve Naroff
17978c4dcb
Make "super" rewrite C++ friendly (since it doesn't support Compound Literals).
...
llvm-svn: 48230
2008-03-11 17:37:02 +00:00
Steve Naroff
c5b9cc70ce
Generate meta-data in a C++ compatible way (remove 2 dependencies on C "flexible array member" idiom and perform some extra casts).
...
llvm-svn: 48202
2008-03-11 00:12:29 +00:00
Steve Naroff
14a0746b13
Missed a couple "_IMPL" suffixes.
...
llvm-svn: 48191
2008-03-10 23:33:22 +00:00
Steve Naroff
a1e115ee57
Fix dangling pointer and give the implementation struct for a class a unique name.
...
llvm-svn: 48190
2008-03-10 23:16:54 +00:00
Steve Naroff
945a3b145a
Pass LangOptions to RewriteTest().
...
llvm-svn: 48172
2008-03-10 20:43:59 +00:00
Chris Lattner
0d799d3957
Add some missing #includes for GCC mainline, patch by Shantonu Sen!
...
llvm-svn: 48153
2008-03-10 17:04:53 +00:00
Chris Lattner
6af064641f
Fix a ted-o
...
llvm-svn: 48089
2008-03-09 05:25:01 +00:00
Chris Lattner
22ad07ca07
simplify triple processing code now that there can be only one arch specified.
...
llvm-svn: 48066
2008-03-09 01:35:13 +00:00
Ted Kremenek
2bdd77696e
Added --trim-path-graph to the driver to trim paths from the ExplodedGraph
...
that are not related to error nodes.
Fixed bug where we did not detect some NULL dereferences.
Added "ExplodedGraph::Trim" to trim all nodes that cannot transitively reach
a set of provided nodes.
Fixed subtle bug in ExplodedNodeImpl where we could create predecessor
iterators that included the mangled "sink" bit. The better fix is to integrate
this bit into the void* for the wrapped State, not the NodeGroups representing
a node's predecessors and successors.
llvm-svn: 48036
2008-03-07 22:58:01 +00:00
Ted Kremenek
ea6507fe04
Added boilerplate to execute the CF reference count checker (which isn't yet implemented).
...
llvm-svn: 47982
2008-03-06 00:08:09 +00:00
Chris Lattner
37e0587839
remove the source location arguments to various target query methods.
...
llvm-svn: 47954
2008-03-05 18:54:05 +00:00
Chris Lattner
855d024a83
Remove the first layer of support for "portability" warnings. This is
...
theoretically useful, but not useful in practice. It adds a bunch of
complexity, and not much value. It's best to nuke it. One big advantage
is that it means the target interfaces will soon lose their SLoc arguments
and target queries can never emit diagnostics anymore (yay). Removing this
also simplifies some of the core preprocessor which should make it slightly
faster.
Ted, I didn't simplify TripleProcessor, which can now have at most one
triple, and can probably just be removed. Please poke at it when you have
time.
llvm-svn: 47930
2008-03-05 01:18:20 +00:00
Chris Lattner
028d6d5792
avoid a warning.
...
llvm-svn: 47839
2008-03-03 05:57:43 +00:00
Chris Lattner
184adbfe5b
Find clang headers in the clang headers dir, search it before
...
the system headers dir. This produces an annoying warning:
clang.cpp:883: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object
I'm not sure how to remove it. :(
llvm-svn: 47836
2008-03-03 03:16:03 +00:00
Chris Lattner
c1bc541323
Add support for the CPATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH,
...
OBJC_INCLUDE_PATH, and OBJCPLUS_INCLUDE_PATH environment variables.
Patch by Sam Bishop!
llvm-svn: 47785
2008-03-01 08:07:28 +00:00
Chris Lattner
bb7bc8d4f0
fix an interaction between -isystem . and isysroot.
...
llvm-svn: 47646
2008-02-26 23:46:22 +00:00
Chris Lattner
eb85ab44f2
convert tabs to spaces, patch by Mike Stump!
...
llvm-svn: 47560
2008-02-25 21:04:36 +00:00
Chris Lattner
cb0d62c70d
enable digraphs for C94, thanks to Neil for pointing this out.
...
llvm-svn: 47543
2008-02-25 04:01:39 +00:00
Ted Kremenek
c77f34daad
Modified clang driver option -dump-live-variables to (optionally) use the
...
--analyze-function option to analyze specific functions.
llvm-svn: 47498
2008-02-22 20:13:09 +00:00
Ted Kremenek
88329bf0ea
clang driver options --dump-cfg and --view-cfg now (optionally) use the
...
--analyze-function option to dump/view the CFGs of specific functions.
llvm-svn: 47497
2008-02-22 20:00:31 +00:00
Ted Kremenek
76c03b4a55
When running the GRSimpleVals analysis, skip functions that do not
...
appear in a file.
llvm-svn: 47491
2008-02-22 19:10:58 +00:00
Ted Kremenek
dbb1a3724c
For now, --grsimple skips analyzing functions in header files.
...
llvm-svn: 47303
2008-02-19 02:33:31 +00:00
Ted Kremenek
0f7130adc4
--grsimple now reports the number of nodes in the ExplodedGraph for
...
an analyzed function.
GRExprEngine now records stores to "uninitialized lvalues" (which are sinks in
the ExplodedGraph).
llvm-svn: 47293
2008-02-19 00:22:37 +00:00
Ted Kremenek
86e793937a
Running -grsimple now emits diagnostics about the time spent analyzing each function. Will
...
probably make this a separate command line option later.
Added "--analyze-function" option to the driver to (gradually) allow different
analyses to only be run on specific functions. Currently only --grsimple uses
this option.
llvm-svn: 47285
2008-02-18 21:21:23 +00:00
Eli Friedman
1d88371663
A couple of msvc compile fixes from the ml; I haven't tested with msvc,
...
but the fixes are reasonable.
llvm-svn: 47224
2008-02-16 23:17:23 +00:00
Lauro Ramos Venancio
10984b2ee9
Set Ubuntu 7.10 c++ include path.
...
llvm-svn: 47186
2008-02-15 22:36:38 +00:00
Ted Kremenek
e161afc4dd
Added --grsimple-view option to clang driver; this is the same as
...
--grsimple except that it visualizes the ExplodedGraph using dot and
outputs the current function being analyzed. --grsimple is now silent
except when it emits diagnostics.
llvm-svn: 47146
2008-02-15 00:35:38 +00:00
Ted Kremenek
d3122cb83c
Renamed GRConstants => GRSimpleVals.
...
Moved driver logic for --grsimple to GRSimpleVals.cpp.
llvm-svn: 47137
2008-02-14 22:36:46 +00:00
Steve Naroff
bff738543d
Move policy on unnamed fields (a Microsoft extension) from Parser::ParseStructDeclaration() to the driver.
...
llvm-svn: 46974
2008-02-11 22:40:08 +00:00
Steve Naroff
5a858df0b3
Fix http://llvm.org/bugs/show_bug.cgi?id=2013 .
...
llvm-svn: 46972
2008-02-11 22:17:33 +00:00
Steve Naroff
a369922449
A bunch-o changes to fix <rdar://problem/5716046> incomplete implementation of ObjC class warning is incomplete
...
As part of this fix, I made a low-level change to the text diagnostics machinery (to basically avoid printing duplicate source lines/carets when you have multiple diagnostics that refer to the same exact place). For now, this only happens with we don't have a source range (could be extended to support source ranges as well).
llvm-svn: 46897
2008-02-08 22:06:17 +00:00
Anders Carlsson
5c6c05956e
Put back the top-level asm code; all tests pass now.
...
llvm-svn: 46868
2008-02-08 00:33:21 +00:00
Anders Carlsson
0fae4f56df
Back out 46855 for now, it causes test failures on Darwin.
...
llvm-svn: 46867
2008-02-08 00:23:11 +00:00
Anders Carlsson
bcc3a4bf64
Handle top-level asm declarations.
...
llvm-svn: 46855
2008-02-07 17:19:11 +00:00
Ted Kremenek
d74da0838f
Added proof-of-concept NULL pointer diagnostics to GRConstants.
...
Modified the driver to pass the Diagnostic object to GRConstants.
llvm-svn: 46847
2008-02-07 06:33:19 +00:00
Steve Naroff
b2c80c7c7b
Implement -fms-extensions. This allows us to fuzzy parse non-standard MS constructs used in "windows.h".
...
llvm-svn: 46838
2008-02-07 03:50:06 +00:00
Eli Friedman
1242fff6ec
Make sure to propagate qualifiers through the member operator.
...
llvm-svn: 46830
2008-02-06 22:48:16 +00:00
Chris Lattner
adf1f51fc5
move the codegen ASTConsumer out of the driver into libcodegen,
...
eliminating a bunch of forwarding methods and generally
simplifying things.
llvm-svn: 46792
2008-02-06 02:01:47 +00:00
Chris Lattner
b5eda6253b
pull .ll and .bc writing out of the ASTConsumer destructors into some top
...
level code in clang. This is a cleanup, but does implement "-o" for
-emit-llvm. One effect of this is that "clang foo.c -emit-llvm" will now
emit into foo.ll instead of stdout. Use "clang foo.c -emit-llvm -o -" or
"clang < foo.c -emit-llvm" to get the old behavior.
llvm-svn: 46791
2008-02-06 01:42:25 +00:00
Chris Lattner
8082d870bd
rename ASTSTreamer.{h|cpp} -> ParseAST.{h|cpp}
...
llvm-svn: 46786
2008-02-06 00:23:21 +00:00
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
Ted Kremenek
15ddcef648
Changed -serialize-ast to not create a temporary directory, but instead
...
create a .ast file in the current working directory. This mirrors the behavior
of the -c option for gcc. Later we should add the ability to write the
serialized file anywhere.
llvm-svn: 45004
2007-12-13 17:50:11 +00:00
Chris Lattner
60af5f3b82
Set target data layout info in module.
...
llvm-svn: 45003
2007-12-13 17:34:31 +00:00
Ted Kremenek
ce8d55b087
Implemented -serialize-ast option for the driver. This is not really tested
...
and is a work in progress.
llvm-svn: 44967
2007-12-13 00:37:31 +00:00
Ted Kremenek
8fdd3d95eb
Implemented prototype mode where the driver can operate on serialized ASTs
...
instead of source files.
llvm-svn: 44962
2007-12-12 23:41:08 +00:00
Ted Kremenek
1daa3cfbae
TargetInfo no longer includes a reference to SourceManager.
...
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:
FullLoc.getManager().someMethod(FullLoc.getLocation());
instead we have:
FullLoc.someMethod();
Modified TextDiagnostics (and related classes) to use this short-hand.
llvm-svn: 44957
2007-12-12 22:39:36 +00:00
Ted Kremenek
6f6ff37b04
Moved construction of TargetInfo objects out of the Driver
...
and into the "Basic" library. TargetInfo objects are now
constructed from triples by calling the static method
TargetInfo::CreateTargetInfo.
llvm-svn: 44940
2007-12-12 18:05:32 +00:00
Chris Lattner
30d23e8289
more cleanups changing things like getInstanceVariables to iterators.
...
llvm-svn: 44930
2007-12-12 07:56:42 +00:00
Chris Lattner
31bc07e6cf
resolve some fixmes and clean up some code by eliminating the get*Vars apis to some classes and use iterators instead.
...
llvm-svn: 44927
2007-12-12 07:46:12 +00:00
Chris Lattner
2d39e07112
Simplify some code, don't force the triple to a darwin triple if non-darwin.
...
llvm-svn: 44911
2007-12-12 05:01:48 +00:00
Ted Kremenek
fc095b1669
Moved creation of SourceManager, HeaderSearch, TargetInfo, and LangOptions
...
into the loop that processes input files. These will soon become translation
unit specific (with the exception of LangOptions).
llvm-svn: 44893
2007-12-11 23:28:38 +00:00
Fariborz Jahanian
16e703ade5
80-column please.
...
llvm-svn: 44888
2007-12-11 23:04:08 +00:00
Ted Kremenek
89fbadd3be
Modified the internals of Diagnostic and DiagnosticClient to use
...
SourceManager*'s instead of SourceManager&'s. This allows the client specify a
NULL SourceManager when using a default constructed SourceLocation. Thus the
SourceManager can be NULL when the SourceLocation's isValid() == false.
The interface to most clients of Diagnostic remains the same.
Diagnostic::Report() is overload to either accept a SourceLocation and a
SourceManager&, or neither. Thus clients that do not have a SourceManager
cannot specify a SourceLocation.
Modified TextDiagnostics* to use this new interface.
Modified the driver to not passed in SourceManager when warning about "-I-".
llvm-svn: 44887
2007-12-11 22:57:35 +00:00
Fariborz Jahanian
4e56ed5fab
Implemented rewriting of protocol-qualified global variable types.
...
Re-implemented some of rewriting of protocol-qualified function
argument types to support it in its generality.
llvm-svn: 44886
2007-12-11 22:50:14 +00:00
Ted Kremenek
d4e5fbacab
Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. Now
...
SourceManager is passed by reference, allowing the SourceManager to be
associated with a specific translation unit, and not the entire execution
of the driver.
Modified all users of Diagnostics to comply with this new interface.
Integrated SourceManager as a member variable of TargetInfo. TargetInfo will
eventually be associated with a single translation unit (just like
SourceManager).
Made the SourceManager reference in ASTContext private. Provided accessor
getSourceManager() for clients to use instead. Modified clients to comply with
new interface.
llvm-svn: 44878
2007-12-11 21:27:55 +00:00
Fariborz Jahanian
c86ee9ce90
Refactor Rewritetest::RewriteObjcQualifiedInterfaceTypes in preparation for more
...
general use.
llvm-svn: 44876
2007-12-11 19:56:36 +00:00
Chris Lattner
29a16af8de
properly namespacify.
...
llvm-svn: 44845
2007-12-11 04:36:28 +00:00
Anders Carlsson
895af08562
Move target specific builtin IDs to TargetBuiltins.h so that they can be used by CGBuiltin.cpp
...
llvm-svn: 44748
2007-12-09 23:17:02 +00:00
Chris Lattner
3ed83c1c0f
The flags on tokens indicate whether they are the start of a *physical* line,
...
not the start of a logical line. Be careful about this distinction, which
affects when newlines are printed and when paste-avoidance happens, etc.
This fixes PR1848, thanks to Neil for noticing this!
llvm-svn: 44743
2007-12-09 21:11:08 +00:00
Chris Lattner
84f450789a
Fix a pretty big but subtle bug counting the number of newlines to emit.
...
This would cause us to emit different code (in -E mode) for these two files:
---
#define t(x) x
t(a
3)
---
#define t(x) x
t(a
3)
---
In one case, -E would print "a\n3", in the other it printed "a3". Now
it prints "a3" for both.
This is part of PR1848.
llvm-svn: 44742
2007-12-09 20:45:43 +00:00
Chris Lattner
9c4aad2dba
avoid ///usr/include/foo.h, patch by Sean Middleditch
...
llvm-svn: 44731
2007-12-09 00:39:55 +00:00
Anders Carlsson
050f494f66
Add getTargetPrefix to TargetInfo, to be used with target specific intrinsics.
...
llvm-svn: 44712
2007-12-08 19:32:57 +00:00
Steve Naroff
1f6ed92dbb
Omit the field name when including the super class structure template.
...
This allows us to access a superclasses ivars without deriving the absolute path.
The comments below say a bit more...
llvm-svn: 44688
2007-12-07 22:15:58 +00:00
Fariborz Jahanian
ff6a455c12
Implemented when static typing is combined with protocols and use as receiver
...
type.
llvm-svn: 44685
2007-12-07 21:21:21 +00:00
Fariborz Jahanian
33c0e815f3
Patch for rewriting of @protocol.
...
llvm-svn: 44681
2007-12-07 18:47:10 +00:00
Steve Naroff
b2f8ff153d
Rewrite 'super' within a class method. This required some minor tweaks to the front-end.
...
llvm-svn: 44673
2007-12-07 03:50:46 +00:00
Fariborz Jahanian
227c0d13bc
On Steve's suggestion, moved handling of use of undeclared method in a message
...
to rewriter (my previous patch).
llvm-svn: 44665
2007-12-06 19:49:56 +00:00
Ted Kremenek
260d01d6e6
Subdivided the function InitializeBaseLanguage into InitializeBaseLanguage,
...
GetLanguage, and InitializeLangOptions. The goal is to break up this logic
into atomic units of functionality that can later be refactored into better
driver logic that is capable of handling a mixture of source files of
different languages.
llvm-svn: 44642
2007-12-05 23:49:08 +00:00
Chris Lattner
2ed8f31f2f
Avoid passing Diags into InitializeIncludePaths.
...
llvm-svn: 44639
2007-12-05 23:24:17 +00:00
Ted Kremenek
e095881856
Converted SerializationTest (--test-pickling) to use the new TranslationUnit
...
class to serialize and deserialize translation units.
llvm-svn: 44634
2007-12-05 22:08:43 +00:00
Steve Naroff
ff9f8efe4d
Make sure the class methods get attached to the metaclass object.
...
Need to query the implementation, not the interface...
llvm-svn: 44633
2007-12-05 21:49:40 +00:00
Ted Kremenek
62f4302ec7
Added "TranslationUnit" class that will be used to provide an interface
...
for serializing/deserializing ASTs that is decoupled from the logic
in SerializationTest (which will soon be rewritten to use this interface).
llvm-svn: 44631
2007-12-05 21:36:08 +00:00
Ted Kremenek
dd1a7aade5
Modified: CreateTargetInfo(). Now takes Diagnostic* instead of Diagnostic&.
...
Modified: ctor of SerializationTest: Now takes LangOptions argument. We
will eventually serialize this as well.
llvm-svn: 44630
2007-12-05 21:34:36 +00:00
Chris Lattner
36021a9cc1
I'm apparently the only sad lonely ppc user left :)
...
llvm-svn: 44622
2007-12-05 18:41:05 +00:00
Ted Kremenek
a4c13bd94b
Moved creation of ASTConsumers that can operate on both freshly-parsed and
...
deserialized ASTs into the function CreateASTConsumer(). This function
is called by ProcessInputFile, and soon the logic that processes deserialized
ASTs.
llvm-svn: 44618
2007-12-05 18:27:04 +00:00