diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-28 05:34:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-28 05:34:05 +0000 |
commit | 45e8cbdce25c2e16c7aac2036a591f6190097ae6 (patch) | |
tree | 305f3b00be1b424585a9e9d14830db2de61a7df4 /CodeGen/CodeGenModule.h | |
parent | dd1b516f2f5ed5953de1875afc2d04aa5a14d137 (diff) |
Implement support for -fwritable-strings and make the code generator
merge string literals when it is not provided.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenModule.h')
-rw-r--r-- | CodeGen/CodeGenModule.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/CodeGen/CodeGenModule.h b/CodeGen/CodeGenModule.h index a044c0d02e..1d7c30e487 100644 --- a/CodeGen/CodeGenModule.h +++ b/CodeGen/CodeGenModule.h @@ -32,6 +32,7 @@ namespace clang { class Decl; class ValueDecl; class FileVarDecl; + struct LangOptions; namespace CodeGen { @@ -39,21 +40,25 @@ namespace CodeGen { /// while generating LLVM code. class CodeGenModule { ASTContext &Context; + const LangOptions &Features; llvm::Module &TheModule; const llvm::TargetData &TheTargetData; CodeGenTypes Types; llvm::Function *MemCpyFn; llvm::DenseMap<const Decl*, llvm::Constant*> GlobalDeclMap; - + llvm::StringMap<llvm::Constant*> CFConstantStringMap; + llvm::StringMap<llvm::Constant*> ConstantStringMap; llvm::Constant *CFConstantStringClassRef; std::vector<llvm::Function *> BuiltinFunctions; public: - CodeGenModule(ASTContext &C, llvm::Module &M, const llvm::TargetData &TD); + CodeGenModule(ASTContext &C, const LangOptions &Features, llvm::Module &M, + const llvm::TargetData &TD); ASTContext &getContext() const { return Context; } + const LangOptions &getLangOptions() const { return Features; } llvm::Module &getModule() const { return TheModule; } CodeGenTypes &getTypes() { return Types; } @@ -64,6 +69,7 @@ public: /// llvm::Function *getBuiltinLibFunction(unsigned BuiltinID); llvm::Constant *GetAddrOfConstantCFString(const std::string& str); + llvm::Constant *GetAddrOfConstantString(const std::string& str); llvm::Function *getMemCpyFn(); |