[cfe-commits] r149739 - in /cfe/trunk: include/clang/Frontend/FrontendActions.h lib/Frontend/ASTMerge.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Fri Feb 3 17:36:04 PST 2012
Author: akirtzidis
Date: Fri Feb 3 19:36:04 2012
New Revision: 149739
URL: http://llvm.org/viewvc/llvm-project?rev=149739&view=rev
Log:
Use variable in place of multiple CI.getFrontendOpts() calls and use a bit
of ArrayRef goodness. No functionality change.
Modified:
cfe/trunk/include/clang/Frontend/FrontendActions.h
cfe/trunk/lib/Frontend/ASTMerge.cpp
cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp
Modified: cfe/trunk/include/clang/Frontend/FrontendActions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/FrontendActions.h?rev=149739&r1=149738&r2=149739&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/FrontendActions.h (original)
+++ cfe/trunk/include/clang/Frontend/FrontendActions.h Fri Feb 3 19:36:04 2012
@@ -153,8 +153,7 @@
virtual void EndSourceFileAction();
public:
- ASTMergeAction(FrontendAction *AdaptedAction,
- std::string *ASTFiles, unsigned NumASTFiles);
+ ASTMergeAction(FrontendAction *AdaptedAction, ArrayRef<std::string> ASTFiles);
virtual ~ASTMergeAction();
virtual bool usesPreprocessorOnly() const;
Modified: cfe/trunk/lib/Frontend/ASTMerge.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTMerge.cpp?rev=149739&r1=149738&r2=149739&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTMerge.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTMerge.cpp Fri Feb 3 19:36:04 2012
@@ -79,8 +79,8 @@
}
ASTMergeAction::ASTMergeAction(FrontendAction *AdaptedAction,
- std::string *ASTFiles, unsigned NumASTFiles)
- : AdaptedAction(AdaptedAction), ASTFiles(ASTFiles, ASTFiles + NumASTFiles) {
+ ArrayRef<std::string> ASTFiles)
+ : AdaptedAction(AdaptedAction), ASTFiles(ASTFiles.begin(), ASTFiles.end()) {
assert(AdaptedAction && "ASTMergeAction needs an action to adapt");
}
Modified: cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp?rev=149739&r1=149738&r2=149739&view=diff
==============================================================================
--- cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp (original)
+++ cfe/trunk/lib/FrontendTool/ExecuteCompilerInvocation.cpp Fri Feb 3 19:36:04 2012
@@ -87,12 +87,14 @@
if (!Act)
return 0;
- if (CI.getFrontendOpts().FixAndRecompile) {
+ const FrontendOptions &FEOpts = CI.getFrontendOpts();
+
+ if (FEOpts.FixAndRecompile) {
Act = new FixItRecompile(Act);
}
// Potentially wrap the base FE action in an ARC Migrate Tool action.
- switch (CI.getFrontendOpts().ARCMTAction) {
+ switch (FEOpts.ARCMTAction) {
case FrontendOptions::ARCMT_None:
break;
case FrontendOptions::ARCMT_Check:
@@ -103,17 +105,16 @@
break;
case FrontendOptions::ARCMT_Migrate:
Act = new arcmt::MigrateAction(Act,
- CI.getFrontendOpts().ARCMTMigrateDir,
- CI.getFrontendOpts().ARCMTMigrateReportOut,
- CI.getFrontendOpts().ARCMTMigrateEmitARCErrors);
+ FEOpts.ARCMTMigrateDir,
+ FEOpts.ARCMTMigrateReportOut,
+ FEOpts.ARCMTMigrateEmitARCErrors);
break;
}
// If there are any AST files to merge, create a frontend action
// adaptor to perform the merge.
- if (!CI.getFrontendOpts().ASTMergeFiles.empty())
- Act = new ASTMergeAction(Act, &CI.getFrontendOpts().ASTMergeFiles[0],
- CI.getFrontendOpts().ASTMergeFiles.size());
+ if (!FEOpts.ASTMergeFiles.empty())
+ Act = new ASTMergeAction(Act, FEOpts.ASTMergeFiles[0]);
return Act;
}
More information about the cfe-commits
mailing list