From: Tobias Grosser Date: Fri, 26 Feb 2016 13:27:02 +0000 (+0000) Subject: BlockGenerators: Allow values to be removed from ScalarMap X-Git-Tag: llvmorg-3.9.0-rc1~13129 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8746fc88ef0af51e6fce3566c50def55d19d74f;p=platform%2Fupstream%2Fllvm.git BlockGenerators: Allow values to be removed from ScalarMap This function is not yet used in Polly, but is useful to external projects that generate multi-module code using Polly. llvm-svn: 262010 --- diff --git a/polly/include/polly/CodeGen/BlockGenerators.h b/polly/include/polly/CodeGen/BlockGenerators.h index 05b8f53..972df67 100644 --- a/polly/include/polly/CodeGen/BlockGenerators.h +++ b/polly/include/polly/CodeGen/BlockGenerators.h @@ -111,6 +111,17 @@ public: /// GlobalMap. Value *getOrCreateScalarAlloca(Value *ScalarBase); + /// @brief Remove a Value's allocation from the ScalarMap. + /// + /// This function allows to remove values from the ScalarMap. This is useful + /// if the corresponding alloca instruction will be deleted (or moved into + /// another module), as without removing these values the underlying + /// AssertingVH will trigger due to us still keeping reference to this + /// scalar. + /// + /// @param ScalarBase The value to remove. + void freeScalarAlloc(Value *ScalarBase) { ScalarMap.erase(ScalarBase); } + /// @brief Return the PHi-node alloca for @p ScalarBase /// /// If no alloca was mapped to @p ScalarBase a new one is created.