OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "native_client/src/trusted/plugin/pnacl_options.h" | 5 #include "native_client/src/trusted/plugin/pnacl_options.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "native_client/src/include/nacl_string.h" | 10 #include "native_client/src/include/nacl_string.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 return; | 38 return; |
39 } | 39 } |
40 opt_level_ = l; | 40 opt_level_ = l; |
41 } | 41 } |
42 | 42 |
43 std::vector<char> PnaclOptions::GetOptCommandline() { | 43 std::vector<char> PnaclOptions::GetOptCommandline() { |
44 std::vector<char> result; | 44 std::vector<char> result; |
45 std::vector<nacl::string> tokens; | 45 std::vector<nacl::string> tokens; |
46 | 46 |
47 // Split the experimental_flags_ + the -On along whitespace. | 47 // Split the experimental_flags_ + the -On along whitespace. |
48 // Mostly a copy of "base/string_util.h", but avoid importing | 48 // Mostly a copy of "base/strings/string_util.h", but avoid importing |
49 // base into the PPAPI plugin for now. | 49 // base into the PPAPI plugin for now. |
50 nacl::string delim(" "); | 50 nacl::string delim(" "); |
51 nacl::string str = experimental_flags_; | 51 nacl::string str = experimental_flags_; |
52 | 52 |
53 if (opt_level_ != -1) { | 53 if (opt_level_ != -1) { |
54 nacl::stringstream ss; | 54 nacl::stringstream ss; |
55 // Cast as int so that it doesn't think it's a char. | 55 // Cast as int so that it doesn't think it's a char. |
56 ss << " -O" << static_cast<int>(opt_level_); | 56 ss << " -O" << static_cast<int>(opt_level_); |
57 str += ss.str(); | 57 str += ss.str(); |
58 } | 58 } |
(...skipping 14 matching lines...) Expand all Loading... |
73 nacl::string t = tokens[i]; | 73 nacl::string t = tokens[i]; |
74 result.reserve(result.size() + t.size()); | 74 result.reserve(result.size() + t.size()); |
75 std::copy(t.begin(), t.end(), std::back_inserter(result)); | 75 std::copy(t.begin(), t.end(), std::back_inserter(result)); |
76 result.push_back('\x00'); | 76 result.push_back('\x00'); |
77 } | 77 } |
78 | 78 |
79 return result; | 79 return result; |
80 } | 80 } |
81 | 81 |
82 } // namespace plugin | 82 } // namespace plugin |
OLD | NEW |