Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: ppapi/native_client/src/trusted/plugin/pnacl_options.h

Issue 12623004: Allow PNaCl NMF to set translator optimization options for experimentation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_OPTIONS_H_
6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_OPTIONS_H_
7
8 #include <vector>
9
10 #include "native_client/src/include/nacl_string.h"
11 #include "native_client/src/include/portability.h"
12
13 namespace plugin {
14
15 // Options for PNaCl translation.
16 class PnaclOptions {
17
18 public:
19 PnaclOptions();
20 PnaclOptions(const PnaclOptions& opts);
21 ~PnaclOptions();
22
23 // Return true if we know the hash of the bitcode, for caching.
24 bool HasCacheKey() { return bitcode_hash_ != ""; }
25
26 // Return the cache key (which takes into account the bitcode hash,
27 // as well as the commandline options).
28 nacl::string GetCacheKey();
29
30 // Return true if the manifest did not specify any special options
31 // (just using the default).
32 bool HasDefaultOpts() {
33 return opt_level_ == -1 && experimental_flags_ == "";
34 }
35
36 // Return a character array of \x00 delimited commandline options.
37 std::vector<char> GetOptCommandline();
38
39 bool translate() { return translate_; }
40 void set_translate(bool t) { translate_ = t; }
41
42 uint8_t opt_level() { return opt_level_; }
43 void set_opt_level(int8_t l);
44
45 nacl::string experimental_flags() {
46 return experimental_flags_;
47 }
48 void set_experimental_flags(const nacl::string& f) {
49 experimental_flags_ = f;
50 }
51
52 void set_bitcode_hash(const nacl::string& c) {
53 bitcode_hash_ = c;
54 }
55
56 private:
57 bool translate_;
58 int8_t opt_level_;
59 nacl::string experimental_flags_;
60 nacl::string bitcode_hash_;
61 };
62
63 } // namespace plugin;
64 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_OPTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698