[llvm-commits] [llvm] r74707 - in /llvm/trunk: include/llvm/LLVMContext.h lib/VMCore/LLVMContext.cpp
Owen Anderson
resistor at mac.com
Thu Jul 2 10:19:51 PDT 2009
Author: resistor
Date: Thu Jul 2 12:19:47 2009
New Revision: 74707
URL: http://llvm.org/viewvc/llvm-project?rev=74707&view=rev
Log:
Add accessors for metadata constants.
Modified:
llvm/trunk/include/llvm/LLVMContext.h
llvm/trunk/lib/VMCore/LLVMContext.cpp
Modified: llvm/trunk/include/llvm/LLVMContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LLVMContext.h?rev=74707&r1=74706&r2=74707&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LLVMContext.h (original)
+++ llvm/trunk/include/llvm/LLVMContext.h Thu Jul 2 12:19:47 2009
@@ -32,6 +32,7 @@
class ConstantVector;
class UndefValue;
class MDNode;
+class MDString;
class IntegerType;
class PointerType;
class StructType;
@@ -180,6 +181,10 @@
// MDNode accessors
MDNode* getMDNode(Value* const* Vals, unsigned NumVals);
+ // MDString accessors
+ MDString* getMDString(const char *StrBegin, const char *StrEnd);
+ MDString* getMDString(const std::string &Str);
+
// FunctionType accessors
FunctionType* getFunctionType(const Type* Result,
const std::vector<const Type*>& Params,
Modified: llvm/trunk/lib/VMCore/LLVMContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LLVMContext.cpp?rev=74707&r1=74706&r2=74707&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/LLVMContext.cpp (original)
+++ llvm/trunk/lib/VMCore/LLVMContext.cpp Thu Jul 2 12:19:47 2009
@@ -411,6 +411,15 @@
return MDNode::get(Vals, NumVals);
}
+// MDString accessors
+MDString* LLVMContext::getMDString(const char *StrBegin, const char *StrEnd) {
+ return MDString::get(StrBegin, StrEnd);
+}
+
+MDString* LLVMContext::getMDString(const std::string &Str) {
+ return MDString::get(Str);
+}
+
// FunctionType accessors
FunctionType* LLVMContext::getFunctionType(const Type* Result,
const std::vector<const Type*>& Params,
More information about the llvm-commits
mailing list