diff options
author | Mark Heffernan <meheff@google.com> | 2014-07-21 19:06:29 +0000 |
---|---|---|
committer | Mark Heffernan <meheff@google.com> | 2014-07-21 19:06:29 +0000 |
commit | 63a2d07f716e3f308da87d5aae1fb945aee034eb (patch) | |
tree | f29687360139ab358ccd1cb9e74e5781782e3a0a /clang | |
parent | 4532489752ff0d330192e50a34b0aa8d2c7c329c (diff) | |
download | llvm-63a2d07f716e3f308da87d5aae1fb945aee034eb.zip llvm-63a2d07f716e3f308da87d5aae1fb945aee034eb.tar.gz llvm-63a2d07f716e3f308da87d5aae1fb945aee034eb.tar.bz2 |
Fix build breakage caused by use of std::to_string(int). Replace with raw_string_ostream.
llvm-svn: 213578
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Basic/Attr.td | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index 4850e26..62bb1dd 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -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(); } }]; |