Cross-DSO control flow integrity (LLVM part).
[oota-llvm.git] / lib / Transforms / IPO / PassManagerBuilder.cpp
index 6f709937f861bf41c39af29a0fa3e41f6faa8a8c..0d8982774d9bac111c910bc5cc35468b996e74e0 100644 (file)
@@ -613,6 +613,10 @@ void PassManagerBuilder::populateLTOPassManager(legacy::PassManagerBase &PM) {
   if (OptLevel > 1)
     addLTOOptimizationPasses(PM);
 
+  // Create a function that performs CFI checks for cross-DSO calls with targets
+  // in the current module.
+  PM.add(createCrossDSOCFIPass());
+
   // Lower bit sets to globals. This pass supports Clang's control flow
   // integrity mechanisms (-fsanitize=cfi*) and needs to run at link time if CFI
   // is enabled. The pass does nothing if CFI is disabled.