blob: 00842bb3244c358fe5be78307eb83146fd7991bc [file] [log] [blame]
Chris Lattnereef2fe72006-01-24 04:13:11 +00001//===-- 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"
18using namespace llvm;
19
20InlineAsm::InlineAsm(const FunctionType *Ty, const std::string &asmString,
Chris Lattner8bbcda22006-01-25 18:57:27 +000021 const std::string &constraints, bool hasSideEffects)
22 : Value(PointerType::get(Ty), Value::InlineAsmVal), AsmString(asmString),
23 Constraints(constraints), HasSideEffects(hasSideEffects) {
Chris Lattnereef2fe72006-01-24 04:13:11 +000024 LeakDetector::addGarbageObject(this);
25
Chris Lattner8bbcda22006-01-25 18:57:27 +000026 // FIXME: do various checks on the constraint string and type.
27
Chris Lattnereef2fe72006-01-24 04:13:11 +000028}
29
30const FunctionType *InlineAsm::getFunctionType() const {
31 return cast<FunctionType>(getType()->getElementType());
32}