aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-01 21:23:16 +0000
committerOwen Anderson <resistor@mac.com>2009-07-01 21:23:16 +0000
commitc93f49832d2dae19a24d644c8021388fc5b099ee (patch)
tree28fa0d00a01c12ca42ea12dc0373c0b3094b6efe
parentd45c36308e563e1fac1cd124d606f403f9a39a29 (diff)
Hold the LLVMContext by reference instead of by pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74642 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/CodeGen/ModuleBuilder.h2
-rw-r--r--include/clang/Frontend/ASTConsumers.h2
-rw-r--r--lib/CodeGen/ModuleBuilder.cpp4
-rw-r--r--lib/Frontend/Backend.cpp4
-rw-r--r--tools/clang-cc/clang-cc.cpp4
5 files changed, 8 insertions, 8 deletions
diff --git a/include/clang/CodeGen/ModuleBuilder.h b/include/clang/CodeGen/ModuleBuilder.h
index f7e2480526..cf83aaf129 100644
--- a/include/clang/CodeGen/ModuleBuilder.h
+++ b/include/clang/CodeGen/ModuleBuilder.h
@@ -36,7 +36,7 @@ namespace clang {
CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags,
const std::string &ModuleName,
const CompileOptions &CO,
- llvm::LLVMContext* C);
+ const llvm::LLVMContext& C);
}
#endif
diff --git a/include/clang/Frontend/ASTConsumers.h b/include/clang/Frontend/ASTConsumers.h
index b02548556d..35b00f1441 100644
--- a/include/clang/Frontend/ASTConsumers.h
+++ b/include/clang/Frontend/ASTConsumers.h
@@ -81,7 +81,7 @@ ASTConsumer *CreateBackendConsumer(BackendAction Action,
const CompileOptions &CompileOpts,
const std::string &ModuleID,
llvm::raw_ostream *OS,
- llvm::LLVMContext* C);
+ const llvm::LLVMContext& C);
// HTML printer: uses the rewriter to convert source code to HTML with
// syntax highlighting suitable for viewing in a web-browser.
diff --git a/lib/CodeGen/ModuleBuilder.cpp b/lib/CodeGen/ModuleBuilder.cpp
index 7937e92967..3faedc12bc 100644
--- a/lib/CodeGen/ModuleBuilder.cpp
+++ b/lib/CodeGen/ModuleBuilder.cpp
@@ -38,7 +38,7 @@ namespace {
llvm::OwningPtr<CodeGen::CodeGenModule> Builder;
public:
CodeGeneratorImpl(Diagnostic &diags, const std::string& ModuleName,
- const CompileOptions &CO, llvm::LLVMContext* C)
+ const CompileOptions &CO, const llvm::LLVMContext& C)
: Diags(diags), CompileOpts(CO), M(new llvm::Module(ModuleName, C)) {}
virtual ~CodeGeneratorImpl() {}
@@ -97,6 +97,6 @@ namespace {
CodeGenerator *clang::CreateLLVMCodeGen(Diagnostic &Diags,
const std::string& ModuleName,
const CompileOptions &CO,
- llvm::LLVMContext* C) {
+ const llvm::LLVMContext& C) {
return new CodeGeneratorImpl(Diags, ModuleName, CO, C);
}
diff --git a/lib/Frontend/Backend.cpp b/lib/Frontend/Backend.cpp
index dc84cd8271..6b7f9ae940 100644
--- a/lib/Frontend/Backend.cpp
+++ b/lib/Frontend/Backend.cpp
@@ -76,7 +76,7 @@ namespace {
BackendConsumer(BackendAction action, Diagnostic &Diags,
const LangOptions &langopts, const CompileOptions &compopts,
const std::string &infile, llvm::raw_ostream* OS,
- LLVMContext* C) :
+ const LLVMContext& C) :
Action(action),
CompileOpts(compopts),
AsmOutStream(OS),
@@ -361,7 +361,7 @@ ASTConsumer *clang::CreateBackendConsumer(BackendAction Action,
const CompileOptions &CompileOpts,
const std::string& InFile,
llvm::raw_ostream* OS,
- LLVMContext* C) {
+ const LLVMContext& C) {
return new BackendConsumer(Action, Diags, LangOpts, CompileOpts,
InFile, OS, C);
}
diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index 69a540bd35..341c10b9ad 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/tools/clang-cc/clang-cc.cpp
@@ -1748,7 +1748,7 @@ static llvm::raw_ostream* ComputeOutFile(const std::string& InFile,
static void ProcessInputFile(Preprocessor &PP, PreprocessorFactory &PPF,
const std::string &InFile, ProgActions PA,
const llvm::StringMap<bool> &Features,
- llvm::LLVMContext* Context) {
+ const llvm::LLVMContext& Context) {
llvm::OwningPtr<llvm::raw_ostream> OS;
llvm::OwningPtr<ASTConsumer> Consumer;
bool ClearSourceMgr = false;
@@ -2284,7 +2284,7 @@ int main(int argc, char **argv) {
((PathDiagnosticClient*)DiagClient.get())->SetPreprocessor(PP.get());
// Process the source file.
- ProcessInputFile(*PP, PPFactory, InFile, ProgAction, Features, &Context);
+ ProcessInputFile(*PP, PPFactory, InFile, ProgAction, Features, Context);
HeaderInfo.ClearFileInfo();
DiagClient->setLangOptions(0);