[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-24 Thread Daniel Grumberg via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG29125ddf1323: Start adding support for generating CC1 command lines from CompilerInvocation (authored by dang). Changed prior to commit: https://reviews.llvm.org/D79796?vs=272416&id=273091#toc Reposito

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-23 Thread Michael Spencer via Phabricator via cfe-commits
Bigcheese accepted this revision. Bigcheese added a comment. This revision is now accepted and ready to land. LGTM with `KeyPathPrefix` moved to the patch that actually uses it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://revie

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-22 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 272416. dang added a comment. Add a `KeyPathPrefix` field to factor out common key path prefixes, for example all `CodeGenOpts`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://reviews.llvm.org/D

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-21 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 272337. dang added a comment. Address code review feedback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://reviews.llvm.org/D79796 Files: clang/include/clang/Driver/CC1Options.td clang/inclu

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-21 Thread Daniel Grumberg via Phabricator via cfe-commits
dang marked 3 inline comments as done. dang added inline comments. Comment at: llvm/utils/TableGen/OptParserEmitter.cpp:430-440 + std::vector> OptsWithMarshalling; + for (unsigned I = 0, E = Opts.size(); I != E; ++I) { +const Record &R = *Opts[I]; +// Start a single o

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-21 Thread Daniel Grumberg via Phabricator via cfe-commits
dang marked 2 inline comments as done. dang added inline comments. Comment at: llvm/utils/TableGen/OptParserEmitter.cpp:468-469 + OS << "};\n"; + OS << "static const unsigned SimpleEnumValueTablesSize = " +"sizeof(SimpleEnumValueTables) / sizeof(SimpleEnumValueTable);\n

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-19 Thread Michael Spencer via Phabricator via cfe-commits
Bigcheese added inline comments. Comment at: clang/include/clang/Frontend/CompilerInvocation.h:193 + /// \param [out] Args - The generated arguments. Note that the caller is + /// responsible for insersting the path to the clang executable and "-cc1" if + /// desired.

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-19 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 272125. dang added a comment. Allocate string when denormalizing an option backed by an `std::string`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://reviews.llvm.org/D79796 Files: clang/inclu

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-19 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 271942. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://reviews.llvm.org/D79796 Files: clang/include/clang/Driver/CC1Options.td clang/include/clang/Frontend/CompilerInvocation.h clang/lib/Fro

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-18 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 271790. dang added a comment. Address the clang-tidy issues. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://reviews.llvm.org/D79796 Files: clang/include/clang/Driver/CC1Options.td clang/incl

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-17 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 271392. dang added a comment. Fixed a couple of bugs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://reviews.llvm.org/D79796 Files: clang/include/clang/Driver/CC1Options.td clang/include/cla

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-16 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 271006. dang marked 5 inline comments as done and an inline comment as not done. dang added a comment. Implement suffix merging to avoid allocations for option spelling when generating the command line. This update also removes unnecessary allocation for `std::

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-15 Thread Daniel Grumberg via Phabricator via cfe-commits
dang marked 2 inline comments as done. dang added inline comments. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:3845 + IS_POSITIVE != DEFAULT_VALUE && this->KEYPATH != DEFAULT_VALUE) \ +Args.push_back(StringAllocator(Twine(PREFIX_TYPE[0]) + NAME)); +#i

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-15 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 270802. dang marked an inline comment as done. dang added a comment. Implement constant table based marshaling for simple enum based options. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://review

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-12 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:3845 + IS_POSITIVE != DEFAULT_VALUE && this->KEYPATH != DEFAULT_VALUE) \ +Args.push_back(StringAllocator(Twine(PREFIX_TYPE[0]) + NAME)); +#include "clang/Driver/Options.inc"

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-12 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 270445. dang edited the summary of this revision. dang added a comment. Implemented a draft of normalizer generation for simple enum based options Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://r

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-11 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 270117. dang added a comment. This addresses the usability concern with having to specify fully scoped definitions for normalized values in the TableGen files. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/n

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-10 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/include/clang/Driver/CC1Options.td:216-221 def mrelocation_model : Separate<["-"], "mrelocation-model">, - HelpText<"The relocation model to use">, Values<"static,pic,ropi,rwpi,ropi-rwpi,dynamic-no-pic">; + HelpText<"The rel

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-10 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 269926. dang added a comment. This address a bunch of existing feedback and makes the TableGen definitions of the additional information significantly nicer to write. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-08 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added inline comments. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:3647 + DiagnosticsEngine &Diags) { +#define OPTION_WITH_MARSHALLING +#define OPTION_WITH_MARSHALLING_FLAG(PREFIX_TYPE, NAME, ID, KIND, GROUP, \ -

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-08 Thread Daniel Grumberg via Phabricator via cfe-commits
dang marked 3 inline comments as done. dang added inline comments. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:137-142 +.Case("static", llvm::Reloc::Static) +.Case("pic", llvm::Reloc::PIC_) +.Case("ropi", llvm::Reloc::ROPI

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-05 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. I have a couple of drive-by suggestions, up to @dang and @Bigcheese whether to incorporate them. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:137-142 +.Case("static", llvm::Reloc::Static) +.Case("pic", llvm::

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-05 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 268872. dang added a comment. This is the good diff CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://reviews.llvm.org/D79796 Files: clang/include/clang/Driver/CC1Options.td clang/include/clang/Frontend/CompilerInvocation.h clang/

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-05 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 268869. dang marked an inline comment as done. dang added a comment. Updating the patch with the correct merge base CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://reviews.llvm.org/D79796 Files: clang/include/clang/Driver/CC1Options

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-05 Thread Daniel Grumberg via Phabricator via cfe-commits
dang marked 4 inline comments as done. dang added inline comments. Comment at: clang/include/clang/Frontend/CompilerInvocation.h:248 + /// \returns - True if parsing was successful, false otherwise + bool parseSimpleArgs(const llvm::opt::ArgList &Args, + D

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-05 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 268746. dang marked 3 inline comments as done. dang added a comment. Address some code review feedback Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://reviews.llvm.org/D79796 Files: clang/inclu

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-06-03 Thread Michael Spencer via Phabricator via cfe-commits
Bigcheese added inline comments. Comment at: clang/include/clang/Frontend/CompilerInvocation.h:248 + /// \returns - True if parsing was successful, false otherwise + bool parseSimpleArgs(const llvm::opt::ArgList &Args, + DiagnosticsEngine &Diags);

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-05-26 Thread Daniel Grumberg via Phabricator via cfe-commits
dang marked 5 inline comments as done. dang added inline comments. Comment at: clang/include/clang/Frontend/CompilerInvocation.h:156 /// \param [out] Res - The resulting invocation. + /// \param [in] CommandLineArgs - Array of argument strings, this should not + /// contain

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-05-26 Thread Daniel Grumberg via Phabricator via cfe-commits
dang updated this revision to Diff 266195. dang added a comment. Address some code review comments and sketch support for options that take a single value. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79796/new/ https://reviews.llvm.org/D79796 F

[PATCH] D79796: Sketch support for generating CC1 command line from CompilerInvocation

2020-05-19 Thread Michael Spencer via Phabricator via cfe-commits
Bigcheese added inline comments. Comment at: clang/include/clang/Frontend/CompilerInvocation.h:156 /// \param [out] Res - The resulting invocation. + /// \param [in] CommandLineArgs - Array of argument strings, this should not + /// contain "-cc1". Is this r