diff options
| author | Pavel Labath <pavel@labath.sk> | 2021-10-05 08:29:16 +0200 |
|---|---|---|
| committer | Pavel Labath <pavel@labath.sk> | 2021-10-05 08:35:18 +0200 |
| commit | 93c1b3caf052f6575abffd29ae53441db2849534 (patch) | |
| tree | b020682d6a7d36c62bee7d7e1606686d86e93690 /lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp | |
| parent | 3e9d04f7e422c3e62d9adac506df8e7d42acc206 (diff) | |
[lldb] Remove some anonymous namespaces
.. and reduce the scope of others. They don't follow llvm coding
standards (which say they should be used only when the same effect
cannot be achieved with the static keyword), and they set a bad example.
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp')
| -rw-r--r-- | lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp index bb09b5e171f0..f3b7c9dd3edc 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp @@ -22,9 +22,8 @@ #include "lldb/Utility/Log.h" using namespace lldb_private; -namespace { -bool isRSAPICall(llvm::Module &module, llvm::CallInst *call_inst) { +static bool isRSAPICall(llvm::Module &module, llvm::CallInst *call_inst) { // TODO get the list of renderscript modules from lldb and check if // this llvm::Module calls into any of them. (void)module; @@ -38,7 +37,8 @@ bool isRSAPICall(llvm::Module &module, llvm::CallInst *call_inst) { return true; } -bool isRSLargeReturnCall(llvm::Module &module, llvm::CallInst *call_inst) { +static bool isRSLargeReturnCall(llvm::Module &module, + llvm::CallInst *call_inst) { // i686 and x86_64 returns for large vectors in the RenderScript API are not // handled as normal register pairs, but as a hidden sret type. This is not // reflected in the debug info or mangled symbol name, and the android ABI @@ -58,7 +58,7 @@ bool isRSLargeReturnCall(llvm::Module &module, llvm::CallInst *call_inst) { ->getPrimitiveSizeInBits() > 128; } -bool isRSAllocationPtrTy(const llvm::Type *type) { +static bool isRSAllocationPtrTy(const llvm::Type *type) { if (!type->isPointerTy()) return false; auto ptr_type = type->getPointerElementType(); @@ -67,7 +67,8 @@ bool isRSAllocationPtrTy(const llvm::Type *type) { ptr_type->getStructName().startswith("struct.rs_allocation"); } -bool isRSAllocationTyCallSite(llvm::Module &module, llvm::CallInst *call_inst) { +static bool isRSAllocationTyCallSite(llvm::Module &module, + llvm::CallInst *call_inst) { (void)module; if (!call_inst->hasByValArgument()) return false; @@ -77,7 +78,7 @@ bool isRSAllocationTyCallSite(llvm::Module &module, llvm::CallInst *call_inst) { return false; } -llvm::FunctionType *cloneToStructRetFnTy(llvm::CallInst *call_inst) { +static llvm::FunctionType *cloneToStructRetFnTy(llvm::CallInst *call_inst) { // on x86 StructReturn functions return a pointer to the return value, rather // than the return value itself // [ref](http://www.agner.org/optimize/calling_conventions.pdf section 6). We @@ -122,9 +123,9 @@ llvm::FunctionType *cloneToStructRetFnTy(llvm::CallInst *call_inst) { orig->isVarArg()); } -bool findRSCallSites(llvm::Module &module, - std::set<llvm::CallInst *> &rs_callsites, - bool (*predicate)(llvm::Module &, llvm::CallInst *)) { +static bool +findRSCallSites(llvm::Module &module, std::set<llvm::CallInst *> &rs_callsites, + bool (*predicate)(llvm::Module &, llvm::CallInst *)) { bool found = false; for (auto &func : module.getFunctionList()) @@ -143,7 +144,7 @@ bool findRSCallSites(llvm::Module &module, return found; } -bool fixupX86StructRetCalls(llvm::Module &module) { +static bool fixupX86StructRetCalls(llvm::Module &module) { bool changed = false; // changing a basic block while iterating over it seems to have some // undefined behaviour going on so we find all RS callsites first, then fix @@ -207,7 +208,7 @@ bool fixupX86StructRetCalls(llvm::Module &module) { return changed; } -bool fixupRSAllocationStructByValCalls(llvm::Module &module) { +static bool fixupRSAllocationStructByValCalls(llvm::Module &module) { // On x86_64, calls to functions in the RS runtime that take an // `rs_allocation` type argument are actually handled as by-ref params by // bcc, but appear to be passed by value by lldb (the callsite all use @@ -259,7 +260,6 @@ bool fixupRSAllocationStructByValCalls(llvm::Module &module) { } return changed; } -} // end anonymous namespace namespace lldb_private { namespace lldb_renderscript { |
