Commit Graph

96 Commits

Author SHA1 Message Date
Richard Smith 86a3ef5b03 Add -frewrite-imports flag.
If specified, when preprocessing, the contents of imported .pcm files will be
included in preprocessed output. The resulting preprocessed file can then be
compiled standalone without the module sources or .pcm files.

llvm-svn: 305116
2017-06-09 21:24:02 +00:00
David Blaikie 0aaa7625e1 unique_ptrify createDriverOptTable
llvm-svn: 291919
2017-01-13 17:34:15 +00:00
Richard Smith bbcc9f0462 C++ Modules TS: add frontend support for building pcm files from module
interface files. At the moment, all declarations (and no macros) are exported,
and 'export' declarations are not supported yet.

llvm-svn: 279794
2016-08-26 00:14:38 +00:00
Gabor Horvath c430990d0b [analyzer] Command line option to show enabled checker list.
This patch adds a command line option to list the checkers that were enabled
by analyzer-checker and not disabled by -analyzer-disable-checker.

It can be very useful to debug long command lines when it is not immediately
apparent which checkers are turned on and which checkers are turned off.

Differential Revision: https://reviews.llvm.org/D23060

llvm-svn: 278006
2016-08-08 13:41:04 +00:00
John Brawn 6c78974b29 Make it possible for AST plugins to enable themselves by default
Currently when an AST plugin is loaded it must then be enabled by passing
-plugin pluginname or -add-plugin pluginname to the -cc1 command line. This
patch adds a method to PluginASTAction which allows it to declare that the
action happens before, instead of, or after the main AST action, plus the
relevant changes to make the plugin action happen at that time automatically.

Differential Revision: http://reviews.llvm.org/D17959

llvm-svn: 263546
2016-03-15 12:51:40 +00:00
NAKAMURA Takumi d8cd060422 Revert r260265, "clang-cl: Support loading plugins on Windows"
It causes memory exhaust on mingw-w64(x64). Investigating.

llvm-svn: 260536
2016-02-11 16:33:20 +00:00
Ehsan Akhgari 75b3a4b507 clang-cl: Support loading plugins on Windows
This builds on the support being added to LLVM to import and export
registries from DLLs.  This will allow us to pick up the registry
entries added in the DLL's copy of FrontendPluginRegistry.

This will allow us to use plugins on Windows using:
$ clang-cl -Xclang -load -Xclang plugin.dll \
           -Xclang -add-plugin -Xclang foo

llvm-svn: 260265
2016-02-09 19:43:11 +00:00
Argyrios Kyrtzidis d35e98fa91 [Frontend] Make the memory management of FrontendAction pointers explicit by using unique_ptr.
llvm-svn: 260048
2016-02-07 19:28:36 +00:00
Chris Bieneman 2bf68c6c1c Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

    "This is the way [autoconf] ends
    Not with a bang but a whimper."
    -T.S. Eliot

Reviewers: chandlerc, grosbach, bob.wilson, echristo

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D16472

llvm-svn: 258862
2016-01-26 21:30:40 +00:00
David Blaikie a97eaa1bc0 Provide a BuryPointer for unique_ptrs.
In theory, it'd be nice if we could move to a case where all buried
pointers were buried via unique_ptr to demonstrate that the program had
finished with the value (that we could really have cleanly deallocated
it) but instead chose to bury it.

I think the main reason that's not possible right now is the various
IntrusiveRefCntPtrs in the Frontend, sharing ownership for a variety of
compiler bits (see the various similar
"CompilerInstance::releaseAndLeak*" functions). I have yet to figure out
their correct ownership semantics - but perhaps, even if the
intrusiveness can be removed, the shared ownership may yet remain and
that would lead to a non-unique burying as is there today. (though we
could model that a little better - by passing in a shared_ptr, etc -
rather than needing the two step that's currently used in those other
releaseAndLeak* functions)

This might be a bit more robust if BuryPointer took the boolean:

BuryPointer(bool, unique_ptr<T>)

and the choice to bury was made internally - that way, even when
DisableFree was not set, the unique_ptr would still be null in the
caller and there'd be no chance of accidentally having a different
codepath where the value is used after burial in !DisableFree, but it
becomes null only in DisableFree, etc...

llvm-svn: 216742
2014-08-29 16:53:14 +00:00
Alp Toker 0621cb2e7d Make clang's rewrite engine a core feature
The rewrite facility's footprint is small so it's not worth going to these
lengths to support disabling at configure time, particularly since key compiler
features now depend on it.

Meanwhile the Objective-C rewriters have been moved under the
ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still
potentially worth excluding from lightweight builds.

Tests are now passing with any combination of feature flags. The flags
historically haven't been tested by LLVM's build servers so caveat emptor.

llvm-svn: 213171
2014-07-16 16:48:33 +00:00
Craig Topper 236bde3d6f [C++11] Use 'nullptr'.
llvm-svn: 209612
2014-05-26 06:21:51 +00:00
Argyrios Kyrtzidis d4d5534034 [objcmt] Don't wrap a PCH generation action with a ObjCMigrateAction one, it messes up the PCH file.
rdar://16941811

llvm-svn: 209059
2014-05-17 04:35:12 +00:00
Chandler Carruth 81f9e02ef3 [leaks] Don't leak the fake arguments we synthesize for LLVM option
parsing.

llvm-svn: 207899
2014-05-03 08:39:35 +00:00
Ahmed Charles b89843299a Replace OwningPtr with std::unique_ptr.
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.

llvm-svn: 203279
2014-03-07 20:03:18 +00:00
Ahmed Charles 9a16beb8bc Change OwningPtr::take() to OwningPtr::release().
This is a precursor to moving to std::unique_ptr.

llvm-svn: 203275
2014-03-07 19:33:25 +00:00
NAKAMURA Takumi 9698686505 [CMake] Use LINK_LIBS instead of target_link_libraries().
llvm-svn: 202238
2014-02-26 06:41:29 +00:00
NAKAMURA Takumi e842e4b2f1 [CMake] Resurrect mis-dropped dependency to ClangDriverOptions since r201842.
llvm-svn: 201978
2014-02-23 13:44:09 +00:00
NAKAMURA Takumi 7da9487dd4 [CMake] Get rid of explicit dependencies to include/clang/*.inc and introduce CLANG_TABLEGEN_TARGETS.
This does;
  - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list.
  - List of targets is added to LLVM_COMMON_DEPENDS.
  - all clang libraries and targets depend on generated headers.

You might wonder this would be regression, but in fact, this is little loss.
  - Almost all of clang libraries depend on tblgen'd files and clang-tblgen.
  - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild.
  - Each library's dependencies to tblgen'd files might vary along headers' structure.
    It made hard to track and update *really optimal* dependencies.

Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS.

llvm-svn: 201842
2014-02-21 07:59:59 +00:00
Ben Langmuir 2cb4a78f93 Add a CC1 option -verify-pch
This option will:
- load the given pch file
- verify it is not out of date by stat'ing dependencies, and
- return 0 on success and non-zero on error

llvm-svn: 200884
2014-02-05 22:21:15 +00:00
Kostya Serebryany ce2c726e99 Bury leaked pointers in a global array to silence a leak detector in --disable-free mode
Summary:
This is an alternative to http://llvm-reviews.chandlerc.com/D2475
suggested by Chandler.

Reviewers: chandlerc, rnk, dblaikie

CC: cfe-commits, earthdok

Differential Revision: http://llvm-reviews.chandlerc.com/D2478

llvm-svn: 198073
2013-12-27 08:11:08 +00:00
NAKAMURA Takumi ebde2aef9f [CMake] clang/lib: Prune redundant dependencies.
llvm-svn: 196864
2013-12-10 02:36:22 +00:00
NAKAMURA Takumi 65d42bcc2b [CMake] clang/lib: Satisfy dependencies to add *actually used* libraries on target_link_libraries() and LLVM_LINK_COMPONENTS.
I will prune redundant dependencies later.

llvm-svn: 196800
2013-12-09 19:04:43 +00:00
Alp Toker ba294d73a1 Bring back a StringRef used in some build configurations
This was removed in the great unused local cleanup of r195814.

Adding cast-to-void to suppress unused variable warnings.

Should fix certain builds like ARCMT.

llvm-svn: 195872
2013-11-27 19:44:04 +00:00
Alp Toker 965f882588 Remove a whole lot of unused variables
There are about 30 removed in this patch, generated by a new FixIt I haven't
got round to submitting yet.

llvm-svn: 195814
2013-11-27 05:22:15 +00:00
Argyrios Kyrtzidis 7a2645f91f [objcmt] If the frontend option is frontend::MigrateSource then we don't need to create
the arcmt wrappers.

llvm-svn: 194627
2013-11-13 23:38:17 +00:00
Richard Smith fee2c8d814 Remove -ast-dump-xml.
llvm-svn: 192131
2013-10-07 20:56:34 +00:00
Fariborz Jahanian 182486c9d9 Objective-C migrator. Simplify migrator option
processing in preparation for adding several more
options. // rdar://15003157

llvm-svn: 191842
2013-10-02 17:08:12 +00:00
Fariborz Jahanian 55d6e6c930 ObjectiveC migrator. This patch infers readonly properties for no-parameter
instance methods returning non-void. This will be quite noisy. So, it is 
placed under a new migrator flag -objcmt-migrate-readonly-property.

llvm-svn: 189537
2013-08-28 23:22:46 +00:00
Jordan Rose a1e4b12223 Fix dependencies now that the ARC migrator depends on the static analyzer.
Thanks for pointing this out, Stephen. I think this is right now -- I
attempted to try all four valid combinations with both the autoconf and
CMake builds.

See also LLVM changes to the configure script.

llvm-svn: 189027
2013-08-22 15:50:02 +00:00
Rafael Espindola 958297dabf Indicate success for simple options when clang called with -cc1.
Patch by David Wiberg.

llvm-svn: 187888
2013-08-07 12:54:47 +00:00
Fariborz Jahanian d83ef848bd ObjC migrator: Add -objcmt-migrate-property to do property
migration. Also, fixes an old bug where older migration 
flags were not being checked for properly.

llvm-svn: 185948
2013-07-09 16:59:14 +00:00
Jordan Rose b8859f6791 With CLANG_ENABLE_STATIC_ANALYZER=0, link clang properly and skip clang-check.
Previously, the CMake build still tried to link clang against the static
analyzer libraries, even if CLANG_ENABLE_STATIC_ANALYZER was off.
Furthermore, clang-check depends on the analyzer, so it should be disabled
(in both CMake and configure builds).

In theory, clang-check could be made to conditionally include analyzer
support (like clang itself), but for now this at least gets a CMake ALL_BUILD
working.

Patch by Stephen Kelly, modified by me.

llvm-svn: 185548
2013-07-03 16:20:29 +00:00
Reid Kleckner 898229ab4b [Driver] Refactor clang driver to use LLVM's Option library
The big changes are:
- Deleting Driver/(Arg|Opt)*
- Rewriting includes to llvm/Option/ and re-sorting
- 'using namespace llvm::opt' in clang::driver
- Fixing the autoconf build by adding option everywhere

As discussed in the review, this change includes using directives in
header files.  I'll make follow up changes to remove those in favor of
name specifiers.

Reviewers: espindola

Differential Revision: http://llvm-reviews.chandlerc.com/D975

llvm-svn: 183989
2013-06-14 17:17:23 +00:00
Douglas Gregor bf7fc9c542 <rdar://problem/13509689> Introduce -module-file-info option that provides information about a particular module file.
This option can be useful for end users who want to know why they
ended up with a ton of different variants of the "std" module in their
module cache. This problem should go away over time, as we reduce the
need for module variants, but it will never go away entirely.

llvm-svn: 178148
2013-03-27 16:47:18 +00:00
Sean Silva aa73d02032 use early returns to simplify and de-nest
llvm-svn: 171654
2013-01-06 07:49:41 +00:00
Roman Divacky d93c8c008e Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the user
specifies not to. Dont build ASTMatchers with Rewriter disabled and
StaticAnalyzer when it's disabled.

Without all those three, the clang binary shrinks (x86_64) from ~36MB
to ~32MB (unstripped).

llvm-svn: 170135
2012-12-13 16:09:42 +00:00
Chandler Carruth 3a02247dc9 Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

llvm-svn: 169237
2012-12-04 09:13:33 +00:00
Richard Smith e70ed8690f PR14303: Add a NoDriverOption flag to those options which are not accepted by
the driver (the options defined in CC1Options.td) and exclude their help from
"clang --help".

llvm-svn: 167638
2012-11-09 22:36:44 +00:00
Ted Kremenek cdf814900d Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.
This is similar to how we divide up the StaticAnalyzer libraries to separate
core functionality to what is clearly associated with Frontend actions.

llvm-svn: 163050
2012-09-01 05:09:24 +00:00
Ted Kremenek 40ea0eaaa1 Make AnalyzerOptions a shared object between CompilerInvocation and
AnalysisManager, allowing the StringMap of configuration values to
be propagated.

llvm-svn: 162978
2012-08-31 04:36:05 +00:00
Alexander Kornienko 4de035947b Added -ast-list option to dump filterable AST decl node names.
llvm-svn: 161040
2012-07-31 09:37:40 +00:00
NAKAMURA Takumi 836926dbdf clang/lib: [CMake] Update tblgen'd dependencies.
llvm-svn: 160851
2012-07-27 06:18:33 +00:00
Chandler Carruth 28969b4139 Remove a goofy CMake hack and use the standard CMake facilities to
express library-level dependencies within Clang.

This is no more verbose really, and plays nicer with the rest of the
CMake facilities. It should also have no change in functionality.

llvm-svn: 158888
2012-06-21 01:30:21 +00:00
David Blaikie e993e4cd9b Support -frewrite-includes as an option while preprocessing.
llvm-svn: 158460
2012-06-14 17:36:09 +00:00
David Blaikie d5321247c4 Add a -rewrite-includes option, which is similar to -rewrite-macros, but only expands #include directives.
Patch contributed by Lubos Lunak (l.lunax@suse.cz).
Review by Matt Beaumont-Gay (matthewbg@google.com).

llvm-svn: 158093
2012-06-06 18:52:13 +00:00
Andrew Trick d4cfa2fe4c Fix cmake. Remaining two ClangCC1Options deps.
llvm-svn: 155977
2012-05-02 05:31:31 +00:00
James Molloy a3c85b8629 Unify Options.td and CC1Options.td, in a first step towards unifying the serialization logic in Frontend and Driver.
Reviewed by Eric, Doug and Chandler, and here: http://llvm.org/reviews/r/7/

llvm-svn: 155916
2012-05-01 14:57:16 +00:00
Douglas Gregor adfb842fc1 Remove the -cc1-level option "-pubnames-dump". Such things should stay
out of the tree and use the tooling infrastructure.

llvm-svn: 154668
2012-04-13 16:03:00 +00:00
Douglas Gregor 41ab2899b2 Introduce a -cc1-level option -pubnames-dump, which simply dumps the
list of identifiers that that 'public' names at the end of the
translation unit, e.g., defined macros or identifiers with top-level
names, in sorted order. Meant to support <rdar://problem/10921596>.

llvm-svn: 153522
2012-03-27 18:06:49 +00:00