[cfe-commits] r86611 - /cfe/trunk/tools/clang-cc/clang-cc.cpp

Daniel Dunbar daniel at zuster.org
Mon Nov 9 16:46:09 CST 2009


Author: ddunbar
Date: Mon Nov  9 16:46:09 2009
New Revision: 86611

URL: http://llvm.org/viewvc/llvm-project?rev=86611&view=rev
Log:
Switch Target* to Target&.

Modified:
    cfe/trunk/tools/clang-cc/clang-cc.cpp

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=86611&r1=86610&r2=86611&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Mon Nov  9 16:46:09 2009
@@ -692,14 +692,14 @@
                llvm::cl::init(-1));
 
 static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
-                                       TargetInfo *Target,
+                                       TargetInfo &Target,
                                        const llvm::StringMap<bool> &Features) {
   // Allow the target to set the default the language options as it sees fit.
-  Target->getDefaultLangOptions(Options);
+  Target.getDefaultLangOptions(Options);
 
   // Pass the map of target features to the target for validation and
   // processing.
-  Target->HandleTargetFeatures(Features);
+  Target.HandleTargetFeatures(Features);
 
   if (LangStd == lang_unspecified) {
     // Based on the base language, pick one.
@@ -882,7 +882,7 @@
   if (MainFileName.getPosition())
     Options.setMainFileName(MainFileName.c_str());
 
-  Target->setForcedLangOptions(Options);
+  Target.setForcedLangOptions(Options);
 }
 
 //===----------------------------------------------------------------------===//
@@ -1295,12 +1295,12 @@
 /// ComputeTargetFeatures - Recompute the target feature list to only
 /// be the list of things that are enabled, based on the target cpu
 /// and feature list.
-static void ComputeFeatureMap(TargetInfo *Target,
+static void ComputeFeatureMap(const TargetInfo &Target,
                               llvm::StringMap<bool> &Features) {
   assert(Features.empty() && "invalid map");
 
   // Initialize the feature map based on the target.
-  Target->getDefaultFeatures(TargetCPU, Features);
+  Target.getDefaultFeatures(TargetCPU, Features);
 
   // Apply the user specified deltas.
   for (llvm::cl::list<std::string>::iterator it = TargetFeatures.begin(),
@@ -1313,7 +1313,7 @@
               Name);
       exit(1);
     }
-    if (!Target->setFeatureEnabled(Features, Name + 1, (Name[0] == '+'))) {
+    if (!Target.setFeatureEnabled(Features, Name + 1, (Name[0] == '+'))) {
       fprintf(stderr, "error: clang-cc: invalid target feature name: %s\n",
               Name + 1);
       exit(1);
@@ -2307,7 +2307,7 @@
 
   // Compute the feature set, unfortunately this effects the language!
   llvm::StringMap<bool> Features;
-  ComputeFeatureMap(Target.get(), Features);
+  ComputeFeatureMap(*Target, Features);
 
   for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i) {
     const std::string &InFile = InputFilenames[i];
@@ -2326,7 +2326,7 @@
     // Initialize language options, inferring file types from input filenames.
     LangOptions LangInfo;
     InitializeLangOptions(LangInfo, LK);
-    InitializeLanguageStandard(LangInfo, LK, Target.get(), Features);
+    InitializeLanguageStandard(LangInfo, LK, *Target, Features);
 
     // Process the -I options and set them in the HeaderInfo.
     HeaderSearch HeaderInfo(FileMgr);




More information about the cfe-commits mailing list