[PATCH] Header dependencies support for modularize

Thompson, John John_Thompson at playstation.sony.com
Wed Aug 21 05:48:29 PDT 2013


Sean,

(Sorry for the delay in getting back to you, I had a fire to put out elsewhere.)

>Is there no better way to do this? I think libOption should expose the info you need.

This would seem to have a prerequisite that ClangTooling have a OptTable somewhere, but there doesn't seem to be a connection.

Now let's suppose I get past that hurdle, either by creating one myself and somehow coercing it to parse the arguments given to ArgumentsAdjuster, how do I use libOption to walk the arguments and figure out which command-line argument is the source file?

Ideally, tooling should have a mechanism to tell me what the source file or files are for each command line in the compilation database.  I had a much simpler version, but it required I modify ArgumentsAdjuster to be given the source file, which the caller had handy, but I couldn't get that change through.

Could someone associated with tooling lend a hand and tell me how to get the input file from the command lines in the compilation database?

Otherwise, let's live with the less-than-perfect solution so I can go on to more important things.

Thanks.

-John


From: Sean Silva [mailto:silvas at purdue.edu]
Sent: Friday, August 16, 2013 10:59 PM
To: Thompson, John
Cc: cfe-commits at cs.uiuc.edu
Subject: Re: [PATCH] Header dependencies support for modularize

+// The most common (but not all) options to modularize that take
+// an argument in the following slot.
+// Note: This needs to be kept in sync with new or removed Clang arguments.
+// But hopefully modularize users won't need too many of these
+// kinds of arguments.
+const char *AddDependenciesAdjuster::OptionsWithArgument[] = {

Is there no better way to do this? I think libOption should expose the info you need.

-- Sean Silva

On Fri, Aug 16, 2013 at 8:42 AM, Thompson, John <John_Thompson at playstation.sony.com<mailto:John_Thompson at playstation.sony.com>> wrote:
A quick review anyone?

Thanks.

-John

-----Original Message-----
From: cfe-commits-bounces at cs.uiuc.edu<mailto:cfe-commits-bounces at cs.uiuc.edu> [mailto:cfe-commits-bounces at cs.uiuc.edu<mailto:cfe-commits-bounces at cs.uiuc.edu>] On Behalf Of John Thompson
Sent: Tuesday, August 13, 2013 11:11 AM
To: john.thompson.jtsoftware at gmail.com<mailto:john.thompson.jtsoftware at gmail.com>
Cc: cfe-commits at cs.uiuc.edu<mailto:cfe-commits at cs.uiuc.edu>
Subject: [PATCH] Header dependencies support for modularize
In using modularize to check a large group of platform headers for modules-readiness, I found that a few headers had dependencies, such that they required other headers to be included first to avoid compile errors on missing definitions.

This patch adds support to modularize to allow specifying depended-on headers in the header file list input to modularize, i.e.

header.h: dependency1.h dependency2.h


http://llvm-reviews.chandlerc.com/D1383

Files:
  test/modularize/NoProblemsDependencies.modularize
  test/modularize/Inputs/SomeOtherTypes.h
  test/modularize/Inputs/IsDependent.h
  modularize/Modularize.cpp
_______________________________________________
cfe-commits mailing list
cfe-commits at cs.uiuc.edu<mailto:cfe-commits at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130821/4168bb60/attachment.html>


More information about the cfe-commits mailing list