Add getTargetTriple() that linker can use to query target architecture.

llvm-svn: 30132
This commit is contained in:
Devang Patel 2006-09-06 20:16:28 +00:00
parent ef94ebb666
commit 5561aa7271
2 changed files with 12 additions and 0 deletions

View File

@ -92,6 +92,7 @@ namespace llvm {
enum LTOStatus optimizeModules(const std::string &OutputFilename,
std::vector<const char*> &exportList,
std::string &targetTriple);
void getTargetTriple(const std::string &InputFilename, std::string &targetTriple);
private:
Module *getModule (const std::string &InputFilename);

View File

@ -116,6 +116,17 @@ LinkTimeOptimizer::getModule(const std::string &InputFilename)
return m;
}
/// InputFilename is a LLVM bytecode file. Reade this bytecode file and
/// set corresponding target triplet string.
void
LinkTimeOptimizer::getTargetTriple(const std::string &InputFilename,
std::string &targetTriple)
{
Module *m = getModule(InputFilename);
if (m)
targetTriple = m->getTargetTriple();
}
/// InputFilename is a LLVM bytecode file. Read it using bytecode reader.
/// Collect global functions and symbol names in symbols vector.
/// Collect external references in references vector.