X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FLinkTimeOptimizer.h;h=164232d20989b0559e5482a9f8a9178bdd527e1e;hb=b5bb9f5b5cfe89f4b7626671f4923d50f8d4cd6a;hp=654623adff85a5bc289d49e3ec488477d8aed441;hpb=c7cfbc58ad88f127df6949791401969a09da560f;p=oota-llvm.git diff --git a/include/llvm/LinkTimeOptimizer.h b/include/llvm/LinkTimeOptimizer.h index 654623adff8..164232d2098 100644 --- a/include/llvm/LinkTimeOptimizer.h +++ b/include/llvm/LinkTimeOptimizer.h @@ -24,6 +24,7 @@ namespace llvm { class Module; class GlobalValue; + class TargetMachine; enum LTOStatus { LTO_UNKNOWN, @@ -56,17 +57,19 @@ namespace llvm { void mayBeNotUsed(); LLVMSymbol (enum LTOLinkageTypes lt, GlobalValue *g, const std::string &n, - const std::string &m) : linkage(lt), gv(g), name(n), - mangledName(m) {} + const std::string &m, int a) : linkage(lt), gv(g), name(n), + mangledName(m), alignment(a) {} const char *getName() { return name.c_str(); } const char *getMangledName() { return mangledName.c_str(); } + int getAlignment() { return alignment; } private: enum LTOLinkageTypes linkage; GlobalValue *gv; std::string name; std::string mangledName; + int alignment; }; class string_compare { @@ -88,9 +91,12 @@ namespace llvm { NameToSymbolMap &, std::set &) = 0; virtual enum LTOStatus optimizeModules(const std::string &, - std::vector &, - std::string &) = 0; + std::vector &, + std::string &, bool, + const char *) = 0; virtual void getTargetTriple(const std::string &, std::string &) = 0; + virtual void removeModule (const std::string &InputFilename) = 0; + virtual void printVersion () = 0; virtual ~LinkTimeOptimizer() = 0; }; @@ -109,16 +115,31 @@ namespace llvm { std::set &references); enum LTOStatus optimizeModules(const std::string &OutputFilename, std::vector &exportList, - std::string &targetTriple); - void getTargetTriple(const std::string &InputFilename, std::string &targetTriple); + std::string &targetTriple, bool saveTemps, + const char *); + void getTargetTriple(const std::string &InputFilename, + std::string &targetTriple); + void removeModule (const std::string &InputFilename); + void printVersion(); + + // Constructors and destructors + LTO() { + /// TODO: Use Target info, it is available at this time. + Target = NULL; + } + ~LTO(); private: Module *getModule (const std::string &InputFilename); + enum LTOStatus optimize(Module *, std::ostream &, + std::vector &); + void getTarget(Module *); private: std::vector modules; NameToSymbolMap allSymbols; NameToModuleMap allModules; + TargetMachine *Target; }; } // End llvm namespace