summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2015-07-30 19:27:04 +0000
committerMichael Kruse <llvm@meinersbur.de>2015-07-30 19:27:04 +0000
commit471a5e3388b00f7a5172d3f7faa448f8a412e599 (patch)
treee6c251276109146ae6690d0ba01be9f614471160 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parentc0d4b00fee2768bac7dca3362360ad993e0db75b (diff)
downloadbcm5719-llvm-471a5e3388b00f7a5172d3f7faa448f8a412e599.tar.gz
bcm5719-llvm-471a5e3388b00f7a5172d3f7faa448f8a412e599.zip
Move computations out of constructors
It is common practice to keep constructors lightweight. The reasons include: - The vtable during the constructor's execution is set to the static type of the object, not to the vtable of the derived class. That is, method calls behave differently in constructors and ordinary methods. This way it is possible to call unimplemented methods of abstract classes, which usually results in a segmentation fault. - If an exception is thrown in the constructor, the destructor is not called, potentially leaking memory. - Code in constructors cannot be called in a regular way, e.g. from non-constructor methods of derived classes. - Because it is common practice, people may not expect the constructor to do more than initializing data and skip them when looking for bugs. Not all of these are applicable to LLVM (e.g. exceptions are disabled). This patch refactors out the computational work in the constructors of Scop and IslAst into regular init functions and introduces static create-functions as replacement. Differential revision: http://reviews.llvm.org/D11491 Reviewers: grosser, jdoerfert llvm-svn: 243677
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud