AArch64: Remove unnecessary parens
[oota-llvm.git] / include / llvm / LTO / LTOCodeGenerator.h
index 04d18fd157ca39d48c944e0a64314bd07c9443a4..b19b2325f73b30358df8595e378de8f51ca40877 100644 (file)
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/StringMap.h"
-#include "llvm/Linker.h"
+#include "llvm/Linker/Linker.h"
 #include "llvm/Target/TargetOptions.h"
 #include <string>
 #include <vector>
 
 namespace llvm {
   class LLVMContext;
+  class DiagnosticInfo;
   class GlobalValue;
   class Mangler;
   class MemoryBuffer;
   class TargetLibraryInfo;
   class TargetMachine;
   class raw_ostream;
-}
 
 //===----------------------------------------------------------------------===//
-/// LTOCodeGenerator - C++ class which implements the opaque lto_code_gen_t
-/// type.
+/// C++ class which implements the opaque lto_code_gen_t type.
 ///
 struct LTOCodeGenerator {
   static const char *getVersionString();
@@ -67,11 +66,12 @@ struct LTOCodeGenerator {
   // Merge given module, return true on success.
   bool addModule(struct LTOModule*, std::string &errMsg);
 
-  void setTargetOptions(llvm::TargetOptions options);
+  void setTargetOptions(TargetOptions options);
   void setDebugInfo(lto_debug_model);
   void setCodePICModel(lto_codegen_model);
 
   void setCpu(const char *mCpu) { MCpu = mCpu; }
+  void setAttr(const char *mAttr) { MAttr = mAttr; }
 
   void addMustPreserveSymbol(const char *sym) { MustPreserveSymbols[sym] = 1; }
 
@@ -114,37 +114,42 @@ struct LTOCodeGenerator {
                       bool disableGVNLoadPRE,
                       std::string &errMsg);
 
+  void setDiagnosticHandler(lto_diagnostic_handler_t, void *);
+
 private:
   void initializeLTOPasses();
 
-  bool generateObjectFile(llvm::raw_ostream &out,
-                          bool disableOpt,
-                          bool disableInline,
-                          bool disableGVNLoadPRE,
-                          std::string &errMsg);
+  bool generateObjectFile(raw_ostream &out, bool disableOpt, bool disableInline,
+                          bool disableGVNLoadPRE, std::string &errMsg);
   void applyScopeRestrictions();
-  void applyRestriction(llvm::GlobalValue &GV,
-                        const llvm::ArrayRef<llvm::StringRef> &Libcalls,
-                        std::vector<const char*> &MustPreserveList,
-                        llvm::SmallPtrSet<llvm::GlobalValue*, 8> &AsmUsed,
-                        llvm::Mangler &Mangler);
+  void applyRestriction(GlobalValue &GV, const ArrayRef<StringRef> &Libcalls,
+                        std::vector<const char *> &MustPreserveList,
+                        SmallPtrSet<GlobalValue *, 8> &AsmUsed,
+                        Mangler &Mangler);
   bool determineTarget(std::string &errMsg);
 
-  typedef llvm::StringMap<uint8_t> StringSet;
+  static void DiagnosticHandler(const DiagnosticInfo &DI, void *Context);
+
+  void DiagnosticHandler2(const DiagnosticInfo &DI);
 
-  llvm::LLVMContext &Context;
-  llvm::Linker Linker;
-  llvm::TargetMachine *TargetMach;
+  typedef StringMap<uint8_t> StringSet;
+
+  LLVMContext &Context;
+  Linker IRLinker;
+  TargetMachine *TargetMach;
   bool EmitDwarfDebugInfo;
   bool ScopeRestrictionsDone;
   lto_codegen_model CodeModel;
   StringSet MustPreserveSymbols;
   StringSet AsmUndefinedRefs;
-  llvm::MemoryBuffer *NativeObjectFile;
+  MemoryBuffer *NativeObjectFile;
   std::vector<char *> CodegenOptions;
   std::string MCpu;
+  std::string MAttr;
   std::string NativeObjectPath;
-  llvm::TargetOptions Options;
+  TargetOptions Options;
+  lto_diagnostic_handler_t DiagHandler;
+  void *DiagContext;
 };
-
+}
 #endif // LTO_CODE_GENERATOR_H