blob: 6da56b887e6e3e9391740d162de84cc752b5d06b [file] [log] [blame]
Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).
You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
Dead Code Detection
-------------------
A statement that can never be executed or whose execution is irrelevant is considered dead.
The most obvious form of dead code is an unreachable statement, which has no control flow path from the beginning of the program to the statement. Code can be unreachable either statically, meaning there is no path to the statement, or dynamically, meaning there are no paths that can be executable.
The second form of dead code is the dead definition, which is a definition of a data that is either redefined before it is referenced, or is never referenced. One restriction on this definition is that the execution of the assignment statement does not alter the value of any other data item other than the one being defined (that is, no side-effects).