Make it obvious that we're iterating over a range of pointers.
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 16 Apr 2015 12:43:07 +0000 (12:43 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 16 Apr 2015 12:43:07 +0000 (12:43 +0000)
Found by -Wrange-loop-analysis.

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

include/llvm/Analysis/RegionInfoImpl.h
lib/Target/CppBackend/CPPBackend.cpp

index 1f48d046720c8421e0ed165f0bbc4d97d2168b76..b31eefc15f784ea43999eccc2fd056303272e826 100644 (file)
@@ -487,7 +487,7 @@ void RegionBase<Tr>::print(raw_ostream &OS, bool print_tree, unsigned level,
     OS.indent(level * 2 + 2);
 
     if (Style == PrintBB) {
     OS.indent(level * 2 + 2);
 
     if (Style == PrintBB) {
-      for (const auto &BB : blocks())
+      for (const auto *BB : blocks())
         OS << BB->getName() << ", "; // TODO: remove the last ","
     } else if (Style == PrintRN) {
       for (const_element_iterator I = element_begin(), E = element_end();
         OS << BB->getName() << ", "; // TODO: remove the last ","
     } else if (Style == PrintRN) {
       for (const_element_iterator I = element_begin(), E = element_end();
index 0cb0beac8c1225e75ee31b666ea292ae8dcf682b..f1a7127e8fd91d26920353144e9bb2483e0b014c 100644 (file)
@@ -1724,7 +1724,7 @@ void CppWriter::printFunctionUses(const Function* F) {
   // initializers.
   if (GenerationType != GenFunction) {
     nl(Out) << "// Global Variable Definitions"; nl(Out);
   // initializers.
   if (GenerationType != GenFunction) {
     nl(Out) << "// Global Variable Definitions"; nl(Out);
-    for (const auto &GV : gvs) {
+    for (auto *GV : gvs) {
       if (GlobalVariable *Var = dyn_cast<GlobalVariable>(GV))
         printVariableBody(Var);
     }
       if (GlobalVariable *Var = dyn_cast<GlobalVariable>(GV))
         printVariableBody(Var);
     }