[cfi] CFI-ICall for ThinLTO.

Implement ControlFlowIntegrity for indirect function calls in ThinLTO.
Design follows the RFC in llvm-dev, see
https://groups.google.com/d/msg/llvm-dev/MgUlaphu4Qc/kywu0AqjAQAJ

llvm-svn: 305533
This commit is contained in:
Evgeniy Stepanov
2017-06-16 00:18:29 +00:00
parent 47d9a560de
commit 4d4ee93d25
17 changed files with 494 additions and 32 deletions

View File

@@ -5252,6 +5252,18 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
{{Record[0], Record[1]}, {Record.begin() + 2, Record.end()}});
break;
}
case bitc::FS_CFI_FUNCTION_DEFS: {
std::set<std::string> &CfiFunctionDefs = TheIndex.cfiFunctionDefs();
for (unsigned I = 0; I != Record.size(); I += 2)
CfiFunctionDefs.insert({Strtab.data() + Record[I], Record[I+1]});
break;
}
case bitc::FS_CFI_FUNCTION_DECLS: {
std::set<std::string> &CfiFunctionDecls = TheIndex.cfiFunctionDecls();
for (unsigned I = 0; I != Record.size(); I += 2)
CfiFunctionDecls.insert({Strtab.data() + Record[I], Record[I+1]});
break;
}
}
}
llvm_unreachable("Exit infinite loop");