blob: 33419a3d51d31adbb05c8f3b6a6cce42e9344ac2 [file] [log] [blame]
Anders Carlsson55085182007-08-21 17:43:55 +00001//===---- CGBuiltin.cpp - Emit LLVM Code for builtins ---------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner0bc735f2007-12-29 19:59:25 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Anders Carlsson55085182007-08-21 17:43:55 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This contains code to emit Objective-C code as LLVM code.
11//
12//===----------------------------------------------------------------------===//
13
14#include "CodeGenFunction.h"
15#include "CodeGenModule.h"
16#include "clang/AST/Expr.h"
17#include "llvm/Constant.h"
Anders Carlsson55085182007-08-21 17:43:55 +000018using namespace clang;
19using namespace CodeGen;
20
Chris Lattner7f02f722007-08-24 05:35:26 +000021llvm::Value *CodeGenFunction::EmitObjCStringLiteral(const ObjCStringLiteral *E){
Anders Carlsson55085182007-08-21 17:43:55 +000022 std::string S(E->getString()->getStrData(), E->getString()->getByteLength());
Chris Lattner7f02f722007-08-24 05:35:26 +000023 return CGM.GetAddrOfConstantCFString(S);
Anders Carlsson55085182007-08-21 17:43:55 +000024}
25