llvm-mirror/lib/LTO/UpdateCompilerUsed.h
Mehdi Amini 33b2e5ac62 Simplify LTOInternalize into UpdateLLVMCompilerUsed
It is now only doing the update to the llvm.compiler_used global.
The client has to call separately the internalization stage.
Hopefully the code is simpler to understand this way.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266174
2016-04-13 06:32:46 +00:00

35 lines
1.1 KiB
C++

//==------ UpdateCompilerUsed.h - LLVM Link Time Optimizer Utility --------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares a helper class to update llvm.compiler_used metadata.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LTO_UPDATE_COMPILER_USED_H
#define LLVM_LTO_UPDATE_COMPILER_USED_H
#include "llvm/ADT/StringSet.h"
#include "llvm/IR/GlobalValue.h"
#include <functional>
namespace llvm {
class Module;
class TargetMachine;
/// Find all globals in \p TheModule that are referenced in
/// \p AsmUndefinedRefs, as well as the user-supplied functions definitions that
/// are also libcalls, and create or update the magic "llvm.compiler_used"
/// global in \p TheModule.
void UpdateCompilerUsed(Module &TheModule, const TargetMachine &TM,
const StringSet<> &AsmUndefinedRefs);
}
#endif // LLVM_LTO_LTOINTERNALIZE_H