File tree 3 files changed +28
-0
lines changed
3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,12 @@ Changes to the C API
157
157
* ``LLVMGetNamedFunctionWithLength ``
158
158
* ``LLVMGetNamedGlobalWithLength ``
159
159
160
+ * The following functions are added to access the ``LLVMContextRef `` associated
161
+ with ``LLVMValueRef `` and ``LLVMBuilderRef `` objects:
162
+
163
+ * ``LLVMGetValueContext ``
164
+ * ``LLVMGetBuilderContext ``
165
+
160
166
* The new pass manager can now be invoked with a custom alias analysis pipeline, using
161
167
the ``LLVMPassBuilderOptionsSetAAPipeline `` function.
162
168
Original file line number Diff line number Diff line change @@ -1973,6 +1973,13 @@ void LLVMDumpValue(LLVMValueRef Val);
1973
1973
*/
1974
1974
char * LLVMPrintValueToString (LLVMValueRef Val );
1975
1975
1976
+ /**
1977
+ * Obtain the context to which this value is associated.
1978
+ *
1979
+ * @see llvm::Value::getContext()
1980
+ */
1981
+ LLVMContextRef LLVMGetValueContext (LLVMValueRef Val );
1982
+
1976
1983
/**
1977
1984
* Return a string representation of the DbgRecord. Use
1978
1985
* LLVMDisposeMessage to free the string.
@@ -4160,6 +4167,13 @@ LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder);
4160
4167
void LLVMBuilderSetDefaultFPMathTag (LLVMBuilderRef Builder ,
4161
4168
LLVMMetadataRef FPMathTag );
4162
4169
4170
+ /**
4171
+ * Obtain the context to which this builder is associated.
4172
+ *
4173
+ * @see llvm::IRBuilder::getContext()
4174
+ */
4175
+ LLVMContextRef LLVMGetBuilderContext (LLVMBuilderRef Builder );
4176
+
4163
4177
/**
4164
4178
* Deprecated: Passing the NULL location will crash.
4165
4179
* Use LLVMGetCurrentDebugLocation2 instead.
Original file line number Diff line number Diff line change @@ -1044,6 +1044,10 @@ char* LLVMPrintValueToString(LLVMValueRef Val) {
1044
1044
return strdup (buf.c_str ());
1045
1045
}
1046
1046
1047
+ LLVMContextRef LLVMGetValueContext (LLVMValueRef Val) {
1048
+ return wrap (&unwrap (Val)->getContext ());
1049
+ }
1050
+
1047
1051
char *LLVMPrintDbgRecordToString (LLVMDbgRecordRef Record) {
1048
1052
std::string buf;
1049
1053
raw_string_ostream os (buf);
@@ -3329,6 +3333,10 @@ void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder,
3329
3333
: nullptr );
3330
3334
}
3331
3335
3336
+ LLVMContextRef LLVMGetBuilderContext (LLVMBuilderRef Builder) {
3337
+ return wrap (&unwrap (Builder)->getContext ());
3338
+ }
3339
+
3332
3340
LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag (LLVMBuilderRef Builder) {
3333
3341
return wrap (unwrap (Builder)->getDefaultFPMathTag ());
3334
3342
}
You can’t perform that action at this time.
0 commit comments