Skip to content
Snippets Groups Projects
Commit 50859c90 authored by Daniel Dunbar's avatar Daniel Dunbar
Browse files

Allow multiple registrations of the same target.

 - This doesn't necessarily seem like a good idea, but the JIT unittest
   currently relies on it.

llvm-svn: 75769
parent 81fed34d
No related branches found
No related tags found
No related merge requests found
......@@ -137,7 +137,8 @@ namespace llvm {
/// @name Target Registration
/// @{
/// RegisterTarget - Register the given target.
/// RegisterTarget - Register the given target. Attempts to register a
/// target which has already been registered will be ignored.
///
/// Clients are responsible for ensuring that registration doesn't occur
/// while another thread is attempting to access the registry. Typically
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment