]> granicus.if.org Git - clang/commitdiff
Use variable in place of multiple CI.getFrontendOpts() calls and use a bit
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 4 Feb 2012 01:36:04 +0000 (01:36 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 4 Feb 2012 01:36:04 +0000 (01:36 +0000)
of ArrayRef goodness. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149739 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/FrontendActions.h
lib/Frontend/ASTMerge.cpp
lib/FrontendTool/ExecuteCompilerInvocation.cpp

index c41d40c8b6df5ced4705826f58c8b3c2f136211d..8f7fe87ee67de2d5f7086f6a6b8581df79a08541 100644 (file)
@@ -153,8 +153,7 @@ protected:
   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;
index a4104115f20a4338b0f1a1033bf6770accb2196b..d33e0ea2cdfe84b7e1c0aff51d49f051764f7a21 100644 (file)
@@ -79,8 +79,8 @@ void ASTMergeAction::EndSourceFileAction() {
 }
 
 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");
 }
 
index 9f2bdf25be5e29ed7d2263cf78368a6027a59a16..cfb185ec524b964954decdf5d92fef2b4cca79c2 100644 (file)
@@ -87,12 +87,14 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) {
   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 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) {
     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;
 }