Use reference instead of copy.
authorJakub Staszak <kubastaszak@gmail.com>
Mon, 16 Sep 2013 22:03:38 +0000 (22:03 +0000)
committerJakub Staszak <kubastaszak@gmail.com>
Mon, 16 Sep 2013 22:03:38 +0000 (22:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190813 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ShrinkWrapping.cpp
lib/MC/MCParser/AsmParser.cpp

index 6c826deaf099d24c15c27bfebfc9f0334fc806b6..2b01fdd8d06628dcf3010db254ae3c726c68bc3e 100644 (file)
@@ -357,7 +357,7 @@ void PEI::propagateUsesAroundLoop(MachineBasicBlock* MBB, MachineLoop* LP) {
 ///
 bool PEI::calculateSets(MachineFunction &Fn) {
   // Sets used to compute spill, restore placement sets.
-  const std::vector<CalleeSavedInfo> CSI =
+  const std::vector<CalleeSavedInfo> &CSI =
     Fn.getFrameInfo()->getCalleeSavedInfo();
 
   // If no CSRs used, we are done.
@@ -1054,7 +1054,7 @@ std::string PEI::getBasicBlockName(const MachineBasicBlock* MBB) {
 
 std::string PEI::stringifyCSRegSet(const CSRegSet& s) {
   const TargetRegisterInfo* TRI = MF->getTarget().getRegisterInfo();
-  const std::vector<CalleeSavedInfo> CSI =
+  const std::vector<CalleeSavedInfo> &CSI =
     MF->getFrameInfo()->getCalleeSavedInfo();
 
   std::ostringstream srep;
index ae88a3ee73c17728b8dd10ffc233210fe6b71a10..2733f64a31a7da6a03ba1dd40b7ce9569520e222 100644 (file)
@@ -1646,7 +1646,7 @@ void AsmParser::DiagHandler(const SMDiagnostic &Diag, void *Context) {
   // Use the CppHashFilename and calculate a line number based on the
   // CppHashLoc and CppHashLineNumber relative to this Diag's SMLoc for
   // the diagnostic.
-  const std::string Filename = Parser->CppHashFilename;
+  const std::string &Filename = Parser->CppHashFilename;
 
   int DiagLocLineNo = DiagSrcMgr.FindLineNumber(DiagLoc, DiagBuf);
   int CppHashLocLineNo =