[PATCH] D28362: [ThinLTO] Optionally ignore empty index file

Teresa Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 6 12:52:27 PST 2017


tejohnson added inline comments.


================
Comment at: lib/CodeGen/BackendUtil.cpp:65
+        "Ignore an empty index file and perform non-ThinLTO compilation"),
+    llvm::cl::init(false));
+
----------------
tejohnson wrote:
> mehdi_amini wrote:
> > Is it common to do this in clang?
> Doesn't look common, but I see one other LLVM internal option (in CodeGenPGO.cpp), and a few other uses in tests. Is there a better way to do internal options in clang?
Since this doesn't look like something commonly done in clang, I am splitting this into 2 patches, one in LLVM and one here. LLVM will instead contain the option, and return a nullptr from llvm::getModuleSummaryIndexForFile when the option is enabled and the file is empty. The clang side can just proceed to normal compilation if a nullptr CombinedIndex is returned (if the option is not enabled, LLVM would return an error instead).


https://reviews.llvm.org/D28362





More information about the cfe-commits mailing list