Skip to content

Commit

Permalink
[examples] Fix -Wcast-qual in OrcV2Examples after D153911 (NFC)
Browse files Browse the repository at this point in the history
/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, "");
                                                   ^
...
  • Loading branch information
DamonFool committed Jul 19, 2023
1 parent 64cfcde commit c2cabe4
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit c2cabe4

Please sign in to comment.