function rtwTargetInfo(tr)

% Copyright 2016 The MathWorks, Inc.

tr.registerTargetInfo(@locTflRegFcn);

end % End of rtwTargetInfo


% Local function(s)
function thisCrl = locTflRegFcn

cc = rtwprivate('getMexCompilerInfo');
switch(cc.comp.Manufacturer)
    case 'GNU'
        compiler = 'gcc';
    case 'Apple'
        compiler = 'clang';
    case 'Microsoft'
        compiler = 'msvc';
    otherwise
        compiler = '';
end
idx = 0;

idx = idx+1;
thisCrl(idx) = RTW.TflRegistry;
thisCrl(idx).Name = 'SIMD Examples'; 
thisCrl(idx).Description = 'Demonstration of using CRL replacements that require data alignment';
thisCrl(idx).TableList = {'crl_table_simd'};
tc = RTW.TargetCharacteristics;
tc.DataAlignment = locDataAlignSpecification(compiler);
thisCrl(idx).TargetCharacteristics = tc;
thisCrl(idx).TargetHWDeviceType = {'*'};

end % End of LOCTFLREGFCN

%% HELPERS
function da = locDataAlignSpecification(compiler)
    da = [];
    
    switch compiler
        case 'msvc'
            aT = '__declspec(align(%n))';
        case {'mingw', 'gcc', 'clang'}
            aT = '__attribute((aligned(%n)))';
        otherwise
            return;
    end

    as = RTW.AlignmentSpecification;
    as.AlignmentSyntaxTemplate = aT;
    as.AlignmentType = { 'DATA_ALIGNMENT_LOCAL_VAR', ...
                         'DATA_ALIGNMENT_GLOBAL_VAR', ...
                         'DATA_ALIGNMENT_STRUCT_FIELD'};
    as.SupportedLanguages={'c', 'c++'};
    da = RTW.DataAlignment;
    da.addAlignmentSpecification(as);          

end




% EOF
