| 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) {
|
|
|