Commit Graph

699 Commits

Author SHA1 Message Date
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. & -> &amp;) 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