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