aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/TargetRegistry.cpp
diff options
context:
space:
mode:
authorStuart Hastings <stuart@apple.com>2009-07-15 17:27:11 +0000
committerStuart Hastings <stuart@apple.com>2009-07-15 17:27:11 +0000
commit2286f8dc4cec0625f7d7a14e2570926cf8599646 (patch)
tree2443581013659cf94139995c03b6883ff4ab43db /lib/Support/TargetRegistry.cpp
parent7fe3dd5b7ea9ef7d3cfd6d26dfdd7ddf49718339 (diff)
downloadexternal_llvm-2286f8dc4cec0625f7d7a14e2570926cf8599646.zip
external_llvm-2286f8dc4cec0625f7d7a14e2570926cf8599646.tar.gz
external_llvm-2286f8dc4cec0625f7d7a14e2570926cf8599646.tar.bz2
Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to repair broken LLVM-GCC build.
Will revert 75770 in the llvm-gcc trunk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/TargetRegistry.cpp')
-rw-r--r--lib/Support/TargetRegistry.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Support/TargetRegistry.cpp b/lib/Support/TargetRegistry.cpp
index 77cf2dd..258d703 100644
--- a/lib/Support/TargetRegistry.cpp
+++ b/lib/Support/TargetRegistry.cpp
@@ -111,13 +111,15 @@ 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;