mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-11 10:25:41 +00:00
[PM] Make the (really awesome) file comment here available as part of
the Doxygen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195709 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -6,46 +6,47 @@
|
|||||||
// License. See LICENSE.TXT for details.
|
// License. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
/// \file
|
||||||
// This interface is used to build and manipulate a call graph, which is a very
|
///
|
||||||
// useful tool for interprocedural optimization.
|
/// This file provides interfaces used to build and manipulate a call graph,
|
||||||
//
|
/// which is a very useful tool for interprocedural optimization.
|
||||||
// Every function in a module is represented as a node in the call graph. The
|
///
|
||||||
// callgraph node keeps track of which functions the are called by the function
|
/// Every function in a module is represented as a node in the call graph. The
|
||||||
// corresponding to the node.
|
/// callgraph node keeps track of which functions the are called by the
|
||||||
//
|
/// function corresponding to the node.
|
||||||
// A call graph may contain nodes where the function that they correspond to is
|
///
|
||||||
// null. These 'external' nodes are used to represent control flow that is not
|
/// A call graph may contain nodes where the function that they correspond to
|
||||||
// represented (or analyzable) in the module. In particular, this analysis
|
/// is null. These 'external' nodes are used to represent control flow that is
|
||||||
// builds one external node such that:
|
/// not represented (or analyzable) in the module. In particular, this
|
||||||
// 1. All functions in the module without internal linkage will have edges
|
/// analysis builds one external node such that:
|
||||||
// from this external node, indicating that they could be called by
|
/// 1. All functions in the module without internal linkage will have edges
|
||||||
// functions outside of the module.
|
/// from this external node, indicating that they could be called by
|
||||||
// 2. All functions whose address is used for something more than a direct
|
/// functions outside of the module.
|
||||||
// call, for example being stored into a memory location will also have an
|
/// 2. All functions whose address is used for something more than a direct
|
||||||
// edge from this external node. Since they may be called by an unknown
|
/// call, for example being stored into a memory location will also have
|
||||||
// caller later, they must be tracked as such.
|
/// an edge from this external node. Since they may be called by an
|
||||||
//
|
/// unknown caller later, they must be tracked as such.
|
||||||
// There is a second external node added for calls that leave this module.
|
///
|
||||||
// Functions have a call edge to the external node iff:
|
/// There is a second external node added for calls that leave this module.
|
||||||
// 1. The function is external, reflecting the fact that they could call
|
/// Functions have a call edge to the external node iff:
|
||||||
// anything without internal linkage or that has its address taken.
|
/// 1. The function is external, reflecting the fact that they could call
|
||||||
// 2. The function contains an indirect function call.
|
/// anything without internal linkage or that has its address taken.
|
||||||
//
|
/// 2. The function contains an indirect function call.
|
||||||
// As an extension in the future, there may be multiple nodes with a null
|
///
|
||||||
// function. These will be used when we can prove (through pointer analysis)
|
/// As an extension in the future, there may be multiple nodes with a null
|
||||||
// that an indirect call site can call only a specific set of functions.
|
/// function. These will be used when we can prove (through pointer analysis)
|
||||||
//
|
/// that an indirect call site can call only a specific set of functions.
|
||||||
// Because of these properties, the CallGraph captures a conservative superset
|
///
|
||||||
// of all of the caller-callee relationships, which is useful for
|
/// Because of these properties, the CallGraph captures a conservative superset
|
||||||
// transformations.
|
/// of all of the caller-callee relationships, which is useful for
|
||||||
//
|
/// transformations.
|
||||||
// The CallGraph class also attempts to figure out what the root of the
|
///
|
||||||
// CallGraph is, which it currently does by looking for a function named 'main'.
|
/// The CallGraph class also attempts to figure out what the root of the
|
||||||
// If no function named 'main' is found, the external node is used as the entry
|
/// CallGraph is, which it currently does by looking for a function named
|
||||||
// node, reflecting the fact that any function without internal linkage could
|
/// 'main'. If no function named 'main' is found, the external node is used as
|
||||||
// be called into (which is common for libraries).
|
/// the entry node, reflecting the fact that any function without internal
|
||||||
//
|
/// linkage could be called into (which is common for libraries).
|
||||||
|
///
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#ifndef LLVM_ANALYSIS_CALLGRAPH_H
|
#ifndef LLVM_ANALYSIS_CALLGRAPH_H
|
||||||
|
Reference in New Issue
Block a user