summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm-c
diff options
context:
space:
mode:
authorRobert Widmann <devteam.codafi@gmail.com>2018-04-06 02:31:29 +0000
committerRobert Widmann <devteam.codafi@gmail.com>2018-04-06 02:31:29 +0000
commitf108d57f9b12ec176a87faa46464057d51063d65 (patch)
tree6950b6fa68cf8841c2613d6f4012637c0e6fdd4b /llvm/include/llvm-c
parent9298e077f7a3256aa23f5a962ac50f6b1cc60ed4 (diff)
downloadbcm5719-llvm-f108d57f9b12ec176a87faa46464057d51063d65.tar.gz
bcm5719-llvm-f108d57f9b12ec176a87faa46464057d51063d65.zip
[LLVM-C] Audit Inline Assembly APIs for Consistency
Summary: - Add a missing getter for module-level inline assembly - Add a missing append function for module-level inline assembly - Deprecate LLVMSetModuleInlineAsm and replace it with LLVMSetModuleInlineAsm2 which takes an explicit length parameter - Deprecate LLVMConstInlineAsm and replace it with LLVMGetInlineAsm, a function that allows passing a dialect and is not mis-classified as a constant operation Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45346 llvm-svn: 329369
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r--llvm/include/llvm-c/Core.h39
1 files changed, 37 insertions, 2 deletions
diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index ddc7fe79384..f4494297164 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -341,6 +341,11 @@ typedef enum {
LLVMDSNote
} LLVMDiagnosticSeverity;
+typedef enum {
+ LLVMInlineAsmDialectATT,
+ LLVMInlineAsmDialectIntel
+} LLVMInlineAsmDialect;
+
/**
* Attribute index are either LLVMAttributeReturnIndex,
* LLVMAttributeFunctionIndex or a parameter number from 1 to N.
@@ -650,11 +655,36 @@ LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename,
char *LLVMPrintModuleToString(LLVMModuleRef M);
/**
+ * Get inline assembly for a module.
+ *
+ * @see Module::getModuleInlineAsm()
+ */
+const char *LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len);
+
+/**
* Set inline assembly for a module.
*
* @see Module::setModuleInlineAsm()
*/
-void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
+void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len);
+
+/**
+ * Append inline assembly to a module.
+ *
+ * @see Module::appendModuleInlineAsm()
+ */
+void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len);
+
+/**
+ * Create the specified uniqued inline asm string.
+ *
+ * @see InlineAsm::get()
+ */
+LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty,
+ char *AsmString, size_t AsmStringSize,
+ char *Constraints, size_t ConstraintsSize,
+ LLVMBool HasSideEffects, LLVMBool IsAlignStack,
+ LLVMInlineAsmDialect Dialect);
/**
* Obtain the context to which this module is associated.
@@ -745,6 +775,9 @@ LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn);
*/
LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn);
+/** Deprecated: Use LLVMSetModuleInlineAsm2 instead. */
+void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
+
/**
* @}
*/
@@ -1820,10 +1853,12 @@ LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList,
LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant,
LLVMValueRef ElementValueConstant,
unsigned *IdxList, unsigned NumIdx);
+LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB);
+
+/** Deprecated: Use LLVMGetInlineAsm instead. */
LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty,
const char *AsmString, const char *Constraints,
LLVMBool HasSideEffects, LLVMBool IsAlignStack);
-LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB);
/**
* @}
OpenPOWER on IntegriCloud