[llvm] c2cabe4 - [examples] Fix -Wcast-qual in OrcV2Examples after D153911 (NFC)
Jie Fu via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 18 23:56:06 PDT 2023
Author: Jie Fu
Date: 2023-07-19T14:55:58+08:00
New Revision: c2cabe479b27af031d3d63cc73630e2c23bddbcd
URL: https://github.com/llvm/llvm-project/commit/c2cabe479b27af031d3d63cc73630e2c23bddbcd
DIFF: https://github.com/llvm/llvm-project/commit/c2cabe479b27af031d3d63cc73630e2c23bddbcd.diff
LOG: [examples] Fix -Wcast-qual in OrcV2Examples after D153911 (NFC)
/Users/jiefu/llvm-project/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c:77:52: error: cast from 'char **' to 'const char **' must have all intermediate pointers const qualified to be safe [-Werror,-Wcast-qual]
LLVMParseCommandLineOptions(argc, (const char **)argv, "");
^
/Users/jiefu/llvm-project/llvm/examples/OrcV2Examples/OrcV2CBindingsAddObjectFile/OrcV2CBindingsAddObjectFile.c:63:52: error: cast from 'char **' to 'const char **' must have all intermediate pointers const qualified to be safe [-Werror,-Wcast-qual]
LLVMParseCommandLineOptions(argc, (const char **)argv, "");
^
/Users/jiefu/llvm-project/llvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c:62:52: error: cast from 'char **' to 'const char **' must have all intermediate pointers const qualified to be safe [-Werror,-Wcast-qual]
LLVMParseCommandLineOptions(argc, (const char **)argv, "");
^
...
Added:
Modified:
llvm/examples/OrcV2Examples/OrcV2CBindingsAddObjectFile/OrcV2CBindingsAddObjectFile.c
llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c
llvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c
llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/OrcV2CBindingsIRTransforms.c
llvm/examples/OrcV2Examples/OrcV2CBindingsLazy/OrcV2CBindingsLazy.c
llvm/examples/OrcV2Examples/OrcV2CBindingsMCJITLikeMemoryManager/OrcV2CBindingsMCJITLikeMemoryManager.c
llvm/examples/OrcV2Examples/OrcV2CBindingsRemovableCode/OrcV2CBindingsRemovableCode.c
llvm/examples/OrcV2Examples/OrcV2CBindingsVeryLazy/OrcV2CBindingsVeryLazy.c
Removed:
################################################################################
diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsAddObjectFile/OrcV2CBindingsAddObjectFile.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsAddObjectFile/OrcV2CBindingsAddObjectFile.c
index a3a991dad1ffe1..b51fc930c4318e 100644
--- a/llvm/examples/OrcV2Examples/OrcV2CBindingsAddObjectFile/OrcV2CBindingsAddObjectFile.c
+++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsAddObjectFile/OrcV2CBindingsAddObjectFile.c
@@ -55,12 +55,12 @@ LLVMModuleRef createDemoModule(LLVMContextRef Ctx) {
return M;
}
-int main(int argc, char *argv[]) {
+int main(int argc, const char *argv[]) {
int MainResult = 0;
// Parse command line arguments and initialize LLVM Core.
- LLVMParseCommandLineOptions(argc, (const char **)argv, "");
+ LLVMParseCommandLineOptions(argc, argv, "");
// Initialize native target codegen and asm printer.
LLVMInitializeNativeTarget();
diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c
index 2411a779b7bfd5..286fa8baac4f8a 100644
--- a/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c
+++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c
@@ -69,12 +69,12 @@ LLVMOrcThreadSafeModuleRef createDemoModule(void) {
return TSM;
}
-int main(int argc, char *argv[]) {
+int main(int argc, const char *argv[]) {
int MainResult = 0;
// Parse command line arguments and initialize LLVM Core.
- LLVMParseCommandLineOptions(argc, (const char **)argv, "");
+ LLVMParseCommandLineOptions(argc, argv, "");
// Initialize native target codegen and asm printer.
LLVMInitializeNativeTarget();
diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c
index 72ac112b17f9da..1b4102625fa1b8 100644
--- a/llvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c
+++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsDumpObjects/OrcV2CBindingsDumpObjects.c
@@ -55,11 +55,11 @@ LLVMErrorRef dumpObjectsTransform(void *Ctx, LLVMMemoryBufferRef *ObjInOut) {
return LLVMOrcDumpObjects_CallOperator(DumpObjects, ObjInOut);
}
-int main(int argc, char *argv[]) {
+int main(int argc, const char *argv[]) {
int MainResult = 0;
- LLVMParseCommandLineOptions(argc, (const char **)argv, "");
+ LLVMParseCommandLineOptions(argc, argv, "");
LLVMInitializeNativeTarget();
LLVMInitializeNativeAsmPrinter();
diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/OrcV2CBindingsIRTransforms.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/OrcV2CBindingsIRTransforms.c
index b46d00baff3226..41ae6e53db1d62 100644
--- a/llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/OrcV2CBindingsIRTransforms.c
+++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsIRTransforms/OrcV2CBindingsIRTransforms.c
@@ -64,11 +64,11 @@ LLVMErrorRef transform(void *Ctx, LLVMOrcThreadSafeModuleRef *ModInOut,
return LLVMOrcThreadSafeModuleWithModuleDo(*ModInOut, myModuleTransform, Ctx);
}
-int main(int argc, char *argv[]) {
+int main(int argc, const char *argv[]) {
int MainResult = 0;
- LLVMParseCommandLineOptions(argc, (const char **)argv, "");
+ LLVMParseCommandLineOptions(argc, argv, "");
LLVMInitializeNativeTarget();
LLVMInitializeNativeAsmPrinter();
diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsLazy/OrcV2CBindingsLazy.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsLazy/OrcV2CBindingsLazy.c
index c63495a48fd894..33398c8cb98165 100644
--- a/llvm/examples/OrcV2Examples/OrcV2CBindingsLazy/OrcV2CBindingsLazy.c
+++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsLazy/OrcV2CBindingsLazy.c
@@ -96,12 +96,12 @@ LLVMErrorRef parseExampleModule(const char *Source, size_t Len,
return LLVMErrorSuccess;
}
-int main(int argc, char *argv[]) {
+int main(int argc, const char *argv[]) {
int MainResult = 0;
// Parse command line arguments and initialize LLVM Core.
- LLVMParseCommandLineOptions(argc, (const char **)argv, "");
+ LLVMParseCommandLineOptions(argc, argv, "");
// Initialize native target codegen and asm printer.
LLVMInitializeNativeTarget();
diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsMCJITLikeMemoryManager/OrcV2CBindingsMCJITLikeMemoryManager.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsMCJITLikeMemoryManager/OrcV2CBindingsMCJITLikeMemoryManager.c
index c8f439e99f633d..f85430bcfda4a3 100644
--- a/llvm/examples/OrcV2Examples/OrcV2CBindingsMCJITLikeMemoryManager/OrcV2CBindingsMCJITLikeMemoryManager.c
+++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsMCJITLikeMemoryManager/OrcV2CBindingsMCJITLikeMemoryManager.c
@@ -194,12 +194,12 @@ LLVMOrcThreadSafeModuleRef createDemoModule(void) {
return TSM;
}
-int main(int argc, char *argv[]) {
+int main(int argc, const char *argv[]) {
int MainResult = 0;
// Parse command line arguments and initialize LLVM Core.
- LLVMParseCommandLineOptions(argc, (const char **)argv, "");
+ LLVMParseCommandLineOptions(argc, argv, "");
// Initialize native target codegen and asm printer.
LLVMInitializeNativeTarget();
diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsRemovableCode/OrcV2CBindingsRemovableCode.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsRemovableCode/OrcV2CBindingsRemovableCode.c
index 7c6ec1bf517ec7..7f84a3d4134351 100644
--- a/llvm/examples/OrcV2Examples/OrcV2CBindingsRemovableCode/OrcV2CBindingsRemovableCode.c
+++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsRemovableCode/OrcV2CBindingsRemovableCode.c
@@ -69,12 +69,12 @@ LLVMOrcThreadSafeModuleRef createDemoModule(void) {
return TSM;
}
-int main(int argc, char *argv[]) {
+int main(int argc, const char *argv[]) {
int MainResult = 0;
// Parse command line arguments and initialize LLVM Core.
- LLVMParseCommandLineOptions(argc, (const char **)argv, "");
+ LLVMParseCommandLineOptions(argc, argv, "");
// Initialize native target codegen and asm printer.
LLVMInitializeNativeTarget();
diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsVeryLazy/OrcV2CBindingsVeryLazy.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsVeryLazy/OrcV2CBindingsVeryLazy.c
index 864194c2f17fc7..85651f728399e0 100644
--- a/llvm/examples/OrcV2Examples/OrcV2CBindingsVeryLazy/OrcV2CBindingsVeryLazy.c
+++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsVeryLazy/OrcV2CBindingsVeryLazy.c
@@ -160,12 +160,12 @@ void Materialize(void *Ctx, LLVMOrcMaterializationResponsibilityRef MR) {
}
}
-int main(int argc, char *argv[]) {
+int main(int argc, const char *argv[]) {
int MainResult = 0;
// Parse command line arguments and initialize LLVM Core.
- LLVMParseCommandLineOptions(argc, (const char **)argv, "");
+ LLVMParseCommandLineOptions(argc, argv, "");
// Initialize native target codegen and asm printer.
LLVMInitializeNativeTarget();
More information about the llvm-commits
mailing list