[cfe-commits] r74642 - in /cfe/trunk: include/clang/CodeGen/ModuleBuilder.h include/clang/Frontend/ASTConsumers.h lib/CodeGen/ModuleBuilder.cpp lib/Frontend/Backend.cpp tools/clang-cc/clang-cc.cpp
Owen Anderson
resistor at mac.com
Wed Jul 1 14:23:17 PDT 2009
Author: resistor
Date: Wed Jul 1 16:23:16 2009
New Revision: 74642
URL: http://llvm.org/viewvc/llvm-project?rev=74642&view=rev
Log:
Hold the LLVMContext by reference instead of by pointer.
Modified:
cfe/trunk/include/clang/CodeGen/ModuleBuilder.h
cfe/trunk/include/clang/Frontend/ASTConsumers.h
cfe/trunk/lib/CodeGen/ModuleBuilder.cpp
cfe/trunk/lib/Frontend/Backend.cpp
cfe/trunk/tools/clang-cc/clang-cc.cpp
Modified: cfe/trunk/include/clang/CodeGen/ModuleBuilder.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/CodeGen/ModuleBuilder.h?rev=74642&r1=74641&r2=74642&view=diff
==============================================================================
--- cfe/trunk/include/clang/CodeGen/ModuleBuilder.h (original)
+++ cfe/trunk/include/clang/CodeGen/ModuleBuilder.h Wed Jul 1 16:23:16 2009
@@ -36,7 +36,7 @@
CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags,
const std::string &ModuleName,
const CompileOptions &CO,
- llvm::LLVMContext* C);
+ const llvm::LLVMContext& C);
}
#endif
Modified: cfe/trunk/include/clang/Frontend/ASTConsumers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ASTConsumers.h?rev=74642&r1=74641&r2=74642&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/ASTConsumers.h (original)
+++ cfe/trunk/include/clang/Frontend/ASTConsumers.h Wed Jul 1 16:23:16 2009
@@ -81,7 +81,7 @@
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.
Modified: cfe/trunk/lib/CodeGen/ModuleBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ModuleBuilder.cpp?rev=74642&r1=74641&r2=74642&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ModuleBuilder.cpp (original)
+++ cfe/trunk/lib/CodeGen/ModuleBuilder.cpp Wed Jul 1 16:23:16 2009
@@ -38,7 +38,7 @@
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 @@
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);
}
Modified: cfe/trunk/lib/Frontend/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Backend.cpp?rev=74642&r1=74641&r2=74642&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/Backend.cpp (original)
+++ cfe/trunk/lib/Frontend/Backend.cpp Wed Jul 1 16:23:16 2009
@@ -76,7 +76,7 @@
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 @@
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);
}
Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=74642&r1=74641&r2=74642&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Wed Jul 1 16:23:16 2009
@@ -1748,7 +1748,7 @@
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 @@
((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);
More information about the cfe-commits
mailing list