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

Unified Diff: src/IceGlobalContext.h

Issue 265703002: Add Om1 lowering with no optimizations (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Merge changed from Karl's committed CL Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceDefs.h ('k') | src/IceGlobalContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.h
diff --git a/src/IceGlobalContext.h b/src/IceGlobalContext.h
index 9224d899cf449281efb176836bece1af6fc5d166..1ad5f07ea52201447b02d2d427c8893865e4046f 100644
--- a/src/IceGlobalContext.h
+++ b/src/IceGlobalContext.h
@@ -30,7 +30,8 @@ namespace Ice {
class GlobalContext {
public:
GlobalContext(llvm::raw_ostream *OsDump, llvm::raw_ostream *OsEmit,
- VerboseMask Mask, IceString TestPrefix);
+ VerboseMask Mask, TargetArch Arch, OptLevel Opt,
+ IceString TestPrefix);
~GlobalContext();
// Returns true if any of the specified options in the verbose mask
@@ -48,6 +49,9 @@ public:
Ostream &getStrDump() { return StrDump; }
Ostream &getStrEmit() { return StrEmit; }
+ TargetArch getTargetArch() const { return Arch; }
+ OptLevel getOptLevel() const { return Opt; }
+
// When emitting assembly, we allow a string to be prepended to
// names of translated functions. This makes it easier to create an
// execution test against a reference translator like llc, with both
@@ -55,6 +59,15 @@ public:
IceString getTestPrefix() const { return TestPrefix; }
IceString mangleName(const IceString &Name) const;
+ // The purpose of HasEmitted is to add a header comment at the
+ // beginning of assembly code emission, doing it once per file
+ // rather than once per function.
+ bool testAndSetHasEmittedFirstMethod() {
+ bool HasEmitted = HasEmittedFirstMethod;
+ HasEmittedFirstMethod = true;
+ return HasEmitted;
+ }
+
// Manage Constants.
// getConstant*() functions are not const because they might add
// something to the constant pool.
@@ -75,7 +88,10 @@ private:
llvm::BumpPtrAllocator Allocator;
VerboseMask VMask;
llvm::OwningPtr<class ConstantPool> ConstPool;
+ const TargetArch Arch;
+ const OptLevel Opt;
const IceString TestPrefix;
+ bool HasEmittedFirstMethod;
GlobalContext(const GlobalContext &) LLVM_DELETED_FUNCTION;
GlobalContext &operator=(const GlobalContext &) LLVM_DELETED_FUNCTION;
};
« no previous file with comments | « src/IceDefs.h ('k') | src/IceGlobalContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698