Граф коммитов

287 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek c2e7299f26 Add "-token-cache" option for using pretokenized cache files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60440 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 19:57:31 +00:00
Daniel Dunbar c1571453de Add LangOptions marker for assembler-with-cpp mode and use to define
__ASSEMBLER__ properly. Patch from Roman Divacky (with minor
formatting changes). Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60362 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 18:55:22 +00:00
Douglas Gregor 5fd5468af4 Enable blocks in C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60361 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 18:34:47 +00:00
Douglas Gregor cb7de523cc Implement implicit conversions for Objective-C specific types, e.g.,
converting a pointer to one Objective-C interface into a pointer to another
Objective-C interface, and conversions with 'id'. The semantics seems
to match GCC, although they seem somewhat ad hoc.

Fixed a few cases where we assumed the C++ definition of isObjectType,
but were getting the C definition, causing failures in trouble with
conversions to void pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60130 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 23:31:11 +00:00
Zhongxing Xu 2092236777 Add plugin loading for clang. This will be used to load alternative constraint manager for static analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60091 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 05:23:17 +00:00
Ted Kremenek 3f0850e6f2 reverting this because it breaks some blocks cases, I'll send doug a testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59850 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 01:04:48 +00:00
Douglas Gregor dc518e2a0f Don't turn off blocks in C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 17:10:06 +00:00
Chris Lattner a03a5b5a84 switch TextDiagnosticPrinter to raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59597 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 06:56:25 +00:00
Chris Lattner 5917fe1189 remove a helper method with only one call site.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59495 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 05:05:28 +00:00
Daniel Dunbar d68ba0ee18 Move backend output out of destructor.
Don't free AST consumer when --disable-free is set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 06:35:39 +00:00
Ted Kremenek 4fc82c8458 Hook up the Plist diagnostic client to the driver.
Fix Plist output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58652 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 23:18:07 +00:00
Ted Kremenek ad99dbfc1d Rename 'HTMLDiagnostics.h' to 'PathDiagnosticClients.h'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58646 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 22:31:48 +00:00
Daniel Dunbar dd913e5576 Turn off module verification in Release-Asserts builds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58500 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 09:34:21 +00:00
Daniel Dunbar e10b0f236b "One" line fix for -parse-noop failure, "id" and several other things
were being treated as type names for non-Objective-C files.
 - Other lines are just because MinimalAction didn't have access to
   the LangOptions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58498 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 08:56:51 +00:00
Daniel Dunbar ac7ffe0102 Improve llvm-gcc compatibility, -Os implies -O2 (sortof).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58374 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29 07:56:11 +00:00
Daniel Dunbar 8e8f3b7f61 Choose CompileOptions (optimization passes) to match llvm-gcc more
closely.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58361 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29 03:42:18 +00:00
Chris Lattner 1b450b092a .s files don't require the preprocessor, patch by Roman Divacky!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 20:33:42 +00:00
Daniel Dunbar 524b86f03f Call llvm_shutdown() on (normal) termination. This makes --time-passes usable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58308 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-28 00:38:08 +00:00
Daniel Dunbar 276373df8c With -verify, only exit early on failure.
- Nice if -verify test exercise the various cleanup functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58285 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 22:10:13 +00:00
Daniel Dunbar 879c3eaab7 Remove unneeded CheckASTConsumer function.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 22:03:52 +00:00
Ted Kremenek 9a30c2474f Use string literal for format string specifier; this prevents ErrMsg from being interpretted as a format string specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25 20:19:34 +00:00
Daniel Dunbar 750c358049 Add initial dependency file generation support. Patch by Kovarththanan
Rajaratnam, with some updates and formatting changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58122 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24 22:12:41 +00:00
Ted Kremenek 95c7b00fe8 Make the analyzer store (memory model) a command line option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58056 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24 01:04:59 +00:00
Ted Kremenek 7cae2f64a7 Added driver option "-cxx-inheritance-view" for viewing the C++ hierarchy of a class in GraphViz.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58051 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-23 23:36:29 +00:00
Daniel Dunbar 70f92436f5 Add -O[0-3s] support (following llvm-gcc).
- Passes match llvm-gcc but many of the switches aren't wired.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58034 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-23 05:50:47 +00:00
Chris Lattner a778d7d973 Add support for assembler-with-cpp (preprocessed .S files), patch by
Roman Divacky!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57988 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-22 17:29:21 +00:00
Daniel Dunbar d69bacc399 [LLVM up] Add basic -S option to clang.
- Split backend related consumer out into Backend.cpp, replaces
   LLVMCodeGenWriter.
 - Structure follows llvm-gcc to some extent.
 - Still need to implement all the options which impact code
   generation and the optimization passes which llvm-gcc uses at
   various levels.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57936 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21 23:49:24 +00:00
Steve Naroff fe6b0dc94a Fix <rdar://problem/6261178> clang-on-xcode: [sema] multiple method warning is over enthusiastic.
Fix <rdar://problem/6265257> warnings for ambiguous message send swamp other warnings.

Reworked Sema::MatchTwoMethodDeclarations() to optionally match based on method size and alignment (the default in GCC). Changed Sema::LookupInstanceMethodInGlobalPool() to use this feature.

Added -Wno-struct-selector-match to driver, however didn't hook it up yet. Added a FIXME that says this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57898 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21 10:37:50 +00:00
Ted Kremenek 8588896b47 Added the start of a prototype implementation of PCH based on token caching.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57863 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21 00:54:44 +00:00
Daniel Dunbar d3db401518 Add --disable-free flag to clang.
- Disables the freeing of the ASTContext and the TranslationUnit
   after parsing & sema.
 - Primarily for timing the impact on -fsyntax-only timings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57643 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 16:54:18 +00:00
Chris Lattner b13c5eef36 Add a new -rewrite-test option, which is basically a
playground to experiment with some new rewriter approaches. For now
it is probably the most complex version of 'cat' ever invented.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 05:29:20 +00:00
Chris Lattner c106c106c6 Add a new -dump-raw-tokens option, which allows us to see raw tokens.
Rename -dumptokens to -dump-tokens.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 05:03:36 +00:00
Daniel Dunbar 0b0ee502fc Disable blocks support in C++ mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-10 00:20:52 +00:00
Daniel Dunbar 68c59184ee Allow -verify to be used with -rewrite-macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05 01:38:39 +00:00
Daniel Dunbar b0adbba45c Set exit code properly on "Unexpected program action".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57080 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-04 23:42:49 +00:00
Daniel Dunbar e553a726fa (llvm up) If the target triple is unspecified, automatically set the
OS version part to that of the host on darwin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56943 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 01:21:33 +00:00
Daniel Dunbar 14bfdfec4e Drop code to validate OS part of target triple on darwin, too fragile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56941 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 00:26:24 +00:00
Daniel Dunbar 320a054acf Fix help for --suppress-system-warnings
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 20:49:53 +00:00
Chris Lattner 079f2c467d Handle minor version numbers in __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
like "10.3.9"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 20:30:12 +00:00
Chris Lattner ba0f25f754 Finish handling of -mmacosx-version-min. If you now do something like:
clang -mmacosx-version-min=10.4.9 ...

you'll end up with a target triple like "i686-apple-darwin8.9".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56871 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 20:16:56 +00:00
Chris Lattner 6a30c1fc7f start handling 'mmacosx-version-min', this is not complete yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56828 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 01:13:12 +00:00
Steve Naroff 1318895690 Add driver support for invoking block rewriter.
Also tweaked the create function to take an explicit output file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-18 14:10:13 +00:00
Daniel Dunbar 2fe0997427 Add --suppress-system-warnings (on by default, use =0 to disable)
- For investigating warnings in system headers / builtins.
 - Currently also enables the behavior that allows silent redefinition
   of types in system headers. Conceptually these are separate but I
   didn't feel it was worth two options (or changing LangOptions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56163 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-12 18:10:20 +00:00
Argyrios Kyrtzidis d146552a1e LangOptions.C99 should be false in C++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-11 04:21:06 +00:00
Ted Kremenek ea644d8440 Following gcc's behavior, only enable trigraphs if '-trigraphs' or '-ansi' is
specified, or -std is set to a conforming mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55738 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-03 21:22:16 +00:00
Ted Kremenek f8ce6991f4 Added Ubigraph visualization for the static analyzer (this is pretty alpha quality).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55442 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-27 22:31:43 +00:00
Zhongxing Xu 8148839c10 Moved HTMLDiagnostics to lib/Driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55274 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-24 02:33:36 +00:00
Daniel Dunbar dcb4a1a6dd Add TargetInfo::useNeXTRuntimeAsDefault
- Used to autoselect runtime when neither -fnext-runtime nor
   -fgnu-runtime is specified.
 - Default impl is false, all darwin targets set it to true.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55231 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 08:43:39 +00:00
Nico Weber 0fca022d77 Move most of HeaderSearch initialization to libDriver.
For example, adding the default system include paths in clients is now as
simple as

  InitHeaderSearch init(headers);
  init.AddDefaultSystemIncludePaths(langopts);
  init.Realize();



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55174 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 09:25:22 +00:00
Daniel Dunbar f77ac86f4e Add LangOptions::NeXTRuntime.
- Wired to -fnext-runtime and -fgnu-runtime options.
 - Defaults to GNU, no autoselection for NeXT.

Emit NeXT OBJC_IMAGE_INFO marker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54651 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 21:35:06 +00:00
Daniel Dunbar 6379a7a153 Add -fexceptions to Driver
- Maps to LangOptions.Exceptions
 - Currently always off, should autoselect based on language.

Update CodeGen to set unwind attribute on functions definitions based
       on LangOptions.Exceptions.
 - Still need to set attributes appropriately on calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54643 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 17:36:14 +00:00
Daniel Dunbar e91593ef08 More #include cleaning
- Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
   SourceLocation.h)
 - Move ASTContext constructor into implementation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54627 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 04:54:23 +00:00
Nico Weber 7bfaaaecb3 * Remove isInSystemHeader() from DiagClient, move it to SourceManager
* Move FormatError() from TextDiagnostic up to DiagClient, remove now  
  empty class TextDiagnostic
* Make DiagClient optional for Diagnostic

This fixes the following problems:

* -html-diags (and probably others) does now output the same set of  
  warnings as console clang does
* nothing crashes if one forgets to call setHeaderSearch() on  
  TextDiagnostic
* some code duplication is removed




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 19:59:06 +00:00
Ted Kremenek 7e7e6253d4 ParseAST now never releases the passed ASTConsumer. This is the responsibility of the client.
The motivation is that clients may either:

(a) query the ASTConsumer object after AST parsing to collect data/etc.
(b) reuse the ASTConsumer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54502 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 02:46:37 +00:00
Ted Kremenek 57134339c8 Remove unneeded #includes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54478 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 18:14:04 +00:00
Ted Kremenek 7a08e289b2 Micro cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 18:13:12 +00:00
Ted Kremenek b4398aa27d Fix --html-diags in driver by delaying the construction of an HTMLDiagnosticClient until after we have created the Preprocessor object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54472 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 17:49:57 +00:00
Nico Weber fd54ebcaaf add a libDriver, for now only move the text diangostics stuff from Driver to there
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54383 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 23:33:20 +00:00
Ted Kremenek 815c78fd9a Refactored driver logic for CodeGen into LLVMCodeGenWriter. This ASTConsumer layers on top of LLVMCodeGen (another existing ASTConsumer) to emit bitcode files to disk. This layering takes this logic out of clang.cpp and puts it directly into the ASTConsumer interface. The benefit is that now --emit-llvm works with both serialized ASTs and regular source files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54364 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 18:50:11 +00:00
Ted Kremenek 1683360500 "This patch adds paths for Fedora 9 in clang.cpp and support for two preprocessor options in ccc."
Patch by Zhongxing Xu!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53976 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-24 03:49:15 +00:00
Daniel Dunbar c8aeb655c3 Prevent clang from emitting output when input has errors
+ test case
<rdar://problem/6080040>
http://llvm.org/bugs/show_bug.cgi?id=2280


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53756 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 16:38:05 +00:00
Ted Kremenek f7f3c20a5d Provide an "Analysis Scope" for Analyses so checks can either be run on code declarations (bodies) or Objective-C @implementation blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53584 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-15 00:46:02 +00:00
Ted Kremenek fb9a48cf5e Break off declaration of Analysis enum into Analyses.def. The driver options in
clang.cpp now #include these definitions to create the command line options, and
AnalysisConsumer #includes this file to generate the switch statement to create
actions.

Renamed -check-objc-methodsigs to -warn-objc-methodsigs.

The "missing -dealloc" check is now optional: -warn-objc-missing-dealloc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53575 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 23:41:13 +00:00
Ted Kremenek 0d8019e55c Add new check: -check-objc-methodsigs. This check scans methods in
ObjCImplementationDecls and sees if a ancestor class defines a method with the
same selector but with a different type signature. Right now it just compares
return types, and mainly looks at differences in primitive values. The checking
will be expanded in the future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53482 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 22:40:47 +00:00
Nuno Lopes 68bf387296 add gentoo stable gcc headers path so that all tests pass here (CPATH isnt enough..)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 17:15:18 +00:00
Ted Kremenek 902141f74a Moved logic for -dump-cfg and -view-cfg into AnalysisConsumer.
Renamed -dump-cfg to -cfg-dump, and -view-cfg to -cfg-view.  This naming better matches the same options for asts (e.g. -ast-dump).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53041 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 18:23:21 +00:00
Ted Kremenek 235e031e84 Move -dump-live-variables logic to AnalysisConsumer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53039 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 18:11:29 +00:00
Ted Kremenek bc46f34583 Move logic for "-checker-simple" to the new AnalysisConsumer interface.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53028 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 16:35:50 +00:00
Ted Kremenek b35a74a40c Migrated driver logic for running the CF retain/release checker over to the new AnalysisConsumer interface.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53002 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 00:44:58 +00:00
Ted Kremenek f4381fddf1 Added AnalysisConsumer, a meta-level ASTConsumer class to drive various
analyses. This potentially is the primordial origins of a Clang-equivalent
"PassManager".

The new AnalysisConsumer interface allows multiple analyses to be run from a
single invocation of Clang.

Migrated the logic of "-warn-dead-stores" and "-warn-uninit-values" to use the
new AnalysisConsumer interface. The new interface results in a significant code
reduction to incorporate an analysis into the Driver.

Updated a test case to (correctly) acknowledge that it contains a dead store
(this check wasn't being performed because it was previously masked by
-warn-uninit-values).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52996 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-02 00:03:09 +00:00
Matthijs Kooijman e9484fc09a Make clang work on 32 bit powerpc linux.
Patch by Nick Lewycky!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52777 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 08:39:30 +00:00
Ted Kremenek d88fb6c424 Patch by Anders Bergh:
'There's not much to say about this patch, it just adds the Arch Linux
gcc 4.3.1 header paths for i686 and amd64. The patch was generated
using "svn diff" with clang at revision 52660. The paths aren't
distribution-specific, so they should work for all Linux distributions
using the default(?) names like "i686-pc-linux-gnu".'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52665 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 03:33:47 +00:00
Argyrios Kyrtzidis 14d4140de1 Allow -parse-noop -verify options to be used together.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52249 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-13 12:15:34 +00:00
Ted Kremenek c0c03bc3c4 Use a common SourceManager when processing multiple files. This allows us to cache the contents of source files already loaded from disk.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52066 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 22:42:39 +00:00
Ted Kremenek c68ecb5724 Fix crash when running with multiple source files. This can be improved.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52032 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 01:47:30 +00:00
Ted Kremenek e7d07d1136 Moved LangOptions from TranslationUnit to ASTContext. This induced a variety of cleanups in some ASTConsumers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51943 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 15:55:15 +00:00
Ted Kremenek f372111960 Correctly preserve the order between -F and -I options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51803 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 00:27:00 +00:00
Ted Kremenek 358256def0 Use llvm:🆑:desc for description of the -Wimplicit-function-declaration option.
Patch by Holger Schurig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51774 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 16:42:02 +00:00
Chris Lattner 5b4681c8ef Implement support for -w, which silences all warnings. PR2384.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51683 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 15:36:45 +00:00
Ted Kremenek 1d3cce3e1c Update driver include paths to work on darwin10.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51431 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 15:26:22 +00:00
Chris Lattner 0951052064 make #if 0 code compile, even though it still isn't very useful.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50920 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 22:43:24 +00:00
Sanjiv Gupta e8b9f5b8ea 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50848 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 08:54:20 +00:00
Sanjiv Gupta 56cf96b3ea Remove the ending "." from clang options descriptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50847 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 08:28:14 +00:00
Chris Lattner b57e3d47c3 start implementation of a macro rewriter, this is currently just stubbed out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50845 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 06:52:13 +00:00
Chris Lattner 37d1084efc Add support for -Wimplicit-function-declaration, rdar://5907433
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50672 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05 21:18:06 +00:00
Chris Lattner 8aedf199e9 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50633 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-04 23:52:02 +00:00
Ted Kremenek e5c30122ca 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 05:13:59 +00:00
Ted Kremenek 01d9dbf4ae Add -fobjc-gc and -fobjc-gc-only options to the driver.
Add corresponding enum in LangOptions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50387 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 04:37:03 +00:00
Ted Kremenek c1e9dea3d9 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50149 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 16:25:39 +00:00
Chris Lattner 51574ea138 simplify the return of InitializePreprocessor to be bool instead of a fileid
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49974 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 23:25:44 +00:00
Chris Lattner aa39197431 simplify ownership of the predefines buffer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49973 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 23:09:31 +00:00
Ted Kremenek 339b9c2775 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49875 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-17 22:31:54 +00:00
Ted Kremenek a42cf2e309 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-17 21:38:34 +00:00
Ted Kremenek a760f5f7dc Added fixme.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49797 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 16:53:18 +00:00
Ted Kremenek 47abe76904 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49796 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 16:39:56 +00:00
Chris Lattner 3245a0a1c7 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 :).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49778 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 06:11:58 +00:00
Chris Lattner 8ac661c3c5 Add -o support for -emit-html, make it not produce a file on an error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49777 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 05:21:09 +00:00
Ted Kremenek fdbe6799ca Remove "--html-test" driver option and its corresponding code; all of this
functionality has been migrated into "--emit-html" and "--html-diags".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49776 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 04:38:45 +00:00
Steve Naroff b29b427fa9 Rename RewriteTest->RewriteObjC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49692 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 22:03:09 +00:00
Ted Kremenek 55af98c10a Added driver option "-checker-opt-analyze-headers" to force the static
analyzer to analyze functions declared in header files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49675 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 18:40:58 +00:00