2007-08-22 01:43:55 +08:00
|
|
|
//===---- CGBuiltin.cpp - Emit LLVM Code for builtins ---------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by Anders Carlsson and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This contains code to emit Objective-C code as LLVM code.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "CodeGenFunction.h"
|
|
|
|
#include "CodeGenModule.h"
|
|
|
|
#include "clang/AST/Expr.h"
|
|
|
|
#include "llvm/Constant.h"
|
|
|
|
using namespace clang;
|
|
|
|
using namespace CodeGen;
|
|
|
|
|
2007-08-24 13:35:26 +08:00
|
|
|
llvm::Value *CodeGenFunction::EmitObjCStringLiteral(const ObjCStringLiteral *E){
|
2007-08-22 01:43:55 +08:00
|
|
|
std::string S(E->getString()->getStrData(), E->getString()->getByteLength());
|
2007-08-24 13:35:26 +08:00
|
|
|
return CGM.GetAddrOfConstantCFString(S);
|
2007-08-22 01:43:55 +08:00
|
|
|
}
|
|
|
|
|