Chromium Code Reviews| Index: src/IceGlobalContext.cpp |
| diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp |
| index c8b429fc4b1b4c3d0a88fcf6a4534b82b8226f29..326af659a7ebccac151b4a189f8607053ea528d2 100644 |
| --- a/src/IceGlobalContext.cpp |
| +++ b/src/IceGlobalContext.cpp |
| @@ -12,6 +12,8 @@ |
| // |
| //===----------------------------------------------------------------------===// |
| +#include "llvm/ADT/STLExtras.h" |
| + |
| #include <ctype.h> // isdigit(), isupper() |
| #include <locale> // locale |
| @@ -19,6 +21,7 @@ |
| #include "IceClFlags.h" |
| #include "IceDefs.h" |
| #include "IceGlobalContext.h" |
| +#include "IceGlobalInits.h" |
| #include "IceOperand.h" |
| #include "IceTargetLowering.h" |
| #include "IceTimerTree.h" |
| @@ -289,7 +292,9 @@ IceString GlobalContext::mangleName(const IceString &Name) const { |
| return getTestPrefix() + Name; |
| } |
| -GlobalContext::~GlobalContext() {} |
| +GlobalContext::~GlobalContext() { |
| + llvm::DeleteContainerPointers(GlobalAddresses); |
| +} |
| Constant *GlobalContext::getConstantInt64(Type Ty, uint64_t ConstantInt64) { |
| assert(Ty == IceType_i64); |
| @@ -385,6 +390,22 @@ ConstantList GlobalContext::getConstantPool(Type Ty) const { |
| llvm_unreachable("Unknown type"); |
| } |
| +Function *GlobalContext::newFunction(const FuncSigType *Signature, |
| + unsigned CallingConv, unsigned Linkage, |
| + bool IsProto) { |
| + Function *Func = new Function( |
| + *Signature, static_cast<llvm::CallingConv::ID>(CallingConv), |
| + static_cast<llvm::GlobalValue::LinkageTypes>(Linkage), IsProto); |
| + GlobalAddresses.push_back(Func); |
| + return Func; |
| +} |
| + |
| +GlobalVariable *GlobalContext::newGlobalVariable() { |
| + GlobalVariable *Vbl = new GlobalVariable(); |
|
jvoung (off chromium)
2014/10/10 01:47:28
Most abbreviations of "Variable" are "Var" in the
Karl
2014/10/10 20:17:30
Done.
|
| + GlobalAddresses.push_back(Vbl); |
| + return Vbl; |
| +} |
| + |
| TimerIdT GlobalContext::getTimerID(TimerStackIdT StackID, |
| const IceString &Name) { |
| assert(StackID < Timers.size()); |