From 725584e26d79d00ad4b14cab15babc4b4499d22e Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Wed, 15 Nov 2017 23:55:44 +0000 Subject: Add backend name to Target to enable runtime info to be fed back into TableGen Summary: Make it possible to feed runtime information back to tablegen to enable profile-guided tablegen-eration, detection of untested tablegen definitions, etc. Being a cross-compiler by nature, LLVM will potentially collect data for multiple architectures (e.g. when running 'ninja check'). We therefore need a way for TableGen to figure out what data applies to the backend it is generating at the time. This patch achieves that by including the name of the 'def X : Target ...' for the backend in the TargetRegistry. Reviewers: qcolombet Reviewed By: qcolombet Subscribers: jholewinski, arsenm, jyknight, aditya_nandakumar, sdardis, nemanjai, ab, nhaehnle, t.p.northover, javed.absar, qcolombet, llvm-commits, fedor.sergeev Differential Revision: https://reviews.llvm.org/D39742 llvm-svn: 318352 --- llvm/lib/Support/TargetRegistry.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Support/TargetRegistry.cpp') diff --git a/llvm/lib/Support/TargetRegistry.cpp b/llvm/lib/Support/TargetRegistry.cpp index b5c28325311..ed999fce5da 100644 --- a/llvm/lib/Support/TargetRegistry.cpp +++ b/llvm/lib/Support/TargetRegistry.cpp @@ -86,9 +86,9 @@ const Target *TargetRegistry::lookupTarget(const std::string &TT, return &*I; } -void TargetRegistry::RegisterTarget(Target &T, - const char *Name, +void TargetRegistry::RegisterTarget(Target &T, const char *Name, const char *ShortDesc, + const char *BackendName, Target::ArchMatchFnTy ArchMatchFn, bool HasJIT) { assert(Name && ShortDesc && ArchMatchFn && @@ -105,6 +105,7 @@ void TargetRegistry::RegisterTarget(Target &T, T.Name = Name; T.ShortDesc = ShortDesc; + T.BackendName = BackendName; T.ArchMatchFn = ArchMatchFn; T.HasJIT = HasJIT; } -- cgit v1.2.3