[llvm] 1ba3745 - [llvm-c-test] Fix warnings
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 31 12:15:11 PST 2023
Author: Kazu Hirata
Date: 2023-01-31T12:15:04-08:00
New Revision: 1ba3745c4b9309b5c85f82a231c6ee6b5946753b
URL: https://github.com/llvm/llvm-project/commit/1ba3745c4b9309b5c85f82a231c6ee6b5946753b
DIFF: https://github.com/llvm/llvm-project/commit/1ba3745c4b9309b5c85f82a231c6ee6b5946753b.diff
LOG: [llvm-c-test] Fix warnings
This patch fixes:
llvm/tools/llvm-c-test/metadata.c:49:16: error: unused variable
'tmp' [-Werror,-Wunused-variable]
llvm-project/llvm/tools/llvm-c-test/metadata.c:70:16: error: unused
variable 'md' [-Werror,-Wunused-variable]
llvm/tools/llvm-c-test/metadata.c:74:16: error: unused variable
'md2' [-Werror,-Wunused-variable]
Added:
Modified:
llvm/tools/llvm-c-test/metadata.c
Removed:
################################################################################
diff --git a/llvm/tools/llvm-c-test/metadata.c b/llvm/tools/llvm-c-test/metadata.c
index e8861c3a325da..9c19275642b7e 100644
--- a/llvm/tools/llvm-c-test/metadata.c
+++ b/llvm/tools/llvm-c-test/metadata.c
@@ -56,6 +56,7 @@ int llvm_replace_md_operand(void) {
LLVMMDStringInContext2(context, "bar", 3));
assert(!strncmp(LLVMGetMDString(LLVMGetOperand(md, 0), &tmp), "bar", 0));
+ (void)tmp;
LLVMDisposeModule(m);
@@ -69,11 +70,13 @@ int llvm_is_a_value_as_metadata(void) {
LLVMValueRef values[] = {LLVMConstInt(LLVMInt32Type(), 0, 0)};
LLVMValueRef md = LLVMMDNode(values, 1);
assert(LLVMIsAValueAsMetadata(md) == md);
+ (void)md;
LLVMMetadataRef metas[] = {LLVMMDStringInContext2(context, "foo", 3)};
LLVMValueRef md2 =
LLVMMetadataAsValue(context, LLVMMDNodeInContext2(context, metas, 1));
assert(LLVMIsAValueAsMetadata(md2) == NULL);
+ (void)md2;
return 0;
}
More information about the llvm-commits
mailing list