Changeset 8278abf
- Timestamp:
- Apr 30, 2019, 2:54:01 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b9696a8
- Parents:
- 5b11c25 (diff), ec28948 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 2 added
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/FullBuild
r5b11c25 r8278abf 25 25 ) 26 26 } 27 } 27 28 28 //Push latest changes to do-lang repo 29 push_build() 30 } 29 promote_email(true) 31 30 } 32 31 … … 43 42 44 43 //Send email to notify the failure 45 promote_ failure_email()44 promote_email(false) 46 45 } 47 46 … … 92 91 } 93 92 94 def push_build() {95 //Don't use the build_stage function which outputs the compiler96 stage('Push') {97 98 status_prefix = 'Push'99 100 def out_dir = pwd tmp: true101 sh "mkdir -p ${out_dir}"102 103 //checkout the code to make sure this is a valid git repo104 checkout scm105 106 collect_git_info()107 108 //parse git logs to find what changed109 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 122 93 //Helper routine to collect information about the git history 123 94 def collect_git_info() { … … 141 112 142 113 //Email notification on a full build failure 143 def promote_ failure_email() {114 def promote_email(boolean success) { 144 115 echo('notifying users') 116 117 def result = success ? "PROMOTE - SUCCESS" : "PROMOTE - FAILURE" 145 118 146 119 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line 147 120 //Configurations for email format 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". 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> 153 124 154 Check console output at ${env.BUILD_URL} to view the results. 125 <p>Check console output at ${env.BUILD_URL} to view the results.</p> 155 126 156 - Status -------------------------------------------------------------- 127 <p>- Status --------------------------------------------------------------</p> 157 128 158 PROMOTE FAILURE 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> 159 136 """ 160 137 … … 162 139 163 140 //send email notification 164 emailext body: email_body, subject: email_subject, to: email_to, attachLog: true141 emailext body: email_body, subject: email_subject, to: email_to, attachLog: !success 165 142 } -
Jenkinsfile
r5b11c25 r8278abf 1 1 #!groovy 2 3 import groovy.transform.Field 2 4 3 5 //=========================================================================================================== … … 22 24 wrap([$class: 'TimestamperBuildWrapper']) { 23 25 24 notify_server(0)25 26 26 Settings = prepare_build() 27 27 … … 34 34 checkout() 35 35 36 notify_server(0)37 38 36 build() 39 37 … … 50 48 BuildDir = pwd tmp: true 51 49 SrcDir = pwd tmp: false 52 53 notify_server(45)54 50 } 55 51 } … … 72 68 finally { 73 69 //Send email with final results if this is not a full build 74 if( Settings && !Settings.Silent ) { 75 email(log_needed, Settings.IsSandbox) 76 } 70 email(log_needed) 77 71 78 72 echo 'Build Completed' … … 116 110 //Also specify the compiler by hand 117 111 targets="" 118 if( Settings.RunAllTests ) {112 if( Settings.RunAllTests || Settings.RunBenchmark ) { 119 113 targets="--with-target-hosts='host:debug,host:nodebug'" 120 114 } else { … … 153 147 dir (BuildDir) { 154 148 //Append bench results 155 sh " ${SrcDir}/benchmark/jenkins.sh ${Settings.GitNewRef} ${Settings.Architecture} ${BuildDir}/bench.json"149 sh "make --no-print-directory -C benchmark jenkins" 156 150 } 157 151 } … … 176 170 build_stage('Publish') { 177 171 178 if( !Settings.Publish ) return 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) 179 176 180 177 //Then publish the results 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' 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') 182 182 } 183 183 } … … 196 196 197 197 return """ 198 <pre> 198 199 The branch ${env.BRANCH_NAME} has been updated. 199 200 ${gitUpdate} 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 ----------------------------------------------------------------- 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> 208 212 ${gitLog} 209 ----------------------------------------------------------------------- 213 </pre> 214 215 <p>-----------------------------------------------------------------------</p> 216 <pre> 210 217 Summary of changes: 211 218 ${gitDiff} 219 </pre> 212 220 """ 213 221 } 214 222 215 223 //Standard build email notification 216 def email(boolean log , boolean bIsSandbox) {224 def email(boolean log) { 217 225 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line 218 226 //Configurations for email format … … 221 229 def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase() 222 230 def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}" 223 def email_body = """ This is an automated email from the Jenkins build machine. It was231 def email_body = """<p>This is an automated email from the Jenkins build machine. It was 224 232 generated because of a git hooks/post-receive script following 225 a ref change which was pushed to the C forall repository.233 a ref change which was pushed to the C\u2200 repository.</p> 226 234 """ + GitLogMessage() 227 235 228 def email_to = "cforall@lists.uwaterloo.ca"229 230 if( Settings && !Settings. IsSandbox) {236 def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca" 237 238 if( Settings && !Settings.Silent ) { 231 239 //send email notification 232 240 emailext body: email_body, subject: email_subject, to: email_to, attachLog: log … … 311 319 } 312 320 321 this.IsSandbox = (branch == "jenkins-sandbox") 313 322 this.RunAllTests = param.RunAllTests 314 323 this.RunBenchmark = param.RunBenchmark … … 316 325 this.Publish = param.Publish 317 326 this.Silent = param.Silent 318 this.IsSandbox = (branch == "jenkins-sandbox")319 327 320 328 def full = param.RunAllTests ? " (Full)" : "" … … 333 341 this.GitNewRef = '' 334 342 this.GitOldRef = '' 343 } 344 } 345 346 class PlotGroup implements Serializable { 347 public String name 348 public String unit 349 public boolean log 350 351 PlotGroup(String name, String unit, boolean log) { 352 this.name = name 353 this.unit = unit 354 this.log = log 335 355 } 336 356 } … … 398 418 } 399 419 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 return403 }404 405 420 def make_doc() { 406 421 def err = null … … 417 432 } 418 433 } 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
r5b11c25 r8278abf 67 67 68 68 .NOTPARALLEL: 69 .PHONY: compile.csv ctxswitch.csv mutex.csv signal.csv 69 70 70 71 ## ========================================================================================================= … … 94 95 ## ========================================================================================================= 95 96 97 FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@ 98 96 99 jenkins$(EXEEXT): 97 @echo "{"98 @echo -e '\t"githash": "'${githash}'",'99 @echo -e '\t"arch": "' ${arch} '",'100 100 @DOifskipcompile@ 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},' 101 @+make compile.csv 105 102 @DOendif@ 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 "}" 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 $@ 130 144 131 145 ## ========================================================================================================= -
benchmark/Makefile.in
r5b11c25 r8278abf 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" > $@ 403 404 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run \ 404 405 tls-fetch_add.run ctxswitch-pthread.run \ … … 731 732 732 733 .NOTPARALLEL: 734 .PHONY: compile.csv ctxswitch.csv mutex.csv signal.csv 733 735 734 736 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) … … 756 758 757 759 jenkins$(EXEEXT): 758 @echo "{"759 @echo -e '\t"githash": "'${githash}'",'760 @echo -e '\t"arch": "' ${arch} '",'761 760 @DOifskipcompile@ 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},' 761 @+make compile.csv 766 762 @DOendif@ 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 "}" 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 $@ 791 804 792 805 loop$(EXEEXT): -
libcfa/prelude/sync-builtins.cf
r5b11c25 r8278abf 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*, ...); 325 326 326 327 char __sync_val_compare_and_swap(volatile char *, char, char,...); … … 348 349 unsigned __int128 __sync_val_compare_and_swap_16(volatile unsigned __int128 *, unsigned __int128, unsigned __int128,...); 349 350 #endif 351 forall(dtype T) T * __sync_val_compare_and_swap(T * volatile *, T *, T*,...); 350 352 351 353 char __sync_lock_test_and_set(volatile char *, char,...); … … 434 436 #endif 435 437 436 char __atomic_exchange_n(volatile char *, volatile char *, int);438 char __atomic_exchange_n(volatile char *, char, int); 437 439 char __atomic_exchange_1(volatile char *, char, int); 438 440 void __atomic_exchange(volatile char *, volatile char *, volatile char *, int); 439 signed char __atomic_exchange_n(volatile signed char *, volatile signed char *, int);441 signed char __atomic_exchange_n(volatile signed char *, signed char, int); 440 442 signed char __atomic_exchange_1(volatile signed char *, signed char, int); 441 443 void __atomic_exchange(volatile signed char *, volatile signed char *, volatile signed char *, int); 442 unsigned char __atomic_exchange_n(volatile unsigned char *, volatile unsigned char *, int);444 unsigned char __atomic_exchange_n(volatile unsigned char *, unsigned char, int); 443 445 unsigned char __atomic_exchange_1(volatile unsigned char *, unsigned char, int); 444 446 void __atomic_exchange(volatile unsigned char *, volatile unsigned char *, volatile unsigned char *, int); 445 signed short __atomic_exchange_n(volatile signed short *, volatile signed short *, int);447 signed short __atomic_exchange_n(volatile signed short *, signed short, int); 446 448 signed short __atomic_exchange_2(volatile signed short *, signed short, int); 447 449 void __atomic_exchange(volatile signed short *, volatile signed short *, volatile signed short *, int); 448 unsigned short __atomic_exchange_n(volatile unsigned short *, volatile unsigned short *, int);450 unsigned short __atomic_exchange_n(volatile unsigned short *, unsigned short, int); 449 451 unsigned short __atomic_exchange_2(volatile unsigned short *, unsigned short, int); 450 452 void __atomic_exchange(volatile unsigned short *, volatile unsigned short *, volatile unsigned short *, int); 451 signed int __atomic_exchange_n(volatile signed int *, volatile signed int *, int);453 signed int __atomic_exchange_n(volatile signed int *, signed int, int); 452 454 signed int __atomic_exchange_4(volatile signed int *, signed int, int); 453 455 void __atomic_exchange(volatile signed int *, volatile signed int *, volatile signed int *, int); 454 unsigned int __atomic_exchange_n(volatile unsigned int *, volatile unsigned int *, int);456 unsigned int __atomic_exchange_n(volatile unsigned int *, unsigned int, int); 455 457 unsigned int __atomic_exchange_4(volatile unsigned int *, unsigned int, int); 456 458 void __atomic_exchange(volatile unsigned int *, volatile unsigned int *, volatile unsigned int *, int); 457 signed long long int __atomic_exchange_n(volatile signed long long int *, volatile signed long long int *, int);459 signed long long int __atomic_exchange_n(volatile signed long long int *, signed long long int, int); 458 460 signed long long int __atomic_exchange_8(volatile signed long long int *, signed long long int, int); 459 461 void __atomic_exchange(volatile signed long long int *, volatile signed long long int *, volatile signed long long int *, int); 460 unsigned long long int __atomic_exchange_n(volatile unsigned long long int *, volatile unsigned long long int *, int);462 unsigned long long int __atomic_exchange_n(volatile unsigned long long int *, unsigned long long int, int); 461 463 unsigned long long int __atomic_exchange_8(volatile unsigned long long int *, unsigned long long int, int); 462 464 void __atomic_exchange(volatile unsigned long long int *, volatile unsigned long long int *, volatile unsigned long long int *, int); 463 465 #if defined(__SIZEOF_INT128__) 464 signed __int128 __atomic_exchange_n(volatile signed __int128 *, volatile signed __int128 *, int);466 signed __int128 __atomic_exchange_n(volatile signed __int128 *, signed __int128, int); 465 467 signed __int128 __atomic_exchange_16(volatile signed __int128 *, signed __int128, int); 466 468 void __atomic_exchange(volatile signed __int128 *, volatile signed __int128 *, volatile signed __int128 *, int); 467 unsigned __int128 __atomic_exchange_n(volatile unsigned __int128 *, volatile unsigned __int128 *, int);469 unsigned __int128 __atomic_exchange_n(volatile unsigned __int128 *, unsigned __int128, int); 468 470 unsigned __int128 __atomic_exchange_16(volatile unsigned __int128 *, unsigned __int128, int); 469 471 void __atomic_exchange(volatile unsigned __int128 *, volatile unsigned __int128 *, volatile unsigned __int128 *, int); 470 472 #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); 471 475 472 476 _Bool __atomic_load_n(const volatile _Bool *, int); … … 507 511 void __atomic_load(const volatile unsigned __int128 *, volatile unsigned __int128 *, int); 508 512 #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); 509 515 510 516 _Bool __atomic_compare_exchange_n(volatile char *, char *, char, _Bool, int, int); … … 543 549 _Bool __atomic_compare_exchange (volatile unsigned __int128 *, unsigned __int128 *, unsigned __int128 *, _Bool, int, int); 544 550 #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); 545 553 546 554 void __atomic_store_n(volatile _Bool *, _Bool, int); … … 581 589 void __atomic_store(volatile unsigned __int128 *, unsigned __int128 *, int); 582 590 #endif 591 forall(dtype T) void __atomic_store_n(T * volatile *, T *, int); 592 forall(dtype T) void __atomic_store(T * volatile *, T **, int); 583 593 584 594 char __atomic_add_fetch (volatile char *, char, int); -
src/ResolvExpr/ConversionCost.cc
r5b11c25 r8278abf 10 10 // Created On : Sun May 17 07:06:19 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 14 17:04:31201913 // Update Count : 2 312 // Last Modified On : Fri Apr 26 16:33:04 2019 13 // Update Count : 24 14 14 // 15 15 … … 28 28 29 29 namespace ResolvExpr { 30 #if 0 30 31 const Cost Cost::zero = Cost{ 0, 0, 0, 0, 0, 0, 0 }; 31 32 const Cost Cost::infinity = Cost{ -1, -1, -1, -1, -1, 1, -1 }; … … 37 38 const Cost Cost::spec = Cost{ 0, 0, 0, 0, 0, -1, 0 }; 38 39 const Cost Cost::reference = Cost{ 0, 0, 0, 0, 0, 0, 1 }; 40 #endif 39 41 40 42 #if 0 -
src/ResolvExpr/Cost.h
r5b11c25 r8278abf 7 7 // Cost.h -- 8 8 // 9 // Author : Richard C. Bilson9 // Author : Peter Buhr and Aaron Moss 10 10 // Created On : Sun May 17 09:39:50 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 7 20:54:29201913 // Update Count : 812 // Last Modified On : Mon Apr 29 18:33:44 2019 13 // Update Count : 49 14 14 // 15 15 … … 17 17 18 18 #include <iostream> 19 #include <cassert> 20 #include <climits> 19 21 20 22 namespace ResolvExpr { 23 #if 0 24 25 //*************************** OLD *************************** 26 21 27 class Cost { 22 28 private: 23 29 Cost( int unsafeCost, int polyCost, int safeCost, int signCost, 24 int varCost, int specCost, int referenceCost );30 int varCost, int specCost, int referenceCost ); 25 31 public: 26 32 Cost & incUnsafe( int inc = 1 ); … … 71 77 72 78 inline Cost::Cost( int unsafeCost, int polyCost, int safeCost, int signCost, 73 int varCost, int specCost, int referenceCost )79 int varCost, int specCost, int referenceCost ) 74 80 : unsafeCost( unsafeCost ), polyCost( polyCost ), safeCost( safeCost ), signCost( signCost ), 75 81 varCost( varCost ), specCost( specCost ), referenceCost( referenceCost ) {} … … 121 127 return Cost{ 122 128 unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost, 123 signCost + other.signCost, varCost + other.varCost, specCost + other.specCost,124 referenceCost + other.referenceCost };129 signCost + other.signCost, varCost + other.varCost, specCost + other.specCost, 130 referenceCost + other.referenceCost }; 125 131 } 126 132 … … 211 217 << cost.referenceCost << " )"; 212 218 } 219 220 #else 221 222 //*************************** NEW *************************** 223 224 // To maximize performance and space, the 7 resolution costs are packed into a single 64-bit word. However, the 225 // 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; ///< unused 233 unsigned char referenceCost; ///< reference conversions 234 unsigned char specCost; ///< Polymorphic type specializations (type assertions), negative cost 235 unsigned char varCost; ///< Count of polymorphic type variables 236 unsigned char signCost; ///< Count of safe sign conversions 237 unsigned char safeCost; ///< Safe (widening) conversions 238 unsigned char polyCost; ///< Count of parameters and return values bound to some poly type 239 unsigned char unsafeCost; ///< Unsafe (narrowing) conversions 240 #else 241 #error Cost BIG_ENDIAN unsupported 242 #endif 243 } v; 244 uint64_t all; 245 }; 246 static const unsigned char correctb = 0xff; // byte correction for negative spec cost 247 static const uint64_t correctw = 0x00'00'00'00'00'ff'00'00; //' word correction for negative spec cost 248 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, // padding 268 (unsigned char)referenceCost, // low priority 269 (unsigned char)(specCost + correctb), // correct for signedness 270 (unsigned char)varCost, 271 (unsigned char)signCost, 272 (unsigned char)safeCost, 273 (unsigned char)polyCost, 274 (unsigned char)unsafeCost, // high priority 275 #else 276 #error Cost BIG_ENDIAN unsupported 277 #endif 278 }; 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 > rhs 292 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 cost 308 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 cost 366 } 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 // 0 213 374 } // namespace ResolvExpr 214 375 -
src/ResolvExpr/ResolveAssertions.cc
r5b11c25 r8278abf 35 35 #include "SynTree/Expression.h" // for InferredParams 36 36 #include "TypeEnvironment.h" // for TypeEnvironment, etc. 37 #include "typeops.h" // for adjustExprType 37 #include "typeops.h" // for adjustExprType, specCost 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 assertion61 struct AssnId {62 DeclarationWithType* decl; ///< Declaration of assertion63 AssertionSetValue info; ///< Information about assertion64 65 AssnId(DeclarationWithType* decl, const AssertionSetValue& info) : decl(decl), info(info) {}66 };67 68 /// Cached assertion items69 struct AssnCacheItem {70 CandidateList matches; ///< Possible matches for this assertion71 std::vector<AssnId> deferIds; ///< Deferred assertions which resolve to this item72 73 AssnCacheItem( CandidateList&& m ) : matches(std::move(m)), deferIds() {}74 };75 76 /// Cache of resolved assertions77 using AssnCache = std::unordered_map<std::string, AssnCacheItem>;78 79 60 /// Reference to single deferred item 80 61 struct DeferRef { 81 const AssnCacheItem& item; 62 const DeclarationWithType* decl; 63 const AssertionSetValue& info; 82 64 const AssnCandidate& match; 83 65 }; … … 86 68 /// Acts like indexed list of DeferRef 87 69 struct DeferItem { 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; } 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] }; } 109 82 }; 110 83 … … 181 154 for ( const auto& assn : x.assns ) { 182 155 k += computeConversionCost( 183 assn.match.adjType, assn.item.deferIds[0].decl->get_type(), indexer, 184 x.env ); 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 } 185 171 } 186 172 it = cache.emplace_hint( it, &x, k ); … … 253 239 254 240 /// Resolve a single assertion, in context 255 bool resolveAssertion( AssertionItem& assn, ResnState& resn , AssnCache& cache) {241 bool resolveAssertion( AssertionItem& assn, ResnState& resn ) { 256 242 // skip unused assertions 257 243 if ( ! assn.info.isUsed ) return true; 258 244 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 } 292 } 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 } 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; 271 } 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; 299 278 } 300 301 it = cache.emplace_hint( it, assnKey, AssnCacheItem{ std::move(matches) } ); 302 } 303 304 CandidateList& matches = it->second.matches; 279 } 305 280 306 281 // break if no suitable assertion … … 309 284 // defer if too many suitable assertions 310 285 if ( matches.size() > 1 ) { 311 it->second.deferIds.emplace_back( assn.decl, assn.info ); 312 resn.deferred.emplace_back( cache, assnKey ); 286 resn.deferred.emplace_back( assn.decl, assn.info, std::move(matches) ); 313 287 return true; 314 288 } … … 318 292 addToIndexer( match.have, resn.indexer ); 319 293 resn.newNeed.insert( match.need.begin(), match.need.end() ); 320 resn.alt.env = match.env;321 resn.alt.openVars = match.openVars;294 resn.alt.env = std::move(match.env); 295 resn.alt.openVars = std::move(match.openVars); 322 296 323 297 bindAssertion( assn.decl, assn.info, resn.alt, match, resn.inferred ); … … 380 354 ResnList resns{ ResnState{ alt, root_indexer } }; 381 355 ResnList new_resns{}; 382 AssnCache assnCache;383 356 384 357 // resolve assertions in breadth-first-order up to a limited number of levels deep … … 389 362 for ( auto& assn : resn.need ) { 390 363 // fail early if any assertion is not resolvable 391 if ( ! resolveAssertion( assn, resn , assnCache) ) {364 if ( ! resolveAssertion( assn, resn ) ) { 392 365 Indenter tabs{ Indenter::tabsize, 3 }; 393 366 std::ostringstream ss; … … 410 383 } 411 384 } else { 412 // only resolve each deferred assertion once413 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() );416 385 // resolve deferred assertions by mutual compatibility 417 386 std::vector<CandidateEnvMerger::OutType> compatible = filterCombos( … … 427 396 ++tabs; 428 397 for ( const auto& d : resn.deferred ) { 429 d. get_decl()->print( ss, tabs );398 d.decl->print( ss, tabs ); 430 399 } 431 400 … … 458 427 new_resn.newNeed.insert( match.need.begin(), match.need.end() ); 459 428 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 } 429 bindAssertion( r.decl, r.info, new_resn.alt, match, new_resn.inferred ); 465 430 } 466 431 -
src/SymTab/Mangler.cc
r5b11c25 r8278abf 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 );41 40 Mangler( const Mangler & ) = delete; 42 41 … … 67 66 private: 68 67 std::ostringstream mangleName; ///< Mangled name being constructed 69 typedef std::map< std::string, std::pair< std::string, int > > VarMapType;68 typedef std::map< std::string, std::pair< int, int > > VarMapType; 70 69 VarMapType varNums; ///< Map of type variables to indices 71 70 int nextVarNum; ///< Next type variable index 72 const ResolvExpr::TypeEnvironment* env; ///< optional environment for substitutions73 71 bool isTopLevel; ///< Is the Mangler at the top level 74 72 bool mangleOverridable; ///< Specially mangle overridable built-in methods … … 80 78 public: 81 79 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams, 82 int nextVarNum, const ResolvExpr::TypeEnvironment* env, 83 const VarMapType& varNums ); 80 int nextVarNum, const VarMapType& varNums ); 84 81 85 82 private: … … 109 106 } 110 107 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 118 108 namespace { 119 109 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ) 120 : nextVarNum( 0 ), env(nullptr),isTopLevel( true ),110 : nextVarNum( 0 ), isTopLevel( true ), 121 111 mangleOverridable( mangleOverridable ), typeMode( typeMode ), 122 112 mangleGenericParams( mangleGenericParams ) {} 123 113 124 Mangler::Mangler( const ResolvExpr::TypeEnvironment& env )125 : nextVarNum( 0 ), env( &env ), isTopLevel( true ), mangleOverridable( false ),126 typeMode( false ), mangleGenericParams( true ) {}127 128 114 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams, 129 int nextVarNum, const ResolvExpr::TypeEnvironment* env, 130 const VarMapType& varNums ) 131 : varNums( varNums ), nextVarNum( nextVarNum ), env( env ), isTopLevel( false ), 115 int nextVarNum, const VarMapType& varNums ) 116 : varNums( varNums ), nextVarNum( nextVarNum ), isTopLevel( false ), 132 117 mangleOverridable( mangleOverridable ), typeMode( typeMode ), 133 118 mangleGenericParams( mangleGenericParams ) {} … … 358 343 assert( false ); 359 344 } // switch 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() ); 345 varNums[ (*i)->name ] = std::make_pair( nextVarNum, (int)(*i)->get_kind() ); 377 346 for ( std::list< DeclarationWithType* >::iterator assert = (*i)->assertions.begin(); assert != (*i)->assertions.end(); ++assert ) { 378 347 PassVisitor<Mangler> sub_mangler( 379 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, env, 380 varNums ); 348 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums ); 381 349 (*assert)->accept( sub_mangler ); 382 350 assertionNames.push_back( sub_mangler.pass.get_mangleName() ); -
src/SymTab/Mangler.h
r5b11c25 r8278abf 44 44 /// Mangle ignoring generic type parameters 45 45 std::string mangleConcrete( Type* ty ); 46 /// Mangle for assertion key47 std::string mangleAssnKey( DeclarationWithType* decl,48 const ResolvExpr::TypeEnvironment& env );49 46 50 47 namespace Encoding { -
tests/builtins/sync.cfa
r5b11c25 r8278abf 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; 13 14 14 15 { char ret; ret = __sync_fetch_and_add(vp1, v1); } … … 180 181 { _Bool ret; ret = __sync_bool_compare_and_swap_16(vp16, v16,v16); } 181 182 #endif 183 { _Bool ret; ret = __sync_bool_compare_and_swap(vpp, vp, vp); } 182 184 183 185 { char ret; ret = __sync_val_compare_and_swap(vp1, v1, v1); } … … 193 195 { __int128 ret; ret = __sync_val_compare_and_swap_16(vp16, v16,v16); } 194 196 #endif 197 { struct type * ret; ret = __sync_val_compare_and_swap(vpp, vp, vp); } 198 195 199 196 200 { char ret; ret = __sync_lock_test_and_set(vp1, v1); } … … 230 234 { __atomic_clear(vp1, v1); } 231 235 232 { char ret; ret = __atomic_exchange_n(vp1, &v1, __ATOMIC_SEQ_CST); }236 { char ret; ret = __atomic_exchange_n(vp1, v1, __ATOMIC_SEQ_CST); } 233 237 { char ret; ret = __atomic_exchange_1(vp1, v1, __ATOMIC_SEQ_CST); } 234 238 { char ret; __atomic_exchange(vp1, &v1, &ret, __ATOMIC_SEQ_CST); } 235 { short ret; ret = __atomic_exchange_n(vp2, &v2, __ATOMIC_SEQ_CST); }239 { short ret; ret = __atomic_exchange_n(vp2, v2, __ATOMIC_SEQ_CST); } 236 240 { short ret; ret = __atomic_exchange_2(vp2, v2, __ATOMIC_SEQ_CST); } 237 241 { short ret; __atomic_exchange(vp2, &v2, &ret, __ATOMIC_SEQ_CST); } 238 { int ret; ret = __atomic_exchange_n(vp4, &v4, __ATOMIC_SEQ_CST); }242 { int ret; ret = __atomic_exchange_n(vp4, v4, __ATOMIC_SEQ_CST); } 239 243 { int ret; ret = __atomic_exchange_4(vp4, v4, __ATOMIC_SEQ_CST); } 240 244 { int ret; __atomic_exchange(vp4, &v4, &ret, __ATOMIC_SEQ_CST); } 241 { long long int ret; ret = __atomic_exchange_n(vp8, &v8, __ATOMIC_SEQ_CST); }245 { long long int ret; ret = __atomic_exchange_n(vp8, v8, __ATOMIC_SEQ_CST); } 242 246 { long long int ret; ret = __atomic_exchange_8(vp8, v8, __ATOMIC_SEQ_CST); } 243 247 { long long int ret; __atomic_exchange(vp8, &v8, &ret, __ATOMIC_SEQ_CST); } 244 248 #if defined(__SIZEOF_INT128__) 245 { __int128 ret; ret = __atomic_exchange_n(vp16, &v16, __ATOMIC_SEQ_CST); }249 { __int128 ret; ret = __atomic_exchange_n(vp16, v16, __ATOMIC_SEQ_CST); } 246 250 { __int128 ret; ret = __atomic_exchange_16(vp16, v16, __ATOMIC_SEQ_CST); } 247 251 { __int128 ret; __atomic_exchange(vp16, &v16, &ret, __ATOMIC_SEQ_CST); } 248 252 #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); } 249 255 250 256 { char ret; ret = __atomic_load_n(vp1, __ATOMIC_SEQ_CST); } … … 265 271 { __int128 ret; __atomic_load(vp16, &ret, __ATOMIC_SEQ_CST); } 266 272 #endif 273 { struct type * ret; ret = __atomic_load_n(vpp, __ATOMIC_SEQ_CST); } 274 { struct type * ret; __atomic_load(vpp, &ret, __ATOMIC_SEQ_CST); } 267 275 268 276 { _Bool ret; ret = __atomic_compare_exchange_n(vp1, rp1, v1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } … … 283 291 { _Bool ret; ret = __atomic_compare_exchange(vp16, rp16, &v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 284 292 #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); } 285 295 286 296 { __atomic_store_n(vp1, v1, __ATOMIC_SEQ_CST); } … … 301 311 { __atomic_store(vp16, &v16, __ATOMIC_SEQ_CST); } 302 312 #endif 313 { __atomic_store_n(vpp, vp, __ATOMIC_SEQ_CST); } 314 { __atomic_store(vpp, &vp, __ATOMIC_SEQ_CST); } 303 315 304 316 { char ret; ret = __atomic_add_fetch(vp1, v1, __ATOMIC_SEQ_CST); } -
tools/PrettyGitLogs.sh
r5b11c25 r8278abf 27 27 git rev-list --format=short ${GitOldRef}...${GitNewRef} > ${GIT_LOG} 28 28 29 git diff --stat ${GitNewRef} ${GitOldRef}> ${GIT_DIFF}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}
Note: See TracChangeset
for help on using the changeset viewer.