summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-11-28 05:34:05 +0000
committerChris Lattner <sabre@nondot.org>2007-11-28 05:34:05 +0000
commitfb3000946586de3b70e1970aa1ea992d7a1e1296 (patch)
tree75b5f3d906d1583045ee68f6ab54846457047edf /clang/CodeGen/CodeGenModule.h
parente04dc1fa4d2fb4042a629d8ddeb4134947a56a40 (diff)
downloadbcm5719-llvm-fb3000946586de3b70e1970aa1ea992d7a1e1296.tar.gz
bcm5719-llvm-fb3000946586de3b70e1970aa1ea992d7a1e1296.zip
Implement support for -fwritable-strings and make the code generator
merge string literals when it is not provided. llvm-svn: 44394
Diffstat (limited to 'clang/CodeGen/CodeGenModule.h')
-rw-r--r--clang/CodeGen/CodeGenModule.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/CodeGen/CodeGenModule.h b/clang/CodeGen/CodeGenModule.h
index a044c0d02ee..1d7c30e4872 100644
--- a/clang/CodeGen/CodeGenModule.h
+++ b/clang/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();
OpenPOWER on IntegriCloud