[PATCH] lld: handling of -flavor / -core command line switches

Rui Ueyama ruiu at google.com
Mon Sep 22 10:46:37 PDT 2014


================
Comment at: lib/Driver/UniversalDriver.cpp:126
@@ -125,1 +125,3 @@
 
+static void removeArgumentFromCommandLine(llvm::opt::Arg *argument, int &argc,
+                                          const char **&argv) {
----------------
The function name and the arguments aren't aligned with other code in this file, so they look a bit heavier than the others. I'd write

removeArg(llvm::opt::Arg *arg, int &argc, const char **&argv)

================
Comment at: lib/Driver/UniversalDriver.cpp:129
@@ +128,3 @@
+  // remove the argument along with all its values
+  unsigned int numberOfItemsToRemove = argument->getNumValues() + 1;
+
----------------
numberOfItemsToRemove -> numRemove or something

================
Comment at: lib/Driver/UniversalDriver.cpp:132
@@ +131,3 @@
+  // arg indexes are relative to argv[1]. Get absolute index of the arg
+  // in the command line
+  unsigned int argIndex = argument->getIndex() + 1;
----------------
IMO the comments in this function don't help readers that much. I'd write a comment about what this function is supposed to do ("Removes argument from argv and update argc.") and remove other comments.

================
Comment at: test/Driver/flavor-option.test:8
@@ +7,2 @@
+CHECK: --noinhibit-exec
+CHECK: --output-filetype
----------------
add newline at end of file

http://reviews.llvm.org/D5384






More information about the llvm-commits mailing list