From e32db8458457849f5d894ffa4a1672b9071708f0 Mon Sep 17 00:00:00 2001 From: asrar Date: Sun, 14 Jun 2020 21:44:11 +0530 Subject: Add rust features to print target features `crt-static` is a rust specific target feature that's absent from llvm feature table, adding it there. --- src/rustllvm/PassWrapper.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/rustllvm/PassWrapper.cpp') diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 3d252fe70af..7586dd91ab6 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -425,6 +425,9 @@ extern "C" void LLVMRustPrintTargetFeatures(LLVMTargetMachineRef TM) { for (auto &Feature : FeatTable) printf(" %-*s - %s.\n", MaxFeatLen, Feature.Key, Feature.Desc); printf("\n"); + // Rust specific target features + printf(" %-*s - %s.\n", MaxFeatLen, "crt-static", "Enables libraries with C Run-time Libraries(CRT) to be statically linked"); + printf("\n"); printf("Use +feature to enable a feature, or -feature to disable it.\n" "For example, rustc -C -target-cpu=mycpu -C " -- cgit 1.4.1-3-g733a5 From 4506a358ca4be0b3f7a1f320a677168d964ca9f7 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 16 Jun 2020 17:36:04 +0000 Subject: add header for rust specific feature --- src/rustllvm/PassWrapper.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/rustllvm/PassWrapper.cpp') diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 7586dd91ab6..47c03069182 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -424,8 +424,7 @@ extern "C" void LLVMRustPrintTargetFeatures(LLVMTargetMachineRef TM) { printf("Available features for this target:\n"); for (auto &Feature : FeatTable) printf(" %-*s - %s.\n", MaxFeatLen, Feature.Key, Feature.Desc); - printf("\n"); - // Rust specific target features + printf("Rust-specific features:\n"); printf(" %-*s - %s.\n", MaxFeatLen, "crt-static", "Enables libraries with C Run-time Libraries(CRT) to be statically linked"); printf("\n"); -- cgit 1.4.1-3-g733a5 From 9f50f84ef106c7f521d1322ec39562610339f74d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 16 Jun 2020 18:14:32 +0000 Subject: break long line for formatting --- src/rustllvm/PassWrapper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/rustllvm/PassWrapper.cpp') diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 47c03069182..16c2ac33227 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -425,7 +425,11 @@ extern "C" void LLVMRustPrintTargetFeatures(LLVMTargetMachineRef TM) { for (auto &Feature : FeatTable) printf(" %-*s - %s.\n", MaxFeatLen, Feature.Key, Feature.Desc); printf("Rust-specific features:\n"); - printf(" %-*s - %s.\n", MaxFeatLen, "crt-static", "Enables libraries with C Run-time Libraries(CRT) to be statically linked"); + printf(" %-*s - %s.\n", + MaxFeatLen, + "crt-static", + "Enables libraries with C Run-time Libraries(CRT) to be statically linked" + ); printf("\n"); printf("Use +feature to enable a feature, or -feature to disable it.\n" -- cgit 1.4.1-3-g733a5 From 457acbd5a80153fc06bca12663405c175fd9453f Mon Sep 17 00:00:00 2001 From: root Date: Tue, 16 Jun 2020 18:53:30 +0000 Subject: trim whitespace --- src/rustllvm/PassWrapper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/rustllvm/PassWrapper.cpp') diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 16c2ac33227..28caf61a019 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -425,9 +425,9 @@ extern "C" void LLVMRustPrintTargetFeatures(LLVMTargetMachineRef TM) { for (auto &Feature : FeatTable) printf(" %-*s - %s.\n", MaxFeatLen, Feature.Key, Feature.Desc); printf("Rust-specific features:\n"); - printf(" %-*s - %s.\n", - MaxFeatLen, - "crt-static", + printf(" %-*s - %s.\n", + MaxFeatLen, + "crt-static", "Enables libraries with C Run-time Libraries(CRT) to be statically linked" ); printf("\n"); -- cgit 1.4.1-3-g733a5 From caffb28ece818ce87f1c7573992cae4210544015 Mon Sep 17 00:00:00 2001 From: asrar Date: Wed, 17 Jun 2020 10:31:46 +0530 Subject: add blank line bw sections Separate target features from rust ones with a blank line Co-authored-by: Josh Stone --- src/rustllvm/PassWrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rustllvm/PassWrapper.cpp') diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 28caf61a019..323bd26c698 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -424,7 +424,7 @@ extern "C" void LLVMRustPrintTargetFeatures(LLVMTargetMachineRef TM) { printf("Available features for this target:\n"); for (auto &Feature : FeatTable) printf(" %-*s - %s.\n", MaxFeatLen, Feature.Key, Feature.Desc); - printf("Rust-specific features:\n"); + printf("\nRust-specific features:\n"); printf(" %-*s - %s.\n", MaxFeatLen, "crt-static", -- cgit 1.4.1-3-g733a5