aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-15 10:32:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-15 10:32:44 +0000
commit37083ebf8085108c1614163092974f49b17b19eb (patch)
treeccf7658d9fa7e484cc30e46bac00f974c9844503 /lib/Support
parent23cac004f0b681e298ad8a696d76d0c6f5461891 (diff)
downloadexternal_llvm-37083ebf8085108c1614163092974f49b17b19eb.zip
external_llvm-37083ebf8085108c1614163092974f49b17b19eb.tar.gz
external_llvm-37083ebf8085108c1614163092974f49b17b19eb.tar.bz2
Allow multiple registrations of the same target.
- This doesn't necessarily seem like a good idea, but the JIT unittest currently relies on it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/TargetRegistry.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Support/TargetRegistry.cpp b/lib/Support/TargetRegistry.cpp
index 258d703..77cf2dd 100644
--- a/lib/Support/TargetRegistry.cpp
+++ b/lib/Support/TargetRegistry.cpp
@@ -111,15 +111,13 @@ void TargetRegistry::RegisterTarget(Target &T,
Target::TripleMatchQualityFnTy TQualityFn,
Target::ModuleMatchQualityFnTy MQualityFn,
Target::JITMatchQualityFnTy JITQualityFn) {
- // Note that we don't require the constructor functions already be defined, in
- // case a module happens to initialize the optional functionality before the
- // target.
- assert(!T.Next && !T.Name && !T.ShortDesc && !T.TripleMatchQualityFn &&
- !T.ModuleMatchQualityFn && !T.JITMatchQualityFn &&
- "This Target already registered!");
-
assert(Name && ShortDesc && TQualityFn && MQualityFn && JITQualityFn &&
"Missing required target information!");
+
+ // Check if this target has already been initialized, we allow this as a
+ // convenience to some clients.
+ if (T.Name)
+ return;
// Add to the list of targets.
T.Next = FirstTarget;