Index: src/IceConverter.h |
diff --git a/src/IceConverter.h b/src/IceConverter.h |
index 763dcaeb4f13010ed5534b1474770f00cc781ba8..aec65d9c8e0a65bdcc36fcf875fde6b39da8bb8a 100644 |
--- a/src/IceConverter.h |
+++ b/src/IceConverter.h |
@@ -14,9 +14,11 @@ |
#ifndef SUBZERO_SRC_ICECONVERTER_H |
#define SUBZERO_SRC_ICECONVERTER_H |
+#include "IceDefs.h" |
#include "IceTranslator.h" |
namespace llvm { |
+class GlobalValue; |
class Module; |
} |
@@ -24,21 +26,36 @@ namespace Ice { |
class Converter : public Translator { |
public: |
+ typedef std::map<const llvm::GlobalValue *, GlobalAddress *> |
+ GlobalAddressMapType; |
Converter(llvm::Module *Mod, GlobalContext *Ctx, const Ice::ClFlags &Flags) |
: Translator(Ctx, Flags), Mod(Mod) {} |
+ ~Converter() {} |
jvoung (off chromium)
2014/10/10 01:47:28
override?
Karl
2014/10/10 20:17:30
Why. A translator doesn't have any virtual methods
|
+ |
/// Converts the LLVM Module to ICE. Sets exit status to false if successful, |
/// true otherwise. |
void convertToIce(); |
+ llvm::Module *getModule() { return Mod; } |
jvoung (off chromium)
2014/10/10 01:47:28
method is "const"?
Karl
2014/10/10 20:17:30
Done.
|
+ |
+ // Returns the global address associated with the corresponding global value |
+ // V. |
+ // Returns nullptr if no such global address. |
+ GlobalAddress *getGlobalAddress(const llvm::GlobalValue *V); |
+ |
private: |
llvm::Module *Mod; |
+ GlobalAddressMapType GlobalAddressMap; |
// Converts functions to ICE, and then machine code. |
void convertFunctions(); |
// Converts globals to ICE, and then machine code. |
void convertGlobals(llvm::Module *Mod); |
+ // Installs global addresses into GlobalAddressMap. |
+ void installGlobalAddresses(llvm::Module *Mod); |
+ |
Converter(const Converter &) = delete; |
Converter &operator=(const Converter &) = delete; |
}; |