Simplify LLVMRustModuleCost()

This commit is contained in:
Björn Steinbrink 2017-12-08 11:23:23 +01:00
parent 493c29d35a
commit 7e522b2f0e

View File

@ -1428,11 +1428,6 @@ LLVMRustModuleBufferLen(const LLVMRustModuleBuffer *Buffer) {
extern "C" uint64_t extern "C" uint64_t
LLVMRustModuleCost(LLVMModuleRef M) { LLVMRustModuleCost(LLVMModuleRef M) {
Module &Mod = *unwrap(M); auto f = unwrap(M)->functions();
uint64_t cost = 0; return std::distance(std::begin(f), std::end(f));
for (auto &F : Mod.functions()) {
(void)F;
cost += 1;
}
return cost;
} }