blob: 299698f1f38bf7ea5a134f2c072b5b2f55c9cc26 [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
Ted Kremenek2979ec72008-04-09 15:51:31 +000014#include "CGObjCRuntime.h"
Anders Carlsson55085182007-08-21 17:43:55 +000015#include "CodeGenFunction.h"
16#include "CodeGenModule.h"
17#include "clang/AST/Expr.h"
18#include "llvm/Constant.h"
Anders Carlsson55085182007-08-21 17:43:55 +000019using namespace clang;
20using namespace CodeGen;
21
Chris Lattner7f02f722007-08-24 05:35:26 +000022llvm::Value *CodeGenFunction::EmitObjCStringLiteral(const ObjCStringLiteral *E){
Anders Carlsson55085182007-08-21 17:43:55 +000023 std::string S(E->getString()->getStrData(), E->getString()->getByteLength());
Chris Lattner7f02f722007-08-24 05:35:26 +000024 return CGM.GetAddrOfConstantCFString(S);
Anders Carlsson55085182007-08-21 17:43:55 +000025}
26
Ted Kremenek2979ec72008-04-09 15:51:31 +000027CGObjCRuntime::~CGObjCRuntime() {}