Chris Lattner | eef2fe7 | 2006-01-24 04:13:11 +0000 | [diff] [blame] | 1 | //===-- InlineAsm.cpp - Implement the InlineAsm class ---------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by Chris Lattner and is distributed under the |
| 6 | // University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the InlineAsm class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "llvm/InlineAsm.h" |
| 15 | #include "llvm/DerivedTypes.h" |
| 16 | #include "llvm/Module.h" |
| 17 | #include "llvm/Support/LeakDetector.h" |
| 18 | using namespace llvm; |
| 19 | |
| 20 | InlineAsm::InlineAsm(const FunctionType *Ty, const std::string &asmString, |
Chris Lattner | 8bbcda2 | 2006-01-25 18:57:27 +0000 | [diff] [blame^] | 21 | const std::string &constraints, bool hasSideEffects) |
| 22 | : Value(PointerType::get(Ty), Value::InlineAsmVal), AsmString(asmString), |
| 23 | Constraints(constraints), HasSideEffects(hasSideEffects) { |
Chris Lattner | eef2fe7 | 2006-01-24 04:13:11 +0000 | [diff] [blame] | 24 | LeakDetector::addGarbageObject(this); |
| 25 | |
Chris Lattner | 8bbcda2 | 2006-01-25 18:57:27 +0000 | [diff] [blame^] | 26 | // FIXME: do various checks on the constraint string and type. |
| 27 | |
Chris Lattner | eef2fe7 | 2006-01-24 04:13:11 +0000 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | const FunctionType *InlineAsm::getFunctionType() const { |
| 31 | return cast<FunctionType>(getType()->getElementType()); |
| 32 | } |