aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/InlineAsm.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-25 22:26:05 +0000
committerChris Lattner <sabre@nondot.org>2006-01-25 22:26:05 +0000
commit80cd11561892a639a2628d19815af0695b5dbcaa (patch)
tree228412ab785acf7845876cc6c7eb84f208a34f6b /lib/VMCore/InlineAsm.cpp
parent867335c3395faa3b2cbe17e87c425813b45704b1 (diff)
downloadexternal_llvm-80cd11561892a639a2628d19815af0695b5dbcaa.tar.gz
external_llvm-80cd11561892a639a2628d19815af0695b5dbcaa.tar.bz2
external_llvm-80cd11561892a639a2628d19815af0695b5dbcaa.zip
Print InlineAsm objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25617 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/InlineAsm.cpp')
-rw-r--r--lib/VMCore/InlineAsm.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/VMCore/InlineAsm.cpp b/lib/VMCore/InlineAsm.cpp
index 00842bb324..cc817e3795 100644
--- a/lib/VMCore/InlineAsm.cpp
+++ b/lib/VMCore/InlineAsm.cpp
@@ -13,20 +13,30 @@
#include "llvm/InlineAsm.h"
#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/Support/LeakDetector.h"
using namespace llvm;
+// NOTE: when memoizing the function type, we have to be careful to handle the
+// case when the type gets refined.
+
+InlineAsm *InlineAsm::get(const FunctionType *Ty, const std::string &AsmString,
+ const std::string &Constraints, bool hasSideEffects) {
+ // FIXME: memoize!
+ return new InlineAsm(Ty, AsmString, Constraints, hasSideEffects);
+}
+
InlineAsm::InlineAsm(const FunctionType *Ty, const std::string &asmString,
const std::string &constraints, bool hasSideEffects)
: Value(PointerType::get(Ty), Value::InlineAsmVal), AsmString(asmString),
Constraints(constraints), HasSideEffects(hasSideEffects) {
- LeakDetector::addGarbageObject(this);
- // FIXME: do various checks on the constraint string and type.
-
+ // Do various checks on the constraint string and type.
+ assert(Verify(Ty, constraints) && "Function type not legal for constraints!");
}
const FunctionType *InlineAsm::getFunctionType() const {
return cast<FunctionType>(getType()->getElementType());
}
+
+bool InlineAsm::Verify(const FunctionType *Ty, const std::string &Constraints) {
+ return true;
+}