From eeabfb0a05120031e820f26da6286fe8795459d3 Mon Sep 17 00:00:00 2001 From: Amaury Sechet Date: Sat, 23 Apr 2016 00:12:45 +0000 Subject: [PATCH] Style fix in Core.h / Core.cpp. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267257 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm-c/Core.h | 7 ++++--- lib/IR/Core.cpp | 24 ++++++++++-------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index 0c3d76d6f9b..399e12d7f90 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -636,7 +636,7 @@ LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name); * * @see llvm::Module::getNamedMetadata() */ -unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char* name); +unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name); /** * Obtain the named metadata operands for a module. @@ -649,7 +649,8 @@ unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char* name); * @see llvm::Module::getNamedMetadata() * @see llvm::MDNode::getOperand() */ -void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char* name, LLVMValueRef *Dest); +void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, + LLVMValueRef *Dest); /** * Add an operand to named metadata. @@ -657,7 +658,7 @@ void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char* name, LLVMValueRe * @see llvm::Module::getNamedMetadata() * @see llvm::MDNode::addOperand() */ -void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char* name, +void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val); /** diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index 4a66c26d623..262c6b135a5 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -825,16 +825,14 @@ const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length) { return nullptr; } -unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V) -{ +unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V) { auto *MD = cast(unwrap(V)); if (isa(MD->getMetadata())) return 1; return cast(MD->getMetadata())->getNumOperands(); } -void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest) -{ +void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest) { auto *MD = cast(unwrap(V)); if (auto *MDV = dyn_cast(MD->getMetadata())) { *Dest = wrap(MDV->getValue()); @@ -847,17 +845,16 @@ void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest) Dest[i] = getMDNodeOperandImpl(Context, N, i); } -unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char* name) -{ - if (NamedMDNode *N = unwrap(M)->getNamedMetadata(name)) { +unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name) { + if (NamedMDNode *N = unwrap(M)->getNamedMetadata(Name)) { return N->getNumOperands(); } return 0; } -void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char* name, LLVMValueRef *Dest) -{ - NamedMDNode *N = unwrap(M)->getNamedMetadata(name); +void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, + LLVMValueRef *Dest) { + NamedMDNode *N = unwrap(M)->getNamedMetadata(Name); if (!N) return; LLVMContext &Context = unwrap(M)->getContext(); @@ -865,10 +862,9 @@ void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char* name, LLVMValueRe Dest[i] = wrap(MetadataAsValue::get(Context, N->getOperand(i))); } -void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char* name, - LLVMValueRef Val) -{ - NamedMDNode *N = unwrap(M)->getOrInsertNamedMetadata(name); +void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, + LLVMValueRef Val) { + NamedMDNode *N = unwrap(M)->getOrInsertNamedMetadata(Name); if (!N) return; if (!Val) -- 2.11.0