2006-01-24 12:13:11 +08:00
|
|
|
//===-- InlineAsm.cpp - Implement the InlineAsm class ---------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by Chris Lattner and is distributed under the
|
|
|
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the InlineAsm class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "llvm/InlineAsm.h"
|
|
|
|
#include "llvm/DerivedTypes.h"
|
|
|
|
#include "llvm/Module.h"
|
|
|
|
#include "llvm/Support/LeakDetector.h"
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
InlineAsm::InlineAsm(const FunctionType *Ty, const std::string &asmString,
|
2006-01-26 02:57:27 +08:00
|
|
|
const std::string &constraints, bool hasSideEffects)
|
|
|
|
: Value(PointerType::get(Ty), Value::InlineAsmVal), AsmString(asmString),
|
|
|
|
Constraints(constraints), HasSideEffects(hasSideEffects) {
|
2006-01-24 12:13:11 +08:00
|
|
|
LeakDetector::addGarbageObject(this);
|
|
|
|
|
2006-01-26 02:57:27 +08:00
|
|
|
// FIXME: do various checks on the constraint string and type.
|
|
|
|
|
2006-01-24 12:13:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const FunctionType *InlineAsm::getFunctionType() const {
|
|
|
|
return cast<FunctionType>(getType()->getElementType());
|
|
|
|
}
|