Anders Carlsson | 5508518 | 2007-08-21 17:43:55 +0000 | [diff] [blame^] | 1 | //===---- CGBuiltin.cpp - Emit LLVM Code for builtins ---------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by Anders Carlsson and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 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" |
| 18 | |
| 19 | using namespace clang; |
| 20 | using namespace CodeGen; |
| 21 | |
| 22 | RValue CodeGenFunction::EmitObjCStringLiteral(const ObjCStringLiteral* E) |
| 23 | { |
| 24 | std::string S(E->getString()->getStrData(), E->getString()->getByteLength()); |
| 25 | |
| 26 | return RValue::get(CGM.GetAddrOfConstantCFString(S)); |
| 27 | } |
| 28 | |