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

Unified Diff: src/IceGlobalContext.cpp

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: Created 6 years, 8 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
Index: src/IceGlobalContext.cpp
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index 11de0130984823800f0332d2dd0f698786b4970a..b45a694f7b7877c3e13169ac14552daaa30b1507 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -17,6 +17,7 @@
#include "IceCfg.h"
#include "IceGlobalContext.h"
#include "IceOperand.h"
+#include "IceTargetLowering.h"
namespace Ice {
@@ -75,9 +76,11 @@ public:
GlobalContext::GlobalContext(llvm::raw_ostream *OsDump,
llvm::raw_ostream *OsEmit, VerboseMask Mask,
+ TargetArch Arch, OptLevel Opt,
IceString TestPrefix)
: StrDump(OsDump), StrEmit(OsEmit), VMask(Mask),
- ConstPool(new ConstantPool()), TestPrefix(TestPrefix) {}
+ ConstPool(new ConstantPool()), Arch(Arch), Opt(Opt),
+ TestPrefix(TestPrefix), HasEmittedFirstMethod(false) {}
// In this context, name mangling means to rewrite a symbol using a
// given prefix. For a C++ symbol, nest the original symbol inside
@@ -100,9 +103,9 @@ IceString GlobalContext::mangleName(const IceString &Name) const {
unsigned PrefixLength = getTestPrefix().length();
char NameBase[1 + Name.length()];
- const size_t BufLen = 30 + Name.length() + getTestPrefix().length();
+ const size_t BufLen = 30 + Name.length() + PrefixLength;
char NewName[BufLen];
- uint32_t BaseLength = 0;
+ uint32_t BaseLength = 0; // using uint32_t due to sscanf format string
int ItemsParsed = sscanf(Name.c_str(), "_ZN%s", NameBase);
if (ItemsParsed == 1) {

Powered by Google App Engine
This is Rietveld 408576698