r213578 - Fix build breakage caused by use of std::to_string(int). Replace with raw_string_ostream.

Galina Kistanova gkistanova at gmail.com
Tue Jul 22 11:52:42 PDT 2014


This is a FreeBSD 9.2 box which in this case is running the following gcc47:

$ /usr/local/bin/gcc47 -v
Using built-in specs.
COLLECT_GCC=gcc47
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc47/gcc/x86_64-portbld-freebsd9.1/4.7.4/lto-wrapper
Target: x86_64-portbld-freebsd9.1
Configured with: ./../gcc-4.7-20131214/configure --disable-nls
--libdir=/usr/local/lib/gcc47 --libexecdir=/usr/local/libexec/gcc47
--program-suffix=47 --with-as=/usr/local/bin/as --with-gmp=/usr/local
--with-gxx-include-dir=/usr/local/lib/gcc47/include/c++/
--with-ld=/usr/local/bin/ld --with-libiconv-prefix=/usr/local
--with-pkgversion='FreeBSD Ports Collection' --with-system-zlib
--with-ecj-jar=/usr/local/share/java/ecj-4.5.jar
--enable-languages=c,c++,objc,fortran,java --prefix=/usr/local
--mandir=/usr/local/man --infodir=/usr/local/info/gcc47
--build=x86_64-portbld-freebsd9.1
Thread model: posix
gcc version 4.7.4 20131214 (prerelease) (FreeBSD Ports Collection)
 $ ls -la /usr/local/lib/gcc47/libstdc++*
-rw-r--r--  1 root  wheel  16306322 Dec 18  2013
/usr/local/lib/gcc47/libstdc++.a
lrwxr-xr-x  1 root  wheel        14 Dec 18  2013
/usr/local/lib/gcc47/libstdc++.so -> libstdc++.so.6
-rwxr-xr-x  1 root  wheel   6457984 Dec 18  2013
/usr/local/lib/gcc47/libstdc++.so.6
-r--r--r--  1 root  wheel      2311 Dec 18  2013
/usr/local/lib/gcc47/libstdc++.so.6-gdb.py
 Though a quick check shows the same issue exists there for gcc49:

$ /usr/local/bin/gcc49 -v
Using built-in specs.
COLLECT_GCC=/usr/local/bin/gcc49
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc49/gcc/x86_64-portbld-freebsd9.1/4.9.0/lto-wrapper
Target: x86_64-portbld-freebsd9.1
Configured with: ./../gcc-4.9-20131215/configure --disable-nls
--libdir=/usr/local/lib/gcc49 --libexecdir=/usr/local/libexec/gcc49
--program-suffix=49 --with-as=/usr/local/bin/as --with-gmp=/usr/local
--with-gxx-include-dir=/usr/local/lib/gcc49/include/c++/
--with-ld=/usr/local/bin/ld --with-libiconv-prefix=/usr/local
--with-pkgversion='FreeBSD Ports Collection' --with-system-zlib
--with-ecj-jar=/usr/local/share/java/ecj-4.5.jar
--enable-languages=c,c++,objc,fortran,java --prefix=/usr/local
--mandir=/usr/local/man --infodir=/usr/local/info/gcc49
--build=x86_64-portbld-freebsd9.1
Thread model: posix
gcc version 4.9.0 20131215 (experimental) (FreeBSD Ports Collection)
 $ ls -la /usr/local/lib/gcc49/libstdc++*
-rw-r--r--  1 root  wheel  17673116 Dec 19  2013
/usr/local/lib/gcc49/libstdc++.a
lrwxr-xr-x  1 root  wheel        14 Dec 19  2013
/usr/local/lib/gcc49/libstdc++.so -> libstdc++.so.6
-rwxr-xr-x  1 root  wheel   6929124 Dec 19  2013
/usr/local/lib/gcc49/libstdc++.so.6
-r--r--r--  1 root  wheel      2310 Dec 19  2013
/usr/local/lib/gcc49/libstdc++.so.6-gdb.py
 I will look into this further.

Thanks

Galina




On Mon, Jul 21, 2014 at 12:31 PM, Aaron Ballman <aaron at aaronballman.com>
wrote:

> This is strange to me. Since we require C++11, and std::to_string is
> part of C++11, this shouldn't be required. I'm wondering if the
> standard library on this bot needs to be updated -- Galina, is this
> something you could look into?
>
> Thanks!
>
> ~Aaron
>
> On Mon, Jul 21, 2014 at 3:25 PM, Mark Heffernan <meheff at google.com> wrote:
> > On Jul 21, 2014 12:19 PM, "Aaron Ballman" <aaron at aaronballman.com>
> wrote:
> >>
> >> On Mon, Jul 21, 2014 at 3:06 PM, Mark Heffernan <meheff at google.com>
> wrote:
> >> > Author: meheff
> >> > Date: Mon Jul 21 14:06:29 2014
> >> > New Revision: 213578
> >> >
> >> > URL: http://llvm.org/viewvc/llvm-project?rev=213578&view=rev
> >> > Log:
> >> > Fix build breakage caused by use of std::to_string(int).  Replace with
> >> > raw_string_ostream.
> >>
> >> Out of curiosity, which bot(s) can't handle std::to_string?
> >
> >
> http://lab.llvm.org:8011/builders/clang-mergefunc-x86_64-freeBSD9.2/builds/7633
> >
> > Mark
> >
> >>
> >> ~Aaron
> >>
> >> >
> >> > Modified:
> >> >     cfe/trunk/include/clang/Basic/Attr.td
> >> >
> >> > Modified: cfe/trunk/include/clang/Basic/Attr.td
> >> > URL:
> >> >
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=213578&r1=213577&r2=213578&view=diff
> >> >
> >> >
> ==============================================================================
> >> > --- cfe/trunk/include/clang/Basic/Attr.td (original)
> >> > +++ cfe/trunk/include/clang/Basic/Attr.td Mon Jul 21 14:06:29 2014
> >> > @@ -1814,40 +1814,45 @@ def LoopHint : Attr {
> >> >        // String "unroll" of "#pragma unroll" is already emitted as
> the
> >> >        // pragma name.
> >> >        if (option == UnrollCount)
> >> > -        OS << getValueString();
> >> > +        printArgument(OS);
> >> >        OS << "\n";
> >> >        return;
> >> >      }
> >> >      assert(SpellingIndex == Pragma_clang_loop && "Unexpected
> >> > spelling");
> >> > -    OS << getOptionName(option) << getValueString() << "\n";
> >> > +    OS << getOptionName(option);
> >> > +    printArgument(OS);
> >> > +    OS << "\n";
> >> >    }
> >> >
> >> > -  // Return a string containing the loop hint argument including the
> >> > -  // enclosing parentheses.
> >> > -  std::string getValueString() const {
> >> > -    std::string ValueName;
> >> > +  // Prints the loop hint argument including the enclosing
> parentheses
> >> > to OS.
> >> > +  void printArgument(raw_ostream &OS) const {
> >> > +    OS << "(";
> >> >      if (option == VectorizeWidth || option == InterleaveCount ||
> >> >          option == UnrollCount)
> >> > -      ValueName = std::to_string(value);
> >> > +      OS << value;
> >> >      else if (value)
> >> > -      ValueName = "enable";
> >> > +      OS << "enable";
> >> >      else
> >> > -      ValueName = "disable";
> >> > -
> >> > -    return "(" + ValueName + ")";
> >> > +      OS << "disable";
> >> > +    OS << ")";
> >> >    }
> >> >
> >> >    // Return a string suitable for identifying this attribute in
> >> > diagnostics.
> >> >    std::string getDiagnosticName() const {
> >> > +    std::string DiagnosticName;
> >> > +    llvm::raw_string_ostream OS(DiagnosticName);
> >> >      unsigned SpellingIndex = getSpellingListIndex();
> >> >      if (SpellingIndex == Pragma_unroll && option == Unroll)
> >> > -      return "#pragma unroll";
> >> > +      OS << "#pragma unroll";
> >> >      else if (SpellingIndex == Pragma_unroll && option ==
> UnrollCount) {
> >> > -      return "#pragma unroll" + getValueString();
> >> > +      OS << "#pragma unroll";
> >> > +      printArgument(OS);
> >> >      } else {
> >> >        assert(SpellingIndex == Pragma_clang_loop && "Unexpected
> >> > spelling");
> >> > -      return std::string(getOptionName(option)) + getValueString();
> >> > +      OS << getOptionName(option);
> >> > +      printArgument(OS);
> >> >      }
> >> > +    return OS.str();
> >> >    }
> >> >    }];
> >> >
> >> >
> >> >
> >> > _______________________________________________
> >> > cfe-commits mailing list
> >> > cfe-commits at cs.uiuc.edu
> >> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140722/4f358be0/attachment.html>


More information about the cfe-commits mailing list