summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-03-15 02:13:19 +0000
committerTeresa Johnson <tejohnson@google.com>2016-03-15 02:13:19 +0000
commitb43027d1e0ebc57f6efb8961f3eb4df1b0828ba1 (patch)
treef1b708d3e09b4614bde408def28fa7d0306e3745 /llvm/lib/IR/Function.cpp
parentee88b615007d848e3a37bf3b341fc05ea1282b49 (diff)
downloadbcm5719-llvm-b43027d1e0ebc57f6efb8961f3eb4df1b0828ba1.tar.gz
bcm5719-llvm-b43027d1e0ebc57f6efb8961f3eb4df1b0828ba1.zip
Move global ID computation from Function to GlobalValue (NFC)
Since the static getGlobalIdentifier and getGUID methods are now called for global values other than functions, reflect that by moving these methods to the GlobalValue class. llvm-svn: 263524
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 427efbba4f8..3ecf386e9b1 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -1005,27 +1005,3 @@ Optional<uint64_t> Function::getEntryCount() const {
}
return None;
}
-
-std::string Function::getGlobalIdentifier(StringRef FuncName,
- GlobalValue::LinkageTypes Linkage,
- StringRef FileName) {
-
- // Function names may be prefixed with a binary '1' to indicate
- // that the backend should not modify the symbols due to any platform
- // naming convention. Do not include that '1' in the PGO profile name.
- if (FuncName[0] == '\1')
- FuncName = FuncName.substr(1);
-
- std::string NewFuncName = FuncName;
- if (llvm::GlobalValue::isLocalLinkage(Linkage)) {
- // For local symbols, prepend the main file name to distinguish them.
- // Do not include the full path in the file name since there's no guarantee
- // that it will stay the same, e.g., if the files are checked out from
- // version control in different locations.
- if (FileName.empty())
- NewFuncName = NewFuncName.insert(0, "<unknown>:");
- else
- NewFuncName = NewFuncName.insert(0, FileName.str() + ":");
- }
- return NewFuncName;
-}
OpenPOWER on IntegriCloud