| OLD | NEW |
| 1 //===- subzero/src/IceConverter.h - Converts LLVM to ICE --------*- C++ -*-===// | 1 //===- subzero/src/IceConverter.h - Converts LLVM to ICE --------*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 /// |
| 10 // This file declares the LLVM to ICE converter. | 10 /// \file |
| 11 // | 11 /// This file declares the LLVM to ICE converter. |
| 12 /// |
| 12 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
| 13 | 14 |
| 14 #ifndef SUBZERO_SRC_ICECONVERTER_H | 15 #ifndef SUBZERO_SRC_ICECONVERTER_H |
| 15 #define SUBZERO_SRC_ICECONVERTER_H | 16 #define SUBZERO_SRC_ICECONVERTER_H |
| 16 | 17 |
| 17 #include "IceDefs.h" | 18 #include "IceDefs.h" |
| 18 #include "IceTranslator.h" | 19 #include "IceTranslator.h" |
| 19 | 20 |
| 20 namespace llvm { | 21 namespace llvm { |
| 21 class GlobalValue; | 22 class GlobalValue; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 34 : Translator(Ctx), Mod(Mod) {} | 35 : Translator(Ctx), Mod(Mod) {} |
| 35 | 36 |
| 36 ~Converter() = default; | 37 ~Converter() = default; |
| 37 | 38 |
| 38 /// Converts the LLVM Module to ICE. Sets exit status to false if successful, | 39 /// Converts the LLVM Module to ICE. Sets exit status to false if successful, |
| 39 /// true otherwise. | 40 /// true otherwise. |
| 40 void convertToIce(); | 41 void convertToIce(); |
| 41 | 42 |
| 42 llvm::Module *getModule() const { return Mod; } | 43 llvm::Module *getModule() const { return Mod; } |
| 43 | 44 |
| 44 // Returns the global declaration associated with the corresponding | 45 /// Returns the global declaration associated with the corresponding |
| 45 // global value V. If no such global address, generates fatal error. | 46 /// global value V. If no such global address, generates fatal error. |
| 46 GlobalDeclaration *getGlobalDeclaration(const llvm::GlobalValue *V); | 47 GlobalDeclaration *getGlobalDeclaration(const llvm::GlobalValue *V); |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 llvm::Module *Mod; | 50 llvm::Module *Mod; |
| 50 typedef std::map<const llvm::GlobalValue *, GlobalDeclaration *> | 51 typedef std::map<const llvm::GlobalValue *, GlobalDeclaration *> |
| 51 GlobalDeclarationMapType; | 52 GlobalDeclarationMapType; |
| 52 GlobalDeclarationMapType GlobalDeclarationMap; | 53 GlobalDeclarationMapType GlobalDeclarationMap; |
| 53 | 54 |
| 54 // Walks module and generates names for unnamed globals using prefix | 55 /// Walks module and generates names for unnamed globals using prefix |
| 55 // getFlags().DefaultGlobalPrefix, if the prefix is non-empty. | 56 /// getFlags().DefaultGlobalPrefix, if the prefix is non-empty. |
| 56 void nameUnnamedGlobalVariables(llvm::Module *Mod); | 57 void nameUnnamedGlobalVariables(llvm::Module *Mod); |
| 57 | 58 |
| 58 // Walks module and generates names for unnamed functions using | 59 /// Walks module and generates names for unnamed functions using |
| 59 // prefix getFlags().DefaultFunctionPrefix, if the prefix is | 60 /// prefix getFlags().DefaultFunctionPrefix, if the prefix is |
| 60 // non-empty. | 61 /// non-empty. |
| 61 void nameUnnamedFunctions(llvm::Module *Mod); | 62 void nameUnnamedFunctions(llvm::Module *Mod); |
| 62 | 63 |
| 63 // Converts functions to ICE, and then machine code. | 64 /// Converts functions to ICE, and then machine code. |
| 64 void convertFunctions(); | 65 void convertFunctions(); |
| 65 | 66 |
| 66 // Converts globals to ICE, and then machine code. | 67 /// Converts globals to ICE, and then machine code. |
| 67 void convertGlobals(llvm::Module *Mod); | 68 void convertGlobals(llvm::Module *Mod); |
| 68 | 69 |
| 69 // Installs global declarations into GlobalDeclarationMap. | 70 /// Installs global declarations into GlobalDeclarationMap. |
| 70 void installGlobalDeclarations(llvm::Module *Mod); | 71 void installGlobalDeclarations(llvm::Module *Mod); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 } // end of namespace ICE. | 74 } // end of namespace ICE. |
| 74 | 75 |
| 75 #endif // SUBZERO_SRC_ICECONVERTER_H | 76 #endif // SUBZERO_SRC_ICECONVERTER_H |
| OLD | NEW |