mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Introduce SpecialCaseList::isIn overload for GlobalAliases.
Differential Revision: http://llvm-reviews.chandlerc.com/D1437 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188688 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -174,7 +174,7 @@ bool SpecialCaseList::isIn(const Function& F, const StringRef Category) const {
|
||||
inSectionCategory("fun", F.getName(), Category);
|
||||
}
|
||||
|
||||
static StringRef GetGVTypeString(const GlobalVariable &G) {
|
||||
static StringRef GetGlobalTypeString(const GlobalValue &G) {
|
||||
// Types of GlobalVariables are always pointer types.
|
||||
Type *GType = G.getType()->getElementType();
|
||||
// For now we support blacklisting struct types only.
|
||||
@ -189,7 +189,19 @@ bool SpecialCaseList::isIn(const GlobalVariable &G,
|
||||
const StringRef Category) const {
|
||||
return isIn(*G.getParent(), Category) ||
|
||||
inSectionCategory("global", G.getName(), Category) ||
|
||||
inSectionCategory("type", GetGVTypeString(G), Category);
|
||||
inSectionCategory("type", GetGlobalTypeString(G), Category);
|
||||
}
|
||||
|
||||
bool SpecialCaseList::isIn(const GlobalAlias &GA,
|
||||
const StringRef Category) const {
|
||||
if (isIn(*GA.getParent(), Category))
|
||||
return true;
|
||||
|
||||
if (isa<FunctionType>(GA.getType()->getElementType()))
|
||||
return inSectionCategory("fun", GA.getName(), Category);
|
||||
|
||||
return inSectionCategory("global", GA.getName(), Category) ||
|
||||
inSectionCategory("type", GetGlobalTypeString(GA), Category);
|
||||
}
|
||||
|
||||
bool SpecialCaseList::isIn(const Module &M, const StringRef Category) const {
|
||||
|
Reference in New Issue
Block a user