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

Unified Diff: src/IceGlobalContext.cpp

Issue 641193002: Introduce the notion of function addresses in Subzero. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nit in test. Created 6 years, 2 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/IceGlobalContext.h ('k') | src/IceGlobalInits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.cpp
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index c8b429fc4b1b4c3d0a88fcf6a4534b82b8226f29..b724433e7108fd5f65b44015855c67b9870bd21e 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -19,6 +19,7 @@
#include "IceClFlags.h"
#include "IceDefs.h"
#include "IceGlobalContext.h"
+#include "IceGlobalInits.h"
#include "IceOperand.h"
#include "IceTargetLowering.h"
#include "IceTimerTree.h"
@@ -289,7 +290,9 @@ IceString GlobalContext::mangleName(const IceString &Name) const {
return getTestPrefix() + Name;
}
-GlobalContext::~GlobalContext() {}
+GlobalContext::~GlobalContext() {
+ llvm::DeleteContainerPointers(GlobalDeclarations);
+}
Constant *GlobalContext::getConstantInt64(Type Ty, uint64_t ConstantInt64) {
assert(Ty == IceType_i64);
@@ -385,6 +388,23 @@ ConstantList GlobalContext::getConstantPool(Type Ty) const {
llvm_unreachable("Unknown type");
}
+FunctionDeclaration *
+GlobalContext::newFunctionDeclaration(const FuncSigType *Signature,
+ unsigned CallingConv, unsigned Linkage,
+ bool IsProto) {
+ FunctionDeclaration *Func = new FunctionDeclaration(
+ *Signature, static_cast<llvm::CallingConv::ID>(CallingConv),
+ static_cast<llvm::GlobalValue::LinkageTypes>(Linkage), IsProto);
+ GlobalDeclarations.push_back(Func);
+ return Func;
+}
+
+VariableDeclaration *GlobalContext::newVariableDeclaration() {
+ VariableDeclaration *Var = new VariableDeclaration();
+ GlobalDeclarations.push_back(Var);
+ return Var;
+}
+
TimerIdT GlobalContext::getTimerID(TimerStackIdT StackID,
const IceString &Name) {
assert(StackID < Timers.size());
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceGlobalInits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698