7f62bad542a077ba90066c0c35acc16cfc910546
[oota-llvm.git] / tools / gccld / gccld.h
1 //===- gccld.h - Utility functions header file ------------------*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains function prototypes for the functions in util.cpp.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "llvm/Module.h"
15
16 #include <string>
17 #include <set>
18 #include <ostream>
19
20 namespace llvm {
21
22 void
23 GetAllDefinedSymbols (Module *M, std::set<std::string> &DefinedSymbols);
24
25 void
26 GetAllUndefinedSymbols(Module *M, std::set<std::string> &UndefinedSymbols);
27
28 int
29 GenerateBytecode (Module * M,
30                   bool Strip,
31                   bool Internalize,
32                   std::ostream * Out);
33
34 int
35 GenerateAssembly (const std::string & OutputFilename,
36                   const std::string & InputFilename,
37                   const std::string & llc,
38                   char ** const envp);
39
40 int GenerateCFile(const std::string &OutputFile, const std::string &InputFile,
41                   const std::string &llc, char ** const envp);
42 int
43 GenerateNative (const std::string & OutputFilename,
44                 const std::string & InputFilename,
45                 const std::vector<std::string> & Libraries,
46                 const std::vector<std::string> & LibPaths,
47                 const std::string & gcc,
48                 char ** const envp);
49
50 std::auto_ptr<Module>
51 LoadObject (const std::string & FN, std::string &OutErrorMessage);
52
53 std::string FindLib(const std::string &Filename,
54                     const std::vector<std::string> &Paths,
55                     bool SharedObjectOnly = false);
56   
57 void LinkLibraries (const char * progname, Module* HeadModule,
58                     const std::vector<std::string> & Libraries,
59                     const std::vector<std::string> & LibPaths,
60                     bool Verbose, bool Native);
61 bool
62 LinkFiles (const char * progname,
63            Module * HeadModule,
64            const std::vector<std::string> & Files,
65            bool Verbose);
66
67 } // End llvm namespace