From 9b4101c3745dc25aae0fe0dcd7636a32d8cb5a10 Mon Sep 17 00:00:00 2001 From: Alexander Kellett Date: Wed, 26 Mar 2008 23:57:00 +0100 Subject: [PATCH] new world would like some revision control at this point --- Project/English.lproj/InfoPlist.strings | Bin 0 -> 202 bytes Project/Info.plist | 28 ++ Project/LLVMRuby.xcodeproj/project.pbxproj | 559 +++++++++++++++++++++++++ Project/LLVMRuby.xcodeproj/project.pbxproj.in | 285 +++++++++++++ Project/LLVMRubyObjCPlusPlusBridger-Info.plist | 20 + Project/LLVMRubyObjCPlusPlusBridger.h | 18 + Project/LLVMRubyObjCPlusPlusBridger.mm | 13 + Project/Mumble.cpp | 71 ++++ Project/Mumble.h | 2 + Project/main.m | 6 + Project/rb_main.rb | 4 + 11 files changed, 1006 insertions(+) create mode 100755 Project/English.lproj/InfoPlist.strings create mode 100755 Project/Info.plist create mode 100755 Project/LLVMRuby.xcodeproj/project.pbxproj create mode 100755 Project/LLVMRuby.xcodeproj/project.pbxproj.in create mode 100644 Project/LLVMRubyObjCPlusPlusBridger-Info.plist create mode 100644 Project/LLVMRubyObjCPlusPlusBridger.h create mode 100644 Project/LLVMRubyObjCPlusPlusBridger.mm create mode 100644 Project/Mumble.cpp create mode 100644 Project/Mumble.h create mode 100755 Project/main.m create mode 100755 Project/rb_main.rb diff --git a/Project/English.lproj/InfoPlist.strings b/Project/English.lproj/InfoPlist.strings new file mode 100755 index 0000000000000000000000000000000000000000..cc2655a28bd02d6b4ed57c0faede6d71c70a2149 GIT binary patch literal 202 zcwQZh%?`m}5Jk`0Q#6*1s8~tF%7z3B9zco~p+9Mn)Ejw8oHjS#%r|rIoZmMhBw$6s zk(fJI-Xxsdz3dgWn}XaP*i-A$DfK_3?D91aw>Q&GmkNpKsSP_8JjvwdZ1rQgF$b>_ p<`POTDhX#U9b@L}^Re#LTDMJQ=2}7{F?LEicVKGFNKL$%@&`PTBjW%7 literal 0 HcwPel00001 diff --git a/Project/Info.plist b/Project/Info.plist new file mode 100755 index 0000000..9227659 --- /dev/null +++ b/Project/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.PathDemo + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/Project/LLVMRuby.xcodeproj/project.pbxproj b/Project/LLVMRuby.xcodeproj/project.pbxproj new file mode 100755 index 0000000..3917f7b --- /dev/null +++ b/Project/LLVMRuby.xcodeproj/project.pbxproj @@ -0,0 +1,559 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 44; + objects = { + +/* Begin PBXBuildFile section */ + 4DE339F70D74FCDD00ADB6EE /* rb_main.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */; }; + 4DE3BE140D8651D900ECA448 /* MacRuby.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE3BE130D8651D900ECA448 /* MacRuby.framework */; }; + 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; + 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + BDA9988C0D96D9770082AC95 /* libMumbleTryTwo.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BDA998820D96D9550082AC95 /* libMumbleTryTwo.dylib */; }; + BDA998980D96DA1F0082AC95 /* Mumble.h in Headers */ = {isa = PBXBuildFile; fileRef = BDA998520D96D84A0082AC95 /* Mumble.h */; }; + BDA998990D96DA1F0082AC95 /* Mumble.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BDA998530D96D84A0082AC95 /* Mumble.cpp */; }; + BDE7CEB00D92A959009FA3F7 /* LLVMRubyObjCPlusPlusBridger.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BDE7CEA90D92A92E009FA3F7 /* LLVMRubyObjCPlusPlusBridger.framework */; }; + BDE7CEB40D92A984009FA3F7 /* LLVMRubyObjCPlusPlusBridger.h in Headers */ = {isa = PBXBuildFile; fileRef = BDE7CEB20D92A984009FA3F7 /* LLVMRubyObjCPlusPlusBridger.h */; }; + BDE7CEB50D92A984009FA3F7 /* LLVMRubyObjCPlusPlusBridger.mm in Sources */ = {isa = PBXBuildFile; fileRef = BDE7CEB30D92A984009FA3F7 /* LLVMRubyObjCPlusPlusBridger.mm */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + BDA9988A0D96D9720082AC95 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = BDA998810D96D9550082AC95; + remoteInfo = MumbleTryTwo; + }; + BDE7CEAE0D92A94F009FA3F7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = BDE7CEA80D92A92E009FA3F7; + remoteInfo = LLVMRubyObjCPlusPlusBridger; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = rb_main.rb; sourceTree = ""; }; + 4DE3BE130D8651D900ECA448 /* MacRuby.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MacRuby.framework; path = /Library/Frameworks/MacRuby.framework; sourceTree = ""; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8D1107320486CEB800E47090 /* PathDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PathDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BDA998520D96D84A0082AC95 /* Mumble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Mumble.h; sourceTree = ""; }; + BDA998530D96D84A0082AC95 /* Mumble.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Mumble.cpp; sourceTree = ""; }; + BDA998820D96D9550082AC95 /* libMumbleTryTwo.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libMumbleTryTwo.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + BDE7CEA90D92A92E009FA3F7 /* LLVMRubyObjCPlusPlusBridger.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LLVMRubyObjCPlusPlusBridger.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BDE7CEAA0D92A92E009FA3F7 /* LLVMRubyObjCPlusPlusBridger-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LLVMRubyObjCPlusPlusBridger-Info.plist"; sourceTree = ""; }; + BDE7CEB20D92A984009FA3F7 /* LLVMRubyObjCPlusPlusBridger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLVMRubyObjCPlusPlusBridger.h; sourceTree = ""; }; + BDE7CEB30D92A984009FA3F7 /* LLVMRubyObjCPlusPlusBridger.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LLVMRubyObjCPlusPlusBridger.mm; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D11072E0486CEB800E47090 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, + 4DE3BE140D8651D900ECA448 /* MacRuby.framework in Frameworks */, + BDE7CEB00D92A959009FA3F7 /* LLVMRubyObjCPlusPlusBridger.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BDA998800D96D9550082AC95 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BDE7CEA70D92A92E009FA3F7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BDA9988C0D96D9770082AC95 /* libMumbleTryTwo.dylib in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + BDA998520D96D84A0082AC95 /* Mumble.h */, + BDA998530D96D84A0082AC95 /* Mumble.cpp */, + ); + name = Classes; + sourceTree = ""; + }; + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 4DE3BE130D8651D900ECA448 /* MacRuby.framework */, + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, + 29B97325FDCFA39411CA2CEA /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D1107320486CEB800E47090 /* PathDemo.app */, + BDE7CEA90D92A92E009FA3F7 /* LLVMRubyObjCPlusPlusBridger.framework */, + BDA998820D96D9550082AC95 /* libMumbleTryTwo.dylib */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* PathDemo */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + BDE7CEAA0D92A92E009FA3F7 /* LLVMRubyObjCPlusPlusBridger-Info.plist */, + ); + name = PathDemo; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + BDE7CEB20D92A984009FA3F7 /* LLVMRubyObjCPlusPlusBridger.h */, + BDE7CEB30D92A984009FA3F7 /* LLVMRubyObjCPlusPlusBridger.mm */, + 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 8D1107310486CEB800E47090 /* Info.plist */, + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + BDA9987E0D96D9550082AC95 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + BDA998980D96DA1F0082AC95 /* Mumble.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BDE7CEA40D92A92E009FA3F7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + BDE7CEB40D92A984009FA3F7 /* LLVMRubyObjCPlusPlusBridger.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D1107260486CEB800E47090 /* PathDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "PathDemo" */; + buildPhases = ( + 8D1107290486CEB800E47090 /* Resources */, + 8D11072C0486CEB800E47090 /* Sources */, + 8D11072E0486CEB800E47090 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + BDE7CEAF0D92A94F009FA3F7 /* PBXTargetDependency */, + ); + name = PathDemo; + productInstallPath = "$(HOME)/Applications"; + productName = PathDemo; + productReference = 8D1107320486CEB800E47090 /* PathDemo.app */; + productType = "com.apple.product-type.application"; + }; + BDA998810D96D9550082AC95 /* MumbleTryTwo */ = { + isa = PBXNativeTarget; + buildConfigurationList = BDA998950D96D98E0082AC95 /* Build configuration list for PBXNativeTarget "MumbleTryTwo" */; + buildPhases = ( + BDA9987E0D96D9550082AC95 /* Headers */, + BDA9987F0D96D9550082AC95 /* Sources */, + BDA998800D96D9550082AC95 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MumbleTryTwo; + productName = MumbleTryTwo; + productReference = BDA998820D96D9550082AC95 /* libMumbleTryTwo.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; + BDE7CEA80D92A92E009FA3F7 /* LLVMRubyObjCPlusPlusBridger */ = { + isa = PBXNativeTarget; + buildConfigurationList = BDE7CEAD0D92A930009FA3F7 /* Build configuration list for PBXNativeTarget "LLVMRubyObjCPlusPlusBridger" */; + buildPhases = ( + BDE7CEA40D92A92E009FA3F7 /* Headers */, + BDE7CEA50D92A92E009FA3F7 /* Resources */, + BDE7CEA60D92A92E009FA3F7 /* Sources */, + BDE7CEA70D92A92E009FA3F7 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + BDA9988B0D96D9720082AC95 /* PBXTargetDependency */, + ); + name = LLVMRubyObjCPlusPlusBridger; + productName = LLVMRubyObjCPlusPlusBridger; + productReference = BDE7CEA90D92A92E009FA3F7 /* LLVMRubyObjCPlusPlusBridger.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "LLVMRuby" */; + compatibilityVersion = "Xcode 3.0"; + hasScannedForEncodings = 1; + mainGroup = 29B97314FDCFA39411CA2CEA /* PathDemo */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D1107260486CEB800E47090 /* PathDemo */, + BDE7CEA80D92A92E009FA3F7 /* LLVMRubyObjCPlusPlusBridger */, + BDA998810D96D9550082AC95 /* MumbleTryTwo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D1107290486CEB800E47090 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, + 4DE339F70D74FCDD00ADB6EE /* rb_main.rb in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BDE7CEA50D92A92E009FA3F7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D11072C0486CEB800E47090 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072D0486CEB800E47090 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BDA9987F0D96D9550082AC95 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BDA998990D96DA1F0082AC95 /* Mumble.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BDE7CEA60D92A92E009FA3F7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BDE7CEB50D92A984009FA3F7 /* LLVMRubyObjCPlusPlusBridger.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + BDA9988B0D96D9720082AC95 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BDA998810D96D9550082AC95 /* MumbleTryTwo */; + targetProxy = BDA9988A0D96D9720082AC95 /* PBXContainerItemProxy */; + }; + BDE7CEAF0D92A94F009FA3F7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BDE7CEA80D92A92E009FA3F7 /* LLVMRubyObjCPlusPlusBridger */; + targetProxy = BDE7CEAE0D92A94F009FA3F7 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C165DFE840E0CC02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + BDA998870D96D9560082AC95 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(NATIVE_ARCH)"; + COPY_PHASE_STRIP = NO; + EXECUTABLE_PREFIX = lib; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + HEADER_SEARCH_PATHS = /Users/lypanov/install/llvm/include; + INSTALL_PATH = /usr/local/lib; + LIBRARY_SEARCH_PATHS = /Users/lypanov/install/llvm/lib; + OTHER_LDFLAGS = ( + /Users/lypanov/install/llvm/lib/LLVMSparc.o, + /Users/lypanov/install/llvm/lib/LLVMPowerPC.o, + /Users/lypanov/install/llvm/lib/LLVMMSIL.o, + /Users/lypanov/install/llvm/lib/LLVMMips.o, + "-lLLVMLinker", + "-lLLVMipo", + /Users/lypanov/install/llvm/lib/LLVMInterpreter.o, + "-lLLVMInstrumentation", + /Users/lypanov/install/llvm/lib/LLVMIA64.o, + /Users/lypanov/install/llvm/lib/LLVMExecutionEngine.o, + /Users/lypanov/install/llvm/lib/LLVMJIT.o, + "-lLLVMDebugger", + /Users/lypanov/install/llvm/lib/LLVMCellSPU.o, + /Users/lypanov/install/llvm/lib/LLVMCBackend.o, + "-lLLVMBitWriter", + /Users/lypanov/install/llvm/lib/LLVMX86.o, + "-lLLVMAsmParser", + /Users/lypanov/install/llvm/lib/LLVMARM.o, + "-lLLVMArchive", + "-lLLVMBitReader", + /Users/lypanov/install/llvm/lib/LLVMAlpha.o, + "-lLLVMSelectionDAG", + "-lLLVMCodeGen", + "-lLLVMScalarOpts", + "-lLLVMTransformUtils", + "-lLLVMipa", + "-lLLVMAnalysis", + "-lLLVMTarget", + "-lLLVMCore", + "-lLLVMSupport", + "-lLLVMSystem", + ); + PREBINDING = NO; + PRODUCT_NAME = MumbleTryTwo; + }; + name = Debug; + }; + BDA998880D96D9560082AC95 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + EXECUTABLE_PREFIX = lib; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_MODEL_TUNING = G5; + INSTALL_PATH = /usr/local/lib; + PREBINDING = NO; + PRODUCT_NAME = MumbleTryTwo; + ZERO_LINK = NO; + }; + name = Release; + }; + BDE7CEAB0D92A930009FA3F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(NATIVE_ARCH)"; + COPY_PHASE_STRIP = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + HEADER_SEARCH_PATHS = /Users/lypanov/install/llvm/include; + INFOPLIST_FILE = "LLVMRubyObjCPlusPlusBridger-Info.plist"; + INSTALL_PATH = "$(HOME)/Library/Frameworks"; + LIBRARY_SEARCH_PATHS = /Users/lypanov/install/llvm/lib; + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + PREBINDING = NO; + PRODUCT_NAME = LLVMRubyObjCPlusPlusBridger; + }; + name = Debug; + }; + BDE7CEAC0D92A930009FA3F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; + INFOPLIST_FILE = "LLVMRubyObjCPlusPlusBridger-Info.plist"; + INSTALL_PATH = "$(HOME)/Library/Frameworks"; + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + PREBINDING = NO; + PRODUCT_NAME = LLVMRubyObjCPlusPlusBridger; + ZERO_LINK = NO; + }; + name = Release; + }; + C01FCF4B08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = PathDemo; + WRAPPER_EXTENSION = app; + ZERO_LINK = YES; + }; + name = Debug; + }; + C01FCF4C08A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = PathDemo; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ENABLE_OBJC_GC = required; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ENABLE_OBJC_GC = required; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + BDA998950D96D98E0082AC95 /* Build configuration list for PBXNativeTarget "MumbleTryTwo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BDA998870D96D9560082AC95 /* Debug */, + BDA998880D96D9560082AC95 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + BDE7CEAD0D92A930009FA3F7 /* Build configuration list for PBXNativeTarget "LLVMRubyObjCPlusPlusBridger" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BDE7CEAB0D92A930009FA3F7 /* Debug */, + BDE7CEAC0D92A930009FA3F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "PathDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4B08A954540054247B /* Debug */, + C01FCF4C08A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "LLVMRuby" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/Project/LLVMRuby.xcodeproj/project.pbxproj.in b/Project/LLVMRuby.xcodeproj/project.pbxproj.in new file mode 100755 index 0000000..7f3c689 --- /dev/null +++ b/Project/LLVMRuby.xcodeproj/project.pbxproj.in @@ -0,0 +1,285 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 44; + objects = { + +/* Begin PBXBuildFile section */ + 4DE339F70D74FCDD00ADB6EE /* rb_main.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */; }; + 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; }; + 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; + 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = ""; }; + 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = rb_main.rb; sourceTree = ""; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8D1107320486CEB800E47090 /* «PROJECTNAME».app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "«PROJECTNAME».app"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D11072E0486CEB800E47090 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + ); + name = Classes; + sourceTree = ""; + }; + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, + 29B97325FDCFA39411CA2CEA /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D1107320486CEB800E47090 /* «PROJECTNAME».app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = "«PROJECTNAMEASXML»"; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 8D1107310486CEB800E47090 /* Info.plist */, + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, + 29B97318FDCFA39411CA2CEA /* MainMenu.nib */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8D1107260486CEB800E47090 /* «PROJECTNAME» */ = { + isa = PBXNativeTarget; + buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */; + buildPhases = ( + 8D1107290486CEB800E47090 /* Resources */, + 8D11072C0486CEB800E47090 /* Sources */, + 8D11072E0486CEB800E47090 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "«PROJECTNAME»"; + productInstallPath = "$(HOME)/Applications"; + productName = "«PROJECTNAME»"; + productReference = 8D1107320486CEB800E47090 /* «PROJECTNAME».app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MacRubyApp" */; + compatibilityVersion = "Xcode 3.0"; + hasScannedForEncodings = 1; + mainGroup = 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D1107260486CEB800E47090 /* «PROJECTNAME» */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D1107290486CEB800E47090 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */, + 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, + 4DE339F70D74FCDD00ADB6EE /* rb_main.rb in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D11072C0486CEB800E47090 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072D0486CEB800E47090 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C165DFE840E0CC02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = { + isa = PBXVariantGroup; + children = ( + 29B97319FDCFA39411CA2CEA /* English */, + ); + name = MainMenu.nib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C01FCF4B08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = "«PROJECTNAME»"; + WRAPPER_EXTENSION = app; + ZERO_LINK = YES; + }; + name = Debug; + }; + C01FCF4C08A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = "«PROJECTNAME»"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "PATH_TO_MACRUBY_HEADERS_1", + "PATH_TO_MACRUBY_HEADERS_2", + ); + GCC_ENABLE_OBJC_GC = required; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LIBRARY_SEARCH_PATHS = PATH_TO_MACRUBY_LIBRARY; + OTHER_LDFLAGS = "-lruby"; + PREBINDING = NO; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "PATH_TO_MACRUBY_HEADERS_1", + "PATH_TO_MACRUBY_HEADERS_2", + ); + GCC_ENABLE_OBJC_GC = required; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LIBRARY_SEARCH_PATHS = PATH_TO_MACRUBY_LIBRARY; + OTHER_LDFLAGS = "-lruby"; + PREBINDING = NO; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4B08A954540054247B /* Debug */, + C01FCF4C08A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MacRubyApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/Project/LLVMRubyObjCPlusPlusBridger-Info.plist b/Project/LLVMRubyObjCPlusPlusBridger-Info.plist new file mode 100644 index 0000000..6fbb927 --- /dev/null +++ b/Project/LLVMRubyObjCPlusPlusBridger-Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.yourcompany.LLVMRubyObjCPlusPlusBridger + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + 1.0 + + diff --git a/Project/LLVMRubyObjCPlusPlusBridger.h b/Project/LLVMRubyObjCPlusPlusBridger.h new file mode 100644 index 0000000..9711671 --- /dev/null +++ b/Project/LLVMRubyObjCPlusPlusBridger.h @@ -0,0 +1,18 @@ +// +// LLVMRubyObjCPlusPlusBridger.h +// LLVMRuby +// +// Created by Alexander Kellett on 3/20/08. +// Copyright 2008 __MyCompanyName__. All rights reserved. +// + +#import + + +@interface LLVMRubyObjCPlusPlusBridger : NSObject { + +} + +- (const char*) foo: (const char*)str; + +@end diff --git a/Project/LLVMRubyObjCPlusPlusBridger.mm b/Project/LLVMRubyObjCPlusPlusBridger.mm new file mode 100644 index 0000000..9107ac9 --- /dev/null +++ b/Project/LLVMRubyObjCPlusPlusBridger.mm @@ -0,0 +1,13 @@ +#include "Mumble.h" + +#import "LLVMRubyObjCPlusPlusBridger.h" + +@implementation LLVMRubyObjCPlusPlusBridger + +- (const char*) foo: (const char*)str { + return bah2(str); +} + + +@end + diff --git a/Project/Mumble.cpp b/Project/Mumble.cpp new file mode 100644 index 0000000..2dd78dd --- /dev/null +++ b/Project/Mumble.cpp @@ -0,0 +1,71 @@ +#define __STDC_LIMIT_MACROS + +#include "Mumble.h" + +#include "llvm/Module.h" +#include "llvm/ModuleProvider.h" +#include "llvm/Type.h" +#include "llvm/Assembly/Parser.h" +#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/CodeGen/LinkAllCodegenComponents.h" +#include "llvm/ExecutionEngine/JIT.h" +#include "llvm/ExecutionEngine/GenericValue.h" +#include "llvm/Support/ManagedStatic.h" +#include "llvm/Support/MemoryBuffer.h" +#include "llvm/System/Process.h" +#include +#include + +using namespace llvm; + +std::auto_ptr foobar(const char *boo) { + ParseError Err; + std::auto_ptr M(ParseAssemblyString(boo, 0, &Err)); + if (M.get() == 0) { + cerr << ": " << Err.getMessage() << "\n"; + } + return M; +} + + +/* + + std::ostream *Out = new std::ofstream("/Users/lypanov/llvmrb/foo.lli.bc", std::ios::out | + std::ios::trunc | std::ios::binary); + if (!Out->good()) { + cerr << ": error opening " << "!\n"; + return 0; + } + WriteBitcodeToFile(M.get(), *Out); + + std::string ErrorMsg; + ModuleProvider *MP = 0; + if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN("/Users/lypanov/llvmrb/foo.lli.bc", &ErrorMsg)) { + MP = getBitcodeModuleProvider(Buffer, &ErrorMsg); + if (!MP) { + delete Buffer; + } + } + + +*/ +const char* bah2(const char *boo) { + static ExecutionEngine *EE = 0; + + std::auto_ptr M = foobar(boo); + + if (!EE) { + EE = ExecutionEngine::create(M.get()); + } + + Function *Fn = M->getFunction("foo"); + if (!Fn) { + std::cerr << "'foo' function not found in module.\n"; + } + + std::vector args(1); + args[0].IntVal = APInt(64, 5); + + GenericValue Result = EE->runFunction(Fn, args); + return Result.IntVal.toString(10, false).c_str(); +} \ No newline at end of file diff --git a/Project/Mumble.h b/Project/Mumble.h new file mode 100644 index 0000000..cb32bb7 --- /dev/null +++ b/Project/Mumble.h @@ -0,0 +1,2 @@ + +const char* bah2(const char *boo); \ No newline at end of file diff --git a/Project/main.m b/Project/main.m new file mode 100755 index 0000000..69d4941 --- /dev/null +++ b/Project/main.m @@ -0,0 +1,6 @@ +#import + +int main(int argc, char *argv[]) +{ + return macruby_main("rb_main.rb", argc, argv); +} diff --git a/Project/rb_main.rb b/Project/rb_main.rb new file mode 100755 index 0000000..231a0b0 --- /dev/null +++ b/Project/rb_main.rb @@ -0,0 +1,4 @@ +framework 'Cocoa' +bridge = LLVMRubyObjCPlusPlusBridger.new +# fail "um1" unless (bridge.foo('define i64 @foo(i64 %bah) { ret i64 10 }') == "10") +fail "um2" unless (bridge.foo('define i64 @foo(i64 %bah) { ret i64 %bah }') == "5") -- 2.11.4.GIT