Changes in / [8278abf:5b11c25]
- Files:
-
- 1 added
- 2 deleted
- 12 edited
-
Jenkins/FullBuild (modified) (5 diffs)
-
Jenkinsfile (modified) (15 diffs)
-
benchmark/Makefile.am (modified) (2 diffs)
-
benchmark/Makefile.in (modified) (3 diffs)
-
benchmark/fixcsv.sh (deleted)
-
benchmark/jenkins.sh (added)
-
doc/proposals/unicode.html (deleted)
-
libcfa/prelude/sync-builtins.cf (modified) (6 diffs)
-
src/ResolvExpr/ConversionCost.cc (modified) (3 diffs)
-
src/ResolvExpr/Cost.h (modified) (5 diffs)
-
src/ResolvExpr/ResolveAssertions.cc (modified) (12 diffs)
-
src/SymTab/Mangler.cc (modified) (5 diffs)
-
src/SymTab/Mangler.h (modified) (1 diff)
-
tests/builtins/sync.cfa (modified) (7 diffs)
-
tools/PrettyGitLogs.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/FullBuild
r8278abf r5b11c25 25 25 ) 26 26 } 27 28 //Push latest changes to do-lang repo 29 push_build() 27 30 } 28 29 promote_email(true)30 31 } 31 32 … … 42 43 43 44 //Send email to notify the failure 44 promote_ email(false)45 promote_failure_email() 45 46 } 46 47 … … 91 92 } 92 93 94 def push_build() { 95 //Don't use the build_stage function which outputs the compiler 96 stage('Push') { 97 98 status_prefix = 'Push' 99 100 def out_dir = pwd tmp: true 101 sh "mkdir -p ${out_dir}" 102 103 //checkout the code to make sure this is a valid git repo 104 checkout scm 105 106 collect_git_info() 107 108 //parse git logs to find what changed 109 sh "git remote > ${out_dir}/GIT_REMOTE" 110 git_remote = readFile("${out_dir}/GIT_REMOTE") 111 remoteDoLangExists = git_remote.contains("DoLang") 112 113 if( !remoteDoLangExists ) { 114 sh 'git remote add DoLang git@gitlab.do-lang.org:internal/cfa-cc.git' 115 } 116 117 //sh "GIT_SSH_COMMAND=\"ssh -v\" git push DoLang ${gitRefNewValue}:master" 118 echo('BUILD NOT PUSH SINCE DO-LANG SERVER WAS DOWN') 119 } 120 } 121 93 122 //Helper routine to collect information about the git history 94 123 def collect_git_info() { … … 112 141 113 142 //Email notification on a full build failure 114 def promote_ email(boolean success) {143 def promote_failure_email() { 115 144 echo('notifying users') 116 117 def result = success ? "PROMOTE - SUCCESS" : "PROMOTE - FAILURE"118 145 119 146 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line 120 147 //Configurations for email format 121 def email_subject = "[cforall git][${result}]" 122 def email_body = """<p>This is an automated email from the Jenkins build machine. It was 123 generated following the result of the C\u2200 nightly build.</p> 148 def email_subject = "[cforall git][PROMOTE - FAILURE]" 149 def email_body = """This is an automated email from the Jenkins build machine. It was 150 generated because of a git hooks/post-receive script following 151 a ref change was pushed to the repository containing 152 the project "UNNAMED PROJECT". 124 153 125 <p>Check console output at ${env.BUILD_URL} to view the results.</p> 154 Check console output at ${env.BUILD_URL} to view the results. 126 155 127 <p>- Status --------------------------------------------------------------</p> 156 - Status -------------------------------------------------------------- 128 157 129 <p>${result}</p> 130 131 <p>- Performance ---------------------------------------------------------</p> 132 133 <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=0" > 134 135 <p>- Logs ----------------------------------------------------------------</p> 158 PROMOTE FAILURE 136 159 """ 137 160 … … 139 162 140 163 //send email notification 141 emailext body: email_body, subject: email_subject, to: email_to, attachLog: !success164 emailext body: email_body, subject: email_subject, to: email_to, attachLog: true 142 165 } -
Jenkinsfile
r8278abf r5b11c25 1 1 #!groovy 2 3 import groovy.transform.Field4 2 5 3 //=========================================================================================================== … … 24 22 wrap([$class: 'TimestamperBuildWrapper']) { 25 23 24 notify_server(0) 25 26 26 Settings = prepare_build() 27 27 … … 34 34 checkout() 35 35 36 notify_server(0) 37 36 38 build() 37 39 … … 48 50 BuildDir = pwd tmp: true 49 51 SrcDir = pwd tmp: false 52 53 notify_server(45) 50 54 } 51 55 } … … 68 72 finally { 69 73 //Send email with final results if this is not a full build 70 email(log_needed) 74 if( Settings && !Settings.Silent ) { 75 email(log_needed, Settings.IsSandbox) 76 } 71 77 72 78 echo 'Build Completed' … … 110 116 //Also specify the compiler by hand 111 117 targets="" 112 if( Settings.RunAllTests || Settings.RunBenchmark) {118 if( Settings.RunAllTests ) { 113 119 targets="--with-target-hosts='host:debug,host:nodebug'" 114 120 } else { … … 147 153 dir (BuildDir) { 148 154 //Append bench results 149 sh " make --no-print-directory -C benchmark jenkins"155 sh "${SrcDir}/benchmark/jenkins.sh ${Settings.GitNewRef} ${Settings.Architecture} ${BuildDir}/bench.json" 150 156 } 151 157 } … … 170 176 build_stage('Publish') { 171 177 172 if( !Settings.RunBenchmark ) { echo 'No results to publish!!!' } 173 174 def groupCompile = new PlotGroup('Compilation', 'seconds', true) 175 def groupConcurrency = new PlotGroup('Concurrency', 'nanoseconds', false) 178 if( !Settings.Publish ) return 176 179 177 180 //Then publish the results 178 do_plot(Settings.RunBenchmark && Settings.Publish, 'compile' , groupCompile , 'Compilation') 179 do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch', groupConcurrency, 'Context Switching') 180 do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex' , groupConcurrency, 'Mutual Exclusion') 181 do_plot(Settings.RunBenchmark && Settings.Publish, 'signal' , groupConcurrency, 'Internal and External Scheduling') 181 sh 'curl --silent --show-error -H \'Content-Type: application/json\' --data @${BuildDir}/bench.json https://cforall.uwaterloo.ca:8082/jenkins/publish > /dev/null || true' 182 182 } 183 183 } … … 196 196 197 197 return """ 198 <pre>199 198 The branch ${env.BRANCH_NAME} has been updated. 200 199 ${gitUpdate} 201 </pre> 202 203 <p>Check console output at ${env.BUILD_URL} to view the results.</p> 204 205 <p>- Status --------------------------------------------------------------</p> 206 207 <p>BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}</p> 208 209 <p>- Log -----------------------------------------------------------------</p> 210 211 <pre> 200 201 Check console output at ${env.BUILD_URL} to view the results. 202 203 - Status -------------------------------------------------------------- 204 205 BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result} 206 207 - Log ----------------------------------------------------------------- 212 208 ${gitLog} 213 </pre> 214 215 <p>-----------------------------------------------------------------------</p> 216 <pre> 209 ----------------------------------------------------------------------- 217 210 Summary of changes: 218 211 ${gitDiff} 219 </pre>220 212 """ 221 213 } 222 214 223 215 //Standard build email notification 224 def email(boolean log ) {216 def email(boolean log, boolean bIsSandbox) { 225 217 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line 226 218 //Configurations for email format … … 229 221 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase() 230 222 def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}" 231 def email_body = """ <p>This is an automated email from the Jenkins build machine. It was223 def email_body = """This is an automated email from the Jenkins build machine. It was 232 224 generated because of a git hooks/post-receive script following 233 a ref change which was pushed to the C \u2200 repository.</p>225 a ref change which was pushed to the Cforall repository. 234 226 """ + GitLogMessage() 235 227 236 def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca"237 238 if( Settings && !Settings. Silent) {228 def email_to = "cforall@lists.uwaterloo.ca" 229 230 if( Settings && !Settings.IsSandbox ) { 239 231 //send email notification 240 232 emailext body: email_body, subject: email_subject, to: email_to, attachLog: log … … 319 311 } 320 312 321 this.IsSandbox = (branch == "jenkins-sandbox")322 313 this.RunAllTests = param.RunAllTests 323 314 this.RunBenchmark = param.RunBenchmark … … 325 316 this.Publish = param.Publish 326 317 this.Silent = param.Silent 318 this.IsSandbox = (branch == "jenkins-sandbox") 327 319 328 320 def full = param.RunAllTests ? " (Full)" : "" … … 341 333 this.GitNewRef = '' 342 334 this.GitOldRef = '' 343 }344 }345 346 class PlotGroup implements Serializable {347 public String name348 public String unit349 public boolean log350 351 PlotGroup(String name, String unit, boolean log) {352 this.name = name353 this.unit = unit354 this.log = log355 335 } 356 336 } … … 418 398 } 419 399 400 def notify_server(int wait) { 401 sh """curl --silent --show-error --data "wait=${wait}" -X POST https://cforall.uwaterloo.ca:8082/jenkins/notify > /dev/null || true""" 402 return 403 } 404 420 405 def make_doc() { 421 406 def err = null … … 432 417 } 433 418 } 434 435 def do_plot(boolean silent, String file, PlotGroup group, String title) {436 437 def series = silent ? [] : [[438 file: "${file}.csv",439 exclusionValues: '',440 displayTableFlag: false,441 inclusionFlag: 'OFF',442 url: ''443 ]];444 445 echo "file is ${BuildDir}/benchmark/${file}.csv, group ${group}, title ${title}"446 dir("${BuildDir}/benchmark/") {447 plot csvFileName: "cforall-${env.BRANCH_NAME}-${file}.csv",448 csvSeries: series,449 group: "${group.name}",450 title: "${title}",451 style: 'lineSimple',452 exclZero: false,453 keepRecords: false,454 logarithmic: group.log,455 numBuilds: '120',456 useDescr: true,457 yaxis: group.unit,458 yaxisMaximum: '',459 yaxisMinimum: ''460 }461 } -
benchmark/Makefile.am
r8278abf r5b11c25 67 67 68 68 .NOTPARALLEL: 69 .PHONY: compile.csv ctxswitch.csv mutex.csv signal.csv70 69 71 70 ## ========================================================================================================= … … 95 94 ## ========================================================================================================= 96 95 97 FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@98 99 96 jenkins$(EXEEXT): 97 @echo "{" 98 @echo -e '\t"githash": "'${githash}'",' 99 @echo -e '\t"arch": "' ${arch} '",' 100 100 @DOifskipcompile@ 101 @+make compile.csv 101 @echo -e '\t"compile": {' 102 @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :' 103 @echo -e '\t\t"dummy" : {}' 104 @echo -e '\t},' 102 105 @DOendif@ 103 @+make ctxswitch.csv 104 @+make mutex.csv 105 @+make signal.csv 106 @DOifskipcompile@ 107 @cat compile.csv 108 @DOendif@ 109 @cat ctxswitch.csv 110 @cat mutex.csv 111 @cat signal.csv 112 113 compile.csv: 114 @echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@ 115 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@ 116 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@ 117 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@ 118 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@ 119 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@ 120 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@ 121 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@ 122 @+make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@ 123 @$(srcdir)/fixcsv.sh $@ 124 125 ctxswitch.csv: 126 @echo "coroutine,thread" > $@ 127 @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@ 128 @+make ctxswitch-cfa_thread.runquiet >> $@ 129 @$(srcdir)/fixcsv.sh $@ 130 131 mutex.csv: 132 @echo "1-monitor,2-monitor" > $@ 133 @+make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@ 134 @+make mutex-cfa2.runquiet >> $@ 135 @$(srcdir)/fixcsv.sh $@ 136 137 signal.csv: 138 @echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@ 139 @+make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@ 140 @+make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@ 141 @+make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@ 142 @+make waitfor-cfa2.runquiet >> $@ 143 @$(srcdir)/fixcsv.sh $@ 106 @echo -e '\t"ctxswitch": {' 107 @echo -en '\t\t"coroutine":' 108 @+make ctxswitch-cfa_coroutine.runquiet 109 @echo -en '\t\t,"thread":' 110 @+make ctxswitch-cfa_thread.runquiet 111 @echo -e '\t},' 112 @echo -e '\t"mutex": [' 113 @echo -en '\t\t' 114 @+make mutex-cfa1.runquiet 115 @echo -en '\t\t,' 116 @+make mutex-cfa2.runquiet 117 @echo -e '\t],' 118 @echo -e '\t"scheduling": [' 119 @echo -en '\t\t' 120 @+make signal-cfa1.runquiet 121 @echo -en '\t\t,' 122 @+make signal-cfa2.runquiet 123 @echo -en '\t\t,' 124 @+make waitfor-cfa1.runquiet 125 @echo -en '\t\t,' 126 @+make waitfor-cfa2.runquiet 127 @echo -e '\n\t],' 128 @echo -e '\t"epoch": ' $(shell date +%s) 129 @echo "}" 144 130 145 131 ## ========================================================================================================= -
benchmark/Makefile.in
r8278abf r5b11c25 401 401 PRINT_FORMAT = %20s: #Comments needed for spacing 402 402 dummy_SOURCES = dummyC.c dummyCXX.cpp 403 FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@404 403 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run \ 405 404 tls-fetch_add.run ctxswitch-pthread.run \ … … 732 731 733 732 .NOTPARALLEL: 734 .PHONY: compile.csv ctxswitch.csv mutex.csv signal.csv735 733 736 734 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) … … 758 756 759 757 jenkins$(EXEEXT): 758 @echo "{" 759 @echo -e '\t"githash": "'${githash}'",' 760 @echo -e '\t"arch": "' ${arch} '",' 760 761 @DOifskipcompile@ 761 @+make compile.csv 762 @echo -e '\t"compile": {' 763 @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :' 764 @echo -e '\t\t"dummy" : {}' 765 @echo -e '\t},' 762 766 @DOendif@ 763 @+make ctxswitch.csv 764 @+make mutex.csv 765 @+make signal.csv 766 @DOifskipcompile@ 767 @cat compile.csv 768 @DOendif@ 769 @cat ctxswitch.csv 770 @cat mutex.csv 771 @cat signal.csv 772 773 compile.csv: 774 @echo "array,attributes,empty,expression,io,monitor,operators,typeof" > $@ 775 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-array.make >> $@ 776 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-attributes.make >> $@ 777 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-empty.make >> $@ 778 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-expression.make >> $@ 779 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-io.make >> $@ 780 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-monitor.make >> $@ 781 @+make TIME_FORMAT='%e,' PRINT_FORMAT='' compile-operators.make >> $@ 782 @+make TIME_FORMAT='%e' PRINT_FORMAT='' compile-typeof.make >> $@ 783 @$(srcdir)/fixcsv.sh $@ 784 785 ctxswitch.csv: 786 @echo "coroutine,thread" > $@ 787 @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@ 788 @+make ctxswitch-cfa_thread.runquiet >> $@ 789 @$(srcdir)/fixcsv.sh $@ 790 791 mutex.csv: 792 @echo "1-monitor,2-monitor" > $@ 793 @+make mutex-cfa1.runquiet >> $@ && echo -n ',' >> $@ 794 @+make mutex-cfa2.runquiet >> $@ 795 @$(srcdir)/fixcsv.sh $@ 796 797 signal.csv: 798 @echo "signal-1,signal-2,waitfor-1,waitfor-2" > $@ 799 @+make signal-cfa1.runquiet >> $@ && echo -n ',' >> $@ 800 @+make signal-cfa2.runquiet >> $@ && echo -n ',' >> $@ 801 @+make waitfor-cfa1.runquiet >> $@ && echo -n ',' >> $@ 802 @+make waitfor-cfa2.runquiet >> $@ 803 @$(srcdir)/fixcsv.sh $@ 767 @echo -e '\t"ctxswitch": {' 768 @echo -en '\t\t"coroutine":' 769 @+make ctxswitch-cfa_coroutine.runquiet 770 @echo -en '\t\t,"thread":' 771 @+make ctxswitch-cfa_thread.runquiet 772 @echo -e '\t},' 773 @echo -e '\t"mutex": [' 774 @echo -en '\t\t' 775 @+make mutex-cfa1.runquiet 776 @echo -en '\t\t,' 777 @+make mutex-cfa2.runquiet 778 @echo -e '\t],' 779 @echo -e '\t"scheduling": [' 780 @echo -en '\t\t' 781 @+make signal-cfa1.runquiet 782 @echo -en '\t\t,' 783 @+make signal-cfa2.runquiet 784 @echo -en '\t\t,' 785 @+make waitfor-cfa1.runquiet 786 @echo -en '\t\t,' 787 @+make waitfor-cfa2.runquiet 788 @echo -e '\n\t],' 789 @echo -e '\t"epoch": ' $(shell date +%s) 790 @echo "}" 804 791 805 792 loop$(EXEEXT): -
libcfa/prelude/sync-builtins.cf
r8278abf r5b11c25 323 323 _Bool __sync_bool_compare_and_swap_16(volatile unsigned __int128 *, unsigned __int128, unsigned __int128,...); 324 324 #endif 325 forall(dtype T) _Bool __sync_bool_compare_and_swap(T * volatile *, T *, T*, ...);326 325 327 326 char __sync_val_compare_and_swap(volatile char *, char, char,...); … … 349 348 unsigned __int128 __sync_val_compare_and_swap_16(volatile unsigned __int128 *, unsigned __int128, unsigned __int128,...); 350 349 #endif 351 forall(dtype T) T * __sync_val_compare_and_swap(T * volatile *, T *, T*,...);352 350 353 351 char __sync_lock_test_and_set(volatile char *, char,...); … … 436 434 #endif 437 435 438 char __atomic_exchange_n(volatile char *, char, int);436 char __atomic_exchange_n(volatile char *, volatile char *, int); 439 437 char __atomic_exchange_1(volatile char *, char, int); 440 438 void __atomic_exchange(volatile char *, volatile char *, volatile char *, int); 441 signed char __atomic_exchange_n(volatile signed char *, signed char, int);439 signed char __atomic_exchange_n(volatile signed char *, volatile signed char *, int); 442 440 signed char __atomic_exchange_1(volatile signed char *, signed char, int); 443 441 void __atomic_exchange(volatile signed char *, volatile signed char *, volatile signed char *, int); 444 unsigned char __atomic_exchange_n(volatile unsigned char *, unsigned char, int);442 unsigned char __atomic_exchange_n(volatile unsigned char *, volatile unsigned char *, int); 445 443 unsigned char __atomic_exchange_1(volatile unsigned char *, unsigned char, int); 446 444 void __atomic_exchange(volatile unsigned char *, volatile unsigned char *, volatile unsigned char *, int); 447 signed short __atomic_exchange_n(volatile signed short *, signed short, int);445 signed short __atomic_exchange_n(volatile signed short *, volatile signed short *, int); 448 446 signed short __atomic_exchange_2(volatile signed short *, signed short, int); 449 447 void __atomic_exchange(volatile signed short *, volatile signed short *, volatile signed short *, int); 450 unsigned short __atomic_exchange_n(volatile unsigned short *, unsigned short, int);448 unsigned short __atomic_exchange_n(volatile unsigned short *, volatile unsigned short *, int); 451 449 unsigned short __atomic_exchange_2(volatile unsigned short *, unsigned short, int); 452 450 void __atomic_exchange(volatile unsigned short *, volatile unsigned short *, volatile unsigned short *, int); 453 signed int __atomic_exchange_n(volatile signed int *, signed int, int);451 signed int __atomic_exchange_n(volatile signed int *, volatile signed int *, int); 454 452 signed int __atomic_exchange_4(volatile signed int *, signed int, int); 455 453 void __atomic_exchange(volatile signed int *, volatile signed int *, volatile signed int *, int); 456 unsigned int __atomic_exchange_n(volatile unsigned int *, unsigned int, int);454 unsigned int __atomic_exchange_n(volatile unsigned int *, volatile unsigned int *, int); 457 455 unsigned int __atomic_exchange_4(volatile unsigned int *, unsigned int, int); 458 456 void __atomic_exchange(volatile unsigned int *, volatile unsigned int *, volatile unsigned int *, int); 459 signed long long int __atomic_exchange_n(volatile signed long long int *, signed long long int, int);457 signed long long int __atomic_exchange_n(volatile signed long long int *, volatile signed long long int *, int); 460 458 signed long long int __atomic_exchange_8(volatile signed long long int *, signed long long int, int); 461 459 void __atomic_exchange(volatile signed long long int *, volatile signed long long int *, volatile signed long long int *, int); 462 unsigned long long int __atomic_exchange_n(volatile unsigned long long int *, unsigned long long int, int);460 unsigned long long int __atomic_exchange_n(volatile unsigned long long int *, volatile unsigned long long int *, int); 463 461 unsigned long long int __atomic_exchange_8(volatile unsigned long long int *, unsigned long long int, int); 464 462 void __atomic_exchange(volatile unsigned long long int *, volatile unsigned long long int *, volatile unsigned long long int *, int); 465 463 #if defined(__SIZEOF_INT128__) 466 signed __int128 __atomic_exchange_n(volatile signed __int128 *, signed __int128, int);464 signed __int128 __atomic_exchange_n(volatile signed __int128 *, volatile signed __int128 *, int); 467 465 signed __int128 __atomic_exchange_16(volatile signed __int128 *, signed __int128, int); 468 466 void __atomic_exchange(volatile signed __int128 *, volatile signed __int128 *, volatile signed __int128 *, int); 469 unsigned __int128 __atomic_exchange_n(volatile unsigned __int128 *, unsigned __int128, int);467 unsigned __int128 __atomic_exchange_n(volatile unsigned __int128 *, volatile unsigned __int128 *, int); 470 468 unsigned __int128 __atomic_exchange_16(volatile unsigned __int128 *, unsigned __int128, int); 471 469 void __atomic_exchange(volatile unsigned __int128 *, volatile unsigned __int128 *, volatile unsigned __int128 *, int); 472 470 #endif 473 forall(dtype T) T * __atomic_exchange_n(T * volatile *, T *, int);474 forall(dtype T) void __atomic_exchange(T * volatile *, T * volatile *, T * volatile *, int);475 471 476 472 _Bool __atomic_load_n(const volatile _Bool *, int); … … 511 507 void __atomic_load(const volatile unsigned __int128 *, volatile unsigned __int128 *, int); 512 508 #endif 513 forall(dtype T) T * __atomic_load_n(T * const volatile *, int);514 forall(dtype T) void __atomic_load(T * const volatile *, T **, int);515 509 516 510 _Bool __atomic_compare_exchange_n(volatile char *, char *, char, _Bool, int, int); … … 549 543 _Bool __atomic_compare_exchange (volatile unsigned __int128 *, unsigned __int128 *, unsigned __int128 *, _Bool, int, int); 550 544 #endif 551 forall(dtype T) _Bool __atomic_compare_exchange_n (T * volatile *, T **, T*, _Bool, int, int);552 forall(dtype T) _Bool __atomic_compare_exchange (T * volatile *, T **, T**, _Bool, int, int);553 545 554 546 void __atomic_store_n(volatile _Bool *, _Bool, int); … … 589 581 void __atomic_store(volatile unsigned __int128 *, unsigned __int128 *, int); 590 582 #endif 591 forall(dtype T) void __atomic_store_n(T * volatile *, T *, int);592 forall(dtype T) void __atomic_store(T * volatile *, T **, int);593 583 594 584 char __atomic_add_fetch (volatile char *, char, int); -
src/ResolvExpr/ConversionCost.cc
r8278abf r5b11c25 10 10 // Created On : Sun May 17 07:06:19 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Apr 26 16:33:04201913 // Update Count : 2 412 // Last Modified On : Thu Feb 14 17:04:31 2019 13 // Update Count : 23 14 14 // 15 15 … … 28 28 29 29 namespace ResolvExpr { 30 #if 031 30 const Cost Cost::zero = Cost{ 0, 0, 0, 0, 0, 0, 0 }; 32 31 const Cost Cost::infinity = Cost{ -1, -1, -1, -1, -1, 1, -1 }; … … 38 37 const Cost Cost::spec = Cost{ 0, 0, 0, 0, 0, -1, 0 }; 39 38 const Cost Cost::reference = Cost{ 0, 0, 0, 0, 0, 0, 1 }; 40 #endif41 39 42 40 #if 0 -
src/ResolvExpr/Cost.h
r8278abf r5b11c25 7 7 // Cost.h -- 8 8 // 9 // Author : Peter Buhr and Aaron Moss9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 09:39:50 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Apr 29 18:33:44201913 // Update Count : 4912 // Last Modified On : Thu Feb 7 20:54:29 2019 13 // Update Count : 8 14 14 // 15 15 … … 17 17 18 18 #include <iostream> 19 #include <cassert>20 #include <climits>21 19 22 20 namespace ResolvExpr { 23 #if 024 25 //*************************** OLD ***************************26 27 21 class Cost { 28 22 private: 29 23 Cost( int unsafeCost, int polyCost, int safeCost, int signCost, 30 int varCost, int specCost, int referenceCost );24 int varCost, int specCost, int referenceCost ); 31 25 public: 32 26 Cost & incUnsafe( int inc = 1 ); … … 77 71 78 72 inline Cost::Cost( int unsafeCost, int polyCost, int safeCost, int signCost, 79 int varCost, int specCost, int referenceCost )73 int varCost, int specCost, int referenceCost ) 80 74 : unsafeCost( unsafeCost ), polyCost( polyCost ), safeCost( safeCost ), signCost( signCost ), 81 75 varCost( varCost ), specCost( specCost ), referenceCost( referenceCost ) {} … … 127 121 return Cost{ 128 122 unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost, 129 signCost + other.signCost, varCost + other.varCost, specCost + other.specCost,130 referenceCost + other.referenceCost };123 signCost + other.signCost, varCost + other.varCost, specCost + other.specCost, 124 referenceCost + other.referenceCost }; 131 125 } 132 126 … … 217 211 << cost.referenceCost << " )"; 218 212 } 219 220 #else221 222 //*************************** NEW ***************************223 224 // To maximize performance and space, the 7 resolution costs are packed into a single 64-bit word. However, the225 // specialization cost is a negative value so a correction is needed is a few places.226 227 class Cost {228 union {229 struct {230 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__231 // Little-endian => first value is low priority and last is high priority.232 unsigned char padding; ///< unused233 unsigned char referenceCost; ///< reference conversions234 unsigned char specCost; ///< Polymorphic type specializations (type assertions), negative cost235 unsigned char varCost; ///< Count of polymorphic type variables236 unsigned char signCost; ///< Count of safe sign conversions237 unsigned char safeCost; ///< Safe (widening) conversions238 unsigned char polyCost; ///< Count of parameters and return values bound to some poly type239 unsigned char unsafeCost; ///< Unsafe (narrowing) conversions240 #else241 #error Cost BIG_ENDIAN unsupported242 #endif243 } v;244 uint64_t all;245 };246 static const unsigned char correctb = 0xff; // byte correction for negative spec cost247 static const uint64_t correctw = 0x00'00'00'00'00'ff'00'00; //' word correction for negative spec cost248 public:249 // Compiler adjusts constants for correct endian.250 enum : uint64_t {251 zero = 0x00'00'00'00'00'ff'00'00,252 infinity = 0xff'ff'ff'ff'ff'00'ff'ff,253 unsafe = 0x01'00'00'00'00'ff'00'00,254 poly = 0x00'01'00'00'00'ff'00'00,255 safe = 0x00'00'01'00'00'ff'00'00,256 sign = 0x00'00'00'01'00'ff'00'00,257 var = 0x00'00'00'00'01'ff'00'00,258 spec = 0x00'00'00'00'00'fe'00'00,259 reference = 0x00'00'00'00'00'ff'01'00,260 }; //'261 262 Cost( uint64_t all ) { Cost::all = all; }263 Cost( int unsafeCost, int polyCost, int safeCost, int signCost, int varCost, int specCost, int referenceCost ) {264 // Assume little-endian => first value is low priority and last is high priority.265 v = {266 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__267 (unsigned char)0, // padding268 (unsigned char)referenceCost, // low priority269 (unsigned char)(specCost + correctb), // correct for signedness270 (unsigned char)varCost,271 (unsigned char)signCost,272 (unsigned char)safeCost,273 (unsigned char)polyCost,274 (unsigned char)unsafeCost, // high priority275 #else276 #error Cost BIG_ENDIAN unsupported277 #endif278 };279 }280 281 int get_unsafeCost() const { return v.unsafeCost; }282 int get_polyCost() const { return v.polyCost; }283 int get_safeCost() const { return v.safeCost; }284 int get_signCost() const { return v.signCost; }285 int get_varCost() const { return v.varCost; }286 int get_specCost() const { return -(correctb - v.specCost); }287 int get_referenceCost() const { return v.referenceCost; }288 289 friend bool operator==( const Cost, const Cost );290 friend bool operator!=( const Cost lhs, const Cost rhs );291 // returns negative for *this < rhs, 0 for *this == rhs, positive for *this > rhs292 int compare( const Cost rhs ) const {293 if ( all == infinity ) return 1;294 if ( rhs.all == infinity ) return -1;295 return all > rhs.all ? 1 : all == rhs.all ? 0 : -1;296 }297 friend bool operator<( const Cost lhs, const Cost rhs );298 299 friend Cost operator+( const Cost lhs, const Cost rhs );300 301 Cost operator+=( const Cost rhs ) {302 if ( all == infinity ) return *this;303 if ( rhs.all == infinity ) {304 all = infinity;305 return *this;306 }307 all += rhs.all - correctw; // correct for negative spec cost308 return *this;309 }310 311 Cost incUnsafe( int inc = 1 ) {312 if ( all != infinity ) { assert( v.unsafeCost + inc <= UCHAR_MAX ); v.unsafeCost += inc; }313 return *this;314 }315 316 Cost incPoly( int inc = 1 ) {317 if ( all != infinity ) { assert( v.polyCost + inc <= UCHAR_MAX ); v.polyCost += inc; }318 return *this;319 }320 321 Cost incSafe( int inc = 1 ) {322 if ( all != infinity ) { assert( v.safeCost + inc <= UCHAR_MAX ); v.safeCost += inc; }323 return *this;324 }325 326 Cost incSign( int inc = 1 ) {327 if ( all != infinity ) { assert( v.signCost + inc <= UCHAR_MAX ); v.signCost += inc; }328 return *this;329 }330 331 Cost incVar( int inc = 1 ) {332 if ( all != infinity ) { assert( v.varCost + inc <= UCHAR_MAX ); v.varCost += inc; }333 return *this;334 }335 336 Cost decSpec( int dec = 1 ) {337 if ( all != infinity ) { assert( v.specCost - dec >= 0 ); v.specCost -= dec; }338 return *this;339 }340 341 Cost incReference( int inc = 1 ) {342 if ( all != infinity ) { assert( v.referenceCost + inc <= UCHAR_MAX ); v.referenceCost += inc; }343 return *this;344 }345 346 friend std::ostream & operator<<( std::ostream & os, const Cost cost );347 };348 349 inline bool operator==( const Cost lhs, const Cost rhs ) {350 return lhs.all == rhs.all;351 }352 353 inline bool operator!=( const Cost lhs, const Cost rhs ) {354 return !( lhs.all == rhs.all );355 }356 357 inline bool operator<( const Cost lhs, const Cost rhs ) {358 if ( lhs.all == Cost::infinity ) return false;359 if ( rhs.all == Cost::infinity ) return true;360 return lhs.all < rhs.all;361 }362 363 inline Cost operator+( const Cost lhs, const Cost rhs ) {364 if ( lhs.all == Cost::infinity || rhs.all == Cost::infinity ) return Cost{ Cost::infinity };365 return Cost{ lhs.all + rhs.all - Cost::correctw }; // correct for negative spec cost366 }367 368 inline std::ostream & operator<<( std::ostream & os, const Cost cost ) {369 return os << "( " << cost.get_unsafeCost() << ", " << cost.get_polyCost() << ", " << cost.get_safeCost()370 << ", " << cost.get_signCost() << ", " << cost.get_varCost() << ", " << cost.get_specCost()371 << ", " << cost.get_referenceCost() << " )";372 }373 #endif // 0374 213 } // namespace ResolvExpr 375 214 -
src/ResolvExpr/ResolveAssertions.cc
r8278abf r5b11c25 35 35 #include "SynTree/Expression.h" // for InferredParams 36 36 #include "TypeEnvironment.h" // for TypeEnvironment, etc. 37 #include "typeops.h" // for adjustExprType , specCost37 #include "typeops.h" // for adjustExprType 38 38 #include "Unify.h" // for unify 39 39 … … 58 58 using CandidateList = std::vector<AssnCandidate>; 59 59 60 /// Unique identifier for a yet-to-be-resolved assertion 61 struct AssnId { 62 DeclarationWithType* decl; ///< Declaration of assertion 63 AssertionSetValue info; ///< Information about assertion 64 65 AssnId(DeclarationWithType* decl, const AssertionSetValue& info) : decl(decl), info(info) {} 66 }; 67 68 /// Cached assertion items 69 struct AssnCacheItem { 70 CandidateList matches; ///< Possible matches for this assertion 71 std::vector<AssnId> deferIds; ///< Deferred assertions which resolve to this item 72 73 AssnCacheItem( CandidateList&& m ) : matches(std::move(m)), deferIds() {} 74 }; 75 76 /// Cache of resolved assertions 77 using AssnCache = std::unordered_map<std::string, AssnCacheItem>; 78 60 79 /// Reference to single deferred item 61 80 struct DeferRef { 62 const DeclarationWithType* decl; 63 const AssertionSetValue& info; 81 const AssnCacheItem& item; 64 82 const AssnCandidate& match; 65 83 }; … … 68 86 /// Acts like indexed list of DeferRef 69 87 struct DeferItem { 70 const DeclarationWithType* decl; 71 const AssertionSetValue& info; 72 CandidateList matches; 73 74 DeferItem( DeclarationWithType* decl, const AssertionSetValue& info, CandidateList&& matches ) 75 : decl(decl), info(info), matches(std::move(matches)) {} 76 77 bool empty() const { return matches.empty(); } 78 79 CandidateList::size_type size() const { return matches.size(); } 80 81 DeferRef operator[] ( unsigned i ) const { return { decl, info, matches[i] }; } 88 const AssnCache* cache; ///< Cache storing assertion item 89 std::string key; ///< Key into cache 90 91 DeferItem( const AssnCache& cache, const std::string& key ) : cache(&cache), key(key) {} 92 93 bool empty() const { return cache->at(key).matches.empty(); } 94 95 CandidateList::size_type size() const { return cache->at(key).matches.size(); } 96 97 DeferRef operator[] ( unsigned i ) const { 98 const AssnCacheItem& item = cache->at(key); 99 return { item, item.matches[i] }; 100 } 101 102 const DeclarationWithType* get_decl() const { return cache->at(key).deferIds[0].decl; } 103 104 // sortable by key 105 // TODO look into optimizing combination process with other sort orders (e.g. by number 106 // of matches in candidate) 107 bool operator< ( const DeferItem& o ) const { return key < o.key; } 108 bool operator== ( const DeferItem& o ) const { return key == o.key; } 82 109 }; 83 110 … … 154 181 for ( const auto& assn : x.assns ) { 155 182 k += computeConversionCost( 156 assn.match.adjType, assn.decl->get_type(), indexer, x.env ); 157 158 // mark vars+specialization cost on function-type assertions 159 PointerType* ptr = dynamic_cast< PointerType* >( assn.decl->get_type() ); 160 if ( ! ptr ) continue; 161 FunctionType* func = dynamic_cast< FunctionType* >( ptr->base ); 162 if ( ! func ) continue; 163 164 for ( DeclarationWithType* formal : func->parameters ) { 165 k.decSpec( specCost( formal->get_type() ) ); 166 } 167 k.incVar( func->forall.size() ); 168 for ( TypeDecl* td : func->forall ) { 169 k.decSpec( td->assertions.size() ); 170 } 183 assn.match.adjType, assn.item.deferIds[0].decl->get_type(), indexer, 184 x.env ); 171 185 } 172 186 it = cache.emplace_hint( it, &x, k ); … … 239 253 240 254 /// Resolve a single assertion, in context 241 bool resolveAssertion( AssertionItem& assn, ResnState& resn ) {255 bool resolveAssertion( AssertionItem& assn, ResnState& resn, AssnCache& cache ) { 242 256 // skip unused assertions 243 257 if ( ! assn.info.isUsed ) return true; 244 258 245 // lookup candidates for this assertion 246 std::list< SymTab::Indexer::IdData > candidates; 247 resn.indexer.lookupId( assn.decl->name, candidates ); 248 249 // find the candidates that unify with the desired type 250 CandidateList matches; 251 for ( const auto& cdata : candidates ) { 252 DeclarationWithType* candidate = cdata.id; 253 254 // build independent unification context for candidate 255 AssertionSet have, newNeed; 256 TypeEnvironment newEnv{ resn.alt.env }; 257 OpenVarSet newOpenVars{ resn.alt.openVars }; 258 Type* adjType = candidate->get_type()->clone(); 259 adjustExprType( adjType, newEnv, resn.indexer ); 260 renameTyVars( adjType ); 261 262 // keep unifying candidates 263 if ( unify( assn.decl->get_type(), adjType, newEnv, newNeed, have, newOpenVars, 264 resn.indexer ) ) { 265 // set up binding slot for recursive assertions 266 UniqueId crntResnSlot = 0; 267 if ( ! newNeed.empty() ) { 268 crntResnSlot = ++globalResnSlot; 269 for ( auto& a : newNeed ) { 270 a.second.resnSlot = crntResnSlot; 259 // check cache for this assertion 260 std::string assnKey = SymTab::Mangler::mangleAssnKey( assn.decl, resn.alt.env ); 261 auto it = cache.find( assnKey ); 262 263 // attempt to resolve assertion if this is the first time seen 264 if ( it == cache.end() ) { 265 // lookup candidates for this assertion 266 std::list< SymTab::Indexer::IdData > candidates; 267 resn.indexer.lookupId( assn.decl->name, candidates ); 268 269 // find the candidates that unify with the desired type 270 CandidateList matches; 271 for ( const auto& cdata : candidates ) { 272 DeclarationWithType* candidate = cdata.id; 273 274 // build independent unification context for candidate 275 AssertionSet have, newNeed; 276 TypeEnvironment newEnv{ resn.alt.env }; 277 OpenVarSet newOpenVars{ resn.alt.openVars }; 278 Type* adjType = candidate->get_type()->clone(); 279 adjustExprType( adjType, newEnv, resn.indexer ); 280 renameTyVars( adjType ); 281 282 // keep unifying candidates 283 if ( unify( assn.decl->get_type(), adjType, newEnv, newNeed, have, newOpenVars, 284 resn.indexer ) ) { 285 // set up binding slot for recursive assertions 286 UniqueId crntResnSlot = 0; 287 if ( ! newNeed.empty() ) { 288 crntResnSlot = ++globalResnSlot; 289 for ( auto& a : newNeed ) { 290 a.second.resnSlot = crntResnSlot; 291 } 271 292 } 272 } 273 274 matches.emplace_back( cdata, adjType, std::move(newEnv), std::move(have),275 std::move(newNeed), std::move(newOpenVars), crntResnSlot );276 } else {277 delete adjType;293 294 matches.emplace_back( cdata, adjType, std::move(newEnv), std::move(have), 295 std::move(newNeed), std::move(newOpenVars), crntResnSlot ); 296 } else { 297 delete adjType; 298 } 278 299 } 279 } 300 301 it = cache.emplace_hint( it, assnKey, AssnCacheItem{ std::move(matches) } ); 302 } 303 304 CandidateList& matches = it->second.matches; 280 305 281 306 // break if no suitable assertion … … 284 309 // defer if too many suitable assertions 285 310 if ( matches.size() > 1 ) { 286 resn.deferred.emplace_back( assn.decl, assn.info, std::move(matches) ); 311 it->second.deferIds.emplace_back( assn.decl, assn.info ); 312 resn.deferred.emplace_back( cache, assnKey ); 287 313 return true; 288 314 } … … 292 318 addToIndexer( match.have, resn.indexer ); 293 319 resn.newNeed.insert( match.need.begin(), match.need.end() ); 294 resn.alt.env = std::move(match.env);295 resn.alt.openVars = std::move(match.openVars);320 resn.alt.env = match.env; 321 resn.alt.openVars = match.openVars; 296 322 297 323 bindAssertion( assn.decl, assn.info, resn.alt, match, resn.inferred ); … … 354 380 ResnList resns{ ResnState{ alt, root_indexer } }; 355 381 ResnList new_resns{}; 382 AssnCache assnCache; 356 383 357 384 // resolve assertions in breadth-first-order up to a limited number of levels deep … … 362 389 for ( auto& assn : resn.need ) { 363 390 // fail early if any assertion is not resolvable 364 if ( ! resolveAssertion( assn, resn ) ) {391 if ( ! resolveAssertion( assn, resn, assnCache ) ) { 365 392 Indenter tabs{ Indenter::tabsize, 3 }; 366 393 std::ostringstream ss; … … 383 410 } 384 411 } else { 412 // only resolve each deferred assertion once 413 std::sort( resn.deferred.begin(), resn.deferred.end() ); 414 auto last = std::unique( resn.deferred.begin(), resn.deferred.end() ); 415 resn.deferred.erase( last, resn.deferred.end() ); 385 416 // resolve deferred assertions by mutual compatibility 386 417 std::vector<CandidateEnvMerger::OutType> compatible = filterCombos( … … 396 427 ++tabs; 397 428 for ( const auto& d : resn.deferred ) { 398 d. decl->print( ss, tabs );429 d.get_decl()->print( ss, tabs ); 399 430 } 400 431 … … 427 458 new_resn.newNeed.insert( match.need.begin(), match.need.end() ); 428 459 429 bindAssertion( r.decl, r.info, new_resn.alt, match, new_resn.inferred ); 460 // for each deferred assertion with the same form 461 for ( AssnId id : r.item.deferIds ) { 462 bindAssertion( 463 id.decl, id.info, new_resn.alt, match, new_resn.inferred ); 464 } 430 465 } 431 466 -
src/SymTab/Mangler.cc
r8278abf r5b11c25 38 38 struct Mangler : public WithShortCircuiting, public WithVisitorRef<Mangler>, public WithGuards { 39 39 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ); 40 Mangler( const ResolvExpr::TypeEnvironment& env ); 40 41 Mangler( const Mangler & ) = delete; 41 42 … … 66 67 private: 67 68 std::ostringstream mangleName; ///< Mangled name being constructed 68 typedef std::map< std::string, std::pair< int, int > > VarMapType;69 typedef std::map< std::string, std::pair< std::string, int > > VarMapType; 69 70 VarMapType varNums; ///< Map of type variables to indices 70 71 int nextVarNum; ///< Next type variable index 72 const ResolvExpr::TypeEnvironment* env; ///< optional environment for substitutions 71 73 bool isTopLevel; ///< Is the Mangler at the top level 72 74 bool mangleOverridable; ///< Specially mangle overridable built-in methods … … 78 80 public: 79 81 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams, 80 int nextVarNum, const VarMapType& varNums ); 82 int nextVarNum, const ResolvExpr::TypeEnvironment* env, 83 const VarMapType& varNums ); 81 84 82 85 private: … … 106 109 } 107 110 111 std::string mangleAssnKey( DeclarationWithType* decl, 112 const ResolvExpr::TypeEnvironment& env ) { 113 PassVisitor<Mangler> mangler( env ); 114 maybeAccept( decl, mangler ); 115 return mangler.pass.get_mangleName(); 116 } 117 108 118 namespace { 109 119 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ) 110 : nextVarNum( 0 ), isTopLevel( true ),120 : nextVarNum( 0 ), env(nullptr), isTopLevel( true ), 111 121 mangleOverridable( mangleOverridable ), typeMode( typeMode ), 112 122 mangleGenericParams( mangleGenericParams ) {} 113 123 124 Mangler::Mangler( const ResolvExpr::TypeEnvironment& env ) 125 : nextVarNum( 0 ), env( &env ), isTopLevel( true ), mangleOverridable( false ), 126 typeMode( false ), mangleGenericParams( true ) {} 127 114 128 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams, 115 int nextVarNum, const VarMapType& varNums ) 116 : varNums( varNums ), nextVarNum( nextVarNum ), isTopLevel( false ), 129 int nextVarNum, const ResolvExpr::TypeEnvironment* env, 130 const VarMapType& varNums ) 131 : varNums( varNums ), nextVarNum( nextVarNum ), env( env ), isTopLevel( false ), 117 132 mangleOverridable( mangleOverridable ), typeMode( typeMode ), 118 133 mangleGenericParams( mangleGenericParams ) {} … … 343 358 assert( false ); 344 359 } // switch 345 varNums[ (*i)->name ] = std::make_pair( nextVarNum, (int)(*i)->get_kind() ); 360 std::string varName; 361 // replace type with substitution name if environment is available and bound 362 if ( env ) { 363 const ResolvExpr::EqvClass* varClass = env->lookup( (*i)->name ); 364 if ( varClass && varClass->type ) { 365 PassVisitor<Mangler> sub_mangler( 366 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, 367 env, varNums ); 368 varClass->type->accept( sub_mangler ); 369 varName = std::string{"%"} + sub_mangler.pass.get_mangleName(); 370 } 371 } 372 // otherwise just give type numeric name 373 if ( varName.empty() ) { 374 varName = std::to_string( nextVarNum++ ); 375 } 376 varNums[ (*i)->name ] = std::make_pair( varName, (int)(*i)->get_kind() ); 346 377 for ( std::list< DeclarationWithType* >::iterator assert = (*i)->assertions.begin(); assert != (*i)->assertions.end(); ++assert ) { 347 378 PassVisitor<Mangler> sub_mangler( 348 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums ); 379 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, env, 380 varNums ); 349 381 (*assert)->accept( sub_mangler ); 350 382 assertionNames.push_back( sub_mangler.pass.get_mangleName() ); -
src/SymTab/Mangler.h
r8278abf r5b11c25 44 44 /// Mangle ignoring generic type parameters 45 45 std::string mangleConcrete( Type* ty ); 46 /// Mangle for assertion key 47 std::string mangleAssnKey( DeclarationWithType* decl, 48 const ResolvExpr::TypeEnvironment& env ); 46 49 47 50 namespace Encoding { -
tests/builtins/sync.cfa
r8278abf r5b11c25 11 11 volatile __int128 * vp16 = 0; __int128 * rp16 = 0; __int128 v16 = 0; 12 12 #endif 13 struct type * volatile * vpp = 0; struct type ** rpp = 0; struct type * vp = 0;14 13 15 14 { char ret; ret = __sync_fetch_and_add(vp1, v1); } … … 181 180 { _Bool ret; ret = __sync_bool_compare_and_swap_16(vp16, v16,v16); } 182 181 #endif 183 { _Bool ret; ret = __sync_bool_compare_and_swap(vpp, vp, vp); }184 182 185 183 { char ret; ret = __sync_val_compare_and_swap(vp1, v1, v1); } … … 195 193 { __int128 ret; ret = __sync_val_compare_and_swap_16(vp16, v16,v16); } 196 194 #endif 197 { struct type * ret; ret = __sync_val_compare_and_swap(vpp, vp, vp); }198 199 195 200 196 { char ret; ret = __sync_lock_test_and_set(vp1, v1); } … … 234 230 { __atomic_clear(vp1, v1); } 235 231 236 { char ret; ret = __atomic_exchange_n(vp1, v1, __ATOMIC_SEQ_CST); }232 { char ret; ret = __atomic_exchange_n(vp1, &v1, __ATOMIC_SEQ_CST); } 237 233 { char ret; ret = __atomic_exchange_1(vp1, v1, __ATOMIC_SEQ_CST); } 238 234 { char ret; __atomic_exchange(vp1, &v1, &ret, __ATOMIC_SEQ_CST); } 239 { short ret; ret = __atomic_exchange_n(vp2, v2, __ATOMIC_SEQ_CST); }235 { short ret; ret = __atomic_exchange_n(vp2, &v2, __ATOMIC_SEQ_CST); } 240 236 { short ret; ret = __atomic_exchange_2(vp2, v2, __ATOMIC_SEQ_CST); } 241 237 { short ret; __atomic_exchange(vp2, &v2, &ret, __ATOMIC_SEQ_CST); } 242 { int ret; ret = __atomic_exchange_n(vp4, v4, __ATOMIC_SEQ_CST); }238 { int ret; ret = __atomic_exchange_n(vp4, &v4, __ATOMIC_SEQ_CST); } 243 239 { int ret; ret = __atomic_exchange_4(vp4, v4, __ATOMIC_SEQ_CST); } 244 240 { int ret; __atomic_exchange(vp4, &v4, &ret, __ATOMIC_SEQ_CST); } 245 { long long int ret; ret = __atomic_exchange_n(vp8, v8, __ATOMIC_SEQ_CST); }241 { long long int ret; ret = __atomic_exchange_n(vp8, &v8, __ATOMIC_SEQ_CST); } 246 242 { long long int ret; ret = __atomic_exchange_8(vp8, v8, __ATOMIC_SEQ_CST); } 247 243 { long long int ret; __atomic_exchange(vp8, &v8, &ret, __ATOMIC_SEQ_CST); } 248 244 #if defined(__SIZEOF_INT128__) 249 { __int128 ret; ret = __atomic_exchange_n(vp16, v16, __ATOMIC_SEQ_CST); }245 { __int128 ret; ret = __atomic_exchange_n(vp16, &v16, __ATOMIC_SEQ_CST); } 250 246 { __int128 ret; ret = __atomic_exchange_16(vp16, v16, __ATOMIC_SEQ_CST); } 251 247 { __int128 ret; __atomic_exchange(vp16, &v16, &ret, __ATOMIC_SEQ_CST); } 252 248 #endif 253 { struct type * ret; ret = __atomic_exchange_n(vpp, vp, __ATOMIC_SEQ_CST); }254 { struct type * ret; __atomic_exchange(vpp, &vp, &ret, __ATOMIC_SEQ_CST); }255 249 256 250 { char ret; ret = __atomic_load_n(vp1, __ATOMIC_SEQ_CST); } … … 271 265 { __int128 ret; __atomic_load(vp16, &ret, __ATOMIC_SEQ_CST); } 272 266 #endif 273 { struct type * ret; ret = __atomic_load_n(vpp, __ATOMIC_SEQ_CST); }274 { struct type * ret; __atomic_load(vpp, &ret, __ATOMIC_SEQ_CST); }275 267 276 268 { _Bool ret; ret = __atomic_compare_exchange_n(vp1, rp1, v1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } … … 291 283 { _Bool ret; ret = __atomic_compare_exchange(vp16, rp16, &v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 292 284 #endif 293 { _Bool ret; ret = __atomic_compare_exchange_n(vpp, rpp, vp, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }294 { _Bool ret; ret = __atomic_compare_exchange(vpp, rpp, &vp, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }295 285 296 286 { __atomic_store_n(vp1, v1, __ATOMIC_SEQ_CST); } … … 311 301 { __atomic_store(vp16, &v16, __ATOMIC_SEQ_CST); } 312 302 #endif 313 { __atomic_store_n(vpp, vp, __ATOMIC_SEQ_CST); }314 { __atomic_store(vpp, &vp, __ATOMIC_SEQ_CST); }315 303 316 304 { char ret; ret = __atomic_add_fetch(vp1, v1, __ATOMIC_SEQ_CST); } -
tools/PrettyGitLogs.sh
r8278abf r5b11c25 27 27 git rev-list --format=short ${GitOldRef}...${GitNewRef} > ${GIT_LOG} 28 28 29 git diff --stat --color ${GitNewRef} ${GitOldRef} | sed -e 's/\[32m/<span style\=\"color\: \#00AA00\;\">/g' -e 's/\[31m/<span style\=\"color\: \#AA0000\;\">/g' -e 's/\[m/<\/span>/g'> ${GIT_DIFF}29 git diff --stat ${GitNewRef} ${GitOldRef} > ${GIT_DIFF}
Note:
See TracChangeset
for help on using the changeset viewer.