diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index a22e910c455..a09c92282a6 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -1569,7 +1569,7 @@ LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, * * @see ConstantDataSequential::getElementAsConstant() */ -LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef c, unsigned idx); +LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx); /** * Create a ConstantVector from values. diff --git a/include/llvm/IR/Constants.h b/include/llvm/IR/Constants.h index f91bc99c807..03b800efabe 100644 --- a/include/llvm/IR/Constants.h +++ b/include/llvm/IR/Constants.h @@ -613,7 +613,6 @@ public: /// The size of the elements is known to be a multiple of one byte. uint64_t getElementByteSize() const; - /// This method returns true if this is an array of i8. bool isString() const; diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index 93f2ec4958e..55d719cd002 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -910,22 +910,23 @@ LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, return wrap(ConstantDataArray::getString(*unwrap(C), StringRef(Str, Length), DontNullTerminate == 0)); } + LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate) { return LLVMConstStringInContext(LLVMGetGlobalContext(), Str, Length, DontNullTerminate); } -LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef c, unsigned idx) { - return wrap(static_cast(unwrap(c))->getElementAsConstant(idx)); +LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx) { + return wrap(unwrap(C)->getElementAsConstant(idx)); } -LLVMBool LLVMIsConstantString(LLVMValueRef c) { - return static_cast(unwrap(c))->isString(); +LLVMBool LLVMIsConstantString(LLVMValueRef C) { + return unwrap(C)->isString(); } -const char *LLVMGetAsString(LLVMValueRef c, size_t* Length) { - StringRef str = static_cast(unwrap(c))->getAsString(); +const char *LLVMGetAsString(LLVMValueRef C, size_t* Length) { + StringRef str = unwrap(C)->getAsString(); *Length = str.size(); return str.data(); }