blob: b94fa89a7a67c07505f1af02ad4391a7f1b6f5f0 [file] [log] [blame]
John Criswellf4304342003-09-19 20:24:40 +00001//===- util.h - Utility functions header file -----------------------------===//
2//
3// This file contains function prototypes for the functions in util.cpp.
4//
5//===----------------------------------------------------------------------===//
6
7#include "llvm/Module.h"
8
9#include <string>
10#include <set>
11#include <ostream>
12
13int
14PrintAndReturn (const char *progname,
15 const std::string &Message,
16 const std::string &Extra = "");
17
18void
19GetAllDefinedSymbols (Module *M, std::set<std::string> &DefinedSymbols);
20
21void
22GetAllUndefinedSymbols(Module *M, std::set<std::string> &UndefinedSymbols);
23
24char **
25CopyEnv (char ** const envp);
26
27void
28RemoveEnv (const char * name, char ** const envp);
29
30int
31GenerateBytecode (Module * M,
32 bool Strip,
33 bool Internalize,
34 std::ostream * Out);
35
36int
37GenerateAssembly (const std::string & OutputFilename,
38 const std::string & InputFilename,
39 const std::string & llc,
40 char ** const envp);
41int
42GenerateNative (const std::string & OutputFilename,
43 const std::string & InputFilename,
44 const std::vector<std::string> & Libraries,
45 const std::vector<std::string> & LibPaths,
46 const std::string & gcc,
47 char ** const envp);
48
49std::auto_ptr<Module>
50LoadObject (const std::string & FN, std::string &OutErrorMessage);
51
52bool
53LinkLibraries (const char * progname,
54 Module * HeadModule,
55 const std::vector<std::string> & Libraries,
56 const std::vector<std::string> & LibPaths,
57 bool Verbose,
58 bool Native);
59bool
60LinkFiles (const char * progname,
61 Module * HeadModule,
62 const std::vector<std::string> & Files,
63 bool Verbose);
64