mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
add a way to disable all builtins, wire it up to opt's -disable-simplifylibcalls flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125978 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c19175c9d8
commit
188a7e00e7
@ -55,6 +55,10 @@ public:
|
|||||||
void setAvailable(LibFunc::Func F) {
|
void setAvailable(LibFunc::Func F) {
|
||||||
AvailableArray[F/8] |= 1 << (F&7);
|
AvailableArray[F/8] |= 1 << (F&7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// disableAllFunctions - This disables all builtins, which is used for
|
||||||
|
/// options like -fno-builtin.
|
||||||
|
void disableAllFunctions();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
@ -47,3 +47,9 @@ TargetLibraryInfo::TargetLibraryInfo(const Triple &T) : ImmutablePass(ID) {
|
|||||||
|
|
||||||
initialize(*this, T);
|
initialize(*this, T);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// disableAllFunctions - This disables all builtins, which is used for options
|
||||||
|
/// like -fno-builtin.
|
||||||
|
void TargetLibraryInfo::disableAllFunctions() {
|
||||||
|
memset(AvailableArray, 0, sizeof(AvailableArray));
|
||||||
|
}
|
||||||
|
@ -532,8 +532,12 @@ int main(int argc, char **argv) {
|
|||||||
PassManager Passes;
|
PassManager Passes;
|
||||||
|
|
||||||
// Add an appropriate TargetLibraryInfo pass for the module's triple.
|
// Add an appropriate TargetLibraryInfo pass for the module's triple.
|
||||||
if (!M->getTargetTriple().empty())
|
TargetLibraryInfo *TLI = new TargetLibraryInfo(Triple(M->getTargetTriple()));
|
||||||
Passes.add(new TargetLibraryInfo(Triple(M->getTargetTriple())));
|
|
||||||
|
// The -disable-simplify-libcalls flag actually disables all builtin optzns.
|
||||||
|
if (DisableSimplifyLibCalls)
|
||||||
|
TLI->disableAllFunctions();
|
||||||
|
Passes.add(TLI);
|
||||||
|
|
||||||
// Add an appropriate TargetData instance for this module.
|
// Add an appropriate TargetData instance for this module.
|
||||||
TargetData *TD = 0;
|
TargetData *TD = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user