code stringlengths 3 10M | language stringclasses 31
values |
|---|---|
module coral.util.threads.filewatcher;
import coral.util.app.threads;
import core.time;
import std.concurrency;
import fswatch;
import std.stdio;
package class DirectoryMonitorThread : CancellableThread
{
this(const string wpath)
{
watchPath = wpath;
}
override void run()
{
writeln("File watching thread created");
immutable int period = 150;
auto watcher = FileWatch(watchPath);
while(true)
{
auto events = watcher.getEvents();
foreach(event; events)
{
final switch(event.type) with(FileChangeEventType)
{
case createSelf:
break;
case removeSelf:
break;
case create:
break;
case remove:
break;
case rename:
break;
case modify:
writeln("A file was modified");
break;
}
}
if(isCancelled)
break;
sleep(period.msecs);
}
writeln("File watching thread finished");
}
private string watchPath;
@property pure const string path() nothrow @nogc @safe { return watchPath; }
}
| D |
<?xml version="1.0" encoding="ASCII" standalone="no"?>
<di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0">
<pageList>
<availablePage>
<emfPageIdentifier href="VAR_26_BeT-3488137157.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_26_BeT-3488137157.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
| D |
module editor.io;
import std.algorithm;
import std.conv;
import std.string;
import basics.globals;
import basics.globconf;
import basics.user; // hotkeys for the popup dialogs
import editor.dragger;
import editor.editor;
import editor.gui.panel;
import editor.paninit;
import file.filename;
import file.date;
import file.language;
import graphic.map;
import gui;
import hardware.keyset;
import hardware.sound;
import level.level;
import menu.browser.saveas;
import tile.gadtile;
package:
void implConstructor(Editor editor) { with (editor)
{
_level = new Level(_loadedFrom);
_levelToCompareForDataLoss = new Level(_loadedFrom);
Map newMap() { with (_level) return new Map(topology,
Geom.screenXls.to!int, (Geom.screenYls - Geom.panelYls).to!int); }
_map = newMap();
_mapTerrain = newMap();
_map.centerOnAverage(
_level.gadgets[GadType.HATCH].map!(h => h.screenCenter.x),
_level.gadgets[GadType.HATCH].map!(h => h.screenCenter.y));
_dragger = new MouseDragger();
editor.makePanel();
}}
void implDestructor(Editor editor)
{
if (editor._panel)
rmElder(editor._panel);
}
void newLevel(Editor editor) {
with (editor)
{
editor.askForDataLossThenExecute(delegate void() {
_hover = null;
_selection = null;
_loadedFrom = null;
_panel.currentFilename = null;
_level = new Level;
_level.author = basics.globconf.userName;
_levelToCompareForDataLoss = new Level;
_levelToCompareForDataLoss.author = userName;
});
}}
void saveToExistingFile(Editor editor) {
with (editor)
{
if (editor._loadedFrom) {
basics.user.singleLastLevel = editor._loadedFrom;
if (_level != _levelToCompareForDataLoss)
_level.built = Date.now();
_level.saveToFile(_loadedFrom);
_levelToCompareForDataLoss = new Level(_loadedFrom);
playLoud(Sound.DISKSAVE);
}
else
editor.openSaveAsBrowser();
}}
void openSaveAsBrowser(Editor editor) {
with (editor)
{
assert (noWindowsOpen);
_saveBrowser = new SaveBrowser(dirLevels);
_saveBrowser.highlight(_loadedFrom ? _loadedFrom : singleLastLevel);
addFocus(_saveBrowser);
}}
void askForDataLossThenExecute(
Editor editor,
void delegate() unlessCancelledExecuteThis
) {
with (editor)
{
assert (noWindowsOpen);
assert (_level !is _levelToCompareForDataLoss);
if (_level == _levelToCompareForDataLoss) {
unlessCancelledExecuteThis();
}
else {
MsgBox box = new MsgBox(Lang.saveBoxTitleSave.transl);
if (_loadedFrom) {
box.addMsg(Lang.saveBoxQuestionUnsavedChangedLevel.transl);
box.addMsg("%s %s".format(Lang.saveBoxFileName.transl,
_loadedFrom.rootless));
}
else {
box.addMsg(Lang.saveBoxQuestionUnsavedNewLevel.transl);
}
if (_level.name != null)
box.addMsg("%s %s".format(Lang.saveBoxLevelName.transl,
_level.name));
box.addButton(Lang.saveBoxYesSave.transl, keyMenuOkay, () {
_askForDataLoss = null;
editor.saveToExistingFile();
unlessCancelledExecuteThis();
});
box.addButton(Lang.saveBoxNoDiscard.transl, keyMenuDelete, () {
_askForDataLoss = null;
unlessCancelledExecuteThis();
});
box.addButton(Lang.saveBoxNoCancel.transl,
KeySet(keyMenuExit, keyEditorExit), () {
_askForDataLoss = null;
});
addFocus(box);
_askForDataLoss = box;
}
}}
| D |
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Crypto.build/Utilities/Deprecated.swift.o : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/Base32.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/RSA/RSA.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/MAC/HMAC.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/MAC/OTP.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/RSA/RSAPadding.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/CipherAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/OpenSSLCipherAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/AuthenticatedCipherAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Digest/DigestAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Random/CryptoRandom.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/Cipher.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/AuthenticatedCipher.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/OpenSSLStreamCipher.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/CryptoError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Digest/Digest.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/BCrypt/BCryptDigest.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/RSA/RSAKey.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Crypto.build/Utilities/Deprecated~partial.swiftmodule : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/Base32.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/RSA/RSA.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/MAC/HMAC.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/MAC/OTP.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/RSA/RSAPadding.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/CipherAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/OpenSSLCipherAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/AuthenticatedCipherAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Digest/DigestAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Random/CryptoRandom.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/Cipher.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/AuthenticatedCipher.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/OpenSSLStreamCipher.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/CryptoError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Digest/Digest.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/BCrypt/BCryptDigest.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/RSA/RSAKey.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Crypto.build/Utilities/Deprecated~partial.swiftdoc : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/Base32.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/RSA/RSA.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/MAC/HMAC.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/MAC/OTP.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/RSA/RSAPadding.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/CipherAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/OpenSSLCipherAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/AuthenticatedCipherAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Digest/DigestAlgorithm.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Random/CryptoRandom.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/Cipher.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/AuthenticatedCipher.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Cipher/OpenSSLStreamCipher.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/CryptoError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/Digest/Digest.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/BCrypt/BCryptDigest.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/Crypto/RSA/RSAKey.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Random.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /usr/local/Cellar/libressl/3.0.2/include/openssl/asn1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/tls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dtls1.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs12.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem2.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl23.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509v3.h /usr/local/Cellar/libressl/3.0.2/include/openssl/md5.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pkcs7.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509.h /usr/local/Cellar/libressl/3.0.2/include/openssl/sha.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rsa.h /usr/local/Cellar/libressl/3.0.2/include/openssl/obj_mac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/hmac.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ec.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /usr/local/Cellar/libressl/3.0.2/include/openssl/rand.h /usr/local/Cellar/libressl/3.0.2/include/openssl/conf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslconf.h /usr/local/Cellar/libressl/3.0.2/include/openssl/dh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ecdh.h /usr/local/Cellar/libressl/3.0.2/include/openssl/lhash.h /usr/local/Cellar/libressl/3.0.2/include/openssl/stack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/safestack.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ssl.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CCryptoOpenSSL/include/c_crypto_openssl.h /usr/local/Cellar/libressl/3.0.2/include/openssl/pem.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bn.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /usr/local/Cellar/libressl/3.0.2/include/openssl/bio.h /usr/local/Cellar/libressl/3.0.2/include/openssl/crypto.h /usr/local/Cellar/libressl/3.0.2/include/openssl/srtp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/evp.h /usr/local/Cellar/libressl/3.0.2/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/3.0.2/include/openssl/buffer.h /usr/local/Cellar/libressl/3.0.2/include/openssl/err.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/3.0.2/include/openssl/objects.h /usr/local/Cellar/libressl/3.0.2/include/openssl/opensslv.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /usr/local/Cellar/libressl/3.0.2/include/openssl/x509_vfy.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBase32/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/crypto/Sources/CBcrypt/include/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-ssl-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/ServerTrustPolicy.o : /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/MultipartFormData.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Timeline.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Alamofire.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Response.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/TaskDelegate.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/SessionDelegate.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/ParameterEncoding.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Validation.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/ResponseSerialization.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/SessionManager.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/AFError.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Notifications.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Result.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Request.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/ServerTrustPolicy~partial.swiftmodule : /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/MultipartFormData.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Timeline.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Alamofire.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Response.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/TaskDelegate.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/SessionDelegate.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/ParameterEncoding.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Validation.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/ResponseSerialization.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/SessionManager.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/AFError.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Notifications.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Result.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Request.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/ServerTrustPolicy~partial.swiftdoc : /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/MultipartFormData.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Timeline.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Alamofire.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Response.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/TaskDelegate.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/SessionDelegate.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/ParameterEncoding.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Validation.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/ResponseSerialization.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/SessionManager.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/AFError.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Notifications.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Result.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/Request.swift /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Alamofire/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/RyanLiao/Desktop/XCodeWorkspace/Flix/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/Users/harukikondo/git/RustGUISample/rustguisample/target/debug/build/glam-6bd99e12aa8e70f4/build_script_build-6bd99e12aa8e70f4: /Users/harukikondo/.cargo/registry/src/github.com-1ecc6299db9ec823/glam-0.8.7/build.rs
/Users/harukikondo/git/RustGUISample/rustguisample/target/debug/build/glam-6bd99e12aa8e70f4/build_script_build-6bd99e12aa8e70f4.d: /Users/harukikondo/.cargo/registry/src/github.com-1ecc6299db9ec823/glam-0.8.7/build.rs
/Users/harukikondo/.cargo/registry/src/github.com-1ecc6299db9ec823/glam-0.8.7/build.rs:
| D |
/Users/hauyadav/Learn/nysample/NYTSample/Build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/PKHUD.build/Objects-normal/x86_64/PKHUDProgressView.o : /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/HUD.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUD.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDAnimating.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDAnimation.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/WindowRootViewController.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDAssets.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDRotatingImageView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/FrameView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDWideBaseView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDSquareBaseView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDErrorView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDSystemActivityIndicatorView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDSuccessView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDProgressView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDTextView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/Window.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUD.h /Users/hauyadav/Learn/nysample/NYTSample/Pods/Target\ Support\ Files/PKHUD/PKHUD-umbrella.h /Users/hauyadav/Learn/nysample/NYTSample/Build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/PKHUD.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/hauyadav/Learn/nysample/NYTSample/Build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/PKHUD.build/Objects-normal/x86_64/PKHUDProgressView~partial.swiftmodule : /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/HUD.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUD.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDAnimating.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDAnimation.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/WindowRootViewController.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDAssets.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDRotatingImageView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/FrameView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDWideBaseView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDSquareBaseView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDErrorView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDSystemActivityIndicatorView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDSuccessView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDProgressView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDTextView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/Window.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUD.h /Users/hauyadav/Learn/nysample/NYTSample/Pods/Target\ Support\ Files/PKHUD/PKHUD-umbrella.h /Users/hauyadav/Learn/nysample/NYTSample/Build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/PKHUD.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/hauyadav/Learn/nysample/NYTSample/Build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/PKHUD.build/Objects-normal/x86_64/PKHUDProgressView~partial.swiftdoc : /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/HUD.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUD.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDAnimating.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDAnimation.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/WindowRootViewController.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDAssets.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDRotatingImageView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/FrameView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDWideBaseView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDSquareBaseView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDErrorView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDSystemActivityIndicatorView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDSuccessView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDProgressView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUDTextView.swift /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/Window.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/hauyadav/Learn/nysample/NYTSample/Pods/PKHUD/PKHUD/PKHUD.h /Users/hauyadav/Learn/nysample/NYTSample/Pods/Target\ Support\ Files/PKHUD/PKHUD-umbrella.h /Users/hauyadav/Learn/nysample/NYTSample/Build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/PKHUD.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/home/timon/Documents/laminar_file_share/file_server/target/debug/deps/cfg_if-5e77b06387fac8e3.rmeta: /home/timon/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-0.1.9/src/lib.rs
/home/timon/Documents/laminar_file_share/file_server/target/debug/deps/libcfg_if-5e77b06387fac8e3.rlib: /home/timon/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-0.1.9/src/lib.rs
/home/timon/Documents/laminar_file_share/file_server/target/debug/deps/cfg_if-5e77b06387fac8e3.d: /home/timon/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-0.1.9/src/lib.rs
/home/timon/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-0.1.9/src/lib.rs:
| D |
// Org from ng.learn 1 Mar 5:07am - Dr.Smith
import std.stdio;
import std.conv;
void main() {
double[string] data;
double[200][1_000] data2;
for(int i = 0; i < 1_000; i++) {
for(int j = 0; j < 200; j++) {
// fake multi-dim works
string str = to!string(i) ~ "," ~ to!string(j);
data[str] = i * j;
// real multi-dim does not work
data2[i][j] = i * j;
}
}
writeln("30,70 = ", data[ "30,70" ] );
} | D |
module xtk.meta;
public import std.traits, std.typecons, std.typetuple;
template Identity(alias A)
{
alias A Identity;
}
template Identity(T)
{
alias T Identity;
}
template Seq(T...)
{
alias T Seq;
}
template Pack(T...)
{
alias T field;
// alias Identity!(T.length) length;
enum size_t length = field.length;
struct Tag;
}
template isPack(T...)
{
enum isPack = is(Identity!(T[0]).Tag == Pack!(T[0].field).Tag);
}
version(unittest)
{
static assert( isPack!(Pack!(1,2, int)));
static assert(!isPack!(1,2, int));
static assert(!isPack!(1));
static assert(!isPack!(int));
}
// workaround @@@BUG4333@@@
template staticLength(tuple...)
{
enum size_t staticLength = tuple.length;
}
template Join(string sep, Args...)
{
enum Join = staticReduce!("A==\"\" ? B : A~`"~sep~"`~B", "", Args);
}
template mixinAll(mixins...)
{
static if (mixins.length == 1)
{
static if (is(typeof(mixins[0]) == string))
{
mixin(mixins[0]);
}
else
{
alias mixins[0] it;
mixin it;
}
}
else static if (mixins.length >= 2)
{
mixin mixinAll!(mixins[ 0 .. $/2]);
mixin mixinAll!(mixins[$/2 .. $ ]);
}
}
template staticMap(alias F, T...)
{
static if (T.length == 0)
{
alias Seq!() staticMap;
}
else static if (T.length == 1)
{
alias Seq!(F!(T[0])) staticMap;
}
else
{
alias Seq!(
staticMap!(F, T[0 .. $/2]),
staticMap!(F, T[$/2 .. $ ])) staticMap;
}
}
/**
*/
template staticIota(int beg, int end, int step = 1)
if (step != 0)
{
static if (beg + 1 >= end)
{
static if (beg >= end)
alias Seq!() staticIota;
else
alias Seq!(+beg) staticIota;
}
else
{
alias Seq!(
staticIota!(beg, beg+(end-beg)/2),
staticIota!( beg+(end-beg)/2, end))
staticIota;
}
}
/// ditto
template staticIota(int end)
{
alias staticIota!(0, end) staticIota;
}
template staticZip(alias P, alias Q)
{
static assert(P.length == Q.length);
static if (P.length == 0)
alias Seq!() staticZip;
else
alias Seq!(
Pack!(P.field[0], Q.field[0]),
staticZip!(Pack!(P.field[1..$]), Pack!(Q.field[1..$]))
) staticZip;
}
template staticZip(alias P, alias Q, alias R)
{
static assert(P.length == Q.length && Q.length == R.length);
static if (P.length == 0)
alias Seq!() staticZip;
else
alias Seq!(
Pack!(P.field[0], Q.field[0], R.field[0]),
staticZip!(Pack!(P.field[1..$]), Pack!(Q.field[1..$]), Pack!(R.field[1..$]))
) staticZip;
}
///
template BinaryFun(string Code)
{
template BinaryFun(alias A, alias B)
{
enum BinaryFun = mixin(Code);
}
}
private template staticReduceEnv(alias Init, alias F, T...)
{
template Temp(alias T)
{
alias T Res;
}
template Engine(alias Tmp, T...)
{
static if (T.length == 0)
{
alias Tmp.Res Engine;
}
else
{
alias Engine!(Temp!(F!(Tmp.Res, T[0])), T[1..$]) Engine;
}
}
alias Engine!(Temp!(Init), T) Res;
}
/// reduce
template staticReduce(alias F, alias Init, T...)
{
static if (isSomeString!(typeof(F)))
{
alias staticReduceEnv!(Init, BinaryFun!F, T).Res staticReduce;
}
else
{
alias staticReduceEnv!(Init, F, T).Res staticReduce;
}
}
version(unittest)
{
static assert(staticReduce!(q{A==""?B:A~", "~B}, "", Seq!("AAA", "BBB", "CCC")) == "AAA, BBB, CCC");
}
template allSatisfy(alias F, T...)
{
static if (T.length == 0)
{
enum bool allSatisfy = true;
}
else static if (T.length == 1)
{
static if (isPack!(T[0]))
alias F!(T[0].field) allSatisfy;
else
alias F!(T[0]) allSatisfy;
}
else
{
static if (isPack!(T[0]))
enum bool allSatisfy = F!(T[0].field) && allSatisfy!(F, T[1 .. $]);
else
enum bool allSatisfy = F!(T[0]) && allSatisfy!(F, T[1 .. $]);
}
}
template isCovariantParameterWith(alias F, alias G)
{
enum isCovariantParameterWith =
allSatisfy!(isImplicitlyConvertible, staticZip!(F, G));
}
template isImplicitlyConvertible(From, To)
{
enum bool isImplicitlyConvertible =
std.traits.isImplicitlyConvertible!(From, To);
}
template isImplicitlyConvertible(alias P) if (is(P Q == Pack!(T), T...))
{
enum bool isImplicitlyConvertible =
isImplicitlyConvertible!(P.field);
}
/**
Return $(D true) if $(D_PARAM T) is template.
*/
template isTemplate(alias T)
{
enum isTemplate = is(typeof(T)) && !__traits(compiles, { auto v = T; });
}
template Typeof(alias A)
{
alias typeof(A) Typeof;
}
template isType(T...) if (T.length == 1)
{
enum isType = is(T[0]);
}
template isStruct(T...) if (T.length == 1)
{
enum isStruct = is(T[0] == struct);
}
template RemoveIf(alias F, T...)
{
static if (T.length == 0)
{
alias Seq!() RemoveIf;
}
else static if (T.length == 1)
{
static if (F!(T[0]))
alias Seq!() RemoveIf;
else
alias Seq!(T[0]) RemoveIf;
}
else
{
alias Seq!(
RemoveIf!(F, T[0 .. $/2]),
RemoveIf!(F, T[$/2 .. $])) RemoveIf;
}
}
template Filter(alias F, T...)
{
static if (T.length == 0)
{
alias Seq!() Filter;
}
else static if (T.length == 1)
{
static if (F!(T[0]))
alias Seq!(T[0]) Filter;
else
alias Seq!() Filter;
}
else
{
alias Seq!(
Filter!(F, T[0 .. $/2]),
Filter!(F, T[$/2 .. $])) Filter;
}
}
/+template allTypes(T)
{
Filter!(isType, __traits(allMembers, T)
}
+/
template Equal(A, B)
{
enum Equal = is(A == B);
}
template Equal(A, alias B)
{
enum Equal = false;
}
template Equal(alias A, B)
{
enum Equal = false;
}
template Equal(alias A, alias B)
{
enum Equal = is(Pack!A.Tag == Pack!B.Tag);
}
template Equal(A)
{
alias Equal_!(A) Equal;
}
template Equal(alias A)
{
alias Equal_!(A).Equal Equal;
}
template Equal_(A)
{
template Equal(B) { enum Equal = .Equal!(A, B); }
template Equal(alias B){ enum Equal = .Equal!(A, B); }
}
template Equal_(alias A)
{
template Equal(B) { enum Equal = .Equal!(A, B); }
template Equal(alias B){ enum Equal = .Equal!(A, B); }
}
/+
template Test(T...)
{
}
static assert(isTemplate!Test);
static if (is(Test _ == T!U, alias T, U...))
{
static assert(0);
}
+/
template Not(alias F)// if (isTemplate!F)
{
template Not(A...)
{
enum Not = !(F!A);
}
}
version(unittest)
{
alias Seq!(1,2,3) a;
alias Filter!(Not!(Equal!(1)), Seq!(1,2,3)) b;
static assert(Equal!(Pack!b, Pack!(2,3)));
}
| D |
/**
* Converts expressions to Intermediate Representation (IR) for the backend.
*
* Copyright: Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/e2ir.d, _e2ir.d)
* Documentation: https://dlang.org/phobos/dmd_e2ir.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/e2ir.d
*/
module dmd.e2ir;
import core.stdc.stdio;
import core.stdc.stddef;
import core.stdc.string;
import core.stdc.time;
import dmd.root.array;
import dmd.root.ctfloat;
import dmd.root.rmem;
import dmd.root.rootobject;
import dmd.root.stringtable;
import dmd.aggregate;
import dmd.arraytypes;
import dmd.astenums;
import dmd.attrib;
import dmd.canthrow;
import dmd.ctfeexpr;
import dmd.dclass;
import dmd.declaration;
import dmd.denum;
import dmd.dmodule;
import dmd.dscope;
import dmd.dstruct;
import dmd.dsymbol;
import dmd.dtemplate;
import dmd.errors;
import dmd.expression;
import dmd.func;
import dmd.globals;
import dmd.glue;
import dmd.hdrgen;
import dmd.id;
import dmd.init;
import dmd.location;
import dmd.mtype;
import dmd.objc_glue;
import dmd.printast;
import dmd.s2ir;
import dmd.sideeffect;
import dmd.statement;
import dmd.target;
import dmd.tocsym;
import dmd.toctype;
import dmd.toir;
import dmd.tokens;
import dmd.toobj;
import dmd.typinf;
import dmd.visitor;
import dmd.backend.cc;
import dmd.backend.cdef;
import dmd.backend.cgcv;
import dmd.backend.code;
import dmd.backend.code_x86;
import dmd.backend.cv4;
import dmd.backend.dt;
import dmd.backend.el;
import dmd.backend.global;
import dmd.backend.obj;
import dmd.backend.oper;
import dmd.backend.rtlsym;
import dmd.backend.symtab;
import dmd.backend.ty;
import dmd.backend.type;
extern (C++):
alias Elems = Array!(elem *);
alias toSymbol = dmd.tocsym.toSymbol;
alias toSymbol = dmd.glue.toSymbol;
void* mem_malloc2(uint);
@property int REGSIZE() { return _tysize[TYnptr]; }
/* If variable var is a reference
*/
bool ISREF(Declaration var)
{
if (var.isReference())
{
return true;
}
return ISX64REF(var);
}
/* If variable var of type typ is a reference due to x64 calling conventions
*/
bool ISX64REF(Declaration var)
{
if (var.isReference())
{
return false;
}
if (var.isParameter())
{
if (target.os == Target.OS.Windows && target.is64bit)
{
return var.type.size(Loc.initial) > REGSIZE
|| (var.storage_class & STC.lazy_)
|| (var.type.isTypeStruct() && !var.type.isTypeStruct().sym.isPOD());
}
else if (target.os & Target.OS.Posix)
{
return !(var.storage_class & STC.lazy_) && var.type.isTypeStruct() && !var.type.isTypeStruct().sym.isPOD();
}
}
return false;
}
/* If variable exp of type typ is a reference due to x64 calling conventions
*/
bool ISX64REF(IRState* irs, Expression exp)
{
if (irs.target.os == Target.OS.Windows && irs.target.is64bit)
{
return exp.type.size(Loc.initial) > REGSIZE
|| (exp.type.isTypeStruct() && !exp.type.isTypeStruct().sym.isPOD());
}
else if (irs.target.os & Target.OS.Posix)
{
return exp.type.isTypeStruct() && !exp.type.isTypeStruct().sym.isPOD();
}
return false;
}
/**************************************************
* Generate a copy from e2 to e1.
* Params:
* e1 = lvalue
* e2 = rvalue
* t = value type
* tx = if !null, then t converted to C type
* Returns:
* generated elem
*/
elem* elAssign(elem* e1, elem* e2, Type t, type* tx)
{
//printf("e1:\n"); elem_print(e1);
//printf("e2:\n"); elem_print(e2);
//if (t) printf("t: %s\n", t.toChars());
elem *e = el_bin(OPeq, e2.Ety, e1, e2);
switch (tybasic(e2.Ety))
{
case TYarray:
e.Ejty = e.Ety = TYstruct;
goto case TYstruct;
case TYstruct:
e.Eoper = OPstreq;
if (!tx)
tx = Type_toCtype(t);
//printf("tx:\n"); type_print(tx);
e.ET = tx;
// if (type_zeroCopy(tx))
// e.Eoper = OPcomma;
break;
default:
break;
}
return e;
}
/*************************************************
* Determine if zero bits need to be copied for this backend type
* Params:
* t = backend type
* Returns:
* true if 0 bits
*/
bool type_zeroCopy(type* t)
{
return type_size(t) == 0 ||
(tybasic(t.Tty) == TYstruct &&
(t.Ttag.Stype.Ttag.Sstruct.Sflags & STR0size));
}
/*******************************************************
* Write read-only string to object file, create a local symbol for it.
* Makes a copy of str's contents, does not keep a reference to it.
* Params:
* str = string
* len = number of code units in string
* sz = number of bytes per code unit
* Returns:
* Symbol
*/
Symbol *toStringSymbol(const(char)* str, size_t len, size_t sz)
{
//printf("toStringSymbol() %p\n", stringTab);
auto sv = stringTab.update(str, len * sz);
if (!sv.value)
{
Symbol* si;
if (target.os == Target.OS.Windows)
{
/* This should be in the back end, but mangleToBuffer() is
* in the front end.
*/
/* The stringTab pools common strings within an object file.
* Win32 and Win64 use COMDATs to pool common strings across object files.
*/
/* VC++ uses a name mangling scheme, for example, "hello" is mangled to:
* ??_C@_05CJBACGMB@hello?$AA@
* ^ length
* ^^^^^^^^ 8 byte checksum
* But the checksum algorithm is unknown. Just invent our own.
*/
import dmd.common.outbuffer : OutBuffer;
OutBuffer buf;
buf.writestring("__");
void printHash()
{
// Replace long string with hash of that string
import dmd.backend.md5;
MD5_CTX mdContext = void;
MD5Init(&mdContext);
MD5Update(&mdContext, cast(ubyte*)str, cast(uint)(len * sz));
MD5Final(&mdContext);
foreach (u; mdContext.digest)
{
ubyte u1 = u >> 4;
buf.writeByte((u1 < 10) ? u1 + '0' : u1 + 'A' - 10);
u1 = u & 0xF;
buf.writeByte((u1 < 10) ? u1 + '0' : u1 + 'A' - 10);
}
}
const mangleMinLen = 14; // mangling: "__a14_(14*2 chars)" = 6+14*2 = 34
if (len >= mangleMinLen) // long mangling for sure, use hash
printHash();
else
{
import dmd.dmangle;
scope StringExp se = new StringExp(Loc.initial, str[0 .. len], len, cast(ubyte)sz, 'c');
mangleToBuffer(se, &buf); // recycle how strings are mangled for templates
if (buf.length >= 32 + 2) // long mangling, replace with hash
{
buf.setsize(2);
printHash();
}
}
si = symbol_calloc(buf[]);
si.Sclass = SC.comdat;
si.Stype = type_static_array(cast(uint)(len * sz), tstypes[TYchar]);
si.Stype.Tcount++;
type_setmangle(&si.Stype, mTYman_c);
si.Sflags |= SFLnodebug | SFLartifical;
si.Sfl = FLdata;
si.Salignment = cast(ubyte)sz;
out_readonly_comdat(si, str, cast(uint)(len * sz), cast(uint)sz);
}
else
{
si = out_string_literal(str, cast(uint)len, cast(uint)sz);
}
sv.value = si;
}
return sv.value;
}
/*******************************************************
* Turn StringExp into Symbol.
*/
Symbol *toStringSymbol(StringExp se)
{
Symbol *si;
const n = cast(int)se.numberOfCodeUnits();
if (se.sz == 1)
{
const slice = se.peekString();
si = toStringSymbol(slice.ptr, slice.length, 1);
}
else
{
auto p = cast(char *)mem.xmalloc(n * se.sz);
se.writeTo(p, false);
si = toStringSymbol(p, n, se.sz);
mem.xfree(p);
}
return si;
}
/******************************************************
* Replace call to GC allocator with call to tracing GC allocator.
* Params:
* irs = to get function from
* e = elem to modify in place
* loc = to get file/line from
*/
void toTraceGC(IRState *irs, elem *e, const ref Loc loc)
{
static immutable RTLSYM[2][25] map =
[
[ RTLSYM.NEWCLASS, RTLSYM.TRACENEWCLASS ],
[ RTLSYM.NEWITEMT, RTLSYM.TRACENEWITEMT ],
[ RTLSYM.NEWITEMIT, RTLSYM.TRACENEWITEMIT ],
[ RTLSYM.NEWARRAYT, RTLSYM.TRACENEWARRAYT ],
[ RTLSYM.NEWARRAYIT, RTLSYM.TRACENEWARRAYIT ],
[ RTLSYM.NEWARRAYMTX, RTLSYM.TRACENEWARRAYMTX ],
[ RTLSYM.NEWARRAYMITX, RTLSYM.TRACENEWARRAYMITX ],
[ RTLSYM.CALLFINALIZER, RTLSYM.TRACECALLFINALIZER ],
[ RTLSYM.CALLINTERFACEFINALIZER, RTLSYM.TRACECALLINTERFACEFINALIZER ],
[ RTLSYM.ARRAYLITERALTX, RTLSYM.TRACEARRAYLITERALTX ],
[ RTLSYM.ASSOCARRAYLITERALTX, RTLSYM.TRACEASSOCARRAYLITERALTX ],
[ RTLSYM.ARRAYCATT, RTLSYM.TRACEARRAYCATT ],
[ RTLSYM.ARRAYCATNTX, RTLSYM.TRACEARRAYCATNTX ],
[ RTLSYM.ARRAYAPPENDCD, RTLSYM.TRACEARRAYAPPENDCD ],
[ RTLSYM.ARRAYAPPENDWD, RTLSYM.TRACEARRAYAPPENDWD ],
[ RTLSYM.ARRAYAPPENDT, RTLSYM.TRACEARRAYAPPENDT ],
[ RTLSYM.ARRAYAPPENDCTX, RTLSYM.TRACEARRAYAPPENDCTX ],
[ RTLSYM.ARRAYSETLENGTHT, RTLSYM.TRACEARRAYSETLENGTHT ],
[ RTLSYM.ARRAYSETLENGTHIT, RTLSYM.TRACEARRAYSETLENGTHIT ],
[ RTLSYM.ALLOCMEMORY, RTLSYM.TRACEALLOCMEMORY ],
];
if (irs.params.tracegc && loc.filename)
{
assert(e.Eoper == OPcall);
elem *e1 = e.EV.E1;
assert(e1.Eoper == OPvar);
auto s = e1.EV.Vsym;
/* In -dip1008 code the allocation of exceptions is no longer done by the
* gc, but by a manual reference counting mechanism implementend in druntime.
* If that is the case, then there is nothing to trace.
*/
if (s == getRtlsym(RTLSYM.NEWTHROW))
return;
foreach (ref m; map)
{
if (s == getRtlsym(m[0]))
{
e1.EV.Vsym = getRtlsym(m[1]);
e.EV.E2 = el_param(e.EV.E2, filelinefunction(irs, loc));
return;
}
}
assert(0);
}
}
/*******************************************
* Convert Expression to elem, then append destructors for any
* temporaries created in elem.
* Params:
* e = Expression to convert
* irs = context
* Returns:
* generated elem tree
*/
elem *toElemDtor(Expression e, IRState *irs)
{
//printf("Expression.toElemDtor() %s\n", e.toChars());
/* "may" throw may actually be false if we look at a subset of
* the function. Here, the subset is `e`. If that subset is nothrow,
* we can generate much better code for the destructors for that subset,
* even if the rest of the function throws.
* If mayThrow is false, it cannot be true for some subset of the function,
* so no need to check.
* If calling canThrow() here turns out to be too expensive,
* it can be enabled only for optimized builds.
*/
const mayThrowSave = irs.mayThrow;
if (irs.mayThrow && !canThrow(e, irs.getFunc(), false))
irs.mayThrow = false;
const starti = irs.varsInScope.length;
elem* er = toElem(e, irs);
const endi = irs.varsInScope.length;
irs.mayThrow = mayThrowSave;
// Add destructors
elem* ex = appendDtors(irs, er, starti, endi);
return ex;
}
/*******************************************
* Take address of an elem.
* Accounts for e being an rvalue by assigning the rvalue
* to a temp.
* Params:
* e = elem to take address of
* t = Type of elem
* alwaysCopy = when true, always copy e to a tmp
* Returns:
* the equivalent of &e
*/
elem *addressElem(elem *e, Type t, bool alwaysCopy = false)
{
//printf("addressElem()\n");
elem **pe;
for (pe = &e; (*pe).Eoper == OPcomma; pe = &(*pe).EV.E2)
{
}
// For conditional operator, both branches need conversion.
if ((*pe).Eoper == OPcond)
{
elem *ec = (*pe).EV.E2;
ec.EV.E1 = addressElem(ec.EV.E1, t, alwaysCopy);
ec.EV.E2 = addressElem(ec.EV.E2, t, alwaysCopy);
(*pe).Ejty = (*pe).Ety = cast(ubyte)ec.EV.E1.Ety;
(*pe).ET = ec.EV.E1.ET;
e.Ety = TYnptr;
return e;
}
if (alwaysCopy || ((*pe).Eoper != OPvar && (*pe).Eoper != OPind))
{
elem *e2 = *pe;
type *tx;
// Convert to ((tmp=e2),tmp)
TY ty;
if (t && ((ty = t.toBasetype().ty) == Tstruct || ty == Tsarray))
tx = Type_toCtype(t);
else if (tybasic(e2.Ety) == TYstruct)
{
assert(t); // don't know of a case where this can be null
tx = Type_toCtype(t);
}
else
tx = type_fake(e2.Ety);
Symbol *stmp = symbol_genauto(tx);
elem *eeq = elAssign(el_var(stmp), e2, t, tx);
*pe = el_bin(OPcomma,e2.Ety,eeq,el_var(stmp));
}
tym_t typ = TYnptr;
if (e.Eoper == OPind && tybasic(e.EV.E1.Ety) == TYimmutPtr)
typ = TYimmutPtr;
e = el_una(OPaddr,typ,e);
return e;
}
/********************************
* Reset stringTab[] between object files being emitted, because the symbols are local.
*/
void clearStringTab()
{
//printf("clearStringTab()\n");
if (stringTab)
stringTab.reset(1000); // 1000 is arbitrary guess
else
{
stringTab = new StringTable!(Symbol*)();
stringTab._init(1000);
}
}
private __gshared StringTable!(Symbol*) *stringTab;
/*********************************************
* Convert Expression to backend elem.
* Params:
* e = expression tree
* irs = context
* Returns:
* backend elem tree
*/
elem* toElem(Expression e, IRState *irs)
{
elem* visit(Expression e)
{
printf("[%s] %s: %s\n", e.loc.toChars(), EXPtoString(e.op).ptr, e.toChars());
assert(0);
}
elem* visitSymbol(SymbolExp se) // VarExp and SymOffExp
{
elem *e;
Type tb = (se.op == EXP.symbolOffset) ? se.var.type.toBasetype() : se.type.toBasetype();
int offset = (se.op == EXP.symbolOffset) ? cast(int)(cast(SymOffExp)se).offset : 0;
VarDeclaration v = se.var.isVarDeclaration();
//printf("[%s] SymbolExp.toElem('%s') %p, %s\n", se.loc.toChars(), se.toChars(), se, se.type.toChars());
//printf("\tparent = '%s'\n", se.var.parent ? se.var.parent.toChars() : "null");
if (se.op == EXP.variable && se.var.needThis())
{
se.error("need `this` to access member `%s`", se.toChars());
return el_long(TYsize_t, 0);
}
/* The magic variable __ctfe is always false at runtime
*/
if (se.op == EXP.variable && v && v.ident == Id.ctfe)
{
return el_long(totym(se.type), 0);
}
if (FuncLiteralDeclaration fld = se.var.isFuncLiteralDeclaration())
{
if (fld.tok == TOK.reserved)
{
// change to non-nested
fld.tok = TOK.function_;
fld.vthis = null;
}
if (!fld.deferToObj)
{
fld.deferToObj = true;
irs.deferToObj.push(fld);
}
}
Symbol *s = toSymbol(se.var);
// VarExp generated for `__traits(initSymbol, Aggregate)`?
if (auto symDec = se.var.isSymbolDeclaration())
{
if (se.type.isTypeDArray())
{
assert(se.type == Type.tvoid.arrayOf().constOf(), se.toString());
// Generate s[0 .. Aggregate.sizeof] for non-zero initialised aggregates
// Otherwise create (null, Aggregate.sizeof)
auto ad = symDec.dsym;
auto ptr = (ad.isStructDeclaration() && ad.type.isZeroInit(Loc.initial))
? el_long(TYnptr, 0)
: el_ptr(s);
auto length = el_long(TYsize_t, ad.structsize);
auto slice = el_pair(TYdarray, length, ptr);
elem_setLoc(slice, se.loc);
return slice;
}
}
FuncDeclaration fd = null;
if (se.var.toParent2())
fd = se.var.toParent2().isFuncDeclaration();
const bool nrvo = fd && fd.isNRVO() && fd.nrvo_var == se.var;
if (nrvo)
s = fd.shidden;
if (s.Sclass == SC.auto_ || s.Sclass == SC.parameter || s.Sclass == SC.shadowreg)
{
if (fd && fd != irs.getFunc())
{
// 'var' is a variable in an enclosing function.
elem *ethis = getEthis(se.loc, irs, fd, null, se.originalScope);
ethis = el_una(OPaddr, TYnptr, ethis);
/* https://issues.dlang.org/show_bug.cgi?id=9383
* If 's' is a virtual function parameter
* placed in closure, and actually accessed from in/out
* contract, instead look at the original stack data.
*/
bool forceStackAccess = false;
if (fd.isVirtual() && (fd.fdrequire || fd.fdensure))
{
Dsymbol sx = irs.getFunc();
while (sx != fd)
{
if (sx.ident == Id.require || sx.ident == Id.ensure)
{
forceStackAccess = true;
break;
}
sx = sx.toParent2();
}
}
int soffset;
if (v && v.offset && !forceStackAccess)
soffset = v.offset;
else
{
soffset = cast(int)s.Soffset;
/* If fd is a non-static member function of a class or struct,
* then ethis isn't the frame pointer.
* ethis is the 'this' pointer to the class/struct instance.
* We must offset it.
*/
if (fd.vthis)
{
Symbol *vs = toSymbol(fd.vthis);
//printf("vs = %s, offset = %x, %p\n", vs.Sident, cast(int)vs.Soffset, vs);
soffset -= vs.Soffset;
}
//printf("\tSoffset = x%x, sthis.Soffset = x%x\n", s.Soffset, irs.sthis.Soffset);
}
if (!nrvo)
soffset += offset;
e = el_bin(OPadd, TYnptr, ethis, el_long(TYnptr, soffset));
if (se.op == EXP.variable)
e = el_una(OPind, TYnptr, e);
if (ISREF(se.var) && !(ISX64REF(se.var) && v && v.offset && !forceStackAccess))
e = el_una(OPind, s.Stype.Tty, e);
else if (se.op == EXP.symbolOffset && nrvo)
{
e = el_una(OPind, TYnptr, e);
e = el_bin(OPadd, e.Ety, e, el_long(TYsize_t, offset));
}
goto L1;
}
}
/* If var is a member of a closure
*/
if (v && v.offset)
{
assert(irs.sclosure);
e = el_var(irs.sclosure);
e = el_bin(OPadd, TYnptr, e, el_long(TYsize_t, v.offset));
if (se.op == EXP.variable)
{
e = el_una(OPind, totym(se.type), e);
if (tybasic(e.Ety) == TYstruct)
e.ET = Type_toCtype(se.type);
elem_setLoc(e, se.loc);
}
if (ISREF(se.var) && !ISX64REF(se.var))
{
e.Ety = TYnptr;
e = el_una(OPind, s.Stype.Tty, e);
}
else if (se.op == EXP.symbolOffset && nrvo)
{
e = el_una(OPind, TYnptr, e);
e = el_bin(OPadd, e.Ety, e, el_long(TYsize_t, offset));
}
else if (se.op == EXP.symbolOffset)
{
e = el_bin(OPadd, e.Ety, e, el_long(TYsize_t, offset));
}
goto L1;
}
if (s.Sclass == SC.auto_ && s.Ssymnum == SYMIDX.max)
{
//printf("\tadding symbol %s\n", s.Sident);
symbol_add(s);
}
if (se.var.isImportedSymbol())
{
assert(se.op == EXP.variable);
if (target.os & Target.OS.Posix)
{
e = el_var(s);
}
else
{
e = el_var(toImport(se.var));
e = el_una(OPind,s.Stype.Tty,e);
}
}
else if (ISREF(se.var))
{
// Out parameters are really references
e = el_var(s);
e.Ety = TYnptr;
if (se.op == EXP.variable)
e = el_una(OPind, s.Stype.Tty, e);
else if (offset)
e = el_bin(OPadd, TYnptr, e, el_long(TYsize_t, offset));
}
else if (se.op == EXP.variable)
e = el_var(s);
else
{
e = nrvo ? el_var(s) : el_ptr(s);
e = el_bin(OPadd, e.Ety, e, el_long(TYsize_t, offset));
}
L1:
if (se.op == EXP.variable)
{
if (nrvo)
{
e.Ety = TYnptr;
e = el_una(OPind, 0, e);
}
tym_t tym;
if (se.var.storage_class & STC.lazy_)
tym = TYdelegate; // Tdelegate as C type
else if (tb.ty == Tfunction)
tym = s.Stype.Tty;
else
tym = totym(se.type);
e.Ejty = cast(ubyte)(e.Ety = tym);
if (tybasic(tym) == TYstruct)
{
e.ET = Type_toCtype(se.type);
}
else if (tybasic(tym) == TYarray)
{
e.Ejty = e.Ety = TYstruct;
e.ET = Type_toCtype(se.type);
}
else if (tysimd(tym))
{
e.ET = Type_toCtype(se.type);
}
}
elem_setLoc(e,se.loc);
return e;
}
elem* visitFunc(FuncExp fe)
{
//printf("FuncExp.toElem() %s\n", fe.toChars());
FuncLiteralDeclaration fld = fe.fd;
if (fld.tok == TOK.reserved && fe.type.ty == Tpointer)
{
// change to non-nested
fld.tok = TOK.function_;
fld.vthis = null;
}
if (!fld.deferToObj)
{
fld.deferToObj = true;
irs.deferToObj.push(fld);
}
Symbol *s = toSymbol(fld);
elem *e = el_ptr(s);
if (fld.isNested())
{
elem *ethis;
// Delegate literals report isNested() even if they are in global scope,
// so we need to check that the parent is a function.
if (!fld.toParent2().isFuncDeclaration())
ethis = el_long(TYnptr, 0);
else
ethis = getEthis(fe.loc, irs, fld);
e = el_pair(TYdelegate, ethis, e);
}
elem_setLoc(e, fe.loc);
return e;
}
elem* visitDeclaration(DeclarationExp de)
{
//printf("DeclarationExp.toElem() %s\n", de.toChars());
return Dsymbol_toElem(de.declaration, irs);
}
/***************************************
*/
elem* visitTypeid(TypeidExp e)
{
//printf("TypeidExp.toElem() %s\n", e.toChars());
if (Type t = isType(e.obj))
{
elem* result = getTypeInfo(e, t, irs);
return el_bin(OPadd, result.Ety, result, el_long(TYsize_t, t.vtinfo.offset));
}
if (Expression ex = isExpression(e.obj))
{
if (auto ev = ex.isVarExp())
{
if (auto em = ev.var.isEnumMember())
ex = em.value;
}
if (auto ecr = ex.isClassReferenceExp())
{
Type t = ecr.type;
elem* result = getTypeInfo(ecr, t, irs);
return el_bin(OPadd, result.Ety, result, el_long(TYsize_t, t.vtinfo.offset));
}
auto tc = ex.type.toBasetype().isTypeClass();
assert(tc);
// generate **classptr to get the classinfo
elem* result = toElem(ex, irs);
result = el_una(OPind,TYnptr,result);
result = el_una(OPind,TYnptr,result);
// Add extra indirection for interfaces
if (tc.sym.isInterfaceDeclaration())
result = el_una(OPind,TYnptr,result);
return result;
}
assert(0);
}
/***************************************
*/
elem* visitThis(ThisExp te)
{
//printf("ThisExp.toElem()\n");
assert(irs.sthis);
elem *ethis;
if (te.var)
{
assert(te.var.parent);
FuncDeclaration fd = te.var.toParent2().isFuncDeclaration();
assert(fd);
ethis = getEthis(te.loc, irs, fd);
ethis = fixEthis2(ethis, fd);
}
else
{
ethis = el_var(irs.sthis);
ethis = fixEthis2(ethis, irs.getFunc());
}
if (te.type.ty == Tstruct)
{
ethis = el_una(OPind, TYstruct, ethis);
ethis.ET = Type_toCtype(te.type);
}
elem_setLoc(ethis,te.loc);
return ethis;
}
/***************************************
*/
elem* visitInteger(IntegerExp ie)
{
elem *e = el_long(totym(ie.type), ie.getInteger());
elem_setLoc(e,ie.loc);
return e;
}
/***************************************
*/
elem* visitReal(RealExp re)
{
//printf("RealExp.toElem(%p) %s\n", re, re.toChars());
elem *e = el_long(TYint, 0);
tym_t ty = totym(re.type.toBasetype());
switch (tybasic(ty))
{
case TYfloat:
case TYifloat:
e.EV.Vfloat = cast(float) re.value;
break;
case TYdouble:
case TYidouble:
e.EV.Vdouble = cast(double) re.value;
break;
case TYldouble:
case TYildouble:
e.EV.Vldouble = re.value;
break;
default:
printf("ty = %d, tym = %x, re=%s, re.type=%s, re.type.toBasetype=%s\n",
re.type.ty, ty, re.toChars(), re.type.toChars(), re.type.toBasetype().toChars());
assert(0);
}
e.Ety = ty;
return e;
}
/***************************************
*/
elem* visitComplex(ComplexExp ce)
{
//printf("ComplexExp.toElem(%p) %s\n", ce, ce.toChars());
elem *e = el_long(TYint, 0);
real_t re = ce.value.re;
real_t im = ce.value.im;
tym_t ty = totym(ce.type);
switch (tybasic(ty))
{
case TYcfloat:
union UF { float f; uint i; }
e.EV.Vcfloat.re = cast(float) re;
if (CTFloat.isSNaN(re))
{
UF u;
u.f = e.EV.Vcfloat.re;
u.i &= 0xFFBFFFFFL;
e.EV.Vcfloat.re = u.f;
}
e.EV.Vcfloat.im = cast(float) im;
if (CTFloat.isSNaN(im))
{
UF u;
u.f = e.EV.Vcfloat.im;
u.i &= 0xFFBFFFFFL;
e.EV.Vcfloat.im = u.f;
}
break;
case TYcdouble:
union UD { double d; ulong i; }
e.EV.Vcdouble.re = cast(double) re;
if (CTFloat.isSNaN(re))
{
UD u;
u.d = e.EV.Vcdouble.re;
u.i &= 0xFFF7FFFFFFFFFFFFUL;
e.EV.Vcdouble.re = u.d;
}
e.EV.Vcdouble.im = cast(double) im;
if (CTFloat.isSNaN(re))
{
UD u;
u.d = e.EV.Vcdouble.im;
u.i &= 0xFFF7FFFFFFFFFFFFUL;
e.EV.Vcdouble.im = u.d;
}
break;
case TYcldouble:
e.EV.Vcldouble.re = re;
e.EV.Vcldouble.im = im;
break;
default:
assert(0);
}
e.Ety = ty;
return e;
}
/***************************************
*/
elem* visitNull(NullExp ne)
{
return el_long(totym(ne.type), 0);
}
/***************************************
*/
elem* visitString(StringExp se)
{
//printf("StringExp.toElem() %s, type = %s\n", se.toChars(), se.type.toChars());
elem *e;
Type tb = se.type.toBasetype();
if (tb.ty == Tarray)
{
Symbol *si = toStringSymbol(se);
e = el_pair(TYdarray, el_long(TYsize_t, se.numberOfCodeUnits()), el_ptr(si));
}
else if (tb.ty == Tsarray)
{
Symbol *si = toStringSymbol(se);
e = el_var(si);
e.Ejty = e.Ety = TYstruct;
e.ET = si.Stype;
e.ET.Tcount++;
}
else if (tb.ty == Tpointer)
{
e = el_calloc();
e.Eoper = OPstring;
// freed in el_free
const len = cast(size_t)((se.numberOfCodeUnits() + 1) * se.sz);
e.EV.Vstring = cast(char *)mem_malloc2(cast(uint) len);
se.writeTo(e.EV.Vstring, true);
e.EV.Vstrlen = len;
e.Ety = TYnptr;
}
else
{
printf("type is %s\n", se.type.toChars());
assert(0);
}
elem_setLoc(e,se.loc);
return e;
}
elem* visitNew(NewExp ne)
{
//printf("NewExp.toElem() %s\n", ne.toChars());
Type t = ne.type.toBasetype();
//printf("\ttype = %s\n", t.toChars());
//if (ne.member)
//printf("\tmember = %s\n", ne.member.toChars());
elem *e;
Type ectype;
if (t.ty == Tclass)
{
auto tclass = ne.newtype.toBasetype().isTypeClass();
assert(tclass);
ClassDeclaration cd = tclass.sym;
/* Things to do:
* 1) ex: call allocator
* 2) ey: set vthis for nested classes
* 2) ew: set vthis2 for nested classes
* 3) ez: call constructor
*/
elem *ex = null;
elem *ey = null;
elem *ew = null;
elem *ezprefix = null;
elem *ez = null;
if (ne.onstack)
{
/* Create an instance of the class on the stack,
* and call it stmp.
* Set ex to be the &stmp.
*/
.type *tc = type_struct_class(tclass.sym.toChars(),
tclass.sym.alignsize, tclass.sym.structsize,
null, null,
false, false, true, false);
tc.Tcount--;
Symbol *stmp = symbol_genauto(tc);
ex = el_ptr(stmp);
Symbol *si = toInitializer(tclass.sym);
elem *ei = el_var(si);
if (cd.isNested())
{
ey = el_same(&ex);
ez = el_copytree(ey);
if (cd.vthis2)
ew = el_copytree(ey);
}
else if (ne.member)
ez = el_same(&ex);
ex = el_una(OPind, TYstruct, ex);
ex = elAssign(ex, ei, null, Type_toCtype(tclass).Tnext);
ex = el_una(OPaddr, TYnptr, ex);
ectype = tclass;
}
else
{
assert(!(global.params.ehnogc && ne.thrownew),
"This should have been rewritten to `_d_newThrowable` in the semantic phase.");
Symbol *csym = toSymbol(cd);
const rtl = RTLSYM.NEWCLASS;
ex = el_bin(OPcall,TYnptr,el_var(getRtlsym(rtl)),el_ptr(csym));
toTraceGC(irs, ex, ne.loc);
ectype = null;
if (cd.isNested())
{
ey = el_same(&ex);
ez = el_copytree(ey);
if (cd.vthis2)
ew = el_copytree(ey);
}
else if (ne.member)
ez = el_same(&ex);
//elem_print(ex);
//elem_print(ey);
//elem_print(ez);
}
if (ne.thisexp)
{
ClassDeclaration cdthis = ne.thisexp.type.isClassHandle();
assert(cdthis);
//printf("cd = %s\n", cd.toChars());
//printf("cdthis = %s\n", cdthis.toChars());
assert(cd.isNested());
int offset = 0;
Dsymbol cdp = cd.toParentLocal(); // class we're nested in
//printf("member = %p\n", member);
//printf("cdp = %s\n", cdp.toChars());
//printf("cdthis = %s\n", cdthis.toChars());
if (cdp != cdthis)
{
int i = cdp.isClassDeclaration().isBaseOf(cdthis, &offset);
assert(i);
}
elem *ethis = toElem(ne.thisexp, irs);
if (offset)
ethis = el_bin(OPadd, TYnptr, ethis, el_long(TYsize_t, offset));
if (!cd.vthis)
{
ne.error("forward reference to `%s`", cd.toChars());
}
else
{
ey = el_bin(OPadd, TYnptr, ey, el_long(TYsize_t, cd.vthis.offset));
ey = el_una(OPind, TYnptr, ey);
ey = el_bin(OPeq, TYnptr, ey, ethis);
}
//printf("ex: "); elem_print(ex);
//printf("ey: "); elem_print(ey);
//printf("ez: "); elem_print(ez);
}
else if (cd.isNested())
{
/* Initialize cd.vthis:
* *(ey + cd.vthis.offset) = this;
*/
ey = setEthis(ne.loc, irs, ey, cd);
}
if (cd.vthis2)
{
/* Initialize cd.vthis2:
* *(ew + cd.vthis2.offset) = this;
*/
assert(ew);
ew = setEthis(ne.loc, irs, ew, cd, true);
}
if (ne.member)
{
if (ne.argprefix)
ezprefix = toElem(ne.argprefix, irs);
// Call constructor
ez = callfunc(ne.loc, irs, 1, ne.type, ez, ectype, ne.member, ne.member.type, null, ne.arguments);
}
e = el_combine(ex, ey);
e = el_combine(e, ew);
e = el_combine(e, ezprefix);
e = el_combine(e, ez);
}
else if (t.ty == Tpointer && t.nextOf().toBasetype().ty == Tstruct)
{
t = ne.newtype.toBasetype();
TypeStruct tclass = t.isTypeStruct();
StructDeclaration sd = tclass.sym;
/* Things to do:
* 1) ex: call allocator
* 2) ey: set vthis for nested structs
* 2) ew: set vthis2 for nested structs
* 3) ez: call constructor
*/
elem *ex = null;
elem *ey = null;
elem *ew = null;
elem *ezprefix = null;
elem *ez = null;
// call _d_newitemT(ti)
e = getTypeInfo(ne, ne.newtype, irs);
const rtl = t.isZeroInit(Loc.initial) ? RTLSYM.NEWITEMT : RTLSYM.NEWITEMIT;
ex = el_bin(OPcall,TYnptr,el_var(getRtlsym(rtl)),e);
toTraceGC(irs, ex, ne.loc);
ectype = null;
elem *ev = el_same(&ex);
if (ne.argprefix)
ezprefix = toElem(ne.argprefix, irs);
if (ne.member)
{
if (sd.isNested())
{
ey = el_copytree(ev);
/* Initialize sd.vthis:
* *(ey + sd.vthis.offset) = this;
*/
ey = setEthis(ne.loc, irs, ey, sd);
if (sd.vthis2)
{
/* Initialize sd.vthis2:
* *(ew + sd.vthis2.offset) = this1;
*/
ew = el_copytree(ev);
ew = setEthis(ne.loc, irs, ew, sd, true);
}
}
// Call constructor
ez = callfunc(ne.loc, irs, 1, ne.type, ev, ectype, ne.member, ne.member.type, null, ne.arguments);
/* Structs return a ref, which gets automatically dereferenced.
* But we want a pointer to the instance.
*/
ez = el_una(OPaddr, TYnptr, ez);
}
else
{
StructLiteralExp sle = StructLiteralExp.create(ne.loc, sd, ne.arguments, t);
ez = toElemStructLit(sle, irs, EXP.construct, ev.EV.Vsym, false);
}
//elem_print(ex);
//elem_print(ey);
//elem_print(ez);
e = el_combine(ex, ey);
e = el_combine(e, ew);
e = el_combine(e, ezprefix);
e = el_combine(e, ez);
}
else if (auto tda = t.isTypeDArray())
{
elem *ezprefix = ne.argprefix ? toElem(ne.argprefix, irs) : null;
assert(ne.arguments && ne.arguments.length >= 1);
if (ne.arguments.length == 1)
{
// Single dimension array allocations
Expression arg = (*ne.arguments)[0]; // gives array length
e = toElem(arg, irs);
// call _d_newT(ti, arg)
e = el_param(e, getTypeInfo(ne, ne.type, irs));
const rtl = tda.next.isZeroInit(Loc.initial) ? RTLSYM.NEWARRAYT : RTLSYM.NEWARRAYIT;
e = el_bin(OPcall,TYdarray,el_var(getRtlsym(rtl)),e);
toTraceGC(irs, e, ne.loc);
}
else
{
// Multidimensional array allocations
foreach (i; 0 .. ne.arguments.length)
{
assert(t.ty == Tarray);
t = t.nextOf();
assert(t);
}
// Allocate array of dimensions on the stack
Symbol *sdata = null;
elem *earray = ExpressionsToStaticArray(irs, ne.loc, ne.arguments, &sdata);
e = el_pair(TYdarray, el_long(TYsize_t, ne.arguments.length), el_ptr(sdata));
if (irs.target.os == Target.OS.Windows && irs.target.is64bit)
e = addressElem(e, Type.tsize_t.arrayOf());
e = el_param(e, getTypeInfo(ne, ne.type, irs));
const rtl = t.isZeroInit(Loc.initial) ? RTLSYM.NEWARRAYMTX : RTLSYM.NEWARRAYMITX;
e = el_bin(OPcall,TYdarray,el_var(getRtlsym(rtl)),e);
toTraceGC(irs, e, ne.loc);
e = el_combine(earray, e);
}
e = el_combine(ezprefix, e);
}
else if (auto tp = t.isTypePointer())
{
elem *ezprefix = ne.argprefix ? toElem(ne.argprefix, irs) : null;
// call _d_newitemT(ti)
e = getTypeInfo(ne, ne.newtype, irs);
const rtl = tp.next.isZeroInit(Loc.initial) ? RTLSYM.NEWITEMT : RTLSYM.NEWITEMIT;
e = el_bin(OPcall,TYnptr,el_var(getRtlsym(rtl)),e);
toTraceGC(irs, e, ne.loc);
if (ne.arguments && ne.arguments.length == 1)
{
/* ezprefix, ts=_d_newitemT(ti), *ts=arguments[0], ts
*/
elem *e2 = toElem((*ne.arguments)[0], irs);
Symbol *ts = symbol_genauto(Type_toCtype(tp));
elem *eeq1 = el_bin(OPeq, TYnptr, el_var(ts), e);
elem *ederef = el_una(OPind, e2.Ety, el_var(ts));
elem *eeq2 = el_bin(OPeq, e2.Ety, ederef, e2);
e = el_combine(eeq1, eeq2);
e = el_combine(e, el_var(ts));
//elem_print(e);
}
e = el_combine(ezprefix, e);
}
else if (auto taa = t.isTypeAArray())
{
Symbol *s = aaGetSymbol(taa, "New", 0);
elem *ti = getTypeInfo(ne, t, irs);
// aaNew(ti)
elem *ep = el_params(ti, null);
e = el_bin(OPcall, TYnptr, el_var(s), ep);
elem_setLoc(e, ne.loc);
return e;
}
else
{
ne.error("internal compiler error: cannot new type `%s`\n", t.toChars());
assert(0);
}
elem_setLoc(e,ne.loc);
return e;
}
//////////////////////////// Unary ///////////////////////////////
/***************************************
*/
elem* visitNeg(NegExp ne)
{
elem *e = toElem(ne.e1, irs);
Type tb1 = ne.e1.type.toBasetype();
assert(tb1.ty != Tarray && tb1.ty != Tsarray);
switch (tb1.ty)
{
case Tvector:
{
// rewrite (-e) as (0-e)
elem *ez = el_calloc();
ez.Eoper = OPconst;
ez.Ety = e.Ety;
ez.EV.Vcent.lo = 0;
ez.EV.Vcent.hi = 0;
e = el_bin(OPmin, totym(ne.type), ez, e);
break;
}
default:
e = el_una(OPneg, totym(ne.type), e);
break;
}
elem_setLoc(e,ne.loc);
return e;
}
/***************************************
*/
elem* visitCom(ComExp ce)
{
elem *e1 = toElem(ce.e1, irs);
Type tb1 = ce.e1.type.toBasetype();
tym_t ty = totym(ce.type);
assert(tb1.ty != Tarray && tb1.ty != Tsarray);
elem *e;
switch (tb1.ty)
{
case Tbool:
e = el_bin(OPxor, ty, e1, el_long(ty, 1));
break;
case Tvector:
{
// rewrite (~e) as (e^~0)
elem *ec = el_calloc();
ec.Eoper = OPconst;
ec.Ety = e1.Ety;
ec.EV.Vcent.lo = ~0L;
ec.EV.Vcent.hi = ~0L;
e = el_bin(OPxor, ty, e1, ec);
break;
}
default:
e = el_una(OPcom,ty,e1);
break;
}
elem_setLoc(e,ce.loc);
return e;
}
/***************************************
*/
elem* visitNot(NotExp ne)
{
elem *e = el_una(OPnot, totym(ne.type), toElem(ne.e1, irs));
elem_setLoc(e,ne.loc);
return e;
}
/***************************************
*/
elem* visitHalt(HaltExp he)
{
return genHalt(he.loc);
}
/********************************************
*/
elem* visitAssert(AssertExp ae)
{
// https://dlang.org/spec/expression.html#assert_expressions
//printf("AssertExp.toElem() %s\n", ae.toChars());
elem *e;
if (irs.params.useAssert == CHECKENABLE.on)
{
if (irs.params.checkAction == CHECKACTION.C)
{
auto econd = toElem(ae.e1, irs);
auto ea = callCAssert(irs, ae.loc, ae.e1, ae.msg, null);
auto eo = el_bin(OPoror, TYvoid, econd, ea);
elem_setLoc(eo, ae.loc);
return eo;
}
if (irs.params.checkAction == CHECKACTION.halt)
{
/* Generate:
* ae.e1 || halt
*/
auto econd = toElem(ae.e1, irs);
auto ea = genHalt(ae.loc);
auto eo = el_bin(OPoror, TYvoid, econd, ea);
elem_setLoc(eo, ae.loc);
return eo;
}
e = toElem(ae.e1, irs);
Symbol *ts = null;
elem *einv = null;
Type t1 = ae.e1.type.toBasetype();
FuncDeclaration inv;
// If e1 is a class object, call the class invariant on it
if (irs.params.useInvariants == CHECKENABLE.on && t1.ty == Tclass &&
!(cast(TypeClass)t1).sym.isInterfaceDeclaration() &&
!(cast(TypeClass)t1).sym.isCPPclass())
{
ts = symbol_genauto(Type_toCtype(t1));
einv = el_bin(OPcall, TYvoid, el_var(getRtlsym(RTLSYM.DINVARIANT)), el_var(ts));
}
else if (irs.params.useInvariants == CHECKENABLE.on &&
t1.ty == Tpointer &&
t1.nextOf().ty == Tstruct &&
(inv = (cast(TypeStruct)t1.nextOf()).sym.inv) !is null)
{
// If e1 is a struct object, call the struct invariant on it
ts = symbol_genauto(Type_toCtype(t1));
einv = callfunc(ae.loc, irs, 1, inv.type.nextOf(), el_var(ts), ae.e1.type, inv, inv.type, null, null);
}
// Construct: (e1 || ModuleAssert(line))
Module m = cast(Module)irs.blx._module;
char *mname = cast(char*)m.srcfile.toChars();
//printf("filename = '%s'\n", ae.loc.filename);
//printf("module = '%s'\n", m.srcfile.toChars());
/* Determine if we are in a unittest
*/
FuncDeclaration fd = irs.getFunc();
UnitTestDeclaration ud = fd ? fd.isUnitTestDeclaration() : null;
/* If the source file name has changed, probably due
* to a #line directive.
*/
elem *ea;
if (ae.loc.filename && (ae.msg || strcmp(ae.loc.filename, mname) != 0))
{
const(char)* id = ae.loc.filename;
size_t len = strlen(id);
Symbol *si = toStringSymbol(id, len, 1);
elem *efilename = el_pair(TYdarray, el_long(TYsize_t, len), el_ptr(si));
if (irs.target.os == Target.OS.Windows && irs.target.is64bit)
efilename = addressElem(efilename, Type.tstring, true);
if (ae.msg)
{
/* https://issues.dlang.org/show_bug.cgi?id=8360
* If the condition is evalated to true,
* msg is not evaluated at all. so should use
* toElemDtor(msg, irs) instead of toElem(msg, irs).
*/
elem *emsg = toElemDtor(ae.msg, irs);
emsg = array_toDarray(ae.msg.type, emsg);
if (irs.target.os == Target.OS.Windows && irs.target.is64bit)
emsg = addressElem(emsg, Type.tvoid.arrayOf(), false);
ea = el_var(getRtlsym(ud ? RTLSYM.DUNITTEST_MSG : RTLSYM.DASSERT_MSG));
ea = el_bin(OPcall, TYnoreturn, ea, el_params(el_long(TYint, ae.loc.linnum), efilename, emsg, null));
}
else
{
ea = el_var(getRtlsym(ud ? RTLSYM.DUNITTEST : RTLSYM.DASSERT));
ea = el_bin(OPcall, TYnoreturn, ea, el_param(el_long(TYint, ae.loc.linnum), efilename));
}
}
else
{
auto eassert = el_var(getRtlsym(ud ? RTLSYM.DUNITTESTP : RTLSYM.DASSERTP));
auto efile = toEfilenamePtr(m);
auto eline = el_long(TYint, ae.loc.linnum);
ea = el_bin(OPcall, TYnoreturn, eassert, el_param(eline, efile));
}
if (einv)
{
// tmp = e, e || assert, e.inv
elem *eassign = el_bin(OPeq, e.Ety, el_var(ts), e);
e = el_combine(eassign, el_bin(OPoror, TYvoid, el_var(ts), ea));
e = el_combine(e, einv);
}
else
e = el_bin(OPoror,TYvoid,e,ea);
}
else
{
// BUG: should replace assert(0); with a HLT instruction
e = el_long(TYint, 0);
}
elem_setLoc(e,ae.loc);
return e;
}
elem* visitThrow(ThrowExp te)
{
//printf("ThrowExp.toElem() '%s'\n", te.toChars());
elem *e = toElemDtor(te.e1, irs);
const rtlthrow = config.ehmethod == EHmethod.EH_DWARF ? RTLSYM.THROWDWARF : RTLSYM.THROWC;
elem *sym = el_var(getRtlsym(rtlthrow));
return el_bin(OPcall, TYnoreturn, sym, e);
}
elem* visitPost(PostExp pe)
{
//printf("PostExp.toElem() '%s'\n", pe.toChars());
elem *e = toElem(pe.e1, irs);
elem *einc = toElem(pe.e2, irs);
e = el_bin((pe.op == EXP.plusPlus) ? OPpostinc : OPpostdec,
e.Ety,e,einc);
elem_setLoc(e,pe.loc);
return e;
}
//////////////////////////// Binary ///////////////////////////////
/********************************************
*/
elem *toElemBin(BinExp be, int op)
{
//printf("toElemBin() '%s'\n", be.toChars());
Type tb1 = be.e1.type.toBasetype();
Type tb2 = be.e2.type.toBasetype();
assert(!((tb1.ty == Tarray || tb1.ty == Tsarray ||
tb2.ty == Tarray || tb2.ty == Tsarray) &&
tb2.ty != Tvoid &&
op != OPeq && op != OPandand && op != OPoror));
tym_t tym = totym(be.type);
elem *el = toElem(be.e1, irs);
elem *er = toElem(be.e2, irs);
elem *e = el_bin(op,tym,el,er);
elem_setLoc(e,be.loc);
return e;
}
elem *toElemBinAssign(BinAssignExp be, int op)
{
//printf("toElemBinAssign() '%s'\n", be.toChars());
//printAST(be);
Type tb1 = be.e1.type.toBasetype();
Type tb2 = be.e2.type.toBasetype();
assert(!((tb1.ty == Tarray || tb1.ty == Tsarray ||
tb2.ty == Tarray || tb2.ty == Tsarray) &&
tb2.ty != Tvoid &&
op != OPeq && op != OPandand && op != OPoror));
tym_t tym = totym(be.type);
elem *el;
elem *ev;
if (be.e1.op == EXP.cast_)
{
int depth = 0;
Expression e1 = be.e1;
while (e1.op == EXP.cast_)
{
++depth;
e1 = (cast(CastExp)e1).e1;
}
assert(depth > 0);
el = toElem(e1, irs);
el = addressElem(el, e1.type.pointerTo());
ev = el_same(&el);
el = el_una(OPind, totym(e1.type), el);
ev = el_una(OPind, tym, ev);
foreach (d; 0 .. depth)
{
e1 = be.e1;
foreach (i; 1 .. depth - d)
e1 = (cast(CastExp)e1).e1;
el = toElemCast(cast(CastExp)e1, el, true);
}
}
else
{
el = toElem(be.e1, irs);
if (el.Eoper == OPbit)
{
elem *er = toElem(be.e2, irs);
elem* e = el_bin(op, tym, el, er);
elem_setLoc(e,be.loc);
return e;
}
el = addressElem(el, be.e1.type.pointerTo());
ev = el_same(&el);
el = el_una(OPind, tym, el);
ev = el_una(OPind, tym, ev);
}
elem *er = toElem(be.e2, irs);
elem *e = el_bin(op, tym, el, er);
e = el_combine(e, ev);
elem_setLoc(e,be.loc);
return e;
}
/***************************************
*/
elem* visitAdd(AddExp e)
{
return toElemBin(e, OPadd);
}
/***************************************
*/
elem* visitMin(MinExp e)
{
return toElemBin(e, OPmin);
}
/*****************************************
* Evaluate elem and convert to dynamic array suitable for a function argument.
*/
elem *eval_Darray(Expression e)
{
elem *ex = toElem(e, irs);
ex = array_toDarray(e.type, ex);
if (irs.target.os == Target.OS.Windows && irs.target.is64bit)
{
ex = addressElem(ex, Type.tvoid.arrayOf(), false);
}
return ex;
}
/***************************************
* https://dlang.org/spec/expression.html#cat_expressions
*/
elem* visitCat(CatExp ce)
{
/* Do this check during code gen rather than semantic() because concatenation is
* allowed in CTFE, and cannot distinguish that in semantic().
*/
if (irs.params.betterC)
{
error(ce.loc, "array concatenation of expression `%s` requires the GC which is not available with -betterC", ce.toChars());
return el_long(TYint, 0);
}
Type tb1 = ce.e1.type.toBasetype();
Type tb2 = ce.e2.type.toBasetype();
Type ta = (tb1.ty == Tarray || tb1.ty == Tsarray) ? tb1 : tb2;
elem *e;
if (ce.e1.op == EXP.concatenate)
{
CatExp ex = ce;
// Flatten ((a ~ b) ~ c) to [a, b, c]
Elems elems;
elems.shift(array_toDarray(ex.e2.type, toElem(ex.e2, irs)));
do
{
ex = cast(CatExp)ex.e1;
elems.shift(array_toDarray(ex.e2.type, toElem(ex.e2, irs)));
} while (ex.e1.op == EXP.concatenate);
elems.shift(array_toDarray(ex.e1.type, toElem(ex.e1, irs)));
// We can't use ExpressionsToStaticArray because each exp needs
// to have array_toDarray called on it first, as some might be
// single elements instead of arrays.
Symbol *sdata;
elem *earr = ElemsToStaticArray(ce.loc, ce.type, &elems, &sdata);
elem *ep = el_pair(TYdarray, el_long(TYsize_t, elems.length), el_ptr(sdata));
if (irs.target.os == Target.OS.Windows && irs.target.is64bit)
ep = addressElem(ep, Type.tvoid.arrayOf());
ep = el_param(ep, getTypeInfo(ce, ta, irs));
e = el_bin(OPcall, TYdarray, el_var(getRtlsym(RTLSYM.ARRAYCATNTX)), ep);
toTraceGC(irs, e, ce.loc);
e = el_combine(earr, e);
}
else
{
elem *e1 = eval_Darray(ce.e1);
elem *e2 = eval_Darray(ce.e2);
elem *ep = el_params(e2, e1, getTypeInfo(ce, ta, irs), null);
e = el_bin(OPcall, TYdarray, el_var(getRtlsym(RTLSYM.ARRAYCATT)), ep);
toTraceGC(irs, e, ce.loc);
}
elem_setLoc(e,ce.loc);
return e;
}
/***************************************
*/
elem* visitMul(MulExp e)
{
return toElemBin(e, OPmul);
}
/************************************
*/
elem* visitDiv(DivExp e)
{
return toElemBin(e, OPdiv);
}
/***************************************
*/
elem* visitMod(ModExp e)
{
return toElemBin(e, OPmod);
}
/***************************************
*/
elem* visitCmp(CmpExp ce)
{
//printf("CmpExp.toElem() %s\n", ce.toChars());
OPER eop;
Type t1 = ce.e1.type.toBasetype();
Type t2 = ce.e2.type.toBasetype();
switch (ce.op)
{
case EXP.lessThan: eop = OPlt; break;
case EXP.greaterThan: eop = OPgt; break;
case EXP.lessOrEqual: eop = OPle; break;
case EXP.greaterOrEqual: eop = OPge; break;
case EXP.equal: eop = OPeqeq; break;
case EXP.notEqual: eop = OPne; break;
default:
printf("%s\n", ce.toChars());
assert(0);
}
if (!t1.isfloating())
{
// Convert from floating point compare to equivalent
// integral compare
eop = cast(OPER)rel_integral(eop);
}
elem *e;
if (cast(int)eop > 1 && t1.ty == Tclass && t2.ty == Tclass)
{
// Should have already been lowered
assert(0);
}
else if (cast(int)eop > 1 &&
(t1.ty == Tarray || t1.ty == Tsarray) &&
(t2.ty == Tarray || t2.ty == Tsarray))
{
// This codepath was replaced by lowering during semantic
// to object.__cmp in druntime.
assert(0);
}
else if (t1.ty == Tvector)
{
elem* e1 = toElem(ce.e1, irs);
elem* e2 = toElem(ce.e2, irs);
tym_t tym = totym(ce.type);
elem* ex; // store side effects in ex
// swap operands
void swapOps()
{
// put side effects of e1 into ex
if (el_sideeffect(e1) && e2.Eoper != OPconst)
{
ex = e1;
e1 = el_same(&ex);
}
// swap
auto tmp = e2;
e2 = e1;
e1 = tmp;
}
if (t1.isfloating())
{
/* Rewrite in terms of < or <= operator
*/
OPER op;
switch (eop)
{
case OPlt: // x < y
case OPle: // x <= y
op = eop;
break;
case OPgt: op = OPlt; goto Lswap; // y < x
case OPge: op = OPle; goto Lswap; // y <= x
Lswap:
swapOps();
break;
default:
assert(0);
}
e = el_bin(op, tym, e1, e2);
elem_setLoc(e, ce.loc);
e = el_combine(ex, e);
return e;
}
/* Rewrite in terms of > operator
*/
bool swap; // swap operands
bool comp; // complement result
switch (eop)
{
case OPgt: break; // x > y
case OPlt: swap = true; break; // y > x
case OPle: comp = true; break; // !(x > y)
case OPge: swap = true; comp = true; break; // !(y > x)
default: assert(0);
}
if (swap)
swapOps();
if (t1.isunsigned() || t2.isunsigned())
{
/* only signed compare is available. Bias
* unsigned values by subtracting int.min
*/
ulong val;
Type telement = t1.isTypeVector().basetype.nextOf().toBasetype();
tym_t ty = totym(telement);
switch (tysize(ty)) // vector element size
{
case 1: val = byte.min; break;
case 2: val = short.min; break;
case 4: val = int.min; break;
case 8: val = long.min; break;
default:
assert(0);
}
elem* ec1 = el_vectorConst(totym(t1), val);
e1 = el_bin(OPmin, ec1.Ety, e1, ec1);
elem* ec2 = el_calloc();
el_copy(ec2, ec1);
e2 = el_bin(OPmin, ec2.Ety, e2, ec2);
}
e = el_bin(OPgt, tym, e1, e2);
if (comp)
{
// ex ^ ~0
elem* ec = el_vectorConst(totym(t1), ~0L);
e = el_bin(OPxor, ec.Ety, e, ec);
}
elem_setLoc(e, ce.loc);
e = el_combine(ex, e);
}
else
{
if (cast(int)eop <= 1)
{
/* The result is determinate, create:
* (e1 , e2) , eop
*/
e = toElemBin(ce,OPcomma);
e = el_bin(OPcomma,e.Ety,e,el_long(e.Ety,cast(int)eop));
}
else
e = toElemBin(ce,eop);
}
return e;
}
elem* visitEqual(EqualExp ee)
{
//printf("EqualExp.toElem() %s\n", ee.toChars());
Type t1 = ee.e1.type.toBasetype();
Type t2 = ee.e2.type.toBasetype();
OPER eop;
switch (ee.op)
{
case EXP.equal: eop = OPeqeq; break;
case EXP.notEqual: eop = OPne; break;
default:
printf("%s\n", ee.toChars());
assert(0);
}
//printf("EqualExp.toElem()\n");
elem *e;
if (t1.ty == Tstruct)
{
// Rewritten to IdentityExp or memberwise-compare
assert(0);
}
else if ((t1.ty == Tarray || t1.ty == Tsarray) &&
(t2.ty == Tarray || t2.ty == Tsarray))
{
Type telement = t1.nextOf().toBasetype();
Type telement2 = t2.nextOf().toBasetype();
if ((telement.isintegral() || telement.ty == Tvoid) && telement.ty == telement2.ty)
{
// Optimize comparisons of arrays of basic types
// For arrays of integers/characters, and void[],
// replace druntime call with:
// For a==b: a.length==b.length && (a.length == 0 || memcmp(a.ptr, b.ptr, size)==0)
// For a!=b: a.length!=b.length || (a.length != 0 || memcmp(a.ptr, b.ptr, size)!=0)
// size is a.length*sizeof(a[0]) for dynamic arrays, or sizeof(a) for static arrays.
elem* earr1 = toElem(ee.e1, irs);
elem* earr2 = toElem(ee.e2, irs);
elem* eptr1, eptr2; // Pointer to data, to pass to memcmp
elem* elen1, elen2; // Length, for comparison
elem* esiz1, esiz2; // Data size, to pass to memcmp
const sz = telement.size(); // Size of one element
if (t1.ty == Tarray)
{
elen1 = el_una(target.is64bit ? OP128_64 : OP64_32, TYsize_t, el_same(&earr1));
esiz1 = el_bin(OPmul, TYsize_t, el_same(&elen1), el_long(TYsize_t, sz));
eptr1 = array_toPtr(t1, el_same(&earr1));
}
else
{
elen1 = el_long(TYsize_t, (cast(TypeSArray)t1).dim.toInteger());
esiz1 = el_long(TYsize_t, t1.size());
earr1 = addressElem(earr1, t1);
eptr1 = el_same(&earr1);
}
if (t2.ty == Tarray)
{
elen2 = el_una(target.is64bit ? OP128_64 : OP64_32, TYsize_t, el_same(&earr2));
esiz2 = el_bin(OPmul, TYsize_t, el_same(&elen2), el_long(TYsize_t, sz));
eptr2 = array_toPtr(t2, el_same(&earr2));
}
else
{
elen2 = el_long(TYsize_t, (cast(TypeSArray)t2).dim.toInteger());
esiz2 = el_long(TYsize_t, t2.size());
earr2 = addressElem(earr2, t2);
eptr2 = el_same(&earr2);
}
elem *esize = t2.ty == Tsarray ? esiz2 : esiz1;
e = el_param(eptr1, eptr2);
e = el_bin(OPmemcmp, TYint, e, esize);
e = el_bin(eop, TYint, e, el_long(TYint, 0));
elem *elen = t2.ty == Tsarray ? elen2 : elen1;
elem *esizecheck = el_bin(eop, TYint, el_same(&elen), el_long(TYsize_t, 0));
e = el_bin(ee.op == EXP.equal ? OPoror : OPandand, TYint, esizecheck, e);
if (t1.ty == Tsarray && t2.ty == Tsarray)
assert(t1.size() == t2.size());
else
{
elem *elencmp = el_bin(eop, TYint, elen1, elen2);
e = el_bin(ee.op == EXP.equal ? OPandand : OPoror, TYint, elencmp, e);
}
// Ensure left-to-right order of evaluation
e = el_combine(earr2, e);
e = el_combine(earr1, e);
elem_setLoc(e, ee.loc);
return e;
}
elem *ea1 = eval_Darray(ee.e1);
elem *ea2 = eval_Darray(ee.e2);
elem *ep = el_params(getTypeInfo(ee, telement.arrayOf(), irs),
ea2, ea1, null);
const rtlfunc = RTLSYM.ARRAYEQ2;
e = el_bin(OPcall, TYint, el_var(getRtlsym(rtlfunc)), ep);
if (ee.op == EXP.notEqual)
e = el_bin(OPxor, TYint, e, el_long(TYint, 1));
elem_setLoc(e,ee.loc);
}
else if (t1.ty == Taarray && t2.ty == Taarray)
{
TypeAArray taa = cast(TypeAArray)t1;
Symbol *s = aaGetSymbol(taa, "Equal", 0);
elem *ti = getTypeInfo(ee, taa, irs);
elem *ea1 = toElem(ee.e1, irs);
elem *ea2 = toElem(ee.e2, irs);
// aaEqual(ti, e1, e2)
elem *ep = el_params(ea2, ea1, ti, null);
e = el_bin(OPcall, TYnptr, el_var(s), ep);
if (ee.op == EXP.notEqual)
e = el_bin(OPxor, TYint, e, el_long(TYint, 1));
elem_setLoc(e, ee.loc);
return e;
}
else if (eop == OPne && t1.ty == Tvector)
{
/* (e1 == e2) ^ ~0
*/
elem* ex = toElemBin(ee, OPeqeq);
elem *ec = el_calloc();
ec.Eoper = OPconst;
ec.Ety = totym(t1);
ec.EV.Vcent.lo = ~0L;
ec.EV.Vcent.hi = ~0L;
e = el_bin(OPxor, ec.Ety, ex, ec);
}
else
{
e = toElemBin(ee, eop);
}
return e;
}
elem* visitIdentity(IdentityExp ie)
{
Type t1 = ie.e1.type.toBasetype();
Type t2 = ie.e2.type.toBasetype();
OPER eop;
switch (ie.op)
{
case EXP.identity: eop = OPeqeq; break;
case EXP.notIdentity: eop = OPne; break;
default:
printf("%s\n", ie.toChars());
assert(0);
}
//printf("IdentityExp.toElem() %s\n", ie.toChars());
/* Fix Issue 18746 : https://issues.dlang.org/show_bug.cgi?id=18746
* Before skipping the comparison for empty structs
* it is necessary to check whether the expressions involved
* have any sideeffects
*/
const canSkipCompare = isTrivialExp(ie.e1) && isTrivialExp(ie.e2);
elem *e;
if (t1.ty == Tstruct && (cast(TypeStruct)t1).sym.fields.length == 0 && canSkipCompare)
{
// we can skip the compare if the structs are empty
e = el_long(TYbool, ie.op == EXP.identity);
}
else if (t1.ty == Tstruct || t1.isfloating())
{
// Do bit compare of struct's
elem *es1 = toElem(ie.e1, irs);
es1 = addressElem(es1, ie.e1.type);
elem *es2 = toElem(ie.e2, irs);
es2 = addressElem(es2, ie.e2.type);
e = el_param(es1, es2);
elem *ecount;
// In case of `real`, don't compare padding bits
// https://issues.dlang.org/show_bug.cgi?id=3632
ecount = el_long(TYsize_t, (t1.ty == TY.Tfloat80) ? (t1.size() - target.realpad) : t1.size());
e = el_bin(OPmemcmp, TYint, e, ecount);
e = el_bin(eop, TYint, e, el_long(TYint, 0));
elem_setLoc(e, ie.loc);
}
else if ((t1.ty == Tarray || t1.ty == Tsarray) &&
(t2.ty == Tarray || t2.ty == Tsarray))
{
elem *ea1 = toElem(ie.e1, irs);
ea1 = array_toDarray(t1, ea1);
elem *ea2 = toElem(ie.e2, irs);
ea2 = array_toDarray(t2, ea2);
e = el_bin(eop, totym(ie.type), ea1, ea2);
elem_setLoc(e, ie.loc);
}
else
e = toElemBin(ie, eop);
return e;
}
/***************************************
*/
elem* visitIn(InExp ie)
{
elem *key = toElem(ie.e1, irs);
elem *aa = toElem(ie.e2, irs);
TypeAArray taa = cast(TypeAArray)ie.e2.type.toBasetype();
// aaInX(aa, keyti, key);
key = addressElem(key, ie.e1.type);
Symbol *s = aaGetSymbol(taa, "InX", 0);
elem *keyti = getTypeInfo(ie, taa.index, irs);
elem *ep = el_params(key, keyti, aa, null);
elem *e = el_bin(OPcall, totym(ie.type), el_var(s), ep);
elem_setLoc(e, ie.loc);
return e;
}
/***************************************
*/
elem* visitRemove(RemoveExp re)
{
auto taa = re.e1.type.toBasetype().isTypeAArray();
assert(taa);
elem *ea = toElem(re.e1, irs);
elem *ekey = toElem(re.e2, irs);
ekey = addressElem(ekey, re.e2.type);
Symbol *s = aaGetSymbol(taa, "DelX", 0);
elem *keyti = getTypeInfo(re, taa.index, irs);
elem *ep = el_params(ekey, keyti, ea, null);
elem *e = el_bin(OPcall, TYnptr, el_var(s), ep);
elem_setLoc(e, re.loc);
return e;
}
/***************************************
*/
elem* visitAssign(AssignExp ae)
{
version (none)
{
if (ae.op == EXP.blit) printf("BlitExp.toElem('%s')\n", ae.toChars());
if (ae.op == EXP.assign) printf("AssignExp.toElem('%s')\n", ae.toChars());
if (ae.op == EXP.construct) printf("ConstructExp.toElem('%s')\n", ae.toChars());
}
elem* setResult(elem* e)
{
elem_setLoc(e, ae.loc);
return e;
}
/*
https://issues.dlang.org/show_bug.cgi?id=23120
If rhs is a noreturn expression, then there is no point
to generate any code for the noreturen variable.
*/
if (ae.e2.type.isTypeNoreturn())
return setResult(toElem(ae.e2, irs));
Type t1b = ae.e1.type.toBasetype();
// Look for array.length = n
if (auto ale = ae.e1.isArrayLengthExp())
{
assert(0, "This case should have been rewritten to `_d_arraysetlengthT` in the semantic phase");
}
// Look for array[]=n
if (auto are = ae.e1.isSliceExp())
{
Type t1 = t1b;
Type ta = are.e1.type.toBasetype();
// which we do if the 'next' types match
if (ae.memset == MemorySet.blockAssign)
{
// Do a memset for array[]=v
//printf("Lpair %s\n", ae.toChars());
Type tb = ta.nextOf().toBasetype();
uint sz = cast(uint)tb.size();
elem *n1 = toElem(are.e1, irs);
elem *elwr = are.lwr ? toElem(are.lwr, irs) : null;
elem *eupr = are.upr ? toElem(are.upr, irs) : null;
elem *n1x = n1;
elem *enbytes;
elem *einit;
// Look for array[]=n
if (auto ts = ta.isTypeSArray())
{
n1 = array_toPtr(ta, n1);
enbytes = toElem(ts.dim, irs);
n1x = n1;
n1 = el_same(&n1x);
einit = resolveLengthVar(are.lengthVar, &n1, ta);
}
else if (ta.ty == Tarray)
{
n1 = el_same(&n1x);
einit = resolveLengthVar(are.lengthVar, &n1, ta);
enbytes = el_copytree(n1);
n1 = array_toPtr(ta, n1);
enbytes = el_una(target.is64bit ? OP128_64 : OP64_32, TYsize_t, enbytes);
}
else if (ta.ty == Tpointer)
{
n1 = el_same(&n1x);
enbytes = el_long(TYsize_t, -1); // largest possible index
einit = null;
}
// Enforce order of evaluation of n1[elwr..eupr] as n1,elwr,eupr
elem *elwrx = elwr;
if (elwr) elwr = el_same(&elwrx);
elem *euprx = eupr;
if (eupr) eupr = el_same(&euprx);
version (none)
{
printf("sz = %d\n", sz);
printf("n1x\n"); elem_print(n1x);
printf("einit\n"); elem_print(einit);
printf("elwrx\n"); elem_print(elwrx);
printf("euprx\n"); elem_print(euprx);
printf("n1\n"); elem_print(n1);
printf("elwr\n"); elem_print(elwr);
printf("eupr\n"); elem_print(eupr);
printf("enbytes\n"); elem_print(enbytes);
}
einit = el_combine(n1x, einit);
einit = el_combine(einit, elwrx);
einit = el_combine(einit, euprx);
elem *evalue = toElem(ae.e2, irs);
version (none)
{
printf("n1\n"); elem_print(n1);
printf("enbytes\n"); elem_print(enbytes);
}
if (irs.arrayBoundsCheck() && eupr && ta.ty != Tpointer)
{
assert(elwr);
elem *enbytesx = enbytes;
enbytes = el_same(&enbytesx);
elem *c1 = el_bin(OPle, TYint, el_copytree(eupr), enbytesx);
elem *c2 = el_bin(OPle, TYint, el_copytree(elwr), el_copytree(eupr));
c1 = el_bin(OPandand, TYint, c1, c2);
// Construct: (c1 || arrayBoundsError)
auto ea = buildArraySliceError(irs, ae.loc, el_copytree(elwr), el_copytree(eupr), el_copytree(enbytesx));
elem *eb = el_bin(OPoror,TYvoid,c1,ea);
einit = el_combine(einit, eb);
}
elem *elength;
if (elwr)
{
el_free(enbytes);
elem *elwr2 = el_copytree(elwr);
elwr2 = el_bin(OPmul, TYsize_t, elwr2, el_long(TYsize_t, sz));
n1 = el_bin(OPadd, TYnptr, n1, elwr2);
enbytes = el_bin(OPmin, TYsize_t, eupr, elwr);
elength = el_copytree(enbytes);
}
else
elength = el_copytree(enbytes);
elem* e = setArray(are.e1, n1, enbytes, tb, evalue, irs, ae.op);
e = el_pair(TYdarray, elength, e);
e = el_combine(einit, e);
//elem_print(e);
return setResult(e);
}
else
{
/* It's array1[]=array2[]
* which is a memcpy
*/
elem *eto = toElem(ae.e1, irs);
elem *efrom = toElem(ae.e2, irs);
uint size = cast(uint)t1.nextOf().size();
elem *esize = el_long(TYsize_t, size);
/* Determine if we need to do postblit
*/
bool postblit = false;
if (needsPostblit(t1.nextOf()) &&
(ae.e2.op == EXP.slice && (cast(UnaExp)ae.e2).e1.isLvalue() ||
ae.e2.op == EXP.cast_ && (cast(UnaExp)ae.e2).e1.isLvalue() ||
ae.e2.op != EXP.slice && ae.e2.isLvalue()))
{
postblit = true;
}
bool destructor = needsDtor(t1.nextOf()) !is null;
assert(ae.e2.type.ty != Tpointer);
if (!postblit && !destructor)
{
elem *ex = el_same(&eto);
/* Returns: length of array ex
*/
static elem *getDotLength(IRState* irs, elem *eto, elem *ex)
{
if (eto.Eoper == OPpair &&
eto.EV.E1.Eoper == OPconst)
{
// It's a constant, so just pull it from eto
return el_copytree(eto.EV.E1);
}
else
{
// It's not a constant, so pull it from the dynamic array
return el_una(target.is64bit ? OP128_64 : OP64_32, TYsize_t, el_copytree(ex));
}
}
auto elen = getDotLength(irs, eto, ex);
auto nbytes = el_bin(OPmul, TYsize_t, elen, esize); // number of bytes to memcpy
auto epto = array_toPtr(ae.e1.type, ex);
elem *epfr;
elem *echeck;
if (irs.arrayBoundsCheck()) // check array lengths match and do not overlap
{
auto ey = el_same(&efrom);
auto eleny = getDotLength(irs, efrom, ey);
epfr = array_toPtr(ae.e2.type, ey);
// length check: (eleny == elen)
auto c = el_bin(OPeqeq, TYint, eleny, el_copytree(elen));
/* Don't check overlap if epto and epfr point to different symbols
*/
if (!(epto.Eoper == OPaddr && epto.EV.E1.Eoper == OPvar &&
epfr.Eoper == OPaddr && epfr.EV.E1.Eoper == OPvar &&
epto.EV.E1.EV.Vsym != epfr.EV.E1.EV.Vsym))
{
// Add overlap check (c && (px + nbytes <= py || py + nbytes <= px))
auto c2 = el_bin(OPle, TYint, el_bin(OPadd, TYsize_t, el_copytree(epto), el_copytree(nbytes)), el_copytree(epfr));
auto c3 = el_bin(OPle, TYint, el_bin(OPadd, TYsize_t, el_copytree(epfr), el_copytree(nbytes)), el_copytree(epto));
c = el_bin(OPandand, TYint, c, el_bin(OPoror, TYint, c2, c3));
}
// Construct: (c || arrayBoundsError)
echeck = el_bin(OPoror, TYvoid, c, buildRangeError(irs, ae.loc));
}
else
{
epfr = array_toPtr(ae.e2.type, efrom);
efrom = null;
echeck = null;
}
/* Construct:
* memcpy(ex.ptr, ey.ptr, nbytes)[0..elen]
*/
elem* e = el_bin(OPmemcpy, TYnptr, epto, el_param(epfr, nbytes));
//elem* e = el_params(nbytes, epfr, epto, null);
//e = el_bin(OPcall,TYnptr,el_var(getRtlsym(RTLSYM.MEMCPY)),e);
e = el_pair(eto.Ety, el_copytree(elen), e);
/* Combine: eto, efrom, echeck, e
*/
e = el_combine(el_combine(eto, efrom), el_combine(echeck, e));
return setResult(e);
}
else if ((postblit || destructor) &&
ae.op != EXP.blit &&
ae.op != EXP.construct)
assert(0, "Trying to reference `_d_arrayassign`, this should not happen!");
else
{
// Generate:
// _d_arraycopy(eto, efrom, esize)
if (irs.target.os == Target.OS.Windows && irs.target.is64bit)
{
eto = addressElem(eto, Type.tvoid.arrayOf());
efrom = addressElem(efrom, Type.tvoid.arrayOf());
}
elem *ep = el_params(eto, efrom, esize, null);
elem* e = el_bin(OPcall, totym(ae.type), el_var(getRtlsym(RTLSYM.ARRAYCOPY)), ep);
return setResult(e);
}
}
assert(0);
}
/* Look for initialization of an `out` or `ref` variable
*/
if (ae.memset == MemorySet.referenceInit)
{
assert(ae.op == EXP.construct || ae.op == EXP.blit);
auto ve = ae.e1.isVarExp();
assert(ve);
assert(ve.var.storage_class & (STC.out_ | STC.ref_));
// It'll be initialized to an address
elem* e = toElem(ae.e2, irs);
e = addressElem(e, ae.e2.type);
elem *es = toElem(ae.e1, irs);
if (es.Eoper == OPind)
es = es.EV.E1;
else
es = el_una(OPaddr, TYnptr, es);
es.Ety = TYnptr;
e = el_bin(OPeq, TYnptr, es, e);
assert(!(t1b.ty == Tstruct && ae.e2.op == EXP.int64));
return setResult(e);
}
tym_t tym = totym(ae.type);
elem *e1 = toElem(ae.e1, irs);
elem *e1x;
elem* setResult2(elem* e)
{
return setResult(el_combine(e, e1x));
}
// Create a reference to e1.
if (e1.Eoper == OPvar || e1.Eoper == OPbit)
e1x = el_copytree(e1);
else
{
/* Rewrite to:
* e1 = *((tmp = &e1), tmp)
* e1x = *tmp
*/
e1 = addressElem(e1, null);
e1x = el_same(&e1);
e1 = el_una(OPind, tym, e1);
if (tybasic(tym) == TYstruct)
e1.ET = Type_toCtype(ae.e1.type);
e1x = el_una(OPind, tym, e1x);
if (tybasic(tym) == TYstruct)
e1x.ET = Type_toCtype(ae.e1.type);
//printf("e1 = \n"); elem_print(e1);
//printf("e1x = \n"); elem_print(e1x);
}
// inlining may generate lazy variable initialization
if (auto ve = ae.e1.isVarExp())
if (ve.var.storage_class & STC.lazy_)
{
assert(ae.op == EXP.construct || ae.op == EXP.blit);
elem* e = el_bin(OPeq, tym, e1, toElem(ae.e2, irs));
return setResult2(e);
}
/* This will work if we can distinguish an assignment from
* an initialization of the lvalue. It'll work if the latter.
* If the former, because of aliasing of the return value with
* function arguments, it'll fail.
*/
if (ae.op == EXP.construct && ae.e2.op == EXP.call)
{
CallExp ce = cast(CallExp)ae.e2;
TypeFunction tf = cast(TypeFunction)ce.e1.type.toBasetype();
if (tf.ty == Tfunction && retStyle(tf, ce.f && ce.f.needThis()) == RET.stack)
{
elem *ehidden = e1;
ehidden = el_una(OPaddr, TYnptr, ehidden);
assert(!irs.ehidden);
irs.ehidden = ehidden;
elem* e = toElem(ae.e2, irs);
return setResult2(e);
}
/* Look for:
* v = structliteral.ctor(args)
* and have the structliteral write into v, rather than create a temporary
* and copy the temporary into v
*/
if (e1.Eoper == OPvar && // no closure variables https://issues.dlang.org/show_bug.cgi?id=17622
ae.e1.op == EXP.variable && ce.e1.op == EXP.dotVariable)
{
auto dve = cast(DotVarExp)ce.e1;
auto fd = dve.var.isFuncDeclaration();
if (fd && fd.isCtorDeclaration())
{
if (auto sle = dve.e1.isStructLiteralExp())
{
sle.sym = toSymbol((cast(VarExp)ae.e1).var);
elem* e = toElem(ae.e2, irs);
return setResult2(e);
}
}
}
}
//if (ae.op == EXP.construct) printf("construct\n");
if (auto t1s = t1b.isTypeStruct())
{
if (ae.e2.op == EXP.int64)
{
assert(ae.op == EXP.blit);
/* Implement:
* (struct = 0)
* with:
* memset(&struct, 0, struct.sizeof)
*/
uint sz = cast(uint)ae.e1.type.size();
elem *el = e1;
elem *enbytes = el_long(TYsize_t, sz);
elem *evalue = el_long(TYchar, 0);
el = el_una(OPaddr, TYnptr, el);
elem* e = el_param(enbytes, evalue);
e = el_bin(OPmemset,TYnptr,el,e);
return setResult2(e);
}
//printf("toElemBin() '%s'\n", ae.toChars());
if (auto sle = ae.e2.isStructLiteralExp())
{
auto ex = e1.Eoper == OPind ? e1.EV.E1 : e1;
if (ex.Eoper == OPvar && ex.EV.Voffset == 0 &&
(ae.op == EXP.construct || ae.op == EXP.blit))
{
elem* e = toElemStructLit(sle, irs, ae.op, ex.EV.Vsym, true);
el_free(e1);
return setResult2(e);
}
static bool allZeroBits(ref Expressions exps)
{
foreach (e; exps[])
{
/* The expression types checked can be expanded to include
* floating point, struct literals, and array literals.
* Just be careful to return false for -0.0
*/
if (!e ||
e.op == EXP.int64 && e.isIntegerExp().toInteger() == 0 ||
e.op == EXP.null_)
continue;
return false;
}
return true;
}
/* Use a memset to 0
*/
if ((sle.useStaticInit ||
sle.elements && allZeroBits(*sle.elements) && !sle.sd.isNested()) &&
ae.e2.type.isZeroInit(ae.e2.loc))
{
elem* enbytes = el_long(TYsize_t, ae.e1.type.size());
elem* evalue = el_long(TYchar, 0);
elem* el = el_una(OPaddr, TYnptr, e1);
elem* e = el_bin(OPmemset,TYnptr, el, el_param(enbytes, evalue));
return setResult2(e);
}
}
/* Implement:
* (struct = struct)
*/
elem *e2 = toElem(ae.e2, irs);
elem* e = elAssign(e1, e2, ae.e1.type, null);
return setResult2(e);
}
else if (t1b.ty == Tsarray)
{
if (ae.op == EXP.blit && ae.e2.op == EXP.int64)
{
/* Implement:
* (sarray = 0)
* with:
* memset(&sarray, 0, struct.sizeof)
*/
elem *ey = null;
targ_size_t sz = ae.e1.type.size();
elem *el = e1;
elem *enbytes = el_long(TYsize_t, sz);
elem *evalue = el_long(TYchar, 0);
el = el_una(OPaddr, TYnptr, el);
elem* e = el_param(enbytes, evalue);
e = el_bin(OPmemset,TYnptr,el,e);
e = el_combine(ey, e);
return setResult2(e);
}
/* Implement:
* (sarray = sarray)
*/
assert(ae.e2.type.toBasetype().ty == Tsarray);
bool postblit = needsPostblit(t1b.nextOf()) !is null;
bool destructor = needsDtor(t1b.nextOf()) !is null;
/* Optimize static array assignment with array literal.
* Rewrite:
* e1 = [a, b, ...];
* as:
* e1[0] = a, e1[1] = b, ...;
*
* If the same values are contiguous, that will be rewritten
* to block assignment.
* Rewrite:
* e1 = [x, a, a, b, ...];
* as:
* e1[0] = x, e1[1..2] = a, e1[3] = b, ...;
*/
if (ae.op == EXP.construct && // https://issues.dlang.org/show_bug.cgi?id=11238
// avoid aliasing issue
ae.e2.op == EXP.arrayLiteral)
{
ArrayLiteralExp ale = cast(ArrayLiteralExp)ae.e2;
elem* e;
if (ale.elements.length == 0)
{
e = e1;
}
else
{
Symbol *stmp = symbol_genauto(TYnptr);
e1 = addressElem(e1, t1b);
e1 = el_bin(OPeq, TYnptr, el_var(stmp), e1);
// Eliminate _d_arrayliteralTX call in ae.e2.
e = ExpressionsToStaticArray(irs, ale.loc, ale.elements, &stmp, 0, ale.basis);
e = el_combine(e1, e);
}
return setResult2(e);
}
if (ae.op == EXP.assign)
{
if (auto ve1 = ae.e1.isVectorArrayExp())
{
// Use an OPeq rather than an OPstreq
e1 = toElem(ve1.e1, irs);
elem* e2 = toElem(ae.e2, irs);
e2.Ety = e1.Ety;
elem* e = el_bin(OPeq, e2.Ety, e1, e2);
return setResult2(e);
}
}
/* https://issues.dlang.org/show_bug.cgi?id=13661
* Even if the elements in rhs are all rvalues and
* don't have to call postblits, this assignment should call
* destructors on old assigned elements.
*/
bool lvalueElem = false;
if (ae.e2.op == EXP.slice && (cast(UnaExp)ae.e2).e1.isLvalue() ||
ae.e2.op == EXP.cast_ && (cast(UnaExp)ae.e2).e1.isLvalue() ||
ae.e2.op != EXP.slice && ae.e2.isLvalue())
{
lvalueElem = true;
}
elem *e2 = toElem(ae.e2, irs);
if (!postblit && !destructor ||
ae.op == EXP.construct && !lvalueElem && postblit ||
ae.op == EXP.blit ||
type_size(e1.ET) == 0)
{
elem* e = elAssign(e1, e2, ae.e1.type, null);
return setResult2(e);
}
else if (ae.op == EXP.construct)
{
assert(0, "Trying reference _d_arrayctor, this should not happen!");
}
else
{
if (ae.e2.isLvalue)
assert(0, "Trying to reference `_d_arrayassign_l`, this should not happen!");
else
assert(0, "Trying to reference `_d_arrayassign_r`, this should not happen!");
}
}
else
{
elem* e = el_bin(OPeq, tym, e1, toElem(ae.e2, irs));
return setResult2(e);
}
assert(0);
}
/***************************************
*/
elem* visitAddAssign(AddAssignExp e)
{
//printf("AddAssignExp.toElem() %s\n", e.toChars());
return toElemBinAssign(e, OPaddass);
}
/***************************************
*/
elem* visitMinAssign(MinAssignExp e)
{
return toElemBinAssign(e, OPminass);
}
/***************************************
*/
elem* visitCatAssign(CatAssignExp ce)
{
//printf("CatAssignExp.toElem('%s')\n", ce.toChars());
elem *e;
Type tb1 = ce.e1.type.toBasetype();
Type tb2 = ce.e2.type.toBasetype();
assert(tb1.ty == Tarray);
Type tb1n = tb1.nextOf().toBasetype();
elem *e1 = toElem(ce.e1, irs);
elem *e2 = toElem(ce.e2, irs);
/* Because e1 is an lvalue, refer to it via a pointer to it in the form
* of ev. Put any side effects into re1
*/
elem* re1 = addressElem(e1, ce.e1.type.pointerTo(), false);
elem* ev = el_same(&re1);
switch (ce.op)
{
case EXP.concatenateDcharAssign:
{
// Append dchar to char[] or wchar[]
assert(tb2.ty == Tdchar &&
(tb1n.ty == Tchar || tb1n.ty == Twchar));
elem *ep = el_params(e2, el_copytree(ev), null);
const rtl = (tb1.nextOf().ty == Tchar)
? RTLSYM.ARRAYAPPENDCD
: RTLSYM.ARRAYAPPENDWD;
e = el_bin(OPcall, TYdarray, el_var(getRtlsym(rtl)), ep);
toTraceGC(irs, e, ce.loc);
elem_setLoc(e, ce.loc);
break;
}
case EXP.concatenateAssign:
{
assert(0, "This case should have been rewritten to `_d_arrayappendT` in the semantic phase");
}
case EXP.concatenateElemAssign:
{
assert(0, "This case should have been rewritten to `_d_arrayappendcTX` in the semantic phase");
}
default:
assert(0);
}
/* Generate: (re1, e, *ev)
*/
e = el_combine(re1, e);
ev = el_una(OPind, e1.Ety, ev);
e = el_combine(e, ev);
elem_setLoc(e, ce.loc);
return e;
}
/***************************************
*/
elem* visitDivAssign(DivAssignExp e)
{
return toElemBinAssign(e, OPdivass);
}
/***************************************
*/
elem* visitModAssign(ModAssignExp e)
{
return toElemBinAssign(e, OPmodass);
}
/***************************************
*/
elem* visitMulAssign(MulAssignExp e)
{
return toElemBinAssign(e, OPmulass);
}
/***************************************
*/
elem* visitShlAssign(ShlAssignExp e)
{
return toElemBinAssign(e, OPshlass);
}
/***************************************
*/
elem* visitShrAssign(ShrAssignExp e)
{
//printf("ShrAssignExp.toElem() %s, %s\n", e.e1.type.toChars(), e.e1.toChars());
Type t1 = e.e1.type;
if (e.e1.op == EXP.cast_)
{
/* Use the type before it was integrally promoted to int
*/
CastExp ce = cast(CastExp)e.e1;
t1 = ce.e1.type;
}
return toElemBinAssign(e, t1.isunsigned() ? OPshrass : OPashrass);
}
/***************************************
*/
elem* visitUshrAssign(UshrAssignExp e)
{
//printf("UShrAssignExp.toElem() %s, %s\n", e.e1.type.toChars(), e.e1.toChars());
return toElemBinAssign(e, OPshrass);
}
/***************************************
*/
elem* visitAndAssign(AndAssignExp e)
{
return toElemBinAssign(e, OPandass);
}
/***************************************
*/
elem* visitOrAssign(OrAssignExp e)
{
return toElemBinAssign(e, OPorass);
}
/***************************************
*/
elem* visitXorAssign(XorAssignExp e)
{
return toElemBinAssign(e, OPxorass);
}
/***************************************
*/
elem* visitLogical(LogicalExp aae)
{
tym_t tym = totym(aae.type);
elem *el = toElem(aae.e1, irs);
elem *er = toElemDtor(aae.e2, irs);
elem *e = el_bin(aae.op == EXP.andAnd ? OPandand : OPoror,tym,el,er);
elem_setLoc(e, aae.loc);
if (irs.params.cov && aae.e2.loc.linnum)
e.EV.E2 = el_combine(incUsageElem(irs, aae.e2.loc), e.EV.E2);
return e;
}
/***************************************
*/
elem* visitXor(XorExp e)
{
return toElemBin(e, OPxor);
}
/***************************************
*/
elem* visitAnd(AndExp e)
{
return toElemBin(e, OPand);
}
/***************************************
*/
elem* visitOr(OrExp e)
{
return toElemBin(e, OPor);
}
/***************************************
*/
elem* visitShl(ShlExp e)
{
return toElemBin(e, OPshl);
}
/***************************************
*/
elem* visitShr(ShrExp e)
{
return toElemBin(e, e.e1.type.isunsigned() ? OPshr : OPashr);
}
/***************************************
*/
elem* visitUshr(UshrExp se)
{
elem *eleft = toElem(se.e1, irs);
eleft.Ety = touns(eleft.Ety);
elem *eright = toElem(se.e2, irs);
elem *e = el_bin(OPshr, totym(se.type), eleft, eright);
elem_setLoc(e, se.loc);
return e;
}
/****************************************
*/
elem* visitComma(CommaExp ce)
{
assert(ce.e1 && ce.e2);
elem *eleft = toElem(ce.e1, irs);
elem *eright = toElem(ce.e2, irs);
elem *e = el_combine(eleft, eright);
if (e)
elem_setLoc(e, ce.loc);
return e;
}
/***************************************
*/
elem* visitCond(CondExp ce)
{
elem *ec = toElem(ce.econd, irs);
elem *eleft = toElem(ce.e1, irs);
if (irs.params.cov && ce.e1.loc.linnum)
eleft = el_combine(incUsageElem(irs, ce.e1.loc), eleft);
elem *eright = toElem(ce.e2, irs);
if (irs.params.cov && ce.e2.loc.linnum)
eright = el_combine(incUsageElem(irs, ce.e2.loc), eright);
tym_t ty = eleft.Ety;
if (tybasic(ty) == TYnoreturn)
ty = eright.Ety;
if (ce.e1.type.toBasetype().ty == Tvoid ||
ce.e2.type.toBasetype().ty == Tvoid)
ty = TYvoid;
elem* e;
if (tybasic(eleft.Ety) == TYnoreturn &&
tybasic(eright.Ety) != TYnoreturn)
{
/* ec ? eleft : eright => (ec && eleft),eright
*/
e = el_bin(OPandand, TYvoid, ec, eleft);
e = el_combine(e, eright);
if (tybasic(ty) == TYstruct)
e.ET = Type_toCtype(ce.e2.type);
}
else if (tybasic(eright.Ety) == TYnoreturn)
{
/* ec ? eleft : eright => (ec || eright),eleft
*/
e = el_bin(OPoror, TYvoid, ec, eright);
e = el_combine(e, eleft);
if (tybasic(ty) == TYstruct)
e.ET = Type_toCtype(ce.e1.type);
}
else
{
e = el_bin(OPcond, ty, ec, el_bin(OPcolon, ty, eleft, eright));
if (tybasic(ty) == TYstruct)
e.ET = Type_toCtype(ce.e1.type);
}
elem_setLoc(e, ce.loc);
return e;
}
/***************************************
*/
elem* visitType(TypeExp e)
{
//printf("TypeExp.toElem()\n");
e.error("type `%s` is not an expression", e.toChars());
return el_long(TYint, 0);
}
elem* visitScope(ScopeExp e)
{
e.error("`%s` is not an expression", e.sds.toChars());
return el_long(TYint, 0);
}
elem* visitDotVar(DotVarExp dve)
{
// *(&e + offset)
//printf("[%s] DotVarExp.toElem('%s')\n", dve.loc.toChars(), dve.toChars());
VarDeclaration v = dve.var.isVarDeclaration();
if (!v)
{
dve.error("`%s` is not a field, but a %s", dve.var.toChars(), dve.var.kind());
return el_long(TYint, 0);
}
// https://issues.dlang.org/show_bug.cgi?id=12900
Type txb = dve.type.toBasetype();
Type tyb = v.type.toBasetype();
if (auto tv = txb.isTypeVector()) txb = tv.basetype;
if (auto tv = tyb.isTypeVector()) tyb = tv.basetype;
debug if (txb.ty != tyb.ty)
printf("[%s] dve = %s, dve.type = %s, v.type = %s\n", dve.loc.toChars(), dve.toChars(), dve.type.toChars(), v.type.toChars());
assert(txb.ty == tyb.ty);
// https://issues.dlang.org/show_bug.cgi?id=14730
if (v.offset == 0)
{
FuncDeclaration fd = v.parent.isFuncDeclaration();
if (fd && fd.semanticRun < PASS.obj)
setClosureVarOffset(fd);
}
elem *e = toElem(dve.e1, irs);
Type tb1 = dve.e1.type.toBasetype();
tym_t typ = TYnptr;
if (tb1.ty != Tclass && tb1.ty != Tpointer)
{
e = addressElem(e, tb1);
typ = tybasic(e.Ety);
}
auto offset = el_long(TYsize_t, v.offset);
offset = objc.getOffset(v, tb1, offset);
e = el_bin(OPadd, typ, e, offset);
if (v.storage_class & (STC.out_ | STC.ref_))
e = el_una(OPind, TYnptr, e);
e = el_una(OPind, totym(dve.type), e);
if (auto bf = v.isBitFieldDeclaration())
{
// Insert special bitfield operator
auto mos = el_long(TYuint, bf.fieldWidth * 256 + bf.bitOffset);
e = el_bin(OPbit, e.Ety, e, mos);
}
if (tybasic(e.Ety) == TYstruct)
{
e.ET = Type_toCtype(dve.type);
}
elem_setLoc(e,dve.loc);
return e;
}
elem* visitDelegate(DelegateExp de)
{
int directcall = 0;
//printf("DelegateExp.toElem() '%s'\n", de.toChars());
if (de.func.semanticRun == PASS.semantic3done)
{
// Bug 7745 - only include the function if it belongs to this module
// ie, it is a member of this module, or is a template instance
// (the template declaration could come from any module).
Dsymbol owner = de.func.toParent();
while (!owner.isTemplateInstance() && owner.toParent())
owner = owner.toParent();
if (owner.isTemplateInstance() || owner == irs.m )
{
irs.deferToObj.push(de.func);
}
}
elem *eeq = null;
elem *ethis;
Symbol *sfunc = toSymbol(de.func);
elem *ep;
elem *ethis2 = null;
if (de.vthis2)
{
// avoid using toSymbol directly because vthis2 may be a closure var
Expression ve = new VarExp(de.loc, de.vthis2);
ve.type = de.vthis2.type;
ve = new AddrExp(de.loc, ve);
ve.type = de.vthis2.type.pointerTo();
ethis2 = toElem(ve, irs);
}
if (de.func.isNested() && !de.func.isThis())
{
ep = el_ptr(sfunc);
if (de.e1.op == EXP.null_)
ethis = toElem(de.e1, irs);
else
ethis = getEthis(de.loc, irs, de.func, de.func.toParentLocal());
if (ethis2)
ethis2 = setEthis2(de.loc, irs, de.func, ethis2, ðis, &eeq);
}
else
{
ethis = toElem(de.e1, irs);
if (de.e1.type.ty != Tclass && de.e1.type.ty != Tpointer)
ethis = addressElem(ethis, de.e1.type);
if (ethis2)
ethis2 = setEthis2(de.loc, irs, de.func, ethis2, ðis, &eeq);
if (de.e1.op == EXP.super_ || de.e1.op == EXP.dotType)
directcall = 1;
if (!de.func.isThis())
de.error("delegates are only for non-static functions");
if (!de.func.isVirtual() ||
directcall ||
de.func.isFinalFunc())
{
ep = el_ptr(sfunc);
}
else
{
// Get pointer to function out of virtual table
assert(ethis);
ep = el_same(ðis);
ep = el_una(OPind, TYnptr, ep);
uint vindex = de.func.vtblIndex;
assert(cast(int)vindex >= 0);
// Build *(ep + vindex * 4)
ep = el_bin(OPadd,TYnptr,ep,el_long(TYsize_t, vindex * irs.target.ptrsize));
ep = el_una(OPind,TYnptr,ep);
}
//if (func.tintro)
// func.error(loc, "cannot form delegate due to covariant return type");
}
elem *e;
if (ethis2)
ethis = ethis2;
if (ethis.Eoper == OPcomma)
{
ethis.EV.E2 = el_pair(TYdelegate, ethis.EV.E2, ep);
ethis.Ety = TYdelegate;
e = ethis;
}
else
e = el_pair(TYdelegate, ethis, ep);
elem_setLoc(e, de.loc);
if (eeq)
e = el_combine(eeq, e);
return e;
}
elem* visitDotType(DotTypeExp dte)
{
// Just a pass-thru to e1
//printf("DotTypeExp.toElem() %s\n", dte.toChars());
elem *e = toElem(dte.e1, irs);
elem_setLoc(e, dte.loc);
return e;
}
elem* visitCall(CallExp ce)
{
//printf("[%s] CallExp.toElem('%s') %p, %s\n", ce.loc.toChars(), ce.toChars(), ce, ce.type.toChars());
assert(ce.e1.type);
Type t1 = ce.e1.type.toBasetype();
Type ectype = t1;
elem *eeq = null;
elem *ehidden = irs.ehidden;
irs.ehidden = null;
elem *ec;
FuncDeclaration fd = null;
bool dctor = false;
if (ce.e1.op == EXP.dotVariable && t1.ty != Tdelegate)
{
DotVarExp dve = cast(DotVarExp)ce.e1;
fd = dve.var.isFuncDeclaration();
if (auto sle = dve.e1.isStructLiteralExp())
{
if (fd && fd.isCtorDeclaration() ||
fd.type.isMutable() ||
sle.type.size() <= 8) // more efficient than fPIC
sle.useStaticInit = false; // don't modify initializer, so make copy
}
ec = toElem(dve.e1, irs);
ectype = dve.e1.type.toBasetype();
/* Recognize:
* [1] ce: ((S __ctmp = initializer),__ctmp).ctor(args)
* where the left of the . was turned into [2] or [3] for EH_DWARF:
* [2] ec: (dctor info ((__ctmp = initializer),__ctmp)), __ctmp
* [3] ec: (dctor info ((_flag=0),((__ctmp = initializer),__ctmp))), __ctmp
* The trouble
* https://issues.dlang.org/show_bug.cgi?id=13095
* is if ctor(args) throws, then __ctmp is destructed even though __ctmp
* is not a fully constructed object yet. The solution is to move the ctor(args) itno the dctor tree.
* But first, detect [1], then [2], then split up [2] into:
* eeq: (dctor info ((__ctmp = initializer),__ctmp))
* eeq: (dctor info ((_flag=0),((__ctmp = initializer),__ctmp))) for EH_DWARF
* ec: __ctmp
*/
if (fd && fd.isCtorDeclaration())
{
//printf("test30 %s\n", dve.e1.toChars());
if (dve.e1.op == EXP.comma)
{
//printf("test30a\n");
if ((cast(CommaExp)dve.e1).e1.op == EXP.declaration && (cast(CommaExp)dve.e1).e2.op == EXP.variable)
{ // dve.e1: (declaration , var)
//printf("test30b\n");
if (ec.Eoper == OPcomma &&
ec.EV.E1.Eoper == OPinfo &&
ec.EV.E1.EV.E1.Eoper == OPdctor &&
ec.EV.E1.EV.E2.Eoper == OPcomma)
{ // ec: ((dctor info (* , *)) , *)
//printf("test30c\n");
dctor = true; // remember we detected it
// Split ec into eeq and ec per comment above
eeq = ec.EV.E1; // (dctor info (*, *))
ec.EV.E1 = null;
ec = el_selecte2(ec); // *
}
}
}
}
if (dctor)
{
}
else if (ce.arguments && ce.arguments.length && ec.Eoper != OPvar)
{
if (ec.Eoper == OPind && el_sideeffect(ec.EV.E1))
{
/* Rewrite (*exp)(arguments) as:
* tmp = exp, (*tmp)(arguments)
*/
elem *ec1 = ec.EV.E1;
Symbol *stmp = symbol_genauto(type_fake(ec1.Ety));
eeq = el_bin(OPeq, ec.Ety, el_var(stmp), ec1);
ec.EV.E1 = el_var(stmp);
}
else if (tybasic(ec.Ety) != TYnptr)
{
/* Rewrite (exp)(arguments) as:
* tmp=&exp, (*tmp)(arguments)
*/
ec = addressElem(ec, ectype);
Symbol *stmp = symbol_genauto(type_fake(ec.Ety));
eeq = el_bin(OPeq, ec.Ety, el_var(stmp), ec);
ec = el_una(OPind, totym(ectype), el_var(stmp));
}
}
}
else if (ce.e1.op == EXP.variable)
{
fd = (cast(VarExp)ce.e1).var.isFuncDeclaration();
version (none)
{
// This optimization is not valid if alloca can be called
// multiple times within the same function, eg in a loop
// see issue 3822
if (fd && fd.ident == Id.__alloca &&
!fd.fbody && fd._linkage == LINK.c &&
arguments && arguments.length == 1)
{ Expression arg = (*arguments)[0];
arg = arg.optimize(WANTvalue);
if (arg.isConst() && arg.type.isintegral())
{ dinteger_t sz = arg.toInteger();
if (sz > 0 && sz < 0x40000)
{
// It's an alloca(sz) of a fixed amount.
// Replace with an array allocated on the stack
// of the same size: char[sz] tmp;
assert(!ehidden);
.type *t = type_static_array(sz, tschar); // BUG: fix extra Tcount++
Symbol *stmp = symbol_genauto(t);
ec = el_ptr(stmp);
elem_setLoc(ec,loc);
return ec;
}
}
}
}
ec = toElem(ce.e1, irs);
}
else
{
ec = toElem(ce.e1, irs);
if (ce.arguments && ce.arguments.length)
{
/* The idea is to enforce expressions being evaluated left to right,
* even though call trees are evaluated parameters first.
* We just do a quick hack to catch the more obvious cases, though
* we need to solve this generally.
*/
if (ec.Eoper == OPind && el_sideeffect(ec.EV.E1))
{
/* Rewrite (*exp)(arguments) as:
* tmp=exp, (*tmp)(arguments)
*/
elem *ec1 = ec.EV.E1;
Symbol *stmp = symbol_genauto(type_fake(ec1.Ety));
eeq = el_bin(OPeq, ec.Ety, el_var(stmp), ec1);
ec.EV.E1 = el_var(stmp);
}
else if (tybasic(ec.Ety) == TYdelegate && el_sideeffect(ec))
{
/* Rewrite (exp)(arguments) as:
* tmp=exp, (tmp)(arguments)
*/
Symbol *stmp = symbol_genauto(type_fake(ec.Ety));
eeq = el_bin(OPeq, ec.Ety, el_var(stmp), ec);
ec = el_var(stmp);
}
}
}
elem *ethis2 = null;
if (ce.vthis2)
{
// avoid using toSymbol directly because vthis2 may be a closure var
Expression ve = new VarExp(ce.loc, ce.vthis2);
ve.type = ce.vthis2.type;
ve = new AddrExp(ce.loc, ve);
ve.type = ce.vthis2.type.pointerTo();
ethis2 = toElem(ve, irs);
}
elem *ecall = callfunc(ce.loc, irs, ce.directcall, ce.type, ec, ectype, fd, t1, ehidden, ce.arguments, null, ethis2);
if (dctor && ecall.Eoper == OPind)
{
/* Continuation of fix outlined above for moving constructor call into dctor tree.
* Given:
* eeq: (dctor info ((__ctmp = initializer),__ctmp))
* eeq: (dctor info ((_flag=0),((__ctmp = initializer),__ctmp))) for EH_DWARF
* ecall: * call(ce, args)
* Rewrite ecall as:
* * (dctor info ((__ctmp = initializer),call(ce, args)))
* * (dctor info ((_flag=0),(__ctmp = initializer),call(ce, args)))
*/
elem *ea = ecall.EV.E1; // ea: call(ce,args)
tym_t ty = ea.Ety;
ecall.EV.E1 = eeq;
assert(eeq.Eoper == OPinfo);
elem *eeqcomma = eeq.EV.E2;
assert(eeqcomma.Eoper == OPcomma);
while (eeqcomma.EV.E2.Eoper == OPcomma)
{
eeqcomma.Ety = ty;
eeqcomma = eeqcomma.EV.E2;
}
eeq.Ety = ty;
el_free(eeqcomma.EV.E2);
eeqcomma.EV.E2 = ea; // replace ,__ctmp with ,call(ce,args)
eeqcomma.Ety = ty;
eeq = null;
}
elem_setLoc(ecall, ce.loc);
if (eeq)
ecall = el_combine(eeq, ecall);
return ecall;
}
elem* visitAddr(AddrExp ae)
{
//printf("AddrExp.toElem('%s')\n", ae.toChars());
if (auto sle = ae.e1.isStructLiteralExp())
{
//printf("AddrExp.toElem('%s') %d\n", ae.toChars(), ae);
//printf("StructLiteralExp(%p); origin:%p\n", sle, sle.origin);
//printf("sle.toSymbol() (%p)\n", sle.toSymbol());
if (irs.Cfile)
{
Symbol* stmp = symbol_genauto(Type_toCtype(sle.sd.type));
elem* es = toElemStructLit(sle, irs, EXP.construct, stmp, true);
elem* e = addressElem(el_var(stmp), ae.e1.type);
e.Ety = totym(ae.type);
e = el_bin(OPcomma, e.Ety, es, e);
elem_setLoc(e, ae.loc);
return e;
}
elem *e = el_ptr(toSymbol(sle.origin));
e.ET = Type_toCtype(ae.type);
elem_setLoc(e, ae.loc);
return e;
}
else
{
elem *e = toElem(ae.e1, irs);
e = addressElem(e, ae.e1.type);
e.Ety = totym(ae.type);
elem_setLoc(e, ae.loc);
return e;
}
}
elem* visitPtr(PtrExp pe)
{
//printf("PtrExp.toElem() %s\n", pe.toChars());
elem *e = toElem(pe.e1, irs);
if (tybasic(e.Ety) == TYnptr &&
pe.e1.type.nextOf() &&
pe.e1.type.nextOf().isImmutable())
{
e.Ety = TYimmutPtr; // pointer to immutable
}
e = el_una(OPind,totym(pe.type),e);
if (tybasic(e.Ety) == TYstruct)
{
e.ET = Type_toCtype(pe.type);
}
elem_setLoc(e, pe.loc);
return e;
}
elem* visitDelete(DeleteExp de)
{
Type tb;
//printf("DeleteExp.toElem()\n");
if (de.e1.op == EXP.index)
{
IndexExp ae = cast(IndexExp)de.e1;
tb = ae.e1.type.toBasetype();
assert(tb.ty != Taarray);
}
//e1.type.print();
elem *e = toElem(de.e1, irs);
tb = de.e1.type.toBasetype();
RTLSYM rtl;
switch (tb.ty)
{
case Tclass:
if (de.e1.op == EXP.variable)
{
VarExp ve = cast(VarExp)de.e1;
if (ve.var.isVarDeclaration() &&
ve.var.isVarDeclaration().onstack)
{
rtl = RTLSYM.CALLFINALIZER;
if (tb.isClassHandle().isInterfaceDeclaration())
rtl = RTLSYM.CALLINTERFACEFINALIZER;
break;
}
}
goto default;
default:
assert(0);
}
e = el_bin(OPcall, TYvoid, el_var(getRtlsym(rtl)), e);
toTraceGC(irs, e, de.loc);
elem_setLoc(e, de.loc);
return e;
}
elem* visitVector(VectorExp ve)
{
version (none)
{
printf("VectorExp.toElem()\n");
printAST(ve);
printf("\tfrom: %s\n", ve.e1.type.toChars());
printf("\tto : %s\n", ve.to.toChars());
}
elem* e;
if (ve.e1.op == EXP.arrayLiteral)
{
e = el_calloc();
e.Eoper = OPconst;
e.Ety = totym(ve.type);
foreach (const i; 0 .. ve.dim)
{
Expression elem = ve.e1.isArrayLiteralExp()[i];
const complex = elem.toComplex();
const integer = elem.toInteger();
switch (elem.type.toBasetype().ty)
{
case Tfloat32:
// Must not call toReal directly, to avoid dmd bug 14203 from breaking dmd
e.EV.Vfloat8[i] = cast(float) complex.re;
break;
case Tfloat64:
// Must not call toReal directly, to avoid dmd bug 14203 from breaking dmd
e.EV.Vdouble4[i] = cast(double) complex.re;
break;
case Tint64:
case Tuns64:
e.EV.Vullong4[i] = integer;
break;
case Tint32:
case Tuns32:
e.EV.Vulong8[i] = cast(uint)integer;
break;
case Tint16:
case Tuns16:
e.EV.Vushort16[i] = cast(ushort)integer;
break;
case Tint8:
case Tuns8:
e.EV.Vuchar32[i] = cast(ubyte)integer;
break;
default:
assert(0);
}
}
}
else if (ve.type.size() == ve.e1.type.size())
{
e = toElem(ve.e1, irs);
e.Ety = totym(ve.type); // paint vector type on it
}
else
{
// Create vecfill(e1)
elem* e1 = toElem(ve.e1, irs);
e = el_una(OPvecfill, totym(ve.type), e1);
}
elem_setLoc(e, ve.loc);
return e;
}
elem* visitVectorArray(VectorArrayExp vae)
{
elem* result;
// Generate code for `vec.array`
if (auto ve = vae.e1.isVectorExp())
{
// https://issues.dlang.org/show_bug.cgi?id=19607
// When viewing a vector literal as an array, build the underlying array directly.
if (ve.e1.op == EXP.arrayLiteral)
result = toElem(ve.e1, irs);
else
{
// Generate: stmp[0 .. dim] = e1
type* tarray = Type_toCtype(vae.type);
Symbol* stmp = symbol_genauto(tarray);
result = setArray(ve.e1, el_ptr(stmp), el_long(TYsize_t, tarray.Tdim),
ve.e1.type, toElem(ve.e1, irs), irs, EXP.blit);
result = el_combine(result, el_var(stmp));
result.ET = tarray;
}
}
else
{
// For other vector expressions this just a paint operation.
elem* e = toElem(vae.e1, irs);
type* tarray = Type_toCtype(vae.type);
// Take the address then repaint,
// this makes it swap to the right registers
e = addressElem(e, vae.e1.type);
e = el_una(OPind, tarray.Tty, e);
e.ET = tarray;
result = e;
}
result.Ety = totym(vae.type);
elem_setLoc(result, vae.loc);
return result;
}
elem* visitCast(CastExp ce)
{
version (none)
{
printf("CastExp.toElem()\n");
ce.print();
printf("\tfrom: %s\n", ce.e1.type.toChars());
printf("\tto : %s\n", ce.to.toChars());
}
elem *e = toElem(ce.e1, irs);
return toElemCast(ce, e, false);
}
elem* visitArrayLength(ArrayLengthExp ale)
{
elem *e = toElem(ale.e1, irs);
e = el_una(target.is64bit ? OP128_64 : OP64_32, totym(ale.type), e);
elem_setLoc(e, ale.loc);
return e;
}
elem* visitDelegatePtr(DelegatePtrExp dpe)
{
// *cast(void**)(&dg)
elem *e = toElem(dpe.e1, irs);
Type tb1 = dpe.e1.type.toBasetype();
e = addressElem(e, tb1);
e = el_una(OPind, totym(dpe.type), e);
elem_setLoc(e, dpe.loc);
return e;
}
elem* visitDelegateFuncptr(DelegateFuncptrExp dfpe)
{
// *cast(void**)(&dg + size_t.sizeof)
elem *e = toElem(dfpe.e1, irs);
Type tb1 = dfpe.e1.type.toBasetype();
e = addressElem(e, tb1);
e = el_bin(OPadd, TYnptr, e, el_long(TYsize_t, target.is64bit ? 8 : 4));
e = el_una(OPind, totym(dfpe.type), e);
elem_setLoc(e, dfpe.loc);
return e;
}
elem* visitSlice(SliceExp se)
{
//printf("SliceExp.toElem() se = %s %s\n", se.type.toChars(), se.toChars());
Type tb = se.type.toBasetype();
assert(tb.ty == Tarray || tb.ty == Tsarray);
Type t1 = se.e1.type.toBasetype();
elem *e = toElem(se.e1, irs);
if (se.lwr)
{
uint sz = cast(uint)t1.nextOf().size();
elem *einit = resolveLengthVar(se.lengthVar, &e, t1);
if (t1.ty == Tsarray)
e = array_toPtr(se.e1.type, e);
if (!einit)
{
einit = e;
e = el_same(&einit);
}
// e is a temporary, typed:
// TYdarray if t.ty == Tarray
// TYptr if t.ty == Tsarray or Tpointer
elem *elwr = toElem(se.lwr, irs);
elem *eupr = toElem(se.upr, irs);
elem *elwr2 = el_sideeffect(eupr) ? el_copytotmp(&elwr) : el_same(&elwr);
elem *eupr2 = eupr;
//printf("upperIsInBounds = %d lowerIsLessThanUpper = %d\n", se.upperIsInBounds, se.lowerIsLessThanUpper);
if (irs.arrayBoundsCheck())
{
// Checks (unsigned compares):
// upr <= array.length
// lwr <= upr
elem *c1 = null;
elem *elen;
if (!se.upperIsInBounds)
{
eupr2 = el_same(&eupr);
eupr2.Ety = TYsize_t; // make sure unsigned comparison
if (auto tsa = t1.isTypeSArray())
{
elen = el_long(TYsize_t, tsa.dim.toInteger());
}
else if (t1.ty == Tarray)
{
if (se.lengthVar && !(se.lengthVar.storage_class & STC.const_))
elen = el_var(toSymbol(se.lengthVar));
else
{
elen = e;
e = el_same(&elen);
elen = el_una(target.is64bit ? OP128_64 : OP64_32, TYsize_t, elen);
}
}
c1 = el_bin(OPle, TYint, eupr, elen);
if (!se.lowerIsLessThanUpper)
{
c1 = el_bin(OPandand, TYint,
c1, el_bin(OPle, TYint, elwr2, eupr2));
elwr2 = el_copytree(elwr2);
eupr2 = el_copytree(eupr2);
}
}
else if (!se.lowerIsLessThanUpper)
{
eupr2 = el_same(&eupr);
eupr2.Ety = TYsize_t; // make sure unsigned comparison
c1 = el_bin(OPle, TYint, elwr2, eupr);
elwr2 = el_copytree(elwr2);
}
if (c1)
{
// Construct: (c1 || arrayBoundsError)
// if lowerIsLessThanUpper (e.g. arr[-1..0]), elen is null here
elen = elen ? elen : el_long(TYsize_t, 0);
auto ea = buildArraySliceError(irs, se.loc, el_copytree(elwr2), el_copytree(eupr2), el_copytree(elen));
elem *eb = el_bin(OPoror, TYvoid, c1, ea);
elwr = el_combine(elwr, eb);
}
}
if (t1.ty != Tsarray)
e = array_toPtr(se.e1.type, e);
// Create an array reference where:
// length is (upr - lwr)
// pointer is (ptr + lwr*sz)
// Combine as (length pair ptr)
elem *eofs = el_bin(OPmul, TYsize_t, elwr2, el_long(TYsize_t, sz));
elem *eptr = el_bin(OPadd, TYnptr, e, eofs);
if (tb.ty == Tarray)
{
elem *elen = el_bin(OPmin, TYsize_t, eupr2, el_copytree(elwr2));
e = el_pair(TYdarray, elen, eptr);
}
else
{
assert(tb.ty == Tsarray);
e = el_una(OPind, totym(se.type), eptr);
if (tybasic(e.Ety) == TYstruct)
e.ET = Type_toCtype(se.type);
}
e = el_combine(elwr, e);
e = el_combine(einit, e);
//elem_print(e);
}
else if (t1.ty == Tsarray && tb.ty == Tarray)
{
e = sarray_toDarray(se.loc, t1, null, e);
}
else
{
assert(t1.ty == tb.ty); // Tarray or Tsarray
// https://issues.dlang.org/show_bug.cgi?id=14672
// If se is in left side operand of element-wise
// assignment, the element type can be painted to the base class.
int offset;
assert(t1.nextOf().equivalent(tb.nextOf()) ||
tb.nextOf().isBaseOf(t1.nextOf(), &offset) && offset == 0);
}
elem_setLoc(e, se.loc);
return e;
}
elem* visitIndex(IndexExp ie)
{
elem *e;
elem *n1 = toElem(ie.e1, irs);
elem *eb = null;
//printf("IndexExp.toElem() %s\n", ie.toChars());
Type t1 = ie.e1.type.toBasetype();
if (auto taa = t1.isTypeAArray())
{
// set to:
// *aaGetY(aa, aati, valuesize, &key);
// or
// *aaGetRvalueX(aa, keyti, valuesize, &key);
uint vsize = cast(uint)taa.next.size();
// n2 becomes the index, also known as the key
elem *n2 = toElem(ie.e2, irs);
/* Turn n2 into a pointer to the index. If it's an lvalue,
* take the address of it. If not, copy it to a temp and
* take the address of that.
*/
n2 = addressElem(n2, taa.index);
elem *valuesize = el_long(TYsize_t, vsize);
//printf("valuesize: "); elem_print(valuesize);
Symbol *s;
elem *ti;
if (ie.modifiable)
{
n1 = el_una(OPaddr, TYnptr, n1);
s = aaGetSymbol(taa, "GetY", 1);
ti = getTypeInfo(ie.e1, taa.unSharedOf().mutableOf(), irs);
}
else
{
s = aaGetSymbol(taa, "GetRvalueX", 1);
ti = getTypeInfo(ie.e1, taa.index, irs);
}
//printf("taa.index = %s\n", taa.index.toChars());
//printf("ti:\n"); elem_print(ti);
elem *ep = el_params(n2, valuesize, ti, n1, null);
e = el_bin(OPcall, TYnptr, el_var(s), ep);
if (irs.arrayBoundsCheck())
{
elem *n = el_same(&e);
// Construct: ((e || arrayBoundsError), n)
auto ea = buildRangeError(irs, ie.loc);
e = el_bin(OPoror,TYvoid,e,ea);
e = el_bin(OPcomma, TYnptr, e, n);
}
e = el_una(OPind, totym(ie.type), e);
if (tybasic(e.Ety) == TYstruct)
e.ET = Type_toCtype(ie.type);
}
else
{
elem *einit = resolveLengthVar(ie.lengthVar, &n1, t1);
elem *n2 = toElem(ie.e2, irs);
if (irs.arrayBoundsCheck() && !ie.indexIsInBounds)
{
elem *elength;
if (auto tsa = t1.isTypeSArray())
{
const length = tsa.dim.toInteger();
elength = el_long(TYsize_t, length);
goto L1;
}
else if (t1.ty == Tarray)
{
elength = n1;
n1 = el_same(&elength);
elength = el_una(target.is64bit ? OP128_64 : OP64_32, TYsize_t, elength);
L1:
elem *n2x = n2;
n2 = el_same(&n2x);
n2x = el_bin(OPlt, TYint, n2x, elength);
// Construct: (n2x || arrayBoundsError)
auto ea = buildArrayIndexError(irs, ie.loc, el_copytree(n2), el_copytree(elength));
eb = el_bin(OPoror,TYvoid,n2x,ea);
}
}
n1 = array_toPtr(t1, n1);
{
elem *escale = el_long(TYsize_t, t1.nextOf().size());
n2 = el_bin(OPmul, TYsize_t, n2, escale);
e = el_bin(OPadd, TYnptr, n1, n2);
e = el_una(OPind, totym(ie.type), e);
if (tybasic(e.Ety) == TYstruct || tybasic(e.Ety) == TYarray)
{
e.Ety = TYstruct;
e.ET = Type_toCtype(ie.type);
}
}
eb = el_combine(einit, eb);
e = el_combine(eb, e);
}
elem_setLoc(e, ie.loc);
return e;
}
elem* visitTuple(TupleExp te)
{
//printf("TupleExp.toElem() %s\n", te.toChars());
elem *e = null;
if (te.e0)
e = toElem(te.e0, irs);
foreach (el; *te.exps)
{
elem *ep = toElem(el, irs);
e = el_combine(e, ep);
}
return e;
}
static elem *tree_insert(Elems *args, size_t low, size_t high)
{
assert(low < high);
if (low + 1 == high)
return (*args)[low];
int mid = cast(int)((low + high) >> 1);
return el_param(tree_insert(args, low, mid),
tree_insert(args, mid, high));
}
elem* visitArrayLiteral(ArrayLiteralExp ale)
{
size_t dim = ale.elements ? ale.elements.length : 0;
//printf("ArrayLiteralExp.toElem() %s, type = %s\n", ale.toChars(), ale.type.toChars());
Type tb = ale.type.toBasetype();
if (tb.ty == Tsarray && tb.nextOf().toBasetype().ty == Tvoid)
{
// Convert void[n] to ubyte[n]
tb = Type.tuns8.sarrayOf((cast(TypeSArray)tb).dim.toUInteger());
}
elem *e;
if (dim > 0)
{
if (ale.onstack || tb.ty == Tsarray ||
irs.Cfile && tb.ty == Tpointer)
{
Symbol *stmp = null;
e = ExpressionsToStaticArray(irs, ale.loc, ale.elements, &stmp, 0, ale.basis);
e = el_combine(e, el_ptr(stmp));
}
else
{
/* Instead of passing the initializers on the stack, allocate the
* array and assign the members inline.
* Avoids the whole variadic arg mess.
*/
// call _d_arrayliteralTX(ti, dim)
e = el_bin(OPcall, TYnptr,
el_var(getRtlsym(RTLSYM.ARRAYLITERALTX)),
el_param(el_long(TYsize_t, dim), getTypeInfo(ale, ale.type, irs)));
toTraceGC(irs, e, ale.loc);
Symbol *stmp = symbol_genauto(Type_toCtype(Type.tvoid.pointerTo()));
e = el_bin(OPeq, TYnptr, el_var(stmp), e);
e = el_combine(e, ExpressionsToStaticArray(irs, ale.loc, ale.elements, &stmp, 0, ale.basis));
e = el_combine(e, el_var(stmp));
}
}
else
{
e = el_long(TYsize_t, 0);
}
if (tb.ty == Tarray)
{
e = el_pair(TYdarray, el_long(TYsize_t, dim), e);
}
else if (tb.ty == Tpointer)
{
}
else
{
e = el_una(OPind, TYstruct, e);
e.ET = Type_toCtype(ale.type);
}
elem_setLoc(e, ale.loc);
return e;
}
elem* visitAssocArrayLiteral(AssocArrayLiteralExp aale)
{
//printf("AssocArrayLiteralExp.toElem() %s\n", aale.toChars());
Type t = aale.type.toBasetype().mutableOf();
size_t dim = aale.keys.length;
if (dim)
{
// call _d_assocarrayliteralTX(TypeInfo_AssociativeArray ti, void[] keys, void[] values)
// Prefer this to avoid the varargs fiasco in 64 bit code
assert(t.ty == Taarray);
Type ta = t;
Symbol *skeys = null;
elem *ekeys = ExpressionsToStaticArray(irs, aale.loc, aale.keys, &skeys);
Symbol *svalues = null;
elem *evalues = ExpressionsToStaticArray(irs, aale.loc, aale.values, &svalues);
elem *ev = el_pair(TYdarray, el_long(TYsize_t, dim), el_ptr(svalues));
elem *ek = el_pair(TYdarray, el_long(TYsize_t, dim), el_ptr(skeys ));
if (irs.target.os == Target.OS.Windows && irs.target.is64bit)
{
ev = addressElem(ev, Type.tvoid.arrayOf());
ek = addressElem(ek, Type.tvoid.arrayOf());
}
elem *e = el_params(ev, ek,
getTypeInfo(aale, ta, irs),
null);
// call _d_assocarrayliteralTX(ti, keys, values)
e = el_bin(OPcall,TYnptr,el_var(getRtlsym(RTLSYM.ASSOCARRAYLITERALTX)),e);
toTraceGC(irs, e, aale.loc);
if (t != ta)
e = addressElem(e, ta);
elem_setLoc(e, aale.loc);
e = el_combine(evalues, e);
e = el_combine(ekeys, e);
return e;
}
else
{
elem *e = el_long(TYnptr, 0); // empty associative array is the null pointer
if (t.ty != Taarray)
e = addressElem(e, Type.tvoidptr);
return e;
}
}
elem* visitStructLiteral(StructLiteralExp sle)
{
//printf("[%s] StructLiteralExp.toElem() %s\n", sle.loc.toChars(), sle.toChars());
return toElemStructLit(sle, irs, EXP.construct, sle.sym, true);
}
elem* visitObjcClassReference(ObjcClassReferenceExp e)
{
return objc.toElem(e);
}
/*****************************************************/
/* CTFE stuff */
/*****************************************************/
elem* visitClassReference(ClassReferenceExp e)
{
//printf("ClassReferenceExp.toElem() %p, value=%p, %s\n", e, e.value, e.toChars());
return el_ptr(toSymbol(e));
}
switch (e.op)
{
default: return visit(e);
case EXP.negate: return visitNeg(e.isNegExp());
case EXP.tilde: return visitCom(e.isComExp());
case EXP.not: return visitNot(e.isNotExp());
case EXP.plusPlus:
case EXP.minusMinus: return visitPost(e.isPostExp());
case EXP.add: return visitAdd(e.isAddExp());
case EXP.min: return visitMin(e.isMinExp());
case EXP.concatenate: return visitCat(e.isCatExp());
case EXP.mul: return visitMul(e.isMulExp());
case EXP.div: return visitDiv(e.isDivExp());
case EXP.mod: return visitMod(e.isModExp());
case EXP.lessThan:
case EXP.lessOrEqual:
case EXP.greaterThan:
case EXP.greaterOrEqual: return visitCmp(cast(CmpExp) e);
case EXP.notEqual:
case EXP.equal: return visitEqual(e.isEqualExp());
case EXP.notIdentity:
case EXP.identity: return visitIdentity(e.isIdentityExp());
case EXP.in_: return visitIn(e.isInExp());
case EXP.assign: return visitAssign(e.isAssignExp());
case EXP.construct: return visitAssign(e.isConstructExp());
case EXP.blit: return visitAssign(e.isBlitExp());
case EXP.addAssign: return visitAddAssign(e.isAddAssignExp());
case EXP.minAssign: return visitMinAssign(e.isMinAssignExp());
case EXP.concatenateDcharAssign: return visitCatAssign(e.isCatDcharAssignExp());
case EXP.concatenateElemAssign: return visitCatAssign(e.isCatElemAssignExp());
case EXP.concatenateAssign: return visitCatAssign(e.isCatAssignExp());
case EXP.divAssign: return visitDivAssign(e.isDivAssignExp());
case EXP.modAssign: return visitModAssign(e.isModAssignExp());
case EXP.mulAssign: return visitMulAssign(e.isMulAssignExp());
case EXP.leftShiftAssign: return visitShlAssign(e.isShlAssignExp());
case EXP.rightShiftAssign: return visitShrAssign(e.isShrAssignExp());
case EXP.unsignedRightShiftAssign: return visitUshrAssign(e.isUshrAssignExp());
case EXP.andAssign: return visitAndAssign(e.isAndAssignExp());
case EXP.orAssign: return visitOrAssign(e.isOrAssignExp());
case EXP.xorAssign: return visitXorAssign(e.isXorAssignExp());
case EXP.andAnd:
case EXP.orOr: return visitLogical(e.isLogicalExp());
case EXP.xor: return visitXor(e.isXorExp());
case EXP.and: return visitAnd(e.isAndExp());
case EXP.or: return visitOr(e.isOrExp());
case EXP.leftShift: return visitShl(e.isShlExp());
case EXP.rightShift: return visitShr(e.isShrExp());
case EXP.unsignedRightShift: return visitUshr(e.isUshrExp());
case EXP.address: return visitAddr(e.isAddrExp());
case EXP.variable: return visitSymbol(e.isVarExp());
case EXP.symbolOffset: return visitSymbol(e.isSymOffExp());
case EXP.int64: return visitInteger(e.isIntegerExp());
case EXP.float64: return visitReal(e.isRealExp());
case EXP.complex80: return visitComplex(e.isComplexExp());
case EXP.this_: return visitThis(e.isThisExp());
case EXP.super_: return visitThis(e.isSuperExp());
case EXP.null_: return visitNull(e.isNullExp());
case EXP.string_: return visitString(e.isStringExp());
case EXP.arrayLiteral: return visitArrayLiteral(e.isArrayLiteralExp());
case EXP.assocArrayLiteral: return visitAssocArrayLiteral(e.isAssocArrayLiteralExp());
case EXP.structLiteral: return visitStructLiteral(e.isStructLiteralExp());
case EXP.type: return visitType(e.isTypeExp());
case EXP.scope_: return visitScope(e.isScopeExp());
case EXP.new_: return visitNew(e.isNewExp());
case EXP.tuple: return visitTuple(e.isTupleExp());
case EXP.function_: return visitFunc(e.isFuncExp());
case EXP.declaration: return visitDeclaration(e.isDeclarationExp());
case EXP.typeid_: return visitTypeid(e.isTypeidExp());
case EXP.halt: return visitHalt(e.isHaltExp());
case EXP.comma: return visitComma(e.isCommaExp());
case EXP.assert_: return visitAssert(e.isAssertExp());
case EXP.throw_: return visitThrow(e.isThrowExp());
case EXP.dotVariable: return visitDotVar(e.isDotVarExp());
case EXP.delegate_: return visitDelegate(e.isDelegateExp());
case EXP.dotType: return visitDotType(e.isDotTypeExp());
case EXP.call: return visitCall(e.isCallExp());
case EXP.star: return visitPtr(e.isPtrExp());
case EXP.delete_: return visitDelete(e.isDeleteExp());
case EXP.cast_: return visitCast(e.isCastExp());
case EXP.vector: return visitVector(e.isVectorExp());
case EXP.vectorArray: return visitVectorArray(e.isVectorArrayExp());
case EXP.slice: return visitSlice(e.isSliceExp());
case EXP.arrayLength: return visitArrayLength(e.isArrayLengthExp());
case EXP.delegatePointer: return visitDelegatePtr(e.isDelegatePtrExp());
case EXP.delegateFunctionPointer: return visitDelegateFuncptr(e.isDelegateFuncptrExp());
case EXP.index: return visitIndex(e.isIndexExp());
case EXP.remove: return visitRemove(e.isRemoveExp());
case EXP.question: return visitCond(e.isCondExp());
case EXP.objcClassReference: return visitObjcClassReference(e.isObjcClassReferenceExp());
case EXP.classReference: return visitClassReference(e.isClassReferenceExp());
}
}
private:
/**************************************
* Mirrors logic in Dsymbol_canThrow().
*/
elem *Dsymbol_toElem(Dsymbol s, IRState* irs)
{
elem *e = null;
void symbolDg(Dsymbol s)
{
e = el_combine(e, Dsymbol_toElem(s, irs));
}
//printf("Dsymbol_toElem() %s\n", s.toChars());
if (auto vd = s.isVarDeclaration())
{
s = s.toAlias();
if (s != vd)
return Dsymbol_toElem(s, irs);
if (vd.storage_class & STC.manifest)
return null;
else if (vd.isStatic() || vd.storage_class & (STC.extern_ | STC.tls | STC.gshared))
toObjFile(vd, false);
else
{
Symbol *sp = toSymbol(s);
symbol_add(sp);
//printf("\tadding symbol '%s'\n", sp.Sident);
if (vd._init)
{
if (auto ie = vd._init.isExpInitializer())
e = toElem(ie.exp, irs);
}
/* Mark the point of construction of a variable that needs to be destructed.
*/
if (vd.needsScopeDtor())
{
elem *edtor = toElem(vd.edtor, irs);
elem *ed = null;
if (irs.isNothrow())
{
ed = edtor;
}
else
{
// Construct special elems to deal with exceptions
e = el_ctor_dtor(e, edtor, &ed);
}
// ed needs to be inserted into the code later
irs.varsInScope.push(ed);
}
}
}
else if (auto cd = s.isClassDeclaration())
{
irs.deferToObj.push(s);
}
else if (auto sd = s.isStructDeclaration())
{
irs.deferToObj.push(sd);
}
else if (auto fd = s.isFuncDeclaration())
{
//printf("function %s\n", fd.toChars());
irs.deferToObj.push(fd);
}
else if (auto ad = s.isAttribDeclaration())
{
ad.include(null).foreachDsymbol(&symbolDg);
}
else if (auto tm = s.isTemplateMixin())
{
//printf("%s\n", tm.toChars());
tm.members.foreachDsymbol(&symbolDg);
}
else if (auto td = s.isTupleDeclaration())
{
td.foreachVar(&symbolDg);
}
else if (auto ed = s.isEnumDeclaration())
{
irs.deferToObj.push(ed);
}
else if (auto ti = s.isTemplateInstance())
{
irs.deferToObj.push(ti);
}
return e;
}
/*************************************************
* Allocate a static array, and initialize its members with elems[].
* Return the initialization expression, and the symbol for the static array in *psym.
*/
elem *ElemsToStaticArray(const ref Loc loc, Type telem, Elems *elems, Symbol **psym)
{
// Create a static array of type telem[dim]
const dim = elems.length;
assert(dim);
Type tsarray = telem.sarrayOf(dim);
const szelem = telem.size();
.type *te = Type_toCtype(telem); // stmp[] element type
Symbol *stmp = symbol_genauto(Type_toCtype(tsarray));
*psym = stmp;
elem *e = null;
foreach (i, ep; *elems)
{
/* Generate: *(&stmp + i * szelem) = element[i]
*/
elem *ev = el_ptr(stmp);
ev = el_bin(OPadd, TYnptr, ev, el_long(TYsize_t, i * szelem));
ev = el_una(OPind, te.Tty, ev);
elem *eeq = elAssign(ev, ep, null, te);
e = el_combine(e, eeq);
}
return e;
}
/*************************************************
* Allocate a static array, and initialize its members with
* exps[].
* Return the initialization expression, and the symbol for the static array in *psym.
*/
elem *ExpressionsToStaticArray(IRState* irs, const ref Loc loc, Expressions *exps, Symbol **psym, size_t offset = 0, Expression basis = null)
{
// Create a static array of type telem[dim]
const dim = exps.length;
assert(dim);
Type telem = ((*exps)[0] ? (*exps)[0] : basis).type;
const szelem = telem.size();
.type *te = Type_toCtype(telem); // stmp[] element type
if (!*psym)
{
Type tsarray2 = telem.sarrayOf(dim);
*psym = symbol_genauto(Type_toCtype(tsarray2));
offset = 0;
}
Symbol *stmp = *psym;
elem *e = null;
for (size_t i = 0; i < dim; )
{
Expression el = (*exps)[i];
if (!el)
el = basis;
if (el.op == EXP.arrayLiteral &&
el.type.toBasetype().ty == Tsarray)
{
ArrayLiteralExp ale = cast(ArrayLiteralExp)el;
if (ale.elements && ale.elements.length)
{
elem *ex = ExpressionsToStaticArray(irs,
ale.loc, ale.elements, &stmp, cast(uint)(offset + i * szelem), ale.basis);
e = el_combine(e, ex);
}
i++;
continue;
}
size_t j = i + 1;
if (el.isConst() || el.op == EXP.null_)
{
// If the trivial elements are same values, do memcpy.
while (j < dim)
{
Expression en = (*exps)[j];
if (!en)
en = basis;
if (!el.isIdentical(en))
break;
j++;
}
}
/* Generate: *(&stmp + i * szelem) = element[i]
*/
elem *ep = toElem(el, irs);
elem *ev = tybasic(stmp.Stype.Tty) == TYnptr ? el_var(stmp) : el_ptr(stmp);
ev = el_bin(OPadd, TYnptr, ev, el_long(TYsize_t, offset + i * szelem));
elem *eeq;
if (j == i + 1)
{
ev = el_una(OPind, te.Tty, ev);
eeq = elAssign(ev, ep, null, te);
}
else
{
elem *edim = el_long(TYsize_t, j - i);
eeq = setArray(el, ev, edim, telem, ep, irs, EXP.blit);
}
e = el_combine(e, eeq);
i = j;
}
return e;
}
/***************************************************
*/
elem *toElemCast(CastExp ce, elem *e, bool isLvalue)
{
tym_t ftym;
tym_t ttym;
OPER eop;
Type tfrom = ce.e1.type.toBasetype();
Type t = ce.to.toBasetype(); // skip over typedef's
TY fty;
TY tty;
if (t.equals(tfrom) ||
t.equals(Type.tvoid)) // https://issues.dlang.org/show_bug.cgi?id=18573
// Remember to pop value left on FPU stack
return e;
fty = tfrom.ty;
tty = t.ty;
//printf("fty = %d\n", fty);
static elem* Lret(CastExp ce, elem* e)
{
// Adjust for any type paints
Type t = ce.type.toBasetype();
e.Ety = totym(t);
if (tyaggregate(e.Ety))
e.ET = Type_toCtype(t);
elem_setLoc(e, ce.loc);
return e;
}
static elem* Lpaint(CastExp ce, elem* e, tym_t ttym)
{
e.Ety = ttym;
return Lret(ce, e);
}
static elem* Lzero(CastExp ce, elem* e, tym_t ttym)
{
e = el_bin(OPcomma, ttym, e, el_long(ttym, 0));
return Lret(ce, e);
}
static elem* Leop(CastExp ce, elem* e, OPER eop, tym_t ttym)
{
e = el_una(eop, ttym, e);
return Lret(ce, e);
}
if (tty == Tpointer && fty == Tarray)
{
if (e.Eoper == OPvar)
{
// e1 . *(&e1 + 4)
e = el_una(OPaddr, TYnptr, e);
e = el_bin(OPadd, TYnptr, e, el_long(TYsize_t, tysize(TYnptr)));
e = el_una(OPind,totym(t),e);
}
else
{
// e1 . (uint)(e1 >> 32)
if (target.is64bit)
{
e = el_bin(OPshr, TYucent, e, el_long(TYint, 64));
e = el_una(OP128_64, totym(t), e);
}
else
{
e = el_bin(OPshr, TYullong, e, el_long(TYint, 32));
e = el_una(OP64_32, totym(t), e);
}
}
return Lret(ce, e);
}
if (tty == Tpointer && fty == Tsarray)
{
// e1 . &e1
e = el_una(OPaddr, TYnptr, e);
return Lret(ce, e);
}
// Convert from static array to dynamic array
if (tty == Tarray && fty == Tsarray)
{
e = sarray_toDarray(ce.loc, tfrom, t, e);
return Lret(ce, e);
}
// Convert from dynamic array to dynamic array
if (tty == Tarray && fty == Tarray)
{
uint fsize = cast(uint)tfrom.nextOf().size();
uint tsize = cast(uint)t.nextOf().size();
if (fsize != tsize)
{ // Array element sizes do not match, so we must adjust the dimensions
if (tsize != 0 && fsize % tsize == 0)
{
// Set array dimension to (length * (fsize / tsize))
// Generate pair(e.length * (fsize/tsize), es.ptr)
elem *es = el_same(&e);
elem *eptr = el_una(OPmsw, TYnptr, es);
elem *elen = el_una(target.is64bit ? OP128_64 : OP64_32, TYsize_t, e);
elem *elen2 = el_bin(OPmul, TYsize_t, elen, el_long(TYsize_t, fsize / tsize));
e = el_pair(totym(ce.type), elen2, eptr);
}
else
{
assert(false, "This case should have been rewritten to `__ArrayCast` in the semantic phase");
}
}
return Lret(ce, e);
}
// Casting between class/interface may require a runtime check
if (fty == Tclass && tty == Tclass)
{
ClassDeclaration cdfrom = tfrom.isClassHandle();
ClassDeclaration cdto = t.isClassHandle();
int offset;
if (cdto.isBaseOf(cdfrom, &offset) && offset != ClassDeclaration.OFFSET_RUNTIME)
{
/* The offset from cdfrom => cdto is known at compile time.
* Cases:
* - class => base class (upcast)
* - class => base interface (upcast)
*/
//printf("offset = %d\n", offset);
if (offset == ClassDeclaration.OFFSET_FWDREF)
{
assert(0, "unexpected forward reference");
}
else if (offset)
{
/* Rewrite cast as (e ? e + offset : null)
*/
if (ce.e1.op == EXP.this_)
{
// Assume 'this' is never null, so skip null check
e = el_bin(OPadd, TYnptr, e, el_long(TYsize_t, offset));
}
else
{
elem *etmp = el_same(&e);
elem *ex = el_bin(OPadd, TYnptr, etmp, el_long(TYsize_t, offset));
ex = el_bin(OPcolon, TYnptr, ex, el_long(TYnptr, 0));
e = el_bin(OPcond, TYnptr, e, ex);
}
}
else
{
// Casting from derived class to base class is a no-op
}
}
else if (cdfrom.classKind == ClassKind.cpp)
{
if (cdto.classKind == ClassKind.cpp)
{
/* Casting from a C++ interface to a C++ interface
* is always a 'paint' operation
*/
return Lret(ce, e); // no-op
}
/* Casting from a C++ interface to a class
* always results in null because there is no runtime
* information available to do it.
*
* Casting from a C++ interface to a non-C++ interface
* always results in null because there's no way one
* can be derived from the other.
*/
e = el_bin(OPcomma, TYnptr, e, el_long(TYnptr, 0));
return Lret(ce, e);
}
else
{
/* The offset from cdfrom => cdto can only be determined at runtime.
* Cases:
* - class => derived class (downcast)
* - interface => derived class (downcast)
* - class => foreign interface (cross cast)
* - interface => base or foreign interface (cross cast)
*/
const rtl = cdfrom.isInterfaceDeclaration()
? RTLSYM.INTERFACE_CAST
: RTLSYM.DYNAMIC_CAST;
elem *ep = el_param(el_ptr(toSymbol(cdto)), e);
e = el_bin(OPcall, TYnptr, el_var(getRtlsym(rtl)), ep);
}
return Lret(ce, e);
}
if (fty == Tvector && tty == Tsarray)
{
if (tfrom.size() == t.size())
{
if (e.Eoper != OPvar && e.Eoper != OPind)
{
// can't perform array ops on it unless it's in memory
e = addressElem(e, tfrom);
e = el_una(OPind, TYarray, e);
e.ET = Type_toCtype(t);
}
return Lret(ce, e);
}
}
ftym = tybasic(e.Ety);
ttym = tybasic(totym(t));
if (ftym == ttym)
return Lret(ce, e);
/* Reduce combinatorial explosion by rewriting the 'to' and 'from' types to a
* generic equivalent (as far as casting goes)
*/
switch (tty)
{
case Tpointer:
if (fty == Tdelegate)
return Lpaint(ce, e, ttym);
tty = target.is64bit ? Tuns64 : Tuns32;
break;
case Tchar: tty = Tuns8; break;
case Twchar: tty = Tuns16; break;
case Tdchar: tty = Tuns32; break;
case Tvoid: return Lpaint(ce, e, ttym);
case Tbool:
{
// Construct e?true:false
e = el_una(OPbool, ttym, e);
return Lret(ce, e);
}
default:
break;
}
switch (fty)
{
case Tnull:
{
// typeof(null) is same with void* in binary level.
return Lzero(ce, e, ttym);
}
case Tpointer: fty = target.is64bit ? Tuns64 : Tuns32; break;
case Tchar: fty = Tuns8; break;
case Twchar: fty = Tuns16; break;
case Tdchar: fty = Tuns32; break;
// noreturn expression will throw/abort and never produce a
// value to cast, hence we discard the cast
case Tnoreturn:
return Lret(ce, e);
default:
break;
}
static int X(int fty, int tty) { return fty * TMAX + tty; }
while (true)
{
switch (X(fty,tty))
{
/* ============================= */
case X(Tbool,Tint8):
case X(Tbool,Tuns8):
return Lpaint(ce, e, ttym);
case X(Tbool,Tint16):
case X(Tbool,Tuns16):
case X(Tbool,Tint32):
case X(Tbool,Tuns32):
if (isLvalue)
{
eop = OPu8_16;
return Leop(ce, e, eop, ttym);
}
else
{
e = el_bin(OPand, TYuchar, e, el_long(TYuchar, 1));
fty = Tuns8;
continue;
}
case X(Tbool,Tint64):
case X(Tbool,Tuns64):
case X(Tbool,Tint128):
case X(Tbool,Tuns128):
case X(Tbool,Tfloat32):
case X(Tbool,Tfloat64):
case X(Tbool,Tfloat80):
case X(Tbool,Tcomplex32):
case X(Tbool,Tcomplex64):
case X(Tbool,Tcomplex80):
e = el_bin(OPand, TYuchar, e, el_long(TYuchar, 1));
fty = Tuns8;
continue;
case X(Tbool,Timaginary32):
case X(Tbool,Timaginary64):
case X(Tbool,Timaginary80):
return Lzero(ce, e, ttym);
/* ============================= */
case X(Tint8,Tuns8): return Lpaint(ce, e, ttym);
case X(Tint8,Tint16):
case X(Tint8,Tuns16):
case X(Tint8,Tint32):
case X(Tint8,Tuns32): eop = OPs8_16; return Leop(ce, e, eop, ttym);
case X(Tint8,Tint64):
case X(Tint8,Tuns64):
case X(Tint8,Tint128):
case X(Tint8,Tuns128):
case X(Tint8,Tfloat32):
case X(Tint8,Tfloat64):
case X(Tint8,Tfloat80):
case X(Tint8,Tcomplex32):
case X(Tint8,Tcomplex64):
case X(Tint8,Tcomplex80):
e = el_una(OPs8_16, TYint, e);
fty = Tint32;
continue;
case X(Tint8,Timaginary32):
case X(Tint8,Timaginary64):
case X(Tint8,Timaginary80): return Lzero(ce, e, ttym);
/* ============================= */
case X(Tuns8,Tint8): return Lpaint(ce, e, ttym);
case X(Tuns8,Tint16):
case X(Tuns8,Tuns16):
case X(Tuns8,Tint32):
case X(Tuns8,Tuns32): eop = OPu8_16; return Leop(ce, e, eop, ttym);
case X(Tuns8,Tint64):
case X(Tuns8,Tuns64):
case X(Tuns8,Tint128):
case X(Tuns8,Tuns128):
case X(Tuns8,Tfloat32):
case X(Tuns8,Tfloat64):
case X(Tuns8,Tfloat80):
case X(Tuns8,Tcomplex32):
case X(Tuns8,Tcomplex64):
case X(Tuns8,Tcomplex80):
e = el_una(OPu8_16, TYuint, e);
fty = Tuns32;
continue;
case X(Tuns8,Timaginary32):
case X(Tuns8,Timaginary64):
case X(Tuns8,Timaginary80): return Lzero(ce, e, ttym);
/* ============================= */
case X(Tint16,Tint8):
case X(Tint16,Tuns8): eop = OP16_8; return Leop(ce, e, eop, ttym);
case X(Tint16,Tuns16): return Lpaint(ce, e, ttym);
case X(Tint16,Tint32):
case X(Tint16,Tuns32): eop = OPs16_32; return Leop(ce, e, eop, ttym);
case X(Tint16,Tint64):
case X(Tint16,Tuns64):
case X(Tint16,Tint128):
case X(Tint16,Tuns128):
e = el_una(OPs16_32, TYint, e);
fty = Tint32;
continue;
case X(Tint16,Tfloat32):
case X(Tint16,Tfloat64):
case X(Tint16,Tfloat80):
case X(Tint16,Tcomplex32):
case X(Tint16,Tcomplex64):
case X(Tint16,Tcomplex80):
e = el_una(OPs16_d, TYdouble, e);
fty = Tfloat64;
continue;
case X(Tint16,Timaginary32):
case X(Tint16,Timaginary64):
case X(Tint16,Timaginary80): return Lzero(ce, e, ttym);
/* ============================= */
case X(Tuns16,Tint8):
case X(Tuns16,Tuns8): eop = OP16_8; return Leop(ce, e, eop, ttym);
case X(Tuns16,Tint16): return Lpaint(ce, e, ttym);
case X(Tuns16,Tint32):
case X(Tuns16,Tuns32): eop = OPu16_32; return Leop(ce, e, eop, ttym);
case X(Tuns16,Tint64):
case X(Tuns16,Tuns64):
case X(Tuns16,Tint128):
case X(Tuns16,Tuns128):
case X(Tuns16,Tfloat64):
case X(Tuns16,Tfloat32):
case X(Tuns16,Tfloat80):
case X(Tuns16,Tcomplex32):
case X(Tuns16,Tcomplex64):
case X(Tuns16,Tcomplex80):
e = el_una(OPu16_32, TYuint, e);
fty = Tuns32;
continue;
case X(Tuns16,Timaginary32):
case X(Tuns16,Timaginary64):
case X(Tuns16,Timaginary80): return Lzero(ce, e, ttym);
/* ============================= */
case X(Tint32,Tint8):
case X(Tint32,Tuns8): e = el_una(OP32_16, TYshort, e);
fty = Tint16;
continue;
case X(Tint32,Tint16):
case X(Tint32,Tuns16): eop = OP32_16; return Leop(ce, e, eop, ttym);
case X(Tint32,Tuns32): return Lpaint(ce, e, ttym);
case X(Tint32,Tint64):
case X(Tint32,Tuns64): eop = OPs32_64; return Leop(ce, e, eop, ttym);
case X(Tint32,Tint128):
case X(Tint32,Tuns128):
e = el_una(OPs32_64, TYullong, e);
fty = Tint64;
continue;
case X(Tint32,Tfloat32):
case X(Tint32,Tfloat64):
case X(Tint32,Tfloat80):
case X(Tint32,Tcomplex32):
case X(Tint32,Tcomplex64):
case X(Tint32,Tcomplex80):
e = el_una(OPs32_d, TYdouble, e);
fty = Tfloat64;
continue;
case X(Tint32,Timaginary32):
case X(Tint32,Timaginary64):
case X(Tint32,Timaginary80): return Lzero(ce, e, ttym);
/* ============================= */
case X(Tuns32,Tint8):
case X(Tuns32,Tuns8): e = el_una(OP32_16, TYshort, e);
fty = Tuns16;
continue;
case X(Tuns32,Tint16):
case X(Tuns32,Tuns16): eop = OP32_16; return Leop(ce, e, eop, ttym);
case X(Tuns32,Tint32): return Lpaint(ce, e, ttym);
case X(Tuns32,Tint64):
case X(Tuns32,Tuns64): eop = OPu32_64; return Leop(ce, e, eop, ttym);
case X(Tuns32,Tint128):
case X(Tuns32,Tuns128):
e = el_una(OPs32_64, TYullong, e);
fty = Tuns64;
continue;
case X(Tuns32,Tfloat32):
case X(Tuns32,Tfloat64):
case X(Tuns32,Tfloat80):
case X(Tuns32,Tcomplex32):
case X(Tuns32,Tcomplex64):
case X(Tuns32,Tcomplex80):
e = el_una(OPu32_d, TYdouble, e);
fty = Tfloat64;
continue;
case X(Tuns32,Timaginary32):
case X(Tuns32,Timaginary64):
case X(Tuns32,Timaginary80): return Lzero(ce, e, ttym);
/* ============================= */
case X(Tint64,Tint8):
case X(Tint64,Tuns8):
case X(Tint64,Tint16):
case X(Tint64,Tuns16): e = el_una(OP64_32, TYint, e);
fty = Tint32;
continue;
case X(Tint64,Tint32):
case X(Tint64,Tuns32): eop = OP64_32; return Leop(ce, e, eop, ttym);
case X(Tint64,Tuns64): return Lpaint(ce, e, ttym);
case X(Tint64,Tint128):
case X(Tint64,Tuns128): eop = OPs64_128; return Leop(ce, e, eop, ttym);
case X(Tint64,Tfloat32):
case X(Tint64,Tfloat64):
case X(Tint64,Tfloat80):
case X(Tint64,Tcomplex32):
case X(Tint64,Tcomplex64):
case X(Tint64,Tcomplex80):
e = el_una(OPs64_d, TYdouble, e);
fty = Tfloat64;
continue;
case X(Tint64,Timaginary32):
case X(Tint64,Timaginary64):
case X(Tint64,Timaginary80): return Lzero(ce, e, ttym);
/* ============================= */
case X(Tuns64,Tint8):
case X(Tuns64,Tuns8):
case X(Tuns64,Tint16):
case X(Tuns64,Tuns16): e = el_una(OP64_32, TYint, e);
fty = Tint32;
continue;
case X(Tuns64,Tint32):
case X(Tuns64,Tuns32): eop = OP64_32; return Leop(ce, e, eop, ttym);
case X(Tuns64,Tint64): return Lpaint(ce, e, ttym);
case X(Tuns64,Tint128):
case X(Tuns64,Tuns128): eop = OPu64_128; return Leop(ce, e, eop, ttym);
case X(Tuns64,Tfloat32):
case X(Tuns64,Tfloat64):
case X(Tuns64,Tfloat80):
case X(Tuns64,Tcomplex32):
case X(Tuns64,Tcomplex64):
case X(Tuns64,Tcomplex80):
e = el_una(OPu64_d, TYdouble, e);
fty = Tfloat64;
continue;
case X(Tuns64,Timaginary32):
case X(Tuns64,Timaginary64):
case X(Tuns64,Timaginary80): return Lzero(ce, e, ttym);
/* ============================= */
case X(Tint128,Tint8):
case X(Tint128,Tuns8):
case X(Tint128,Tint16):
case X(Tint128,Tuns16):
case X(Tint128,Tint32):
case X(Tint128,Tuns32):
e = el_una(OP128_64, TYllong, e);
fty = Tint64;
continue;
case X(Tint128,Tint64):
case X(Tint128,Tuns64): eop = OP128_64; return Leop(ce, e, eop, ttym);
case X(Tint128,Tuns128): return Lpaint(ce, e, ttym);
static if (0) // cent <=> floating point not supported yet
{
case X(Tint128,Tfloat32):
case X(Tint128,Tfloat64):
case X(Tint128,Tfloat80):
case X(Tint128,Tcomplex32):
case X(Tint128,Tcomplex64):
case X(Tint128,Tcomplex80):
e = el_una(OPs64_d, TYdouble, e);
fty = Tfloat64;
continue;
}
case X(Tint128,Timaginary32):
case X(Tint128,Timaginary64):
case X(Tint128,Timaginary80): return Lzero(ce, e, ttym);
/* ============================= */
case X(Tuns128,Tint8):
case X(Tuns128,Tuns8):
case X(Tuns128,Tint16):
case X(Tuns128,Tuns16):
case X(Tuns128,Tint32):
case X(Tuns128,Tuns32):
e = el_una(OP128_64, TYllong, e);
fty = Tint64;
continue;
case X(Tuns128,Tint64):
case X(Tuns128,Tuns64): eop = OP128_64; return Leop(ce, e, eop, ttym);
case X(Tuns128,Tint128): return Lpaint(ce, e, ttym);
static if (0) // cent <=> floating point not supported yet
{
case X(Tuns128,Tfloat32):
case X(Tuns128,Tfloat64):
case X(Tuns128,Tfloat80):
case X(Tuns128,Tcomplex32):
case X(Tuns128,Tcomplex64):
case X(Tuns128,Tcomplex80):
e = el_una(OPu64_d, TYdouble, e);
fty = Tfloat64;
continue;
}
case X(Tuns128,Timaginary32):
case X(Tuns128,Timaginary64):
case X(Tuns128,Timaginary80): return Lzero(ce, e, ttym);
/* ============================= */
case X(Tfloat32,Tint8):
case X(Tfloat32,Tuns8):
case X(Tfloat32,Tint16):
case X(Tfloat32,Tuns16):
case X(Tfloat32,Tint32):
case X(Tfloat32,Tuns32):
case X(Tfloat32,Tint64):
case X(Tfloat32,Tuns64):
static if (0) // cent <=> floating point not supported yet
{
case X(Tfloat32,Tint128):
case X(Tfloat32,Tuns128):
}
case X(Tfloat32,Tfloat80):
e = el_una(OPf_d, TYdouble, e);
fty = Tfloat64;
continue;
case X(Tfloat32,Tfloat64): eop = OPf_d; return Leop(ce, e, eop, ttym);
case X(Tfloat32,Timaginary32):
case X(Tfloat32,Timaginary64):
case X(Tfloat32,Timaginary80): return Lzero(ce, e, ttym);
case X(Tfloat32,Tcomplex32):
case X(Tfloat32,Tcomplex64):
case X(Tfloat32,Tcomplex80):
e = el_bin(OPadd,TYcfloat,el_long(TYifloat,0),e);
fty = Tcomplex32;
continue;
/* ============================= */
case X(Tfloat64,Tint8):
case X(Tfloat64,Tuns8): e = el_una(OPd_s16, TYshort, e);
fty = Tint16;
continue;
case X(Tfloat64,Tint16): eop = OPd_s16; return Leop(ce, e, eop, ttym);
case X(Tfloat64,Tuns16): eop = OPd_u16; return Leop(ce, e, eop, ttym);
case X(Tfloat64,Tint32): eop = OPd_s32; return Leop(ce, e, eop, ttym);
case X(Tfloat64,Tuns32): eop = OPd_u32; return Leop(ce, e, eop, ttym);
case X(Tfloat64,Tint64): eop = OPd_s64; return Leop(ce, e, eop, ttym);
case X(Tfloat64,Tuns64): eop = OPd_u64; return Leop(ce, e, eop, ttym);
static if (0) // cent <=> floating point not supported yet
{
case X(Tfloat64,Tint128):
case X(Tfloat64,Tuns128):
}
case X(Tfloat64,Tfloat32): eop = OPd_f; return Leop(ce, e, eop, ttym);
case X(Tfloat64,Tfloat80): eop = OPd_ld; return Leop(ce, e, eop, ttym);
case X(Tfloat64,Timaginary32):
case X(Tfloat64,Timaginary64):
case X(Tfloat64,Timaginary80): return Lzero(ce, e, ttym);
case X(Tfloat64,Tcomplex32):
case X(Tfloat64,Tcomplex64):
case X(Tfloat64,Tcomplex80):
e = el_bin(OPadd,TYcdouble,el_long(TYidouble,0),e);
fty = Tcomplex64;
continue;
/* ============================= */
case X(Tfloat80,Tint8):
case X(Tfloat80,Tuns8):
case X(Tfloat80,Tint16):
case X(Tfloat80,Tuns16):
case X(Tfloat80,Tint32):
case X(Tfloat80,Tuns32):
case X(Tfloat80,Tint64):
static if (0) // cent <=> floating point not supported yet
{
case X(Tfloat80,Tint128):
case X(Tfloat80,Tuns128):
}
case X(Tfloat80,Tfloat32): e = el_una(OPld_d, TYdouble, e);
fty = Tfloat64;
continue;
case X(Tfloat80,Tuns64):
eop = OPld_u64; return Leop(ce, e, eop, ttym);
case X(Tfloat80,Tfloat64): eop = OPld_d; return Leop(ce, e, eop, ttym);
case X(Tfloat80,Timaginary32):
case X(Tfloat80,Timaginary64):
case X(Tfloat80,Timaginary80): return Lzero(ce, e, ttym);
case X(Tfloat80,Tcomplex32):
case X(Tfloat80,Tcomplex64):
case X(Tfloat80,Tcomplex80):
e = el_bin(OPadd,TYcldouble,e,el_long(TYildouble,0));
fty = Tcomplex80;
continue;
/* ============================= */
case X(Timaginary32,Tint8):
case X(Timaginary32,Tuns8):
case X(Timaginary32,Tint16):
case X(Timaginary32,Tuns16):
case X(Timaginary32,Tint32):
case X(Timaginary32,Tuns32):
case X(Timaginary32,Tint64):
case X(Timaginary32,Tuns64):
case X(Timaginary32,Tfloat32):
case X(Timaginary32,Tfloat64):
static if (0) // cent <=> floating point not supported yet
{
case X(Timaginary32,Tint128):
case X(Timaginary32,Tuns128):
}
case X(Timaginary32,Tfloat80): return Lzero(ce, e, ttym);
case X(Timaginary32,Timaginary64): eop = OPf_d; return Leop(ce, e, eop, ttym);
case X(Timaginary32,Timaginary80):
e = el_una(OPf_d, TYidouble, e);
fty = Timaginary64;
continue;
case X(Timaginary32,Tcomplex32):
case X(Timaginary32,Tcomplex64):
case X(Timaginary32,Tcomplex80):
e = el_bin(OPadd,TYcfloat,el_long(TYfloat,0),e);
fty = Tcomplex32;
continue;
/* ============================= */
case X(Timaginary64,Tint8):
case X(Timaginary64,Tuns8):
case X(Timaginary64,Tint16):
case X(Timaginary64,Tuns16):
case X(Timaginary64,Tint32):
case X(Timaginary64,Tuns32):
case X(Timaginary64,Tint64):
case X(Timaginary64,Tuns64):
static if (0) // cent <=> floating point not supported yet
{
case X(Timaginary64,Tint128):
case X(Timaginary64,Tuns128):
}
case X(Timaginary64,Tfloat32):
case X(Timaginary64,Tfloat64):
case X(Timaginary64,Tfloat80): return Lzero(ce, e, ttym);
case X(Timaginary64,Timaginary32): eop = OPd_f; return Leop(ce, e, eop, ttym);
case X(Timaginary64,Timaginary80): eop = OPd_ld; return Leop(ce, e, eop, ttym);
case X(Timaginary64,Tcomplex32):
case X(Timaginary64,Tcomplex64):
case X(Timaginary64,Tcomplex80):
e = el_bin(OPadd,TYcdouble,el_long(TYdouble,0),e);
fty = Tcomplex64;
continue;
/* ============================= */
case X(Timaginary80,Tint8):
case X(Timaginary80,Tuns8):
case X(Timaginary80,Tint16):
case X(Timaginary80,Tuns16):
case X(Timaginary80,Tint32):
case X(Timaginary80,Tuns32):
case X(Timaginary80,Tint64):
case X(Timaginary80,Tuns64):
static if (0) // cent <=> floating point not supported yet
{
case X(Timaginary80,Tint128):
case X(Timaginary80,Tuns128):
}
case X(Timaginary80,Tfloat32):
case X(Timaginary80,Tfloat64):
case X(Timaginary80,Tfloat80): return Lzero(ce, e, ttym);
case X(Timaginary80,Timaginary32): e = el_una(OPld_d, TYidouble, e);
fty = Timaginary64;
continue;
case X(Timaginary80,Timaginary64): eop = OPld_d; return Leop(ce, e, eop, ttym);
case X(Timaginary80,Tcomplex32):
case X(Timaginary80,Tcomplex64):
case X(Timaginary80,Tcomplex80):
e = el_bin(OPadd,TYcldouble,el_long(TYldouble,0),e);
fty = Tcomplex80;
continue;
/* ============================= */
case X(Tcomplex32,Tint8):
case X(Tcomplex32,Tuns8):
case X(Tcomplex32,Tint16):
case X(Tcomplex32,Tuns16):
case X(Tcomplex32,Tint32):
case X(Tcomplex32,Tuns32):
case X(Tcomplex32,Tint64):
case X(Tcomplex32,Tuns64):
static if (0) // cent <=> floating point not supported yet
{
case X(Tcomplex32,Tint128):
case X(Tcomplex32,Tuns128):
}
case X(Tcomplex32,Tfloat32):
case X(Tcomplex32,Tfloat64):
case X(Tcomplex32,Tfloat80):
e = el_una(OPc_r, TYfloat, e);
fty = Tfloat32;
continue;
case X(Tcomplex32,Timaginary32):
case X(Tcomplex32,Timaginary64):
case X(Tcomplex32,Timaginary80):
e = el_una(OPc_i, TYifloat, e);
fty = Timaginary32;
continue;
case X(Tcomplex32,Tcomplex64):
case X(Tcomplex32,Tcomplex80):
e = el_una(OPf_d, TYcdouble, e);
fty = Tcomplex64;
continue;
/* ============================= */
case X(Tcomplex64,Tint8):
case X(Tcomplex64,Tuns8):
case X(Tcomplex64,Tint16):
case X(Tcomplex64,Tuns16):
case X(Tcomplex64,Tint32):
case X(Tcomplex64,Tuns32):
case X(Tcomplex64,Tint64):
case X(Tcomplex64,Tuns64):
static if (0) // cent <=> floating point not supported yet
{
case X(Tcomplex64,Tint128):
case X(Tcomplex64,Tuns128):
}
case X(Tcomplex64,Tfloat32):
case X(Tcomplex64,Tfloat64):
case X(Tcomplex64,Tfloat80):
e = el_una(OPc_r, TYdouble, e);
fty = Tfloat64;
continue;
case X(Tcomplex64,Timaginary32):
case X(Tcomplex64,Timaginary64):
case X(Tcomplex64,Timaginary80):
e = el_una(OPc_i, TYidouble, e);
fty = Timaginary64;
continue;
case X(Tcomplex64,Tcomplex32): eop = OPd_f; return Leop(ce, e, eop, ttym);
case X(Tcomplex64,Tcomplex80): eop = OPd_ld; return Leop(ce, e, eop, ttym);
/* ============================= */
case X(Tcomplex80,Tint8):
case X(Tcomplex80,Tuns8):
case X(Tcomplex80,Tint16):
case X(Tcomplex80,Tuns16):
case X(Tcomplex80,Tint32):
case X(Tcomplex80,Tuns32):
case X(Tcomplex80,Tint64):
case X(Tcomplex80,Tuns64):
static if (0) // cent <=> floating point not supported yet
{
case X(Tcomplex80,Tint128):
case X(Tcomplex80,Tuns128):
}
case X(Tcomplex80,Tfloat32):
case X(Tcomplex80,Tfloat64):
case X(Tcomplex80,Tfloat80):
e = el_una(OPc_r, TYldouble, e);
fty = Tfloat80;
continue;
case X(Tcomplex80,Timaginary32):
case X(Tcomplex80,Timaginary64):
case X(Tcomplex80,Timaginary80):
e = el_una(OPc_i, TYildouble, e);
fty = Timaginary80;
continue;
case X(Tcomplex80,Tcomplex32):
case X(Tcomplex80,Tcomplex64):
e = el_una(OPld_d, TYcdouble, e);
fty = Tcomplex64;
continue;
/* ============================= */
default:
if (fty == tty)
return Lpaint(ce, e, ttym);
//dump(0);
//printf("fty = %d, tty = %d, %d\n", fty, tty, t.ty);
// This error should really be pushed to the front end
ce.error("e2ir: cannot cast `%s` of type `%s` to type `%s`", ce.e1.toChars(), ce.e1.type.toChars(), t.toChars());
e = el_long(TYint, 0);
return e;
}
}
}
/******************************************
* If argument to a function should use OPstrpar,
* fix it so it does and return it.
*/
elem *useOPstrpar(elem *e)
{
tym_t ty = tybasic(e.Ety);
if (ty == TYstruct || ty == TYarray)
{
e = el_una(OPstrpar, TYstruct, e);
e.ET = e.EV.E1.ET;
assert(e.ET);
}
return e;
}
/************************************
* Call a function.
*/
elem *callfunc(const ref Loc loc,
IRState *irs,
int directcall, // 1: don't do virtual call
Type tret, // return type
elem *ec, // evaluates to function address
Type ectype, // original type of ec
FuncDeclaration fd, // if !=NULL, this is the function being called
Type t, // TypeDelegate or TypeFunction for this function
elem *ehidden, // if !=null, this is the 'hidden' argument
Expressions *arguments,
elem *esel = null, // selector for Objective-C methods (when not provided by fd)
elem *ethis2 = null) // multi-context array
{
elem *ethis = null;
elem *eside = null;
elem *eresult = ehidden;
version (none)
{
printf("callfunc(directcall = %d, tret = '%s', ec = %p, fd = %p)\n",
directcall, tret.toChars(), ec, fd);
printf("ec: "); elem_print(ec);
if (fd)
printf("fd = '%s', vtblIndex = %d, isVirtual() = %d\n", fd.toChars(), fd.vtblIndex, fd.isVirtual());
if (ehidden)
{ printf("ehidden: "); elem_print(ehidden); }
}
t = t.toBasetype();
TypeFunction tf = t.isTypeFunction();
if (!tf)
{
assert(t.ty == Tdelegate);
// A delegate consists of:
// { Object *this; Function *funcptr; }
assert(!fd);
tf = t.nextOf().isTypeFunction();
assert(tf);
ethis = ec;
ec = el_same(ðis);
ethis = el_una(target.is64bit ? OP128_64 : OP64_32, TYnptr, ethis); // get this
ec = array_toPtr(t, ec); // get funcptr
tym_t tym;
/* Delegates use the same calling convention as member functions.
* For extern(C++) on Win32 this differs from other functions.
*/
if (tf.linkage == LINK.cpp && !target.is64bit && target.os == Target.OS.Windows)
tym = (tf.parameterList.varargs == VarArg.variadic) ? TYnfunc : TYmfunc;
else
tym = totym(tf);
ec = el_una(OPind, tym, ec);
}
const ty = fd ? toSymbol(fd).Stype.Tty : ec.Ety;
const left_to_right = tyrevfunc(ty); // left-to-right parameter evaluation
// (TYnpfunc, TYjfunc, TYfpfunc, TYf16func)
elem* ep = null;
const op = fd ? intrinsic_op(fd) : NotIntrinsic;
// Check for noreturn expression pretending to yield function/delegate pointers
if (tybasic(ec.Ety) == TYnoreturn)
{
// Discard unreachable argument evaluation + function call
return ec;
}
if (arguments && arguments.length)
{
if (op == OPvector)
{
Expression arg = (*arguments)[0];
if (arg.op != EXP.int64)
arg.error("simd operator must be an integer constant, not `%s`", arg.toChars());
}
/* Convert arguments[] to elems[] in left-to-right order
*/
const n = arguments.length;
debug
elem*[2] elems_array = void;
else
elem*[10] elems_array = void;
import dmd.common.string : SmallBuffer;
auto pe = SmallBuffer!(elem*)(n, elems_array[]);
elem*[] elems = pe[];
/* Fill elems[] with arguments converted to elems
*/
// j=1 if _arguments[] is first argument
const int j = tf.isDstyleVariadic();
foreach (const i, arg; *arguments)
{
elem *ea = toElem(arg, irs);
//printf("\targ[%d]: %s\n", i, arg.toChars());
if (i - j < tf.parameterList.length &&
i >= j &&
tf.parameterList[i - j].isReference())
{
/* `ref` and `out` parameters mean convert
* corresponding argument to a pointer
*/
elems[i] = addressElem(ea, arg.type.pointerTo());
continue;
}
if (ISX64REF(irs, arg) && op == NotIntrinsic)
{
/* Copy to a temporary, and make the argument a pointer
* to that temporary.
*/
VarDeclaration v;
if (VarExp ve = arg.isVarExp())
v = ve.var.isVarDeclaration();
bool copy = !(v && v.isArgDtorVar); // copy unless the destructor is going to be run on it
// then assume the frontend took care of the copying and pass it by ref
elems[i] = addressElem(ea, arg.type, copy);
continue;
}
if (irs.target.os == Target.OS.Windows && irs.target.is64bit && tybasic(ea.Ety) == TYcfloat)
{
/* Treat a cfloat like it was a struct { float re,im; }
*/
ea.Ety = TYllong;
}
/* Do integral promotions. This is not necessary per the C ABI, but
* some code from the C world seems to rely on it.
*/
if (op == NotIntrinsic && tyintegral(ea.Ety) && arg.type.size(arg.loc) < 4)
{
if (ea.Eoper == OPconst)
{
ea.EV.Vullong = el_tolong(ea);
ea.Ety = TYint;
}
else
{
OPER opc;
switch (tybasic(ea.Ety))
{
case TYbool:
case TYchar:
case TYuchar:
case TYchar8:
opc = OPu8_16;
goto L1;
case TYschar:
opc = OPs8_16;
goto L1;
case TYchar16:
case TYwchar_t:
case TYushort:
opc = OPu16_32;
goto L1;
case TYshort:
opc = OPs16_32;
L1:
ea = el_una(opc, TYint, ea);
ea.Esrcpos = ea.EV.E1.Esrcpos;
break;
default:
break;
}
}
}
elems[i] = ea;
// Passing an expression of noreturn, meaning that the argument
// evaluation will throw / abort / loop indefinetly. Hence skip the
// call and only evaluate up to the current argument
if (tybasic(ea.Ety) == TYnoreturn)
{
return el_combines(cast(void**) elems.ptr, cast(int) i + 1);
}
}
if (!left_to_right &&
!irs.Cfile) // C11 leaves evaluation order implementation-defined, but
// try to match evaluation order of other C compilers
{
eside = fixArgumentEvaluationOrder(elems);
}
foreach (ref e; elems)
{
e = useOPstrpar(e);
}
if (!left_to_right) // swap order if right-to-left
reverse(elems);
ep = el_params(cast(void**)elems.ptr, cast(int)n);
}
objc.setupMethodSelector(fd, &esel);
objc.setupEp(esel, &ep, left_to_right);
const retmethod = retStyle(tf, fd && fd.needThis());
if (retmethod == RET.stack)
{
if (!ehidden)
{
// Don't have one, so create one
type *tc;
Type tret2 = tf.next;
if (tret2.toBasetype().ty == Tstruct ||
tret2.toBasetype().ty == Tsarray)
tc = Type_toCtype(tret2);
else
tc = type_fake(totym(tret2));
Symbol *stmp = symbol_genauto(tc);
ehidden = el_ptr(stmp);
eresult = ehidden;
}
if (irs.target.isPOSIX && tf.linkage != LINK.d)
{
// ehidden goes last on Linux/OSX C++
}
else
{
if (ep)
{
/* // BUG: implement
if (left_to_right && type_mangle(tfunc) == mTYman_cpp)
ep = el_param(ehidden,ep);
else
*/
ep = el_param(ep,ehidden);
}
else
ep = ehidden;
ehidden = null;
}
}
if (fd && fd.isMemberLocal())
{
assert(op == NotIntrinsic); // members should not be intrinsics
AggregateDeclaration ad = fd.isThis();
if (ad)
{
ethis = ec;
if (ad.isStructDeclaration() && tybasic(ec.Ety) != TYnptr)
{
ethis = addressElem(ec, ectype);
}
if (ethis2)
{
ethis2 = setEthis2(loc, irs, fd, ethis2, ðis, &eside);
}
if (el_sideeffect(ethis))
{
elem *ex = ethis;
ethis = el_copytotmp(&ex);
eside = el_combine(ex, eside);
}
}
else
{
// Evaluate ec for side effects
eside = el_combine(ec, eside);
}
Symbol *sfunc = toSymbol(fd);
if (esel)
{
auto result = objc.setupMethodCall(fd, tf, directcall != 0, ec, ehidden, ethis);
ec = result.ec;
ethis = result.ethis;
}
else if (!fd.isVirtual() ||
directcall || // BUG: fix
fd.isFinalFunc()
/* Future optimization: || (whole program analysis && not overridden)
*/
)
{
// make static call
ec = el_var(sfunc);
}
else
{
// make virtual call
assert(ethis);
elem *ev = el_same(ðis);
ev = el_una(OPind, TYnptr, ev);
uint vindex = fd.vtblIndex;
assert(cast(int)vindex >= 0);
// Build *(ev + vindex * 4)
if (!target.is64bit)
assert(tysize(TYnptr) == 4);
ec = el_bin(OPadd,TYnptr,ev,el_long(TYsize_t, vindex * tysize(TYnptr)));
ec = el_una(OPind,TYnptr,ec);
ec = el_una(OPind,tybasic(sfunc.Stype.Tty),ec);
}
}
else if (fd && fd.isNested())
{
assert(!ethis);
ethis = getEthis(loc, irs, fd, fd.toParentLocal());
if (ethis2)
ethis2 = setEthis2(loc, irs, fd, ethis2, ðis, &eside);
}
ep = el_param(ep, ethis2 ? ethis2 : ethis);
if (ehidden)
ep = el_param(ep, ehidden); // if ehidden goes last
const tyret = totym(tret);
// Look for intrinsic functions and construct result into e
elem *e;
if (ec.Eoper == OPvar && op != NotIntrinsic)
{
el_free(ec);
if (op != OPtoPrec && OTbinary(op))
{
ep.Eoper = cast(ubyte)op;
ep.Ety = tyret;
e = ep;
if (op == OPeq)
{ /* This was a volatileStore(ptr, value) operation, rewrite as:
* *ptr = value
*/
e.EV.E1 = el_una(OPind, e.EV.E2.Ety | mTYvolatile, e.EV.E1);
}
if (op == OPscale)
{
elem *et = e.EV.E1;
e.EV.E1 = el_una(OPs32_d, TYdouble, e.EV.E2);
e.EV.E1 = el_una(OPd_ld, TYldouble, e.EV.E1);
e.EV.E2 = et;
}
else if (op == OPyl2x || op == OPyl2xp1)
{
elem *et = e.EV.E1;
e.EV.E1 = e.EV.E2;
e.EV.E2 = et;
}
}
else if (op == OPvector)
{
e = ep;
/* Recognize store operations as:
* (op OPparam (op1 OPparam op2))
* Rewrite as:
* (op1 OPvecsto (op OPparam op2))
* A separate operation is used for stores because it
* has a side effect, and so takes a different path through
* the optimizer.
*/
if (e.Eoper == OPparam &&
e.EV.E1.Eoper == OPconst &&
isXMMstore(cast(uint)el_tolong(e.EV.E1)))
{
//printf("OPvecsto\n");
elem *tmp = e.EV.E1;
e.EV.E1 = e.EV.E2.EV.E1;
e.EV.E2.EV.E1 = tmp;
e.Eoper = OPvecsto;
e.Ety = tyret;
}
else
e = el_una(op,tyret,ep);
}
else if (op == OPind)
e = el_una(op,mTYvolatile | tyret,ep);
else if (op == OPva_start)
e = constructVa_start(ep);
else if (op == OPtoPrec)
{
static int X(int fty, int tty) { return fty * TMAX + tty; }
final switch (X(tybasic(ep.Ety), tybasic(tyret)))
{
case X(TYfloat, TYfloat): // float -> float
case X(TYdouble, TYdouble): // double -> double
case X(TYldouble, TYldouble): // real -> real
e = ep;
break;
case X(TYfloat, TYdouble): // float -> double
e = el_una(OPf_d, tyret, ep);
break;
case X(TYfloat, TYldouble): // float -> real
e = el_una(OPf_d, TYdouble, ep);
e = el_una(OPd_ld, tyret, e);
break;
case X(TYdouble, TYfloat): // double -> float
e = el_una(OPd_f, tyret, ep);
break;
case X(TYdouble, TYldouble): // double -> real
e = el_una(OPd_ld, tyret, ep);
break;
case X(TYldouble, TYfloat): // real -> float
e = el_una(OPld_d, TYdouble, ep);
e = el_una(OPd_f, tyret, e);
break;
case X(TYldouble, TYdouble): // real -> double
e = el_una(OPld_d, tyret, ep);
break;
}
}
else
e = el_una(op,tyret,ep);
}
else
{
// `OPcallns` used to be passed here for certain pure functions,
// but optimizations based on pure have to be retought, see:
// https://issues.dlang.org/show_bug.cgi?id=22277
if (ep)
e = el_bin(OPcall, tyret, ec, ep);
else
e = el_una(OPucall, tyret, ec);
if (tf.parameterList.varargs != VarArg.none)
e.Eflags |= EFLAGS_variadic;
}
const isCPPCtor = fd && fd._linkage == LINK.cpp && fd.isCtorDeclaration();
if (isCPPCtor && irs.target.isPOSIX)
{
// CPP constructor returns void on Posix
// https://itanium-cxx-abi.github.io/cxx-abi/abi.html#return-value-ctor
e.Ety = TYvoid;
e = el_combine(e, el_same(ðis));
}
else if (retmethod == RET.stack)
{
if (irs.target.os == Target.OS.OSX && eresult)
{
/* ABI quirk: hidden pointer is not returned in registers
*/
if (tyaggregate(tyret))
e.ET = Type_toCtype(tret);
e = el_combine(e, el_copytree(eresult));
}
e.Ety = TYnptr;
e = el_una(OPind, tyret, e);
}
if (tf.isref)
{
e.Ety = TYnptr;
e = el_una(OPind, tyret, e);
}
if (tybasic(tyret) == TYstruct)
{
e.ET = Type_toCtype(tret);
}
e = el_combine(eside, e);
return e;
}
/**********************************
* D presumes left-to-right argument evaluation, but we're evaluating things
* right-to-left here.
* 1. determine if this matters
* 2. fix it if it does
* Params:
* arguments = function arguments, these will get rewritten in place
* Returns:
* elem that evaluates the side effects
*/
extern (D) elem *fixArgumentEvaluationOrder(elem*[] elems)
{
/* It matters if all are true:
* 1. at least one argument has side effects
* 2. at least one other argument may depend on side effects
*/
if (elems.length <= 1)
return null;
size_t ifirstside = 0; // index-1 of first side effect
size_t ifirstdep = 0; // index-1 of first dependency on side effect
foreach (i, e; elems)
{
switch (e.Eoper)
{
case OPconst:
case OPrelconst:
case OPstring:
continue;
default:
break;
}
if (el_sideeffect(e))
{
if (!ifirstside)
ifirstside = i + 1;
else if (!ifirstdep)
ifirstdep = i + 1;
}
else
{
if (!ifirstdep)
ifirstdep = i + 1;
}
if (ifirstside && ifirstdep)
break;
}
if (!ifirstdep || !ifirstside)
return null;
/* Now fix by appending side effects and dependencies to eside and replacing
* argument with a temporary.
* Rely on the optimizer removing some unneeded ones using flow analysis.
*/
elem* eside = null;
foreach (i, e; elems)
{
while (e.Eoper == OPcomma)
{
eside = el_combine(eside, e.EV.E1);
e = e.EV.E2;
elems[i] = e;
}
switch (e.Eoper)
{
case OPconst:
case OPrelconst:
case OPstring:
continue;
default:
break;
}
elem *es = e;
elems[i] = el_copytotmp(&es);
eside = el_combine(eside, es);
}
return eside;
}
/***************************************
* Return `true` if elem is a an lvalue.
* Lvalue elems are OPvar and OPind.
*/
bool elemIsLvalue(elem* e)
{
while (e.Eoper == OPcomma || e.Eoper == OPinfo)
e = e.EV.E2;
// For conditional operator, both branches need to be lvalues.
if (e.Eoper == OPcond)
{
elem* ec = e.EV.E2;
return elemIsLvalue(ec.EV.E1) && elemIsLvalue(ec.EV.E2);
}
if (e.Eoper == OPvar)
return true;
/* Match *(&__tmpfordtor+0) which is being destroyed
*/
elem* ev;
if (e.Eoper == OPind &&
e.EV.E1.Eoper == OPadd &&
e.EV.E1.EV.E2.Eoper == OPconst &&
e.EV.E1.EV.E1.Eoper == OPaddr &&
(ev = e.EV.E1.EV.E1.EV.E1).Eoper == OPvar)
{
if (strncmp(ev.EV.Vsym.Sident.ptr, Id.__tmpfordtor.toChars(), 12) == 0)
{
return false; // don't make reference to object being destroyed
}
}
return e.Eoper == OPind && !OTcall(e.EV.E1.Eoper);
}
/*****************************************
* Convert array to a pointer to the data.
* Params:
* t = array type
* e = array to convert, it is "consumed" by the function
* Returns:
* e rebuilt into a pointer to the data
*/
elem *array_toPtr(Type t, elem *e)
{
//printf("array_toPtr()\n");
//elem_print(e);
t = t.toBasetype();
switch (t.ty)
{
case Tpointer:
break;
case Tarray:
case Tdelegate:
if (e.Eoper == OPcomma)
{
e.Ety = TYnptr;
e.EV.E2 = array_toPtr(t, e.EV.E2);
}
else if (e.Eoper == OPpair)
{
if (el_sideeffect(e.EV.E1))
{
e.Eoper = OPcomma;
e.Ety = TYnptr;
}
else
{
auto r = e;
e = e.EV.E2;
e.Ety = TYnptr;
r.EV.E2 = null;
el_free(r);
}
}
else
{
version (all)
e = el_una(OPmsw, TYnptr, e);
else
{
e = el_una(OPaddr, TYnptr, e);
e = el_bin(OPadd, TYnptr, e, el_long(TYsize_t, 4));
e = el_una(OPind, TYnptr, e);
}
}
break;
case Tsarray:
//e = el_una(OPaddr, TYnptr, e);
e = addressElem(e, t);
break;
default:
printf("%s\n", t.toChars());
assert(0);
}
return e;
}
/*****************************************
* Convert array to a dynamic array.
*/
elem *array_toDarray(Type t, elem *e)
{
uint dim;
elem *ef = null;
elem *ex;
//printf("array_toDarray(t = %s)\n", t.toChars());
//elem_print(e);
t = t.toBasetype();
switch (t.ty)
{
case Tarray:
break;
case Tsarray:
e = addressElem(e, t);
dim = cast(uint)(cast(TypeSArray)t).dim.toInteger();
e = el_pair(TYdarray, el_long(TYsize_t, dim), e);
break;
default:
L1:
switch (e.Eoper)
{
case OPconst:
{
const size_t len = tysize(e.Ety);
elem *es = el_calloc();
es.Eoper = OPstring;
// freed in el_free
es.EV.Vstring = cast(char*)mem_malloc2(cast(uint) len);
memcpy(es.EV.Vstring, &e.EV, len);
es.EV.Vstrlen = len;
es.Ety = TYnptr;
e = es;
break;
}
case OPvar:
e = el_una(OPaddr, TYnptr, e);
break;
case OPcomma:
ef = el_combine(ef, e.EV.E1);
ex = e;
e = e.EV.E2;
ex.EV.E1 = null;
ex.EV.E2 = null;
el_free(ex);
goto L1;
case OPind:
ex = e;
e = e.EV.E1;
ex.EV.E1 = null;
ex.EV.E2 = null;
el_free(ex);
break;
default:
{
// Copy expression to a variable and take the
// address of that variable.
e = addressElem(e, t);
break;
}
}
dim = 1;
e = el_pair(TYdarray, el_long(TYsize_t, dim), e);
break;
}
return el_combine(ef, e);
}
/************************************
*/
elem *sarray_toDarray(const ref Loc loc, Type tfrom, Type tto, elem *e)
{
//printf("sarray_toDarray()\n");
//elem_print(e);
dinteger_t dim = (cast(TypeSArray)tfrom).dim.toInteger();
if (tto)
{
uint fsize = cast(uint)tfrom.nextOf().size();
uint tsize = cast(uint)tto.nextOf().size();
// Should have been caught by Expression::castTo
assert(tsize != 0 && (dim * fsize) % tsize == 0);
dim = (dim * fsize) / tsize;
}
elem *elen = el_long(TYsize_t, dim);
e = addressElem(e, tfrom);
e = el_pair(TYdarray, elen, e);
return e;
}
/****************************************
* Get the TypeInfo for type `t`
* Params:
* e = for error reporting
* t = type for which we need TypeInfo
* irs = context
* Returns:
* TypeInfo
*/
private
elem *getTypeInfo(Expression e, Type t, IRState* irs)
{
if (irs.falseBlock)
{
/* Return null so we do not trigger the error
* about no TypeInfo
*/
return el_long(TYnptr, 0);
}
assert(t.ty != Terror);
genTypeInfo(e, e.loc, t, null);
elem* result = el_ptr(toSymbol(t.vtinfo));
return result;
}
/********************************************
* Determine if t is a struct that has postblit.
*/
StructDeclaration needsPostblit(Type t)
{
if (auto ts = t.baseElemOf().isTypeStruct())
{
StructDeclaration sd = ts.sym;
if (sd.postblit)
return sd;
}
return null;
}
/********************************************
* Determine if t is a struct that has destructor.
*/
StructDeclaration needsDtor(Type t)
{
if (auto ts = t.baseElemOf().isTypeStruct())
{
StructDeclaration sd = ts.sym;
if (sd.dtor)
return sd;
}
return null;
}
/*******************************************
* Set an array pointed to by eptr to evalue:
* eptr[0..edim] = evalue;
* Params:
* exp = the expression for which this operation is performed
* eptr = where to write the data to
* edim = number of times to write evalue to eptr[]
* tb = type of evalue
* evalue = value to write
* irs = context
* op = EXP.blit, EXP.assign, or EXP.construct
* Returns:
* created IR code
*/
elem *setArray(Expression exp, elem *eptr, elem *edim, Type tb, elem *evalue, IRState *irs, int op)
{
//elem_print(evalue);
assert(op == EXP.blit || op == EXP.assign || op == EXP.construct);
const sz = cast(uint)tb.size();
Type tb2 = tb;
Lagain:
RTLSYM r;
switch (tb2.ty)
{
case Tfloat80:
case Timaginary80:
r = RTLSYM.MEMSET80;
break;
case Tcomplex80:
r = RTLSYM.MEMSET160;
break;
case Tcomplex64:
r = RTLSYM.MEMSET128;
break;
case Tfloat32:
case Timaginary32:
if (!target.is64bit)
goto default; // legacy binary compatibility
r = RTLSYM.MEMSETFLOAT;
break;
case Tfloat64:
case Timaginary64:
if (!target.is64bit)
goto default; // legacy binary compatibility
r = RTLSYM.MEMSETDOUBLE;
break;
case Tstruct:
{
if (!target.is64bit)
goto default;
TypeStruct tc = cast(TypeStruct)tb2;
StructDeclaration sd = tc.sym;
if (sd.numArgTypes() == 1)
{
tb2 = sd.argType(0);
goto Lagain;
}
goto default;
}
case Tvector:
r = RTLSYM.MEMSETSIMD;
break;
default:
switch (sz)
{
case 1: r = RTLSYM.MEMSET8; break;
case 2: r = RTLSYM.MEMSET16; break;
case 4: r = RTLSYM.MEMSET32; break;
case 8: r = RTLSYM.MEMSET64; break;
case 16: r = target.is64bit ? RTLSYM.MEMSET128ii : RTLSYM.MEMSET128; break;
default: r = RTLSYM.MEMSETN; break;
}
/* Determine if we need to do postblit
*/
if (op != EXP.blit)
{
if (needsPostblit(tb) || needsDtor(tb))
{
if (op == EXP.construct)
assert(0, "Trying to reference _d_arraysetctor, this should not happen!");
else
assert(0, "Trying to reference _d_arraysetassign, this should not happen!");
}
}
if (target.is64bit && tybasic(evalue.Ety) == TYstruct && r != RTLSYM.MEMSETN)
{
/* If this struct is in-memory only, i.e. cannot necessarily be passed as
* a gp register parameter.
* The trouble is that memset() is expecting the argument to be in a gp
* register, but the argument pusher may have other ideas on I64.
* MEMSETN is inefficient, though.
*/
if (tybasic(evalue.ET.Tty) == TYstruct)
{
type *t1 = evalue.ET.Ttag.Sstruct.Sarg1type;
type *t2 = evalue.ET.Ttag.Sstruct.Sarg2type;
if (!t1 && !t2)
{
if (irs.target.os & Target.OS.Posix || sz > 8)
r = RTLSYM.MEMSETN;
}
else if (irs.target.os & Target.OS.Posix &&
r == RTLSYM.MEMSET128ii &&
tyfloating(t1.Tty) &&
tyfloating(t2.Tty))
r = RTLSYM.MEMSET128;
}
}
if (r == RTLSYM.MEMSETN)
{
// void *_memsetn(void *p, void *value, int dim, int sizelem)
evalue = addressElem(evalue, tb);
elem *esz = el_long(TYsize_t, sz);
elem *e = el_params(esz, edim, evalue, eptr, null);
e = el_bin(OPcall,TYnptr,el_var(getRtlsym(r)),e);
return e;
}
break;
}
if (sz > 1 && sz <= 8 &&
evalue.Eoper == OPconst && el_allbits(evalue, 0))
{
r = RTLSYM.MEMSET8;
edim = el_bin(OPmul, TYsize_t, edim, el_long(TYsize_t, sz));
}
if (irs.target.os == Target.OS.Windows && irs.target.is64bit && sz > REGSIZE)
{
evalue = addressElem(evalue, tb);
}
// cast to the proper parameter type
else if (r != RTLSYM.MEMSETN)
{
tym_t tym;
switch (r)
{
case RTLSYM.MEMSET8: tym = TYchar; break;
case RTLSYM.MEMSET16: tym = TYshort; break;
case RTLSYM.MEMSET32: tym = TYlong; break;
case RTLSYM.MEMSET64: tym = TYllong; break;
case RTLSYM.MEMSET80: tym = TYldouble; break;
case RTLSYM.MEMSET160: tym = TYcldouble; break;
case RTLSYM.MEMSET128: tym = TYcdouble; break;
case RTLSYM.MEMSET128ii: tym = TYucent; break;
case RTLSYM.MEMSETFLOAT: tym = TYfloat; break;
case RTLSYM.MEMSETDOUBLE: tym = TYdouble; break;
case RTLSYM.MEMSETSIMD: tym = TYfloat4; break;
default:
assert(0);
}
// do a cast to tym
tym = tym | (evalue.Ety & ~mTYbasic);
if (evalue.Eoper == OPconst)
{
evalue = el_copytree(evalue);
evalue.Ety = tym;
}
else
{
evalue = addressElem(evalue, tb);
evalue = el_una(OPind, tym, evalue);
}
}
evalue = useOPstrpar(evalue);
// Be careful about parameter side effect ordering
if (r == RTLSYM.MEMSET8 ||
r == RTLSYM.MEMSET16 ||
r == RTLSYM.MEMSET32 ||
r == RTLSYM.MEMSET64)
{
elem *e = el_param(edim, evalue);
return el_bin(OPmemset,TYnptr,eptr,e);
}
else
{
elem *e = el_params(edim, evalue, eptr, null);
return el_bin(OPcall,TYnptr,el_var(getRtlsym(r)),e);
}
}
/*******************************************
* Generate elem to zero fill contents of Symbol stmp
* from *poffset..offset2.
* May store anywhere from 0..maxoff, as this function
* tries to use aligned int stores whereever possible.
* Update *poffset to end of initialized hole; *poffset will be >= offset2.
*/
elem *fillHole(Symbol *stmp, size_t *poffset, size_t offset2, size_t maxoff)
{
elem *e = null;
bool basealign = true;
while (*poffset < offset2)
{
elem *e1;
if (tybasic(stmp.Stype.Tty) == TYnptr)
e1 = el_var(stmp);
else
e1 = el_ptr(stmp);
if (basealign)
*poffset &= ~3;
basealign = true;
size_t sz = maxoff - *poffset;
tym_t ty;
switch (sz)
{
case 1: ty = TYchar; break;
case 2: ty = TYshort; break;
case 3:
ty = TYshort;
basealign = false;
break;
default:
ty = TYlong;
// TODO: OPmemset is better if sz is much bigger than 4?
break;
}
e1 = el_bin(OPadd, TYnptr, e1, el_long(TYsize_t, *poffset));
e1 = el_una(OPind, ty, e1);
e1 = el_bin(OPeq, ty, e1, el_long(ty, 0));
e = el_combine(e, e1);
*poffset += tysize(ty);
}
return e;
}
/*************************************************
* Params:
* op = EXP.assign, EXP.construct, EXP.blit
* sym = struct symbol to initialize with the literal. If null, an auto is created
* fillHoles = Fill in alignment holes with zero. Set to
* false if allocated by operator new, as the holes are already zeroed.
*/
elem *toElemStructLit(StructLiteralExp sle, IRState *irs, EXP op, Symbol *sym, bool fillHoles)
{
//printf("[%s] StructLiteralExp.toElem() %s\n", sle.loc.toChars(), sle.toChars());
//printf("\tblit = %s, sym = %p fillHoles = %d\n", op == EXP.blit, sym, fillHoles);
Type forcetype = null;
if (sle.stype)
{
if (TypeEnum te = sle.stype.isTypeEnum())
{
// Reinterpret the struct literal as a complex type.
if (te.sym.isSpecial() &&
(te.sym.ident == Id.__c_complex_float ||
te.sym.ident == Id.__c_complex_double ||
te.sym.ident == Id.__c_complex_real))
{
forcetype = sle.stype;
}
}
}
static elem* Lreinterpret(Loc loc, elem* e, Type type)
{
elem* ep = el_una(OPind, totym(type), el_una(OPaddr, TYnptr, e));
elem_setLoc(ep, loc);
return ep;
}
if (sle.useStaticInit)
{
/* Use the struct declaration's init symbol
*/
elem *e = el_var(toInitializer(sle.sd));
e.ET = Type_toCtype(sle.sd.type);
elem_setLoc(e, sle.loc);
if (sym)
{
elem *ev = el_var(sym);
if (tybasic(ev.Ety) == TYnptr)
ev = el_una(OPind, e.Ety, ev);
ev.ET = e.ET;
e = elAssign(ev, e, null, ev.ET);
//ev = el_var(sym);
//ev.ET = e.ET;
//e = el_combine(e, ev);
elem_setLoc(e, sle.loc);
}
if (forcetype)
return Lreinterpret(sle.loc, e, forcetype);
return e;
}
// struct symbol to initialize with the literal
Symbol *stmp = sym ? sym : symbol_genauto(Type_toCtype(sle.sd.type));
elem *e = null;
/* If a field has explicit initializer (*sle.elements)[i] != null),
* any other overlapped fields won't have initializer. It's asserted by
* StructDeclaration.fill() function.
*
* union U { int x; long y; }
* U u1 = U(1); // elements = [`1`, null]
* U u2 = {y:2}; // elements = [null, `2`];
* U u3 = U(1, 2); // error
* U u4 = {x:1, y:2}; // error
*/
size_t dim = sle.elements ? sle.elements.length : 0;
assert(dim <= sle.sd.fields.length);
if (fillHoles)
{
/* Initialize all alignment 'holes' to zero.
* Do before initializing fields, as the hole filling process
* can spill over into the fields.
*/
const size_t structsize = sle.sd.structsize;
size_t offset = 0;
//printf("-- %s - fillHoles, structsize = %d\n", sle.toChars(), structsize);
for (size_t i = 0; i < sle.sd.fields.length && offset < structsize; )
{
VarDeclaration v = sle.sd.fields[i];
/* If the field v has explicit initializer, [offset .. v.offset]
* is a hole divided by the initializer.
* However if the field size is zero (e.g. int[0] v;), we can merge
* the two holes in the front and the back of the field v.
*/
if (i < dim && (*sle.elements)[i] && v.type.size())
{
//if (offset != v.offset) printf(" 1 fillHole, %d .. %d\n", offset, v.offset);
e = el_combine(e, fillHole(stmp, &offset, v.offset, structsize));
offset = cast(uint)(v.offset + v.type.size());
i++;
continue;
}
if (!v.overlapped)
{
i++;
continue;
}
/* AggregateDeclaration.fields holds the fields by the lexical order.
* This code will minimize each hole sizes. For example:
*
* struct S {
* union { uint f1; ushort f2; } // f1: 0..4, f2: 0..2
* union { uint f3; ulong f4; } // f3: 8..12, f4: 8..16
* }
* S s = {f2:x, f3:y}; // filled holes: 2..8 and 12..16
*/
size_t vend = sle.sd.fields.length;
size_t holeEnd = structsize;
size_t offset2 = structsize;
foreach (j; i + 1 .. vend)
{
VarDeclaration vx = sle.sd.fields[j];
if (!vx.overlapped)
{
vend = j;
break;
}
if (j < dim && (*sle.elements)[j] && vx.type.size())
{
// Find the lowest end offset of the hole.
if (offset <= vx.offset && vx.offset < holeEnd)
{
holeEnd = vx.offset;
offset2 = cast(uint)(vx.offset + vx.type.size());
}
}
}
if (holeEnd < structsize)
{
//if (offset != holeEnd) printf(" 2 fillHole, %d .. %d\n", offset, holeEnd);
e = el_combine(e, fillHole(stmp, &offset, holeEnd, structsize));
offset = offset2;
continue;
}
i = vend;
}
//if (offset != sle.sd.structsize) printf(" 3 fillHole, %d .. %d\n", offset, sle.sd.structsize);
e = el_combine(e, fillHole(stmp, &offset, sle.sd.structsize, sle.sd.structsize));
}
// CTFE may fill the hidden pointer by NullExp.
{
VarDeclaration vbf;
foreach (i, el; *sle.elements)
{
if (!el)
continue;
VarDeclaration v = sle.sd.fields[i];
assert(!v.isThisDeclaration() || el.op == EXP.null_);
elem *e1;
if (tybasic(stmp.Stype.Tty) == TYnptr)
{
e1 = el_var(stmp);
}
else
{
e1 = el_ptr(stmp);
}
e1 = el_bin(OPadd, TYnptr, e1, el_long(TYsize_t, v.offset));
elem *ep = toElem(el, irs);
Type t1b = v.type.toBasetype();
Type t2b = el.type.toBasetype();
if (t1b.ty == Tsarray)
{
if (t2b.implicitConvTo(t1b))
{
elem *esize = el_long(TYsize_t, t1b.size());
ep = array_toPtr(el.type, ep);
e1 = el_bin(OPmemcpy, TYnptr, e1, el_param(ep, esize));
}
else
{
elem *edim = el_long(TYsize_t, t1b.size() / t2b.size());
e1 = setArray(el, e1, edim, t2b, ep, irs, op == EXP.construct ? EXP.blit : op);
}
}
else
{
tym_t ty = totym(v.type);
e1 = el_una(OPind, ty, e1);
if (tybasic(ty) == TYstruct)
e1.ET = Type_toCtype(v.type);
if (auto bf = v.isBitFieldDeclaration())
{
if (!vbf || vbf.offset + vbf.type.size() <= v.offset)
{
/* Initialize entire location the bitfield is in
* ep = (ep & ((1 << bf.fieldWidth) - 1)) << bf.bitOffset
*/
tym_t e1ty = e1.Ety;
auto ex = el_bin(OPand, e1ty, ep, el_long(e1ty, (1L << bf.fieldWidth) - 1));
ep = el_bin(OPshl, e1ty, ex, el_long(e1ty, bf.bitOffset));
vbf = v;
}
else
{
// Insert special bitfield operator
auto mos = el_long(TYuint, bf.fieldWidth * 256 + bf.bitOffset);
e1 = el_bin(OPbit, e1.Ety, e1, mos);
}
}
else
vbf = null;
e1 = elAssign(e1, ep, v.type, e1.ET);
}
e = el_combine(e, e1);
}
}
if (sle.sd.isNested() && dim != sle.sd.fields.length)
{
// Initialize the hidden 'this' pointer
assert(sle.sd.fields.length);
elem* e1, e2;
if (tybasic(stmp.Stype.Tty) == TYnptr)
{
e1 = el_var(stmp);
}
else
{
e1 = el_ptr(stmp);
}
if (sle.sd.vthis2)
{
/* Initialize sd.vthis2:
* *(e2 + sd.vthis2.offset) = this1;
*/
e2 = el_copytree(e1);
e2 = setEthis(sle.loc, irs, e2, sle.sd, true);
}
/* Initialize sd.vthis:
* *(e1 + sd.vthis.offset) = this;
*/
e1 = setEthis(sle.loc, irs, e1, sle.sd);
e = el_combine(e, e1);
e = el_combine(e, e2);
}
elem *ev = el_var(stmp);
ev.ET = Type_toCtype(sle.sd.type);
e = el_combine(e, ev);
elem_setLoc(e, sle.loc);
if (forcetype)
return Lreinterpret(sle.loc, e, forcetype);
return e;
}
/********************************************
* Append destructors for varsInScope[starti..endi] to er.
* Params:
* irs = context
* er = elem to append destructors to
* starti = starting index in varsInScope[]
* endi = ending index in varsInScope[]
* Returns:
* er with destructors appended
*/
elem *appendDtors(IRState *irs, elem *er, size_t starti, size_t endi)
{
//printf("appendDtors(%d .. %d)\n", starti, endi);
/* Code gen can be improved by determining if no exceptions can be thrown
* between the OPdctor and OPddtor, and eliminating the OPdctor and OPddtor.
*/
/* Build edtors, an expression that calls destructors on all the variables
* going out of the scope starti..endi
*/
elem *edtors = null;
foreach (i; starti .. endi)
{
elem *ed = (*irs.varsInScope)[i];
if (ed) // if not skipped
{
//printf("appending dtor\n");
(*irs.varsInScope)[i] = null; // so these are skipped by outer scopes
edtors = el_combine(ed, edtors); // execute in reverse order
}
}
if (edtors)
{
if (irs.target.os == Target.OS.Windows && !irs.target.is64bit) // Win32
{
Blockx *blx = irs.blx;
nteh_declarvars(blx);
}
/* Append edtors to er, while preserving the value of er
*/
if (tybasic(er.Ety) == TYvoid)
{
/* No value to preserve, so simply append
*/
er = el_combine(er, edtors);
}
else
{
elem **pe;
for (pe = &er; (*pe).Eoper == OPcomma; pe = &(*pe).EV.E2)
{
}
elem *erx = *pe;
if (erx.Eoper == OPconst || erx.Eoper == OPrelconst)
{
*pe = el_combine(edtors, erx);
}
else if (elemIsLvalue(erx))
{
/* Lvalue, take a pointer to it
*/
elem *ep = el_una(OPaddr, TYnptr, erx);
elem *e = el_same(&ep);
ep = el_combine(ep, edtors);
ep = el_combine(ep, e);
e = el_una(OPind, erx.Ety, ep);
e.ET = erx.ET;
*pe = e;
}
else
{
elem *e = el_copytotmp(&erx);
erx = el_combine(erx, edtors);
*pe = el_combine(erx, e);
}
}
}
return er;
}
/******************************************************
* Return an elem that is the file, line, and function suitable
* for insertion into the parameter list.
*/
elem *filelinefunction(IRState *irs, const ref Loc loc)
{
const(char)* id = loc.filename;
size_t len = strlen(id);
Symbol *si = toStringSymbol(id, len, 1);
elem *efilename = el_pair(TYdarray, el_long(TYsize_t, len), el_ptr(si));
if (irs.target.os == Target.OS.Windows && irs.target.is64bit)
efilename = addressElem(efilename, Type.tstring, true);
elem *elinnum = el_long(TYint, loc.linnum);
const(char)* s = "";
FuncDeclaration fd = irs.getFunc();
if (fd)
{
s = fd.toPrettyChars();
}
len = strlen(s);
si = toStringSymbol(s, len, 1);
elem *efunction = el_pair(TYdarray, el_long(TYsize_t, len), el_ptr(si));
if (irs.target.os == Target.OS.Windows && irs.target.is64bit)
efunction = addressElem(efunction, Type.tstring, true);
return el_params(efunction, elinnum, efilename, null);
}
/******************************************************
* Construct elem to run when an array bounds check fails. (Without additional context)
* Params:
* irs = to get function from
* loc = to get file/line from
* Returns:
* elem generated
*/
elem* buildRangeError(IRState *irs, const ref Loc loc)
{
final switch (irs.params.checkAction)
{
case CHECKACTION.C:
return callCAssert(irs, loc, null, null, "array overflow");
case CHECKACTION.halt:
return genHalt(loc);
case CHECKACTION.context:
case CHECKACTION.D:
const efile = irs.locToFileElem(loc);
return el_bin(OPcall, TYvoid, el_var(getRtlsym(RTLSYM.DARRAYP)), el_params(el_long(TYint, loc.linnum), efile, null));
}
}
/******************************************************
* Construct elem to run when an array slice is created that is out of bounds
* Params:
* irs = to get function from
* loc = to get file/line from
* lower = lower bound in slice
* upper = upper bound in slice
* elength = length of array
* Returns:
* elem generated
*/
elem* buildArraySliceError(IRState *irs, const ref Loc loc, elem* lower, elem* upper, elem* length) {
final switch (irs.params.checkAction)
{
case CHECKACTION.C:
return callCAssert(irs, loc, null, null, "array slice out of bounds");
case CHECKACTION.halt:
return genHalt(loc);
case CHECKACTION.context:
case CHECKACTION.D:
assert(upper);
assert(lower);
assert(length);
const efile = irs.locToFileElem(loc);
return el_bin(OPcall, TYvoid, el_var(getRtlsym(RTLSYM.DARRAY_SLICEP)), el_params(length, upper, lower, el_long(TYint, loc.linnum), efile, null));
}
}
/******************************************************
* Construct elem to run when an out of bounds array index is accessed
* Params:
* irs = to get function from
* loc = to get file/line from
* index = index in the array
* elength = length of array
* Returns:
* elem generated
*/
elem* buildArrayIndexError(IRState *irs, const ref Loc loc, elem* index, elem* length) {
final switch (irs.params.checkAction)
{
case CHECKACTION.C:
return callCAssert(irs, loc, null, null, "array index out of bounds");
case CHECKACTION.halt:
return genHalt(loc);
case CHECKACTION.context:
case CHECKACTION.D:
assert(length);
const efile = irs.locToFileElem(loc);
return el_bin(OPcall, TYvoid, el_var(getRtlsym(RTLSYM.DARRAY_INDEXP)), el_params(length, index, el_long(TYint, loc.linnum), efile, null));
}
}
/// Returns: elem representing a C-string (char*) to the filename
elem* locToFileElem(const IRState *irs, const ref Loc loc) {
elem* efile;
if (loc.filename)
{
const len = strlen(loc.filename);
Symbol* s = toStringSymbol(loc.filename, len, 1);
efile = el_ptr(s);
}
else
efile = toEfilenamePtr(cast(Module)irs.blx._module);
return efile;
}
/****************************************
* Generate call to C's assert failure function.
* One of exp, emsg, or str must not be null.
* Params:
* irs = context
* loc = location to use for assert message
* exp = if not null expression to test (not evaluated, but converted to a string)
* emsg = if not null then informative message to be computed at run time
* str = if not null then informative message string
* Returns:
* generated call
*/
elem *callCAssert(IRState *irs, const ref Loc loc, Expression exp, Expression emsg, const(char)* str)
{
//printf("callCAssert.toElem() %s\n", e.toChars());
Module m = cast(Module)irs.blx._module;
const(char)* mname = m.srcfile.toChars();
elem* getFuncName()
{
const(char)* id = "";
FuncDeclaration fd = irs.getFunc();
if (fd)
id = fd.toPrettyChars();
const len = strlen(id);
Symbol *si = toStringSymbol(id, len, 1);
return el_ptr(si);
}
//printf("filename = '%s'\n", loc.filename);
//printf("module = '%s'\n", mname);
/* If the source file name has changed, probably due
* to a #line directive.
*/
elem *efilename;
if (loc.filename && strcmp(loc.filename, mname) != 0)
{
const(char)* id = loc.filename;
size_t len = strlen(id);
Symbol *si = toStringSymbol(id, len, 1);
efilename = el_ptr(si);
}
else
{
efilename = toEfilenamePtr(m);
}
elem *elmsg;
if (emsg)
{
// Assuming here that emsg generates a 0 terminated string
auto e = toElemDtor(emsg, irs);
elmsg = array_toPtr(Type.tvoid.arrayOf(), e);
}
else if (exp)
{
// Generate a message out of the assert expression
const(char)* id = exp.toChars();
const len = strlen(id);
Symbol *si = toStringSymbol(id, len, 1);
elmsg = el_ptr(si);
}
else
{
assert(str);
const len = strlen(str);
Symbol *si = toStringSymbol(str, len, 1);
elmsg = el_ptr(si);
}
auto eline = el_long(TYint, loc.linnum);
elem *ea;
if (irs.target.os == Target.OS.OSX)
{
// __assert_rtn(func, file, line, msg);
elem* efunc = getFuncName();
auto eassert = el_var(getRtlsym(RTLSYM.C__ASSERT_RTN));
ea = el_bin(OPcall, TYvoid, eassert, el_params(elmsg, eline, efilename, efunc, null));
}
else
{
version (CRuntime_Musl)
{
// __assert_fail(exp, file, line, func);
elem* efunc = getFuncName();
auto eassert = el_var(getRtlsym(RTLSYM.C__ASSERT_FAIL));
ea = el_bin(OPcall, TYvoid, eassert, el_params(elmsg, efilename, eline, efunc, null));
}
else
{
// [_]_assert(msg, file, line);
const rtlsym = (irs.target.os == Target.OS.Windows) ? RTLSYM.C_ASSERT : RTLSYM.C__ASSERT;
auto eassert = el_var(getRtlsym(rtlsym));
ea = el_bin(OPcall, TYvoid, eassert, el_params(eline, efilename, elmsg, null));
}
}
return ea;
}
/********************************************
* Generate HALT instruction.
* Params:
* loc = location to use for debug info
* Returns:
* generated instruction
*/
elem *genHalt(const ref Loc loc)
{
elem *e = el_calloc();
e.Ety = TYnoreturn;
e.Eoper = OPhalt;
elem_setLoc(e, loc);
return e;
}
/**************************************************
* Initialize the dual-context array with the context pointers.
* Params:
* loc = line and file of what line to show usage for
* irs = current context to get the second context from
* fd = the target function
* ethis2 = dual-context array
* ethis = the first context
* eside = where to store the assignment expressions
* Returns:
* `ethis2` if successful, null otherwise
*/
elem* setEthis2(const ref Loc loc, IRState* irs, FuncDeclaration fd, elem* ethis2, elem** ethis, elem** eside)
{
if (!fd.hasDualContext())
return null;
assert(ethis2 && ethis && *ethis);
elem* ectx0 = el_una(OPind, (*ethis).Ety, el_copytree(ethis2));
elem* eeq0 = el_bin(OPeq, (*ethis).Ety, ectx0, *ethis);
*ethis = el_copytree(ectx0);
*eside = el_combine(eeq0, *eside);
elem* ethis1 = getEthis(loc, irs, fd, fd.toParent2());
elem* ectx1 = el_bin(OPadd, TYnptr, el_copytree(ethis2), el_long(TYsize_t, tysize(TYnptr)));
ectx1 = el_una(OPind, TYnptr, ectx1);
elem* eeq1 = el_bin(OPeq, ethis1.Ety, ectx1, ethis1);
*eside = el_combine(eeq1, *eside);
return ethis2;
}
/*******************************
* Construct OPva_start node
* Params:
* e = function parameters
* Returns:
* OPva_start node
*/
private
elem* constructVa_start(elem* e)
{
assert(e.Eoper == OPparam);
e.Eoper = OPva_start;
e.Ety = TYvoid;
if (target.is64bit)
{
// (OPparam &va &arg)
// call as (OPva_start &va)
auto earg = e.EV.E2;
e.EV.E2 = null;
return el_combine(earg, e);
}
else // 32 bit
{
// (OPparam &arg &va) note arguments are swapped from 64 bit path
// call as (OPva_start &va)
auto earg = e.EV.E1;
e.EV.E1 = e.EV.E2;
e.EV.E2 = null;
return el_combine(earg, e);
}
}
| D |
E: c371, c406, c273, c335, c136, c329, c146, c377, c213, c40, c255, c205, c224, c18, c321, c364, c432, c324, c359, c306, c211, c166, c157, c317, c86, c160, c170, c209, c238, c326, c34, c92, c298, c378, c70, c82, c343, c90, c362, c426, c142, c367, c138, c60, c233, c47, c325, c421, c163, c27, c201, c241, c409, c49, c296, c101, c250, c275, c416, c365, c59, c429, c99, c366, c319, c66, c227, c106, c148, c263, c268, c348, c20, c137, c350, c425, c236, c386, c380, c291, c418, c152, c262, c103, c286, c89, c387, c302, c158, c215, c118, c174, c68, c240, c246, c369, c312, c143, c358, c232, c39, c399, c242, c391, c361, c144, c65, c292, c58, c200, c214, c344, c117, c430, c38, c339, c264, c155, c69, c342, c254, c333, c175, c196.
p4(E,E)
c371,c406
c136,c329
c146,c377
c213,c40
c255,c205
c224,c18
c321,c364
c432,c377
c359,c324
c306,c377
c211,c166
c157,c377
c371,c317
c160,c166
c170,c166
c92,c298
c378,c40
c432,c70
c326,c82
c146,c18
c142,c377
c213,c367
c160,c324
c364,c233
c367,c47
c325,c426
c86,c82
c421,c163
c224,c233
c364,c426
c142,c34
c160,c329
c170,c329
c432,c82
c211,c27
c367,c201
c326,c406
c364,c40
c432,c233
c306,c298
c160,c409
c136,c317
c224,c298
c326,c70
c364,c49
c364,c201
c92,c27
c326,c409
c378,c49
c317,c377
c136,c70
c378,c365
c429,c166
c306,c233
c211,c406
c273,c335
c317,c317
c142,c233
c142,c70
c146,c82
c359,c18
c432,c365
c211,c18
c429,c406
c146,c47
c224,c82
c92,c377
c326,c40
c170,c49
c432,c47
c142,c409
c160,c27
c326,c298
c367,c18
c86,c365
c146,c34
c224,c201
c326,c166
c364,c166
c367,c367
c160,c49
c146,c201
c101,c329
c378,c317
c432,c329
c213,c326
c371,c326
c146,c326
c429,c70
c325,c329
c211,c367
c213,c377
c367,c317
c359,c201
c364,c377
c146,c233
c86,c49
c157,c365
c146,c40
c325,c82
c136,c166
c157,c326
c364,c406
c432,c49
c317,c70
c429,c317
c101,c324
c429,c18
c432,c367
c211,c426
c326,c317
c429,c40
c136,c233
c170,c18
c263,c106
c170,c426
c317,c324
c211,c47
c317,c27
c160,c233
c364,c70
c359,c27
c213,c317
c378,c406
c378,c18
c224,c324
c211,c82
c364,c47
c224,c49
c317,c409
c213,c70
c325,c324
c146,c324
c224,c365
c367,c298
c317,c47
c86,c406
c367,c365
c326,c18
c157,c47
c86,c40
c306,c70
c160,c201
c101,c34
c371,c18
c142,c40
c157,c201
c136,c201
c92,c365
c326,c367
c359,c166
c359,c70
c306,c34
c359,c40
c378,c47
c213,c298
c325,c201
c92,c82
c86,c367
c146,c406
c325,c40
c378,c326
c429,c298
c86,c329
c142,c329
c142,c317
c157,c406
c136,c426
c142,c27
c326,c49
c326,c27
c160,c367
c371,c409
c359,c317
c213,c27
c306,c27
c92,c329
c325,c166
c142,c324
c160,c365
c325,c377
c317,c326
c359,c233
c306,c18
c86,c409
c146,c27
c157,c166
c92,c367
c86,c70
c101,c406
c99,c255
c378,c201
c213,c82
c378,c298
c92,c34
c157,c298
c157,c409
c174,c68
c367,c326
c367,c70
c359,c365
c211,c329
c211,c233
c429,c367
c367,c233
c367,c82
c359,c377
c359,c406
c224,c34
c325,c27
c367,c40
c213,c426
c371,c47
c317,c406
c170,c47
c170,c40
c101,c367
c136,c367
c429,c27
c92,c233
c142,c426
c136,c18
c146,c367
c367,c49
c160,c40
c371,c166
c160,c298
c432,c34
c170,c324
c211,c377
c160,c426
c371,c324
c325,c34
c432,c298
c359,c298
c101,c426
c306,c49
c326,c324
c101,c365
c157,c317
c429,c365
c157,c426
c224,c40
c371,c27
c146,c329
c146,c298
c86,c298
c224,c409
c170,c201
c86,c317
c429,c233
c157,c233
c211,c40
c367,c27
c142,c166
c142,c49
c317,c18
c106,c263
c359,c329
c378,c367
c371,c82
c211,c317
c136,c298
c378,c324
c371,c367
c213,c365
c317,c82
c306,c426
c325,c47
c432,c426
c364,c18
c429,c47
c371,c201
c325,c365
c325,c70
c432,c18
c317,c367
c92,c317
c371,c329
c92,c49
c101,c317
c317,c329
c429,c426
c136,c324
c211,c324
c364,c329
c101,c82
c371,c377
c136,c40
c160,c82
c364,c326
c146,c426
c142,c201
c170,c377
c211,c49
c157,c40
c378,c426
c170,c326
c326,c329
c326,c201
c142,c367
c211,c326
c325,c367
c160,c18
c306,c367
c92,c201
c306,c326
c92,c47
c224,c70
c364,c321
c325,c49
c364,c298
c136,c49
c101,c326
c367,c329
c86,c324
c325,c406
c142,c18
c211,c201
c157,c18
c325,c18
c136,c406
c160,c70
c146,c70
c326,c34
c86,c34
c86,c166
c213,c409
c86,c377
c224,c406
c86,c18
c146,c365
c367,c324
c371,c49
c200,c214
c429,c326
c378,c27
c101,c40
c224,c47
c364,c82
c213,c406
c136,c34
c367,c166
c325,c326
c371,c233
c326,c365
c429,c329
c432,c324
c146,c49
c92,c326
c157,c70
c117,c430
c429,c201
c326,c426
c92,c406
c364,c367
c364,c317
c68,c174
c371,c365
c213,c324
c364,c409
c142,c82
c317,c40
c160,c406
c211,c365
c326,c47
c378,c409
c101,c233
c157,c324
c157,c34
c367,c406
c213,c49
c86,c426
c325,c233
c306,c201
c306,c406
c224,c317
c136,c377
c432,c201
c306,c166
c92,c70
c142,c298
c378,c377
c378,c329
c430,c117
c317,c49
c155,c158
c92,c426
c306,c365
c306,c40
c359,c326
c86,c326
c213,c201
c224,c166
c136,c326
c325,c317
c213,c34
c170,c70
c364,c27
c317,c365
c92,c40
c306,c324
c224,c27
c326,c233
c378,c34
c157,c367
c170,c34
c136,c365
c86,c233
c306,c82
c432,c40
c86,c27
c157,c49
c213,c18
c371,c70
c101,c166
c170,c409
c364,c34
c213,c329
c101,c70
c136,c82
c136,c47
c213,c47
c170,c367
c378,c233
c224,c367
c101,c49
c371,c34
c92,c324
c429,c377
c429,c34
c224,c377
c317,c201
c364,c324
c364,c365
c371,c40
c157,c329
c432,c27
c317,c166
c146,c317
c432,c166
c378,c70
c211,c298
c142,c365
c160,c326
c158,c155
c325,c298
c86,c47
c429,c324
c101,c298
c429,c82
c325,c409
c317,c34
c170,c298
c170,c27
c136,c27
c306,c47
c432,c326
c367,c34
c429,c49
c371,c426
c101,c201
c160,c34
c142,c406
c146,c409
c170,c365
c359,c49
c326,c377
c359,c47
c142,c47
c170,c233
c224,c426
c432,c406
c157,c82
c359,c34
c170,c82
c317,c426
c224,c329
c224,c326
c359,c409
c101,c18
c205,c255
c170,c406
c213,c233
c157,c27
c170,c317
c92,c409
c317,c233
c359,c426
c359,c367
c367,c377
c213,c166
c211,c409
c211,c70
c92,c166
c432,c409
c160,c317
c101,c27
c306,c317
c136,c409
c146,c166
c367,c409
c432,c317
c101,c409
c101,c47
c211,c34
c317,c298
c378,c82
c92,c18
c367,c426
c101,c377
c429,c409
c359,c82
c306,c329
c160,c47
c326,c326
c160,c377
c306,c409
c142,c326
c378,c166
c371,c298
c86,c201
.
p6(E,E)
c273,c335
c209,c238
c99,c255
c138,c60
c136,c242
c421,c163
c421,c391
c364,c321
c86,c377
c200,c214
c143,c358
.
p0(E,E)
c324,c324
c326,c326
c34,c34
c426,c426
c27,c27
c90,c27
c298,c298
c406,c406
c201,c201
c386,c34
c47,c47
c366,c40
c233,c233
c215,c377
c49,c70
c329,c201
c137,c49
c40,c40
c58,c47
c344,c329
c367,c367
c329,c329
c317,c317
c365,c365
c342,c317
c275,c18
c82,c82
c377,c377
c49,c49
c18,c18
c166,c166
c70,c70
c409,c409
.
p3(E,E)
c86,c86
c211,c211
c211,c241
c371,c371
c432,c432
c213,c213
c92,c92
c378,c378
c101,c250
c317,c317
c92,c152
c429,c89
c378,c118
c306,c306
c170,c170
c432,c286
c306,c90
c170,c66
c367,c367
c86,c38
c136,c136
c364,c364
c359,c359
c146,c146
c326,c326
c157,c157
c101,c101
c224,c224
c142,c142
c429,c429
c367,c361
c325,c325
c160,c160
.
p7(E,E)
c343,c90
c213,c213
c296,c205
c101,c250
c170,c66
c106,c106
c148,c263
c20,c348
c359,c359
c425,c425
c99,c158
c90,c90
c240,c174
c86,c86
c232,c321
c409,c387
c144,c65
c292,c106
c136,c136
c367,c361
c369,c246
c59,c59
c387,c387
c377,c86
c364,c364
c92,c152
c103,c262
c321,c59
c306,c90
c236,c425
c196,c117
.
p9(E,E)
c329,c362
c366,c319
c227,c238
c137,c350
c399,c242
c101,c358
c264,c391
c275,c416
c69,c60
c58,c377
c166,c302
c90,c39
.
p5(E,E)
c138,c60
c86,c377
c59,c59
c90,c90
c425,c236
c387,c409
c213,c213
c143,c358
c59,c321
c421,c391
c136,c242
c136,c136
c90,c343
c106,c292
c364,c364
c359,c359
c425,c425
c90,c306
c387,c387
c86,c86
c106,c106
c209,c238
.
p10(E,E)
c275,c416
c359,c380
c364,c291
c359,c418
c166,c302
c366,c319
c213,c286
c136,c425
c137,c350
c90,c39
c361,c421
c152,c146
c58,c377
c250,c339
c329,c362
c66,c254
.
p1(E,E)
c364,c321
c273,c335
c99,c255
c86,c377
c200,c214
c421,c163
.
p2(E,E)
c364,c326
c146,c268
c326,c286
c213,c409
c136,c298
c224,c312
c359,c367
c371,c333
c359,c426
c160,c175
.
p8(E,E)
c348,c20
c262,c103
c246,c369
c321,c232
c65,c144
.
| D |
/Users/brunodaluz/Desktop/project/Build/Intermediates/project.build/Debug/DatabaseKit.build/Objects-normal/x86_64/Container+CachedConnection.o : /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/Deprecated.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/KeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/DatabaseKeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/DictionaryKeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/MemoryKeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/DatabaseStringFindable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/DatabaseConnectable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/DatabaseQueryable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/URL+DatabaseName.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/Database.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/ConfiguredDatabase.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/DatabaseConfig.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolConfig.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/KeyedCacheSupporting.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/LogSupporting.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/DatabaseLog.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/Container+ConnectionPool.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPool.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/Container+CachedConnection.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/DatabaseConnection.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/Container+NewConnection.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Service/DatabaseKitProvider.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/DatabaseLogger.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/DatabaseIdentifier.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/DatabaseLogHandler.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/PrintLogHandler.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/DatabaseKitError.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/Databases.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/Exports.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Service.framework/Modules/Service.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/cpp_magic.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIODarwin/include/c_nio_darwin.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/c-atomics.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOLinux/include/c_nio_linux.h /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio-zlib-support.git-4597058737275259177/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/brunodaluz/Desktop/project/Build/Intermediates/project.build/Debug/DatabaseKit.build/Objects-normal/x86_64/Container+CachedConnection~partial.swiftmodule : /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/Deprecated.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/KeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/DatabaseKeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/DictionaryKeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/MemoryKeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/DatabaseStringFindable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/DatabaseConnectable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/DatabaseQueryable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/URL+DatabaseName.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/Database.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/ConfiguredDatabase.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/DatabaseConfig.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolConfig.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/KeyedCacheSupporting.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/LogSupporting.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/DatabaseLog.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/Container+ConnectionPool.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPool.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/Container+CachedConnection.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/DatabaseConnection.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/Container+NewConnection.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Service/DatabaseKitProvider.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/DatabaseLogger.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/DatabaseIdentifier.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/DatabaseLogHandler.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/PrintLogHandler.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/DatabaseKitError.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/Databases.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/Exports.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Service.framework/Modules/Service.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/cpp_magic.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIODarwin/include/c_nio_darwin.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/c-atomics.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOLinux/include/c_nio_linux.h /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio-zlib-support.git-4597058737275259177/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/brunodaluz/Desktop/project/Build/Intermediates/project.build/Debug/DatabaseKit.build/Objects-normal/x86_64/Container+CachedConnection~partial.swiftdoc : /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/Deprecated.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/KeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/DatabaseKeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/DictionaryKeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/MemoryKeyedCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolCache.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/DatabaseStringFindable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/DatabaseConnectable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/DatabaseQueryable.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/URL+DatabaseName.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/Database.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/ConfiguredDatabase.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/DatabaseConfig.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolConfig.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/KeyedCache/KeyedCacheSupporting.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/LogSupporting.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/DatabaseLog.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/Container+ConnectionPool.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPool.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/Container+CachedConnection.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/DatabaseConnection.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Connection/Container+NewConnection.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Service/DatabaseKitProvider.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/DatabaseLogger.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/DatabaseIdentifier.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/DatabaseLogHandler.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Log/PrintLogHandler.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/DatabaseKitError.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Database/Databases.swift /Users/brunodaluz/Desktop/project/.build/checkouts/database-kit.git--8359960696545479939/Sources/DatabaseKit/Utilities/Exports.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIO.framework/Modules/NIO.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Async.framework/Modules/Async.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Service.framework/Modules/Service.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Core.framework/Modules/Core.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Debugging.framework/Modules/Debugging.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/COperatingSystem.framework/Modules/COperatingSystem.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOConcurrencyHelpers.framework/Modules/NIOConcurrencyHelpers.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/Bits.framework/Modules/Bits.swiftmodule/x86_64.swiftmodule /Users/brunodaluz/Desktop/project/Build/Products/Debug/NIOFoundationCompat.framework/Modules/NIOFoundationCompat.swiftmodule/x86_64.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/cpp_magic.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIODarwin/include/c_nio_darwin.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOAtomics/include/c-atomics.h /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio.git--325538877768392360/Sources/CNIOLinux/include/c_nio_linux.h /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOSHA1/module.modulemap /Users/brunodaluz/Desktop/project/.build/checkouts/swift-nio-zlib-support.git-4597058737275259177/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIODarwin/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOAtomics/module.modulemap /Users/brunodaluz/Desktop/project/project.xcodeproj/GeneratedModuleMap/CNIOLinux/module.modulemap /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/Users/sjwu/video/HouseHold/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMakerPriortizable.o : /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintConfig.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/Debugging.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintItem.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintRelation.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintDescription.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMaker.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/Typealiases.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintInsets.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/Constraint.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/LayoutConstraint.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintView.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintPriority.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/sjwu/video/HouseHold/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/sjwu/video/HouseHold/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap
/Users/sjwu/video/HouseHold/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMakerPriortizable~partial.swiftmodule : /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintConfig.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/Debugging.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintItem.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintRelation.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintDescription.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMaker.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/Typealiases.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintInsets.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/Constraint.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/LayoutConstraint.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintView.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintPriority.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/sjwu/video/HouseHold/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/sjwu/video/HouseHold/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap
/Users/sjwu/video/HouseHold/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/Objects-normal/x86_64/ConstraintMakerPriortizable~partial.swiftdoc : /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutGuideDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutSupportDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintViewDSL.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutGuide.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerExtendable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerRelatable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerEditable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerFinalizable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMakerPriortizable.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintConfig.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/Debugging.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintItem.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/LayoutConstraintItem.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintRelation.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintDescription.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMaker.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/Typealiases.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintAttributes.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutGuide+Extensions.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/UILayoutSupport+Extensions.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintView+Extensions.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintInsets.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintRelatableTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintMultiplierTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintOffsetTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintInsetTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintConstantTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintPriorityTarget.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/Constraint.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/LayoutConstraint.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintLayoutSupport.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintView.swift /Users/sjwu/video/HouseHold/Pods/SnapKit/Source/ConstraintPriority.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/sjwu/video/HouseHold/Pods/Target\ Support\ Files/SnapKit/SnapKit-umbrella.h /Users/sjwu/video/HouseHold/Build/Intermediates/Pods.build/Debug-iphonesimulator/SnapKit.build/unextended-module.modulemap
| D |
/Users/prang/Desktop/AppDontForget2/build/AppDontForget.build/Debug-iphonesimulator/AppDontForget.build/Objects-normal/x86_64/MyprofileViewController.o : /Users/prang/Desktop/AppDontForget2/AppDontForget/AllUsersTableViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarHeaderView.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/LocationManager.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/RequestViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/TodoList.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/Message.swift /Users/prang/Desktop/AppDontForget2/MapCurrentViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarView.swift /Users/prang/Desktop/AppDontForget2/AkiraTextField.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/LoginViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/ViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/TodoTableViewCell.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/UpdateTableViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/SignupViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/AllUsersInTableViewCell.swift /Users/prang/Desktop/AppDontForget2/SendText.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/SCLAlertView.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/ResetPasswordViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/\ AddTodoTableViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarDayCell.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/NewMessageController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CustomableImageView.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/User.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CustomButton.swift /Users/prang/Desktop/AppDontForget2/TextFieldsEffects.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/MyprofileViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/NetworkService.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/ChatLogController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarFlowLayout.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/AppDelegate.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/TodoListTableViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/prang/Desktop/AppDontForget2/AppDontForget/AppDontForget-Bridging-Header.h /Users/prang/Desktop/AppDontForget2/AppDontForget/MGSwipeTableCell.h /Users/prang/Desktop/AppDontForget2/Pods/Firebase/Core/Sources/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/prang/Desktop/AppDontForget2/AppDontForget/MGSwipeButton.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailPasswordAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/Firebase/Core/Sources/Firebase.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/MapKit.swiftmodule
/Users/prang/Desktop/AppDontForget2/build/AppDontForget.build/Debug-iphonesimulator/AppDontForget.build/Objects-normal/x86_64/MyprofileViewController~partial.swiftmodule : /Users/prang/Desktop/AppDontForget2/AppDontForget/AllUsersTableViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarHeaderView.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/LocationManager.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/RequestViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/TodoList.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/Message.swift /Users/prang/Desktop/AppDontForget2/MapCurrentViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarView.swift /Users/prang/Desktop/AppDontForget2/AkiraTextField.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/LoginViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/ViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/TodoTableViewCell.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/UpdateTableViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/SignupViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/AllUsersInTableViewCell.swift /Users/prang/Desktop/AppDontForget2/SendText.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/SCLAlertView.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/ResetPasswordViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/\ AddTodoTableViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarDayCell.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/NewMessageController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CustomableImageView.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/User.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CustomButton.swift /Users/prang/Desktop/AppDontForget2/TextFieldsEffects.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/MyprofileViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/NetworkService.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/ChatLogController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarFlowLayout.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/AppDelegate.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/TodoListTableViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/prang/Desktop/AppDontForget2/AppDontForget/AppDontForget-Bridging-Header.h /Users/prang/Desktop/AppDontForget2/AppDontForget/MGSwipeTableCell.h /Users/prang/Desktop/AppDontForget2/Pods/Firebase/Core/Sources/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/prang/Desktop/AppDontForget2/AppDontForget/MGSwipeButton.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailPasswordAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/Firebase/Core/Sources/Firebase.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/MapKit.swiftmodule
/Users/prang/Desktop/AppDontForget2/build/AppDontForget.build/Debug-iphonesimulator/AppDontForget.build/Objects-normal/x86_64/MyprofileViewController~partial.swiftdoc : /Users/prang/Desktop/AppDontForget2/AppDontForget/AllUsersTableViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarHeaderView.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/LocationManager.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/RequestViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/TodoList.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/Message.swift /Users/prang/Desktop/AppDontForget2/MapCurrentViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarView.swift /Users/prang/Desktop/AppDontForget2/AkiraTextField.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/LoginViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/ViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/TodoTableViewCell.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/UpdateTableViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/SignupViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/AllUsersInTableViewCell.swift /Users/prang/Desktop/AppDontForget2/SendText.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/SCLAlertView.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/ResetPasswordViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/\ AddTodoTableViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarDayCell.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/NewMessageController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CustomableImageView.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/User.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CustomButton.swift /Users/prang/Desktop/AppDontForget2/TextFieldsEffects.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/MyprofileViewController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/NetworkService.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/ChatLogController.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/CalendarFlowLayout.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/AppDelegate.swift /Users/prang/Desktop/AppDontForget2/AppDontForget/TodoListTableViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/prang/Desktop/AppDontForget2/AppDontForget/AppDontForget-Bridging-Header.h /Users/prang/Desktop/AppDontForget2/AppDontForget/MGSwipeTableCell.h /Users/prang/Desktop/AppDontForget2/Pods/Firebase/Core/Sources/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/prang/Desktop/AppDontForget2/AppDontForget/MGSwipeButton.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailPasswordAuthProvider.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/prang/Desktop/AppDontForget2/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/prang/Desktop/AppDontForget2/Pods/Firebase/Core/Sources/Firebase.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/MapKit.swiftmodule
| D |
module uvibe.main;
import tango.net.SocketConduit;
import tango.net.InternetAddress;
import tango.io.Console;
import tango.io.Stdout;
import tango.text.Util;
import callback;
import ircconnection;
import ctcp;
/*
Msg to channel:
:Nayruden!n=Nayruden@64.87.9.88 PRIVMSG #uvibe :Hi UVibe :)
:<nick>!<username>@<hostname> PRIVMSG <channel> :<msg>
:Erlie-chan!n=erieri@121.120.232.227 PRIVMSG UVibe :PING 1227541893367
:<nick>!<username>@<hostname> PRIVMSG <myname> :PING <data>
NOTICE <space> <target> <space> : <marker> <command> [<arg> [...]] <marker>
Join:
:UVibe!n=UVibe@220.149.109.71 JOIN :#daydream
:wolfe.freenode.net 353 UVibe = #daydream :UVibe Erlange Ortzinator th0br0 CIA-6 Nayruden @ChanServ
Ping:
PING :<args>
to be answered with:
PONG :<args>
CTCP REQUEST Erlie-chan CLIENTINFO
Erlie-chan CTCP REPLY CLIENTINFO CLIENTINFO ACTION FINGER TIME VERSION SOURCE OS HOST PING DCC
CTCP REPLY Nayruden VERSION Colloquy 2.1 (3761) - Mac OS X 10.5.5 (Intel) - http://colloquy.info
*/
void main()
{
auto conn = new CTCP!(IRCConnection);
conn.connect( "irc.freenode.net", 8000 );
conn.join( "#daydream" );
conn.onRawLine ~= function void( char[] line )
{
Stdout( line ~ "\n" );
};
while ( conn.isConnected ) {
conn.read();
}
}
| D |
module socks5d.client;
import socks5d.packets;
import socks5d.driver;
import socks5d.factory : f, logger, ConnectionImpl;
import socks5d.server;
import socks5d.auth;
class Client
{
package:
uint id;
protected:
Connection conn;
AuthManager authManager;
public:
this(Connection conn, uint id, AuthManager authManager)
{
assert(authManager !is null);
this.id = id;
this.authManager = authManager;
this.conn = conn;
}
final void run()
{
logger.diagnostic("[%d] New client accepted: %s", id, conn.remoteAddress);
scope (exit) conn.close();
try {
if (authManager.authenticate(this)) {
Connection targetConn = handshake();
scope (exit) {
targetConn.close();
}
conn.duplexPipe(targetConn, id);
}
} catch (SocksException e) {
logger.error("Error: %s", e.msg);
}
logger.debugN("[%d] End of session", id);
}
package:
void send(P)(ref P packet)
if (isSocks5OutgoingPacket!P)
{
logger.debugV("[%d] send: %s", id, packet.printFields);
packet.send(conn);
}
void receive(P)(ref P packet)
if (isSocks5IncomingPacket!P)
{
packet.receive(conn);
logger.debugV("[%d] recv: %s", id, packet.printFields);
}
Connection handshake()
{
import std.socket : InternetAddress;
RequestPacket requestPacket = { connID: id };
ResponsePacket responsePacket = { connID: id };
try {
receive(requestPacket);
} catch (RequestException e) {
logger.warning("[%d] Error: %s", id, e.msg);
responsePacket.replyCode = e.replyCode;
send(responsePacket);
throw e;
}
logger.debugV("[%d] Connecting to %s:%d", id, requestPacket.getHost(), requestPacket.getPort());
Connection targetConn = f.connection();
targetConn.connect(new InternetAddress(requestPacket.getHost(), requestPacket.getPort()));
responsePacket.addressType = AddressType.IPV4;
responsePacket.setBindAddress(
targetConn.localAddress.addr,
targetConn.localAddress.port
);
send(responsePacket);
return targetConn;
}
}
| D |
/home/drees/sc101/rps/target/debug/build/proc-macro2-b4ca5e515c58e8b9/build_script_build-b4ca5e515c58e8b9: /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.28/build.rs
/home/drees/sc101/rps/target/debug/build/proc-macro2-b4ca5e515c58e8b9/build_script_build-b4ca5e515c58e8b9.d: /home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.28/build.rs
/home/drees/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.28/build.rs:
| D |
/*
* hunt-proton: AMQP Protocol library for D programming language.
*
* Copyright (C) 2018-2019 HuntLabs
*
* Website: https://www.huntlabs.net/
*
* Licensed under the Apache-2.0 License.
*
*/
module hunt.proton.amqp.transport.Close;
import hunt.proton.amqp.Binary;
import hunt.proton.amqp.transport.FrameBody;
import hunt.proton.amqp.transport.ErrorCondition;
class Close : FrameBody
{
private ErrorCondition _error;
this() {}
this(Close other)
{
if (other._error !is null)
{
this._error = new ErrorCondition();
this._error.copyFrom(other.getError());
}
}
public ErrorCondition getError()
{
return _error;
}
public void setError(ErrorCondition error)
{
_error = error;
}
//override
public void invoke(E)(FrameBodyHandler!E handler, Binary payload, E context)
{
handler.handleClose(this, payload, context);
}
public FrameBody copy()
{
return new Close(this);
}
}
| D |
/Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/Objects-normal/x86_64/DiskStorage.o : /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/String+MD5.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Deprecated.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Source.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Resource.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Image.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/GIFAnimatedImage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/Storage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/DiskStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/ImageCache.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/AuthenticationChallengeResponsable.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Runtime.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Delegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloaderDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/CallbackQueue.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProgressive.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageDrawing.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDataTask.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageTransition.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherOptionsInfo.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloader.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/ImageDataProvider.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Placeholder.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherManager.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImagePrefetcher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/WKInterfaceImage+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/UIButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/NSButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/ImageView+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RequestModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RedirectHandler.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Filter.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/CacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/FormatIndicatedCacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherError.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDataProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/Indicator.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/SizeExtensions.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/ExtensionHelpers.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageFormat.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Result.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/AnimatedImageView.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Box.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Accelerate.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/os.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Target\ Support\ Files/Kingfisher/Kingfisher-umbrella.h /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Kingfisher.h /Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/Objects-normal/x86_64/DiskStorage~partial.swiftmodule : /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/String+MD5.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Deprecated.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Source.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Resource.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Image.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/GIFAnimatedImage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/Storage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/DiskStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/ImageCache.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/AuthenticationChallengeResponsable.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Runtime.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Delegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloaderDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/CallbackQueue.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProgressive.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageDrawing.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDataTask.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageTransition.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherOptionsInfo.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloader.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/ImageDataProvider.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Placeholder.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherManager.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImagePrefetcher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/WKInterfaceImage+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/UIButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/NSButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/ImageView+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RequestModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RedirectHandler.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Filter.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/CacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/FormatIndicatedCacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherError.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDataProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/Indicator.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/SizeExtensions.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/ExtensionHelpers.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageFormat.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Result.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/AnimatedImageView.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Box.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Accelerate.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/os.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Target\ Support\ Files/Kingfisher/Kingfisher-umbrella.h /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Kingfisher.h /Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/Objects-normal/x86_64/DiskStorage~partial.swiftdoc : /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/String+MD5.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Deprecated.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Source.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/Resource.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Image.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/GIFAnimatedImage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/Storage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/DiskStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/ImageCache.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/AuthenticationChallengeResponsable.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Runtime.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Delegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloaderDelegate.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/CallbackQueue.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProgressive.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageDrawing.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/SessionDataTask.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageTransition.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherOptionsInfo.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDownloader.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/ImageSource/ImageDataProvider.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Placeholder.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherManager.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImagePrefetcher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/WKInterfaceImage+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/UIButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/NSButton+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Extensions/ImageView+Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/Kingfisher.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RequestModifier.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/RedirectHandler.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/Filter.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/CacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Cache/FormatIndicatedCacheSerializer.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/General/KingfisherError.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Networking/ImageDataProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageProcessor.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/Indicator.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/SizeExtensions.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/ExtensionHelpers.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Image/ImageFormat.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Result.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Views/AnimatedImageView.swift /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Utility/Box.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Accelerate.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/os.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Accelerate.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/os.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Target\ Support\ Files/Kingfisher/Kingfisher-umbrella.h /Users/ThiagoBevi/Developer/Teste_iOS/Pods/Kingfisher/Sources/Kingfisher.h /Users/ThiagoBevi/Developer/Teste_iOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Kingfisher.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/os.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/Users/Hasaani/Desktop/iOS/Flappy Birdk/DerivedData/Flappy Birdk/Build/Intermediates/Flappy Birdk.build/Debug-iphonesimulator/Flappy Birdk.build/Objects-normal/x86_64/GameScene.o : /Users/Hasaani/Desktop/iOS/Flappy\ Birdk/Flappy\ Birdk/GameScene.swift /Users/Hasaani/Desktop/iOS/Flappy\ Birdk/Flappy\ Birdk/GameViewController.swift /Users/Hasaani/Desktop/iOS/Flappy\ Birdk/Flappy\ Birdk/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule
/Users/Hasaani/Desktop/iOS/Flappy Birdk/DerivedData/Flappy Birdk/Build/Intermediates/Flappy Birdk.build/Debug-iphonesimulator/Flappy Birdk.build/Objects-normal/x86_64/GameScene~partial.swiftmodule : /Users/Hasaani/Desktop/iOS/Flappy\ Birdk/Flappy\ Birdk/GameScene.swift /Users/Hasaani/Desktop/iOS/Flappy\ Birdk/Flappy\ Birdk/GameViewController.swift /Users/Hasaani/Desktop/iOS/Flappy\ Birdk/Flappy\ Birdk/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule
/Users/Hasaani/Desktop/iOS/Flappy Birdk/DerivedData/Flappy Birdk/Build/Intermediates/Flappy Birdk.build/Debug-iphonesimulator/Flappy Birdk.build/Objects-normal/x86_64/GameScene~partial.swiftdoc : /Users/Hasaani/Desktop/iOS/Flappy\ Birdk/Flappy\ Birdk/GameScene.swift /Users/Hasaani/Desktop/iOS/Flappy\ Birdk/Flappy\ Birdk/GameViewController.swift /Users/Hasaani/Desktop/iOS/Flappy\ Birdk/Flappy\ Birdk/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SpriteKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/GLKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule
| D |
func void B_Kapitelwechsel(var int neues_Kapitel,var int aktuelles_Level_Zen)
{
Kapitel = neues_Kapitel;
if(neues_Kapitel == 1)
{
B_InitTalentSystem();
B_InitAttributeSystem();
Hero_HackChance = 10;
Cronos_NW_ItMi_Flask_Count = 5;
Cronos_NW_ItMi_Sulfur_Count = 2;
Cronos_NW_ItMi_Pitch_Count = 1;
Cronos_NW_ItPo_Mana_01_Count = 5;
Cronos_NW_ItPo_Health_01_Count = 6;
Cronos_NW_ItSc_Light_Count = 5;
Cronos_NW_ItSc_Firebolt_Count = 5;
Cronos_NW_ItSc_Zap_Count = 5;
Cronos_NW_ItSc_LightHeal_Count = 5;
Cronos_NW_ItSc_SumGobSkel_Count = 2;
Cronos_NW_ItSc_Icelance_Count = 5;
Cronos_NW_ItSc_Whirlwind_Count = 1;
Bennet_NW_ItMi_Swordraw_Count = 3;
IceDragonSpell = SPL_InstantFireball;
FullNPCRemoval = TRUE;
if(C_WorldIsFixed(NEWWORLD_ZEN))
{
Wld_InsertItem(ItRu_LightHeal,"FP_ITEM_PASS_02");
Wld_InsertItem(ItWr_OneHStonePlate1_Addon,"FP_ITEM_NW_BIGMILL_01");
Wld_InsertItem(ItWr_StrStonePlate1_Addon,"FP_ITEM_NW_BIGMILL_02");
Wld_InsertItem(ItWr_HitPointStonePlate3_Addon,"FP_ITEM_CASTLEMINE_01");
}
else
{
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_STAND_DEMENTOR_02");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_STAND_DEMENTOR_03");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_STAND_DEMENTOR_05");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_STAND_DEMENTOR_07");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ITEM_GREATPEASANT_FERNANDOSWEAPONS_01");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ITEM_GREATPEASANT_FERNANDOSWEAPONS_02");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ITEM_GREATPEASANT_FERNANDOSWEAPONS_03");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ITEM_GREATPEASANT_FERNANDOSWEAPONS_04");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ITEM_NW_FARM4_WOOD_LUCIASLETTER");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ROAM_FARM4_SHEEP_02");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ROAM_NW_FARM4_WOOD_MONSTER_MORE_02");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ROAM_NW_FARM4_WOOD_MONSTER_N_17");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ROAM_NW_FARM3_PATH_11_SMALLRIVER_09");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ROAM_NW_FARM3_BIGWOOD_02_04");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ROAM_NW_BIGMILL_FARM3_01");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ROAM_NW_BIGMILL_FARM3_03_02");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ROAM_NW_BIGFARM_ALLEE_08_N2");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_ITEM_FOREST_BANDITTRADER_01");
Wld_InsertItem(ItMw_Addon_BanditTrader,"FP_SMALLTALK_NW_FARM2_TO_TAVERN_08_02");
Wld_InsertItem(ItWr_OneHStonePlate1_Addon,"FP_ROAM_NW_BIGMILL_FIELD_MONSTER_04_03");
Wld_InsertItem(ItWr_StrStonePlate1_Addon,"FP_STAND_DEMENTOR_09");
Wld_InsertItem(ItWr_HitPointStonePlate3_Addon,"FP_STAND_DEMENTOR_KDF_12");
};
IntroduceChapter(KapWechsel_1,KapWechsel_1_Text,"chapter1.tga","chapter_01.wav",6000);
}
else if(neues_Kapitel == 2)
{
Sekob.flags = 0;
Bengar.flags = 0;
Bennet_NW_ItMi_Swordraw_Count += 3;
IntroduceChapter(KapWechsel_2,KapWechsel_2_Text,"chapter2.tga","chapter_01.wav",6000);
}
else if(neues_Kapitel == 3)
{
Bennet_NW_ItMi_Swordraw_Count += 3;
Bennet_NW_ItMi_Nugget_Count = 1;
}
else if(neues_Kapitel == 4)
{
Bennet_NW_ItMi_Swordraw_Count += 3;
Bennet_NW_ItMi_Nugget_Count += 2;
PLAYER_TALENT_ALCHEMY[CHARGE_Innoseye] = TRUE;
}
else if(neues_Kapitel == 5)
{
Bennet_NW_ItMi_Swordraw_Count += 3;
Bennet_NW_ItMi_Nugget_Count += 2;
PLAYER_TALENT_ALCHEMY[CHARGE_Innoseye] = TRUE;
}
else if(neues_Kapitel == 6)
{
PLAYER_TALENT_ALCHEMY[CHARGE_Innoseye] = TRUE;
};
if(aktuelles_Level_Zen == OLDWORLD_ZEN)
{
B_Enter_OldWorld();
}
else if(aktuelles_Level_Zen == NEWWORLD_ZEN)
{
B_Enter_NewWorld();
};
B_CheckLog();
if(XP_Static == FALSE)
{
B_SetAmbientXP();
};
};
| D |
/*
* Copyright 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.recyclerview.selection;
import static org.junit.Assert.assertEquals;
import android.os.Bundle;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import androidx.recyclerview.selection.testing.Bundles;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@SmallTest
public final class StorageStrategy_LongTest {
private StorageStrategy<Long> mStorage;
@Before
public void setUp() {
mStorage = StorageStrategy.createLongStorage();
}
@Test
public void testReadWrite() {
MutableSelection<Long> orig = new MutableSelection<>();
orig.add(5L);
orig.add(10L);
orig.add(15L);
Bundle parceled = Bundles.forceParceling(mStorage.asBundle(orig));
Selection<Long> restored = mStorage.asSelection(parceled);
assertEquals(orig, restored);
}
}
| D |
module UnrealScript.TribesGame.TrDevice_RegenPack;
import ScriptClasses;
import UnrealScript.Helpers;
import UnrealScript.TribesGame.TrDevice_Pack;
extern(C++) interface TrDevice_RegenPack : TrDevice_Pack
{
public extern(D):
private static __gshared ScriptClass mStaticClass;
@property final static ScriptClass StaticClass() { mixin(MGSCC("Class TribesGame.TrDevice_RegenPack")); }
private static __gshared TrDevice_RegenPack mDefaultProperties;
@property final static TrDevice_RegenPack DefaultProperties() { mixin(MGDPC("TrDevice_RegenPack", "TrDevice_RegenPack TribesGame.Default__TrDevice_RegenPack")); }
}
| D |
/Users/oslo/code/swift_vapor_server/.build/debug/Core.build/Byte/ByteAliases.swift.o : /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Array.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Bool+String.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Box.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Collection+Safe.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Dispatch.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/DispatchTime+Utilities.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Equatable.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Extractable.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/FileProtocol.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Lock.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/PercentEncoding.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Portal.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Result.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/RFC1123.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Semaphore.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Sequence.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/StaticDataBuffer.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Strand.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/String+CaseInsensitiveCompare.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/String.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/UnsignedInteger.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Byte+Random.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Byte.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/ByteAliases.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Bytes+Base64.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Bytes.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/BytesConvertible.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/oslo/code/swift_vapor_server/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
/Users/oslo/code/swift_vapor_server/.build/debug/Core.build/ByteAliases~partial.swiftmodule : /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Array.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Bool+String.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Box.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Collection+Safe.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Dispatch.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/DispatchTime+Utilities.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Equatable.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Extractable.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/FileProtocol.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Lock.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/PercentEncoding.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Portal.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Result.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/RFC1123.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Semaphore.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Sequence.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/StaticDataBuffer.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Strand.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/String+CaseInsensitiveCompare.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/String.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/UnsignedInteger.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Byte+Random.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Byte.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/ByteAliases.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Bytes+Base64.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Bytes.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/BytesConvertible.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/oslo/code/swift_vapor_server/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
/Users/oslo/code/swift_vapor_server/.build/debug/Core.build/ByteAliases~partial.swiftdoc : /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Array.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Bool+String.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Box.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Collection+Safe.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Dispatch.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/DispatchTime+Utilities.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Equatable.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Extractable.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/FileProtocol.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Lock.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/PercentEncoding.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Portal.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Result.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/RFC1123.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Semaphore.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Sequence.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/StaticDataBuffer.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Strand.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/String+CaseInsensitiveCompare.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/String.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/UnsignedInteger.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Byte+Random.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Byte.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/ByteAliases.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Bytes+Base64.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/Bytes.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/BytesConvertible.swift /Users/oslo/code/swift_vapor_server/Packages/Core-1.1.1/Sources/Core/Byte/BytesSlice+PatternMatching.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/oslo/code/swift_vapor_server/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule
| D |
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
module vtkJPEGReader;
static import vtkd_im;
static import core.stdc.config;
static import std.conv;
static import std.string;
static import std.conv;
static import std.string;
static import vtkObjectBase;
static import vtkImageReader2;
class vtkJPEGReader : vtkImageReader2.vtkImageReader2 {
private void* swigCPtr;
public this(void* cObject, bool ownCObject) {
super(vtkd_im.vtkJPEGReader_Upcast(cObject), ownCObject);
swigCPtr = cObject;
}
public static void* swigGetCPtr(vtkJPEGReader obj) {
return (obj is null) ? null : obj.swigCPtr;
}
mixin vtkd_im.SwigOperatorDefinitions;
public override void dispose() {
synchronized(this) {
if (swigCPtr !is null) {
if (swigCMemOwn) {
swigCMemOwn = false;
throw new object.Exception("C++ destructor does not have public access");
}
swigCPtr = null;
super.dispose();
}
}
}
public static vtkJPEGReader New() {
void* cPtr = vtkd_im.vtkJPEGReader_New();
vtkJPEGReader ret = (cPtr is null) ? null : new vtkJPEGReader(cPtr, false);
return ret;
}
public static int IsTypeOf(string type) {
auto ret = vtkd_im.vtkJPEGReader_IsTypeOf((type ? std.string.toStringz(type) : null));
return ret;
}
public static vtkJPEGReader SafeDownCast(vtkObjectBase.vtkObjectBase o) {
void* cPtr = vtkd_im.vtkJPEGReader_SafeDownCast(vtkObjectBase.vtkObjectBase.swigGetCPtr(o));
vtkJPEGReader ret = (cPtr is null) ? null : new vtkJPEGReader(cPtr, false);
return ret;
}
public vtkJPEGReader NewInstance() const {
void* cPtr = vtkd_im.vtkJPEGReader_NewInstance(cast(void*)swigCPtr);
vtkJPEGReader ret = (cPtr is null) ? null : new vtkJPEGReader(cPtr, false);
return ret;
}
alias vtkImageReader2.vtkImageReader2.NewInstance NewInstance;
}
| D |
/***************************************************************
inline/color.inl
***************************************************************/
module derelict.allegro.inline.color_inl;
import derelict.allegro.color;
int makecol15 (int r, int g, int b)
{
return (((r >> 3) << _rgb_r_shift_15) | ((g >> 3) << _rgb_g_shift_15) |
((b >> 3) << _rgb_b_shift_15));
}
int makecol16 (int r, int g, int b)
{
return (((r >> 3) << _rgb_r_shift_16) | ((g >> 2) << _rgb_g_shift_16) |
((b >> 3) << _rgb_b_shift_16));
}
int makecol24 (int r, int g, int b)
{
return ((r << _rgb_r_shift_24) | (g << _rgb_g_shift_24) |
(b << _rgb_b_shift_24));
}
int makecol32 (int r, int g, int b)
{
return ((r << _rgb_r_shift_32) | (g << _rgb_g_shift_32) |
(b << _rgb_b_shift_32));
}
int makeacol32 (int r, int g, int b, int a)
{
return ((r << _rgb_r_shift_32) | (g << _rgb_g_shift_32) |
(b << _rgb_b_shift_32) | (a << _rgb_a_shift_32));
}
int getr8 (int c)
{
return _rgb_scale_6[cast(int)_current_palette[c].r];
}
int getg8 (int c)
{
return _rgb_scale_6[cast(int)_current_palette[c].g];
}
int getb8 (int c)
{
return _rgb_scale_6[cast(int)_current_palette[c].b];
}
int getr15 (int c)
{
return _rgb_scale_5[(c >> _rgb_r_shift_15) & 0x1F];
}
int getg15 (int c)
{
return _rgb_scale_5[(c >> _rgb_g_shift_15) & 0x1F];
}
int getb15 (int c)
{
return _rgb_scale_5[(c >> _rgb_b_shift_15) & 0x1F];
}
int getr16 (int c)
{
return _rgb_scale_5[(c >> _rgb_r_shift_16) & 0x1F];
}
int getg16 (int c)
{
return _rgb_scale_6[(c >> _rgb_g_shift_16) & 0x3F];
}
int getb16 (int c)
{
return _rgb_scale_5[(c >> _rgb_b_shift_16) & 0x1F];
}
int getr24 (int c)
{
return ((c >> _rgb_r_shift_24) & 0xFF);
}
int getg24 (int c)
{
return ((c >> _rgb_g_shift_24) & 0xFF);
}
int getb24 (int c)
{
return ((c >> _rgb_b_shift_24) & 0xFF);
}
int getr32 (int c)
{
return ((c >> _rgb_r_shift_32) & 0xFF);
}
int getg32 (int c)
{
return ((c >> _rgb_g_shift_32) & 0xFF);
}
int getb32 (int c)
{
return ((c >> _rgb_b_shift_32) & 0xFF);
}
int geta32 (int c)
{
return ((c >> _rgb_a_shift_32) & 0xFF);
}
//#ifndef ALLEGRO_DOS
void _set_color(int idx, in RGB *p)
{
set_color(idx, p);
}
//#endif
| D |
module tracking;
import std.stdio : writeln;
import std.algorithm : map, each;
import std.string : lineSplitter, startsWith, format, wrap, replace;
import std.json : JSONValue;
import std.array : join;
import core.thread : Thread;
import core.time : Duration, seconds;
import std.datetime.systime : SysTime;
import utils : isSuccessful, toPrettyString, jsonBody, errors, throwOnFailure;
import graphql : GraphQLRequest;
import config : Config;
import term : bold, cyan, dimmed;
struct Tracking
{
Config config;
string[][string] track(string[] hashtags)
{
string[][string] failures;
foreach(hashtag; hashtags.map!prependHash)
{
const request = createTrack(hashtag);
auto response = request.send();
if(!response.isSuccessful || "errors" in response.jsonBody)
{
failures[hashtag] = response.errors;
}
}
return failures;
}
string[][string] untrack(string[] hashtags)
{
string[][string] failures;
foreach(hashtag; hashtags.map!prependHash)
{
const request = removeTrack(hashtag);
auto response = request.send();
if(!response.isSuccessful || "errors" in response.jsonBody)
{
failures[hashtag] = response.errors;
}
}
return failures;
}
string[] tracks()
{
auto response = getTracks().send();
string[] hashtags;
if(!response.isSuccessful || "errors" in response.jsonBody)
{
response.errors.writeln;
return hashtags;
}
foreach(hashtag; response.jsonBody["data"].object["tracks"].array)
{
hashtags ~= hashtag["prettyName"].str;
}
return hashtags;
}
Tweet[] list(string search = "")
{
Tweet[] tweets;
auto request = getTweets(search);
auto response = request.send();
response.throwOnFailure();
foreach(tweet; response.jsonBody["data"].object["tweets"].array)
{
tweets ~= Tweet(
tweet["id"].str,
tweet["authorName"].str,
tweet["text"].str,
tweet["publishedAt"].str
);
}
return tweets;
}
void watch(alias callback)(Duration refreshRate)
{
string lastId = "";
while(true)
{
auto tweets = list();
if(tweets.length > 0 && tweets[0].id == lastId)
{
continue;
}
lastId = tweets[0].id;
tweets.map!(tweet => tweet.toPrettyString()).each!callback;
Thread.sleep(refreshRate);
}
}
private GraphQLRequest createTrack(string hashtag)
{
enum query = import("createTrack.graphql").lineSplitter().join("\n");
auto variables = JSONValue(["name": hashtag]);
return GraphQLRequest("createTrack", query, variables, config);
}
private GraphQLRequest removeTrack(string hashtag)
{
enum query = import("removeTrack.graphql").lineSplitter().join("\n");
auto variables = JSONValue(["name": hashtag]);
return GraphQLRequest("removeTrack", query, variables, config);
}
private GraphQLRequest getTracks()
{
enum query = import("tracks.graphql").lineSplitter().join("\n");
auto variables = JSONValue();
return GraphQLRequest("tracks", query, variables, config);
}
private GraphQLRequest getTweets(string search = "")
{
enum query = import("tweets.graphql").lineSplitter().join("\n");
auto variables = JSONValue(["search": search]);
return GraphQLRequest("tweets", query, variables, config);
}
}
string prependHash(string hashtag)
{
return hashtag.startsWith('#') ? hashtag : '#' ~ hashtag;
}
unittest
{
assert("dlang".prependHash() == "#dlang");
assert("#dlang".prependHash() == "#dlang");
assert("".prependHash() == "#");
assert("#".prependHash() == "#");
}
struct Tweet
{
string id;
string authorName;
string text;
SysTime publishedAt;
this(string id, string authorName, string text, string publishedAt)
{
this.id = id;
this.authorName = authorName;
this.text = text;
this.publishedAt = SysTime.fromISOExtString(publishedAt);
}
string url() @property const
{
return format!`https://twitter.com/%s/status/%s`(authorName.replace("@", ""), id);
}
string toString() const
{
return format!"%s (%s)\n%s\n%s\n"(
authorName,
publishedAt.toSimpleString(),
text.wrap(60),
url
);
}
version(Posix)
{
string toPrettyString() const
{
return format!"%s (%s)\n%s\n%s\n"(
authorName.bold().cyan(),
publishedAt.toSimpleString(),
text.wrap(60),
url.dimmed()
);
}
}
else
{
string toPrettyString() const
{
return toString();
}
}
}
unittest
{
auto tweet = Tweet("ID", "Hassan", "This is a test", "2020-08-20T14:27:01.000Z");
assert(tweet.url == "https://twitter.com/Hassan/status/ID");
tweet = Tweet("ID", "@Hassan", "This is a test", "2020-08-20T14:27:01.000Z");
assert(tweet.url == "https://twitter.com/Hassan/status/ID");
}
| D |
module android.java.android.widget.TableLayout;
public import android.java.android.widget.TableLayout_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!TableLayout;
import import52 = android.java.android.view.accessibility.AccessibilityNodeProvider;
import import84 = android.java.java.lang.Class;
import import24 = android.java.android.view.ViewParent;
import import19 = android.java.android.view.PointerIcon;
import import66 = android.java.android.view.WindowId;
import import61 = android.java.android.animation.StateListAnimator;
import import75 = android.java.android.view.ViewTreeObserver;
import import22 = android.java.android.view.ViewGroupOverlay;
import import5 = android.java.android.widget.TableLayout_LayoutParams;
import import63 = android.java.android.os.Handler;
import import8 = android.java.android.graphics.drawable.Drawable;
import import51 = android.java.android.view.View_AccessibilityDelegate;
import import49 = android.java.android.view.autofill.AutofillId;
import import82 = android.java.android.view.ViewPropertyAnimator;
import import31 = android.java.java.util.Map;
import import30 = android.java.android.view.ViewOverlay;
import import65 = android.java.android.os.IBinder;
import import60 = android.java.android.graphics.Matrix;
import import55 = android.java.android.view.KeyEvent_DispatcherState;
import import9 = android.java.android.view.ActionMode;
import import28 = android.java.android.view.WindowInsets;
import import76 = android.java.android.view.animation.Animation;
import import7 = android.java.android.widget.LinearLayout_LayoutParams;
import import69 = android.java.android.graphics.Bitmap;
import import6 = android.java.java.lang.CharSequence;
import import46 = android.java.android.view.accessibility.AccessibilityNodeInfo;
import import71 = android.java.android.content.res.Resources;
import import56 = android.java.android.view.inputmethod.InputConnection;
import import29 = android.java.android.view.animation.Animation_AnimationListener;
import import67 = android.java.android.view.Display;
| D |
#!/usr/bin/env rdmd
// Written in the D programming language
/*
* AUTHOR: Fredrik Boulund
* DATE: 2013-may
* DESCRIPTION:
*
* An implementation of Ukkonen's algorithm for creating suffix trees.
* The book "Algorithms on Strings, Trees and Sequences" by Dan Gusfield, 1997
* was immensely useful to understand the data structure and its construction.
*
* Inspired much by the implementations described here:
* http://stackoverflow.com/questions/9452701/ukkonens-suffix-tree-algorithm-in-plain-english
* http://pastie.org/5925809#
* http://mila.cs.technion.ac.il/~yona/suffix_tree/
*
*/
import std.stdio;
import std.algorithm;
import std.getopt;
/**
* A node in the suffix tree.
* Contains start and end indexes into the tree string
* representing the characters on the edge leading to
* the node; no separate edge class is required.
* The end position is by default int.max unless
* specified and this represents the 'virtual end'
* used during tree construction in Ukkonen's algorithm.
*
*/
class Node
{
int start;
int end;
int slink;
int id;
int pos;
int[char] next; // hash gives O(1) lookup of outgoing edges
/*
* Node constructor.
*/
this(ref int last_added, int s, int e, int p)
{
this.start = s;
this.end = e;
this.slink = 0;
this.id = last_added++;
this.pos = p;
}
/*
* Used during tree construction to compute edge length
* using the virtual end of all leaves (pos).
*/
int edge_length(int pos)
{
return min(end, pos+1)-start;
}
}
/**
* A suffix tree.
*/
class SuffixTree
{
Node[] tree;
string text;
this(Node[] t, string s)
{
this.tree = t;
this.text = s;
}
}
/*
* Adds a suffix link between a node and another requiring a suffix link.
* Only used during tree construction.
*/
void add_SL(ref Node node, ref int needSL, ref Node[] tree)
{
if (needSL > 0)
{
tree[needSL].slink = node.id;
}
needSL = node.id;
}
/*
* Walks down the tree from a node using Ukkonen's skip trick.
*/
bool walk_down(ref Node node, ref int pos, ref int active_len, ref int active_e, ref Node active_node, ref Node[] tree)
{
// Skip down the current edge if long enough; skip trick!
if (active_len >= tree[node.id].edge_length(pos))
{
active_e += tree[node.id].edge_length(pos);
active_len -= tree[node.id].edge_length(pos);
active_node = node;
return true;
}
return false;
}
/**
* The entry point for creating a suffix tree from an input string.
* Allocates memory and performs tree extensions once for each
* character in the input string.
*/
SuffixTree create_ST(string input)
{
// Initialize all variables
char unique_end = '$';
int last_added = 0;
int pos = -1; // Iteration starts at position 0 of the input string
int needSL = 0;
int remainder = 0;
int active_e = 0;
int active_len = 0;
Node[] tree; // Dynamically allocated array of all nodes in the stuffix tree
tree ~= new Node(last_added, -1, -1, -1);
Node active_node = tree[0];
// Dynamic array of characters that have been added to the tree
// This could be refactored away to spare memory by using the
// input string instead.
char[] text;
// Will never be longer than input string + unique end character.
text.length = input.length+1;
/*
* Perform extension of tree for each character in the supplied string
*/
foreach (char c; input)
{
extend_ST(tree, c, last_added, pos, needSL, remainder, tree[0], active_node, active_e, active_len, text);
}
// Add the final unique char to make the implicit suffix tree explicit
extend_ST(tree, unique_end, last_added, pos, needSL, remainder, tree[0], active_node, active_e, active_len, text);
// Update the virtual end position (previously set to int.max)
// of all leaf nodes to the final character of the input string.
foreach (node; tree)
{
if (node.end == int.max)
{
node.end = cast(int) input.length+1;
}
}
SuffixTree st = new SuffixTree(tree, input~unique_end);
return st;
}
/*
* Extend the suffix tree by one character.
* This is the function that does all of the heavy lifting in
* the suffix tree creation.
*/
void extend_ST(ref Node[] tree,
char c,
ref int last_added,
ref int pos,
ref int needSL,
ref int remainder,
ref Node root,
ref Node active_node,
ref int active_e,
ref int active_len,
ref char[] text)
{
text[++pos] = c;
needSL = 0; // Zero means "no node needs suffix link"
remainder++;
while (remainder > 0)
{
if (active_len == 0)
{
active_e = pos;
}
/*
* If active_node doesn't have edge out of it beginning with char c,
* create a new child node with that edge.
*/
if (text[active_e] in tree[active_node.id].next)
{
int next = tree[active_node.id].next[text[active_e]];
if (walk_down(tree[next], pos, active_len, active_e, active_node, tree))
{
// Observation 2: just modify the active point
continue;
}
if (text[tree[next].start + active_len] == c)
{
// Observation 1: the final suffix is already in the tree, only update active point and remainder
active_len++;
// Observation 3: if there is a node requiring a suffix link, make that link
add_SL(active_node, needSL, tree);
break;
}
// split node (internal)
tree ~= new Node(last_added, tree[next].start, tree[next].start + active_len, -1);
int internal = last_added-1; // The index of the new node in the tree array
tree[active_node.id].next[text[active_e]] = tree[internal].id;
// leaf node
tree ~= new Node(last_added, pos, int.max, active_e); // maxint as end; virtual end of all leaves!
int leaf = last_added-1;
// Make sure the pointers to next nodes are updated.
tree[internal].next[c] = leaf;
tree[next].start += active_len;
tree[internal].next[text[tree[next].start]] = next;
add_SL(tree[internal], needSL, tree);
}
else
{
// Create new leaf node out of active_node
tree ~= new Node(last_added, pos, int.max, active_e); // maxint as end
tree[active_node.id].next[text[active_e]] = tree[last_added-1].id;
}
remainder--;
/*
* Rule 1:
* If after an insertion from the active node = root,
* the active length is greater than 0, then:
* active node is not changed
* active length is decremented
* active edge is shifted right (to the first character of the next suffix we must insert)
*/
if (active_node == root && active_len > 0)
{
active_len--;
active_e = pos - remainder + 1;
}
else
{
if (tree[active_node.id].slink > 0)
{
active_node = tree[active_node.slink];
}
else
{
// The suffix link either points to root, which is 0 (or there was none).
active_node = root;
}
}
}
}
/**
* Prints a complete suffix tree by calling print_node one time
* for each node out of the root node.
*/
void print_ST(ref SuffixTree st)
{
print_node(st.tree[0], st.tree, st.text, 0);
}
/**
* Prints a node and all its children nodes by calling itself recursively.
*/
void print_node(Node node, Node[] tree, string s, int depth)
{
if (depth == 0)
{
writeln("root");
}
else if (depth > 0)
{
// Print branches from higher nodes
foreach(l; 1..depth)
{
write("|");
}
write("+");
// Print the actual node
writefln("%s", s[tree[node.id].start .. tree[node.id].end]);
}
// Print all child nodes
foreach(n; node.next)
{
if (n != 0)
{
print_node(tree[n], tree, s, depth+1);
}
}
}
/**
* Performs a search for substring in the suffix tree.
*/
int[] search_ST(SuffixTree st, string s)
{
int next_node = 0;
int matched_characters = 0;
int[] positions;
if (s.length == 0) { return positions;}
if (s[0] in st.tree[0].next)
{
matched_characters++;
next_node = st.tree[0].next[s[0]];
if (search_node(st, next_node, s, matched_characters, positions))
return positions;
}
positions.length = 0;
return positions;
}
int[] find_leaf_positions(SuffixTree st, int cur_node)
{
int[] positions;
if (st.tree[cur_node].next.length == 0)
{
positions ~= st.tree[cur_node].pos;
return positions;
}
foreach (n; st.tree[cur_node].next)
{
positions ~= find_leaf_positions(st, n);
}
return positions;
}
bool search_node(SuffixTree st, int cur_node, string s, ref int matched_characters, ref int[] positions)
{
if (matched_characters == s.length)
{
positions ~= find_leaf_positions(st, cur_node);
return true;
}
/*
* Go through all positions on the edge of this node except the first,
* since it has already been matched in the outgoing edge from the
* previous node.
*/
foreach (pos; st.tree[cur_node].start+1 .. st.tree[cur_node].end)
{
if (s[matched_characters] == st.text[pos])
{
matched_characters++;
// Don't continue searching if complete query string is matched now.
if (matched_characters == s.length)
{
// Append the current position on this edge, as this is
// also a position where the entire search string is
// begins as a substring of the tree string.
positions ~= find_leaf_positions(st, cur_node);
return true;
}
}
else
{
return false;
}
}
/*
* Finished searching the incoming edge now, check if there is an outgoing
* edge beginning with the next character in the search string.
*/
if (s[matched_characters] in st.tree[cur_node].next)
{
// TODO: Investigate try-get from hash
cur_node = st.tree[cur_node].next[s[matched_characters]];
return search_node(st, cur_node, s, ++matched_characters, positions);
}
return false;
}
unittest
{
string s = "bananas";
SuffixTree st = create_ST(s);
int[] positions;
int[] correct_positions = [0, 1, 2, 3, 4, 5, 6, 7];
// Searching for all suffixes in the tree string
foreach(i, c; s)
{
positions = search_ST(st, s[i..$]);
assert(positions[0] == correct_positions[i]);
}
// Search for a string NOT in the tree
positions = search_ST(st, "anab");
assert(positions.length == 0);
// Search for all substrings that are not suffixes
foreach(i, c; s)
{
positions = search_ST(st, s[i..$]);
assert(positions[0] == i);
}
}
/*********************************************************
* MAIN *
*********************************************************/
int main(string[] argv)
{
string s;
string search;
bool print = true;
if (argv.length == 2)
s = argv[1];
else if (argv.length == 3)
{
s = argv[1];
search = argv[2];
}
else if (argv.length == 4 && argv[3] == "-p")
{
s = argv[1];
search = argv[2];
print = false;
}
else
{
//s = "abbc";
//s = "abcd";
//s = "abbc";
//s = "cdddcdc";
//s = "abcabxabcd";
//s = "xabxa";
//s = "mississippi";
//search = "ipp";
writeln("Suffix Tree implementation in the D programming language");
writeln("Fredrik Boulund 2013");
writeln("Usage: suffixtree STRING [QUERY] [-p]");
return 0;
}
if (print)
{
writeln("Suffixes of '", s, "' to insert into the tree:");
foreach(i, c; s)
writeln(" ", s[i..$]);
}
writeln("Creating suffix tree for '", s, "'...");
SuffixTree st = create_ST(s);
writeln("Tree creation completed!");
if (print) print_ST(st);
int[] positions = search_ST(st, search);
if (positions.length == 0)
{
writefln("No matches to '%s' found in the tree string '%s'", search, st.text);
}
else
{
writeln("Found matches to '", search, "' at the following positions");
writeln(positions);
}
return 0;
}
| D |
/**
* Copyright: Copyright (C) Thomas Dixon 2008. все rights reserved.
* License: BSD стиль: $(LICENSE)
* Authors: Thomas Dixon
*/
module util.cipher.TEA;
private import util.cipher.Cipher;
/** Implementation of the TEA cipher designed by
David Wheeler и Roger Needham. */
class TEA : ШифрБлок
{
private
{
static const бцел ROUNDS = 32,
KEY_SIZE = 16,
BLOCK_SIZE = 8,
DELTA = 0x9e3779b9u,
DECRYPT_SUM = 0xc6ef3720u;
бцел sk0, sk1, sk2, sk3, sum;
}
final override проц сбрось(){}
final override ткст имя()
{
return "TEA";
}
final override бцел размерБлока()
{
return BLOCK_SIZE;
}
final проц init(бул зашифруй, СимметричныйКлюч keyParams)
{
_encrypt = зашифруй;
if (keyParams.ключ.length != KEY_SIZE)
не_годится(имя()~": Неверный ключ length (требует 16 байты)");
sk0 = БайтКонвертер.БигЭндиан.в_!(бцел)(keyParams.ключ[0..4]);
sk1 = БайтКонвертер.БигЭндиан.в_!(бцел)(keyParams.ключ[4..8]);
sk2 = БайтКонвертер.БигЭндиан.в_!(бцел)(keyParams.ключ[8..12]);
sk3 = БайтКонвертер.БигЭндиан.в_!(бцел)(keyParams.ключ[12..16]);
_initialized = да;
}
final override бцел обнови(проц[] input_, проц[] output_)
{
if (!_initialized)
не_годится(имя()~": Шифр not инициализован");
ббайт[] ввод = cast(ббайт[]) input_,
вывод = cast(ббайт[]) output_;
if (ввод.length < BLOCK_SIZE)
не_годится(имя()~": Ввод буфер too крат");
if (вывод.length < BLOCK_SIZE)
не_годится(имя()~": Вывод буфер too крат");
бцел v0 = БайтКонвертер.БигЭндиан.в_!(бцел)(ввод[0..4]),
v1 = БайтКонвертер.БигЭндиан.в_!(бцел)(ввод[4..8]);
sum = _encrypt ? 0 : DECRYPT_SUM;
for (цел i = 0; i < ROUNDS; i++)
{
if (_encrypt)
{
sum += DELTA;
v0 += ((v1 << 4) + sk0) ^ (v1 + sum) ^ ((v1 >> 5) + sk1);
v1 += ((v0 << 4) + sk2) ^ (v0 + sum) ^ ((v0 >> 5) + sk3);
}
else
{
v1 -= ((v0 << 4) + sk2) ^ (v0 + sum) ^ ((v0 >> 5) + sk3);
v0 -= ((v1 << 4) + sk0) ^ (v1 + sum) ^ ((v1 >> 5) + sk1);
sum -= DELTA;
}
}
вывод[0..4] = БайтКонвертер.БигЭндиан.из_!(бцел)(v0);
вывод[4..8] = БайтКонвертер.БигЭндиан.из_!(бцел)(v1);
return BLOCK_SIZE;
}
/** Some TEA тест vectors. */
debug (UnitTest)
{
unittest
{
static ткст[] test_keys = [
"00000000000000000000000000000000",
"00000000000000000000000000000000",
"0123456712345678234567893456789a",
"0123456712345678234567893456789a"
];
static ткст[] test_plaintexts = [
"0000000000000000",
"0102030405060708",
"0000000000000000",
"0102030405060708"
];
static ткст[] test_ciphertexts = [
"41ea3a0a94baa940",
"6a2f9cf3fccf3c55",
"34e943b0900f5dcb",
"773dc179878a81c0"
];
TEA t = new TEA();
foreach (бцел i, ткст test_key; test_keys)
{
ббайт[] буфер = new ббайт[t.размерБлока];
ткст результат;
СимметричныйКлюч ключ = new СимметричныйКлюч(БайтКонвертер.hexDecode(test_key));
// Encryption
t.init(да, ключ);
t.обнови(БайтКонвертер.hexDecode(test_plaintexts[i]), буфер);
результат = БайтКонвертер.hexEncode(буфер);
assert(результат == test_ciphertexts[i],
t.имя~": ("~результат~") != ("~test_ciphertexts[i]~")");
// Decryption
t.init(нет, ключ);
t.обнови(БайтКонвертер.hexDecode(test_ciphertexts[i]), буфер);
результат = БайтКонвертер.hexEncode(буфер);
assert(результат == test_plaintexts[i],
t.имя~": ("~результат~") != ("~test_plaintexts[i]~")");
}
}
}
}
| D |
// Written in the D programming language.
/**
Bit-level manipulation facilities.
Macros:
WIKI = StdBitarray
Copyright: Copyright Digital Mars 2007 - 2011.
License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(WEB digitalmars.com, Walter Bright),
$(WEB erdani.org, Andrei Alexandrescu),
Jonathan M Davis,
Alex Rønne Petersen,
Damian Ziemba
Amaury SECHET
Source: $(PHOBOSSRC std/_bitmanip.d)
*/
/*
Copyright Digital Mars 2007 - 2012.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
module std.bitmanip;
//debug = bitarray; // uncomment to turn on debugging printf's
import std.range.primitives;
public import std.system : Endian;
import std.traits;
version(unittest)
{
import std.stdio;
}
private string myToString(ulong n)
{
import core.internal.string;
UnsignedStringBuf buf;
auto s = unsignedToTempString(n, buf);
return cast(string)s ~ (n > uint.max ? "UL" : "U");
}
private template createAccessors(
string store, T, string name, size_t len, size_t offset)
{
static if (!name.length)
{
// No need to create any accessor
enum result = "";
}
else static if (len == 0)
{
// Fields of length 0 are always zero
enum result = "enum "~T.stringof~" "~name~" = 0;\n";
}
else
{
enum ulong
maskAllElse = ((~0uL) >> (64 - len)) << offset,
signBitCheck = 1uL << (len - 1);
static if (T.min < 0)
{
enum long minVal = -(1uL << (len - 1));
enum ulong maxVal = (1uL << (len - 1)) - 1;
alias UT = Unsigned!(T);
enum UT extendSign = cast(UT)~((~0uL) >> (64 - len));
}
else
{
enum ulong minVal = 0;
enum ulong maxVal = (~0uL) >> (64 - len);
enum extendSign = 0;
}
static if (is(T == bool))
{
static assert(len == 1);
enum result =
// getter
"@property bool " ~ name ~ "() @safe pure nothrow @nogc const { return "
~"("~store~" & "~myToString(maskAllElse)~") != 0;}\n"
// setter
~"@property void " ~ name ~ "(bool v) @safe pure nothrow @nogc { "
~"if (v) "~store~" |= "~myToString(maskAllElse)~";"
~"else "~store~" &= ~cast(typeof("~store~"))"~myToString(maskAllElse)~";}\n";
}
else
{
// getter
enum result = "@property "~T.stringof~" "~name~"() @safe pure nothrow @nogc const { auto result = "
~"("~store~" & "
~ myToString(maskAllElse) ~ ") >>"
~ myToString(offset) ~ ";"
~ (T.min < 0
? "if (result >= " ~ myToString(signBitCheck)
~ ") result |= " ~ myToString(extendSign) ~ ";"
: "")
~ " return cast("~T.stringof~") result;}\n"
// setter
~"@property void "~name~"("~T.stringof~" v) @safe pure nothrow @nogc { "
~"assert(v >= "~name~`_min, "Value is smaller than the minimum value of bitfield '`~name~`'"); `
~"assert(v <= "~name~`_max, "Value is greater than the maximum value of bitfield '`~name~`'"); `
~store~" = cast(typeof("~store~"))"
~" (("~store~" & ~cast(typeof("~store~"))"~myToString(maskAllElse)~")"
~" | ((cast(typeof("~store~")) v << "~myToString(offset)~")"
~" & "~myToString(maskAllElse)~"));}\n"
// constants
~"enum "~T.stringof~" "~name~"_min = cast("~T.stringof~")"
~myToString(minVal)~"; "
~" enum "~T.stringof~" "~name~"_max = cast("~T.stringof~")"
~myToString(maxVal)~"; ";
}
}
}
private template createStoreName(Ts...)
{
static if (Ts.length < 2)
enum createStoreName = "";
else
enum createStoreName = "_" ~ Ts[1] ~ createStoreName!(Ts[3 .. $]);
}
private template createStorageAndFields(Ts...)
{
enum Name = createStoreName!Ts;
enum Size = sizeOfBitField!Ts;
static if (Size == ubyte.sizeof * 8)
alias StoreType = ubyte;
else static if (Size == ushort.sizeof * 8)
alias StoreType = ushort;
else static if (Size == uint.sizeof * 8)
alias StoreType = uint;
else static if (Size == ulong.sizeof * 8)
alias StoreType = ulong;
else
{
static assert(false, "Field widths must sum to 8, 16, 32, or 64");
alias StoreType = ulong; // just to avoid another error msg
}
enum result
= "private " ~ StoreType.stringof ~ " " ~ Name ~ ";"
~ createFields!(Name, 0, Ts).result;
}
private template createFields(string store, size_t offset, Ts...)
{
static if (Ts.length > 0)
enum result
= createAccessors!(store, Ts[0], Ts[1], Ts[2], offset).result
~ createFields!(store, offset + Ts[2], Ts[3 .. $]).result;
else
enum result = "";
}
private ulong getBitsForAlign(ulong a)
{
ulong bits = 0;
while ((a & 0x01) == 0)
{
bits++;
a >>= 1;
}
assert(a == 1, "alignment is not a power of 2");
return bits;
}
private template createReferenceAccessor(string store, T, ulong bits, string name)
{
enum storage = "private void* " ~ store ~ "_ptr;\n";
enum storage_accessor = "@property ref size_t " ~ store ~ "() @trusted pure nothrow @nogc const { "
~ "return *cast(size_t*) &" ~ store ~ "_ptr;}\n"
~ "@property void " ~ store ~ "(size_t v) @trusted pure nothrow @nogc { "
~ "" ~ store ~ "_ptr = cast(void*) v;}\n";
enum mask = (1UL << bits) - 1;
// getter
enum ref_accessor = "@property "~T.stringof~" "~name~"() @trusted pure nothrow @nogc const { auto result = "
~ "("~store~" & "~myToString(~mask)~"); "
~ "return cast("~T.stringof~") cast(void*) result;}\n"
// setter
~"@property void "~name~"("~T.stringof~" v) @trusted pure nothrow @nogc { "
~"assert(((cast(typeof("~store~")) cast(void*) v) & "~myToString(mask)
~`) == 0, "Value not properly aligned for '`~name~`'"); `
~store~" = cast(typeof("~store~"))"
~" (("~store~" & (cast(typeof("~store~")) "~myToString(mask)~"))"
~" | ((cast(typeof("~store~")) cast(void*) v) & (cast(typeof("~store~")) "~myToString(~mask)~")));}\n";
enum result = storage ~ storage_accessor ~ ref_accessor;
}
private template sizeOfBitField(T...)
{
static if (T.length < 2)
enum sizeOfBitField = 0;
else
enum sizeOfBitField = T[2] + sizeOfBitField!(T[3 .. $]);
}
private template createTaggedReference(T, ulong a, string name, Ts...)
{
static assert(
sizeOfBitField!Ts <= getBitsForAlign(a),
"Fields must fit in the bits know to be zero because of alignment."
);
enum StoreName = createStoreName!(T, name, 0, Ts);
enum result
= createReferenceAccessor!(StoreName, T, sizeOfBitField!Ts, name).result
~ createFields!(StoreName, 0, Ts, size_t, "", T.sizeof * 8 - sizeOfBitField!Ts).result;
}
/**
Allows creating bit fields inside $(D_PARAM struct)s and $(D_PARAM
class)es.
Example:
----
struct A
{
int a;
mixin(bitfields!(
uint, "x", 2,
int, "y", 3,
uint, "z", 2,
bool, "flag", 1));
}
A obj;
obj.x = 2;
obj.z = obj.x;
----
The example above creates a bitfield pack of eight bits, which fit in
one $(D_PARAM ubyte). The bitfields are allocated starting from the
least significant bit, i.e. x occupies the two least significant bits
of the bitfields storage.
The sum of all bit lengths in one $(D_PARAM bitfield) instantiation
must be exactly 8, 16, 32, or 64. If padding is needed, just allocate
one bitfield with an empty name.
Example:
----
struct A
{
mixin(bitfields!(
bool, "flag1", 1,
bool, "flag2", 1,
uint, "", 6));
}
----
The type of a bit field can be any integral type or enumerated
type. The most efficient type to store in bitfields is $(D_PARAM
bool), followed by unsigned types, followed by signed types.
*/
template bitfields(T...)
{
enum { bitfields = createStorageAndFields!T.result }
}
/**
This string mixin generator allows one to create tagged pointers inside $(D_PARAM struct)s and $(D_PARAM class)es.
A tagged pointer uses the bits known to be zero in a normal pointer or class reference to store extra information.
For example, a pointer to an integer must be 4-byte aligned, so there are 2 bits that are always known to be zero.
One can store a 2-bit integer there.
The example above creates a tagged pointer in the struct A. The pointer is of type
$(D uint*) as specified by the first argument, and is named x, as specified by the second
argument.
Following arguments works the same way as $(D bitfield)'s. The bitfield must fit into the
bits known to be zero because of the pointer alignment.
*/
template taggedPointer(T : T*, string name, Ts...) {
enum taggedPointer = createTaggedReference!(T*, T.alignof, name, Ts).result;
}
///
unittest
{
struct A
{
int a;
mixin(taggedPointer!(
uint*, "x",
bool, "b1", 1,
bool, "b2", 1));
}
A obj;
obj.x = new uint;
obj.b1 = true;
obj.b2 = false;
}
/**
This string mixin generator allows one to create tagged class reference inside $(D_PARAM struct)s and $(D_PARAM class)es.
A tagged class reference uses the bits known to be zero in a normal class reference to store extra information.
For example, a pointer to an integer must be 4-byte aligned, so there are 2 bits that are always known to be zero.
One can store a 2-bit integer there.
The example above creates a tagged reference to an Object in the struct A. This expects the same parameters
as $(D taggedPointer), except the first argument which must be a class type instead of a pointer type.
*/
template taggedClassRef(T, string name, Ts...) if (is(T == class)) {
enum taggedClassRef = createTaggedReference!(T, 8, name, Ts).result;
}
///
unittest
{
struct A
{
int a;
mixin(taggedClassRef!(
Object, "o",
uint, "i", 2));
}
A obj;
obj.o = new Object();
obj.i = 3;
}
@safe pure nothrow @nogc
unittest
{
// Degenerate bitfields (#8474 / #11160) tests mixed with range tests
struct Test1
{
mixin(bitfields!(uint, "a", 32,
uint, "b", 4,
uint, "c", 4,
uint, "d", 8,
uint, "e", 16,));
static assert(Test1.b_min == 0);
static assert(Test1.b_max == 15);
}
struct Test2
{
mixin(bitfields!(bool, "a", 0,
ulong, "b", 64));
static assert(Test2.b_min == ulong.min);
static assert(Test2.b_max == ulong.max);
}
struct Test1b
{
mixin(bitfields!(bool, "a", 0,
int, "b", 8));
}
struct Test2b
{
mixin(bitfields!(int, "a", 32,
int, "b", 4,
int, "c", 4,
int, "d", 8,
int, "e", 16,));
static assert(Test2b.b_min == -8);
static assert(Test2b.b_max == 7);
}
struct Test3b
{
mixin(bitfields!(bool, "a", 0,
long, "b", 64));
static assert(Test3b.b_min == long.min);
static assert(Test3b.b_max == long.max);
}
struct Test4b
{
mixin(bitfields!(long, "a", 32,
int, "b", 32));
}
// Sign extension tests
Test2b t2b;
Test4b t4b;
t2b.b = -5; assert(t2b.b == -5);
t2b.d = -5; assert(t2b.d == -5);
t2b.e = -5; assert(t2b.e == -5);
t4b.a = -5; assert(t4b.a == -5L);
}
unittest
{
struct Test5
{
mixin(taggedPointer!(
int*, "a",
uint, "b", 2));
}
Test5 t5;
t5.a = null;
t5.b = 3;
assert(t5.a is null);
assert(t5.b == 3);
int myint = 42;
t5.a = &myint;
assert(t5.a is &myint);
assert(t5.b == 3);
struct Test6
{
mixin(taggedClassRef!(
Object, "o",
bool, "b", 1));
}
Test6 t6;
t6.o = null;
t6.b = false;
assert(t6.o is null);
assert(t6.b == false);
auto o = new Object();
t6.o = o;
t6.b = true;
assert(t6.o is o);
assert(t6.b == true);
}
unittest
{
static assert(!__traits(compiles,
taggedPointer!(
int*, "a",
uint, "b", 3)));
static assert(!__traits(compiles,
taggedClassRef!(
Object, "a",
uint, "b", 4)));
struct S {
mixin(taggedClassRef!(
Object, "a",
bool, "b", 1));
}
const S s;
void bar(S s) {}
static assert(!__traits(compiles, bar(s)));
}
unittest
{
// Bug #6686
union S {
ulong bits = ulong.max;
mixin (bitfields!(
ulong, "back", 31,
ulong, "front", 33)
);
}
S num;
num.bits = ulong.max;
num.back = 1;
assert(num.bits == 0xFFFF_FFFF_8000_0001uL);
}
unittest
{
// Bug #5942
struct S
{
mixin(bitfields!(
int, "a" , 32,
int, "b" , 32
));
}
S data;
data.b = 42;
data.a = 1;
assert(data.b == 42);
}
unittest
{
struct Test
{
mixin(bitfields!(bool, "a", 1,
uint, "b", 3,
short, "c", 4));
}
@safe void test() pure nothrow
{
Test t;
t.a = true;
t.b = 5;
t.c = 2;
assert(t.a);
assert(t.b == 5);
assert(t.c == 2);
}
test();
}
unittest
{
{
static struct Integrals {
bool checkExpectations(bool eb, int ei, short es) { return b == eb && i == ei && s == es; }
mixin(bitfields!(
bool, "b", 1,
uint, "i", 3,
short, "s", 4));
}
Integrals i;
assert(i.checkExpectations(false, 0, 0));
i.b = true;
assert(i.checkExpectations(true, 0, 0));
i.i = 7;
assert(i.checkExpectations(true, 7, 0));
i.s = -8;
assert(i.checkExpectations(true, 7, -8));
i.s = 7;
assert(i.checkExpectations(true, 7, 7));
}
//Bug# 8876
{
struct MoreIntegrals {
bool checkExpectations(uint eu, ushort es, uint ei) { return u == eu && s == es && i == ei; }
mixin(bitfields!(
uint, "u", 24,
short, "s", 16,
int, "i", 24));
}
MoreIntegrals i;
assert(i.checkExpectations(0, 0, 0));
i.s = 20;
assert(i.checkExpectations(0, 20, 0));
i.i = 72;
assert(i.checkExpectations(0, 20, 72));
i.u = 8;
assert(i.checkExpectations(8, 20, 72));
i.s = 7;
assert(i.checkExpectations(8, 7, 72));
}
enum A { True, False }
enum B { One, Two, Three, Four }
static struct Enums {
bool checkExpectations(A ea, B eb) { return a == ea && b == eb; }
mixin(bitfields!(
A, "a", 1,
B, "b", 2,
uint, "", 5));
}
Enums e;
assert(e.checkExpectations(A.True, B.One));
e.a = A.False;
assert(e.checkExpectations(A.False, B.One));
e.b = B.Three;
assert(e.checkExpectations(A.False, B.Three));
static struct SingleMember {
bool checkExpectations(bool eb) { return b == eb; }
mixin(bitfields!(
bool, "b", 1,
uint, "", 7));
}
SingleMember f;
assert(f.checkExpectations(false));
f.b = true;
assert(f.checkExpectations(true));
}
// Issue 12477
unittest
{
import std.algorithm : canFind;
import std.bitmanip : bitfields;
import core.exception : AssertError;
static struct S
{
mixin(bitfields!(
uint, "a", 6,
int, "b", 2));
}
S s;
try { s.a = uint.max; assert(0); }
catch (AssertError ae)
{ assert(ae.msg.canFind("Value is greater than the maximum value of bitfield 'a'"), ae.msg); }
try { s.b = int.min; assert(0); }
catch (AssertError ae)
{ assert(ae.msg.canFind("Value is smaller than the minimum value of bitfield 'b'"), ae.msg); }
}
/**
Allows manipulating the fraction, exponent, and sign parts of a
$(D_PARAM float) separately. The definition is:
----
struct FloatRep
{
union
{
float value;
mixin(bitfields!(
uint, "fraction", 23,
ubyte, "exponent", 8,
bool, "sign", 1));
}
enum uint bias = 127, fractionBits = 23, exponentBits = 8, signBits = 1;
}
----
*/
struct FloatRep
{
union
{
float value;
mixin(bitfields!(
uint, "fraction", 23,
ubyte, "exponent", 8,
bool, "sign", 1));
}
enum uint bias = 127, fractionBits = 23, exponentBits = 8, signBits = 1;
}
/**
Allows manipulating the fraction, exponent, and sign parts of a
$(D_PARAM double) separately. The definition is:
----
struct DoubleRep
{
union
{
double value;
mixin(bitfields!(
ulong, "fraction", 52,
ushort, "exponent", 11,
bool, "sign", 1));
}
enum uint bias = 1023, signBits = 1, fractionBits = 52, exponentBits = 11;
}
----
*/
struct DoubleRep
{
union
{
double value;
mixin(bitfields!(
ulong, "fraction", 52,
ushort, "exponent", 11,
bool, "sign", 1));
}
enum uint bias = 1023, signBits = 1, fractionBits = 52, exponentBits = 11;
}
unittest
{
// test reading
DoubleRep x;
x.value = 1.0;
assert(x.fraction == 0 && x.exponent == 1023 && !x.sign);
x.value = -0.5;
assert(x.fraction == 0 && x.exponent == 1022 && x.sign);
x.value = 0.5;
assert(x.fraction == 0 && x.exponent == 1022 && !x.sign);
// test writing
x.fraction = 1125899906842624;
x.exponent = 1025;
x.sign = true;
assert(x.value == -5.0);
// test enums
enum ABC { A, B, C }
struct EnumTest
{
mixin(bitfields!(
ABC, "x", 2,
bool, "y", 1,
ubyte, "z", 5));
}
}
unittest
{
// Issue #15305
struct S {
mixin(bitfields!(
bool, "alice", 1,
ulong, "bob", 63,
));
}
S s;
s.bob = long.max - 1;
s.alice = false;
assert(s.bob == long.max - 1);
}
/**
* An array of bits.
*/
struct BitArray
{
private:
import std.format : FormatSpec;
import core.bitop: bts, btr, bsf, bt;
size_t _len;
size_t* _ptr;
enum bitsPerSizeT = size_t.sizeof * 8;
@property size_t fullWords() const @nogc pure nothrow
{
return _len / bitsPerSizeT;
}
// Number of bits after the last full word
@property size_t endBits() const @nogc pure nothrow
{
return _len % bitsPerSizeT;
}
// Bit mask to extract the bits after the last full word
@property size_t endMask() const @nogc pure nothrow
{
return (size_t(1) << endBits) - 1;
}
static size_t lenToDim(size_t len) @nogc pure nothrow
{
return (len + (bitsPerSizeT-1)) / bitsPerSizeT;
}
public:
/**********************************************
* Gets the amount of native words backing this $(D BitArray).
*/
@property size_t dim() const @nogc pure nothrow
{
return lenToDim(_len);
}
/**********************************************
* Gets the amount of bits in the $(D BitArray).
*/
@property size_t length() const @nogc pure nothrow
{
return _len;
}
/**********************************************
* Sets the amount of bits in the $(D BitArray).
* $(RED Warning: increasing length may overwrite bits in
* final word up to the next word boundary. i.e. D dynamic
* array extension semantics are not followed.)
*/
@property size_t length(size_t newlen) pure nothrow
{
if (newlen != _len)
{
size_t olddim = dim;
size_t newdim = lenToDim(newlen);
if (newdim != olddim)
{
// Create a fake array so we can use D's realloc machinery
auto b = _ptr[0 .. olddim];
b.length = newdim; // realloc
_ptr = b.ptr;
}
_len = newlen;
}
return _len;
}
/**********************************************
* Gets the $(D i)'th bit in the $(D BitArray).
*/
bool opIndex(size_t i) const @nogc pure nothrow
in
{
assert(i < _len);
}
body
{
return cast(bool) bt(_ptr, i);
}
unittest
{
debug(bitarray) printf("BitArray.opIndex.unittest\n");
void Fun(const BitArray arr)
{
auto x = arr[0];
assert(x == 1);
}
BitArray a;
a.length = 3;
a[0] = 1;
Fun(a);
}
/**********************************************
* Sets the $(D i)'th bit in the $(D BitArray).
*/
bool opIndexAssign(bool b, size_t i) @nogc pure nothrow
in
{
assert(i < _len);
}
body
{
if (b)
bts(_ptr, i);
else
btr(_ptr, i);
return b;
}
/**********************************************
* Duplicates the $(D BitArray) and its contents.
*/
@property BitArray dup() const pure nothrow
{
BitArray ba;
auto b = _ptr[0 .. dim].dup;
ba._len = _len;
ba._ptr = b.ptr;
return ba;
}
unittest
{
BitArray a;
BitArray b;
int i;
debug(bitarray) printf("BitArray.dup.unittest\n");
a.length = 3;
a[0] = 1; a[1] = 0; a[2] = 1;
b = a.dup;
assert(b.length == 3);
for (i = 0; i < 3; i++)
{ debug(bitarray) printf("b[%d] = %d\n", i, b[i]);
assert(b[i] == (((i ^ 1) & 1) ? true : false));
}
}
/**********************************************
* Support for $(D foreach) loops for $(D BitArray).
*/
int opApply(scope int delegate(ref bool) dg)
{
int result;
foreach (i; 0 .. _len)
{
bool b = opIndex(i);
result = dg(b);
this[i] = b;
if (result)
break;
}
return result;
}
/** ditto */
int opApply(scope int delegate(bool) dg) const
{
int result;
foreach (i; 0 .. _len)
{
bool b = opIndex(i);
result = dg(b);
if (result)
break;
}
return result;
}
/** ditto */
int opApply(scope int delegate(size_t, ref bool) dg)
{
int result;
foreach (i; 0 .. _len)
{
bool b = opIndex(i);
result = dg(i, b);
this[i] = b;
if (result)
break;
}
return result;
}
/** ditto */
int opApply(scope int delegate(size_t, bool) dg) const
{
int result;
foreach (i; 0 .. _len)
{
bool b = opIndex(i);
result = dg(i, b);
if (result)
break;
}
return result;
}
unittest
{
debug(bitarray) printf("BitArray.opApply unittest\n");
static bool[] ba = [1,0,1];
auto a = BitArray(ba);
int i;
foreach (b;a)
{
switch (i)
{
case 0: assert(b == true); break;
case 1: assert(b == false); break;
case 2: assert(b == true); break;
default: assert(0);
}
i++;
}
foreach (j,b;a)
{
switch (j)
{
case 0: assert(b == true); break;
case 1: assert(b == false); break;
case 2: assert(b == true); break;
default: assert(0);
}
}
}
/**********************************************
* Reverses the bits of the $(D BitArray).
*/
@property BitArray reverse() @nogc pure nothrow
out (result)
{
assert(result == this);
}
body
{
if (_len >= 2)
{
bool t;
size_t lo, hi;
lo = 0;
hi = _len - 1;
for (; lo < hi; lo++, hi--)
{
t = this[lo];
this[lo] = this[hi];
this[hi] = t;
}
}
return this;
}
unittest
{
debug(bitarray) printf("BitArray.reverse.unittest\n");
BitArray b;
static bool[5] data = [1,0,1,1,0];
int i;
b = BitArray(data);
b.reverse;
for (i = 0; i < data.length; i++)
{
assert(b[i] == data[4 - i]);
}
}
/**********************************************
* Sorts the $(D BitArray)'s elements.
*/
@property BitArray sort() @nogc pure nothrow
out (result)
{
assert(result == this);
}
body
{
if (_len >= 2)
{
size_t lo, hi;
lo = 0;
hi = _len - 1;
while (1)
{
while (1)
{
if (lo >= hi)
goto Ldone;
if (this[lo] == true)
break;
lo++;
}
while (1)
{
if (lo >= hi)
goto Ldone;
if (this[hi] == false)
break;
hi--;
}
this[lo] = false;
this[hi] = true;
lo++;
hi--;
}
}
Ldone:
return this;
}
unittest
{
debug(bitarray) printf("BitArray.sort.unittest\n");
__gshared size_t x = 0b1100011000;
__gshared ba = BitArray(10, &x);
ba.sort;
for (size_t i = 0; i < 6; i++)
assert(ba[i] == false);
for (size_t i = 6; i < 10; i++)
assert(ba[i] == true);
}
/***************************************
* Support for operators == and != for $(D BitArray).
*/
bool opEquals(const ref BitArray a2) const @nogc pure nothrow
{
if (this.length != a2.length)
return false;
auto p1 = this._ptr;
auto p2 = a2._ptr;
if (p1[0..fullWords] != p2[0..fullWords])
return false;
if (!endBits)
return true;
auto i = fullWords;
return (p1[i] & endMask) == (p2[i] & endMask);
}
unittest
{
debug(bitarray) printf("BitArray.opEquals unittest\n");
static bool[] ba = [1,0,1,0,1];
static bool[] bb = [1,0,1];
static bool[] bc = [1,0,1,0,1,0,1];
static bool[] bd = [1,0,1,1,1];
static bool[] be = [1,0,1,0,1];
static bool[] bf = [1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
static bool[] bg = [1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1];
auto a = BitArray(ba);
auto b = BitArray(bb);
auto c = BitArray(bc);
auto d = BitArray(bd);
auto e = BitArray(be);
auto f = BitArray(bf);
auto g = BitArray(bg);
assert(a != b);
assert(a != c);
assert(a != d);
assert(a == e);
assert(f != g);
}
/***************************************
* Supports comparison operators for $(D BitArray).
*/
int opCmp(BitArray a2) const @nogc pure nothrow
{
auto lesser = this.length < a2.length ? &this : &a2;
size_t fullWords = lesser.fullWords;
size_t endBits = lesser.endBits;
auto p1 = this._ptr;
auto p2 = a2._ptr;
foreach (i; 0 .. fullWords)
{
if (p1[i] != p2[i])
{
return p1[i] & (size_t(1) << bsf(p1[i] ^ p2[i])) ? 1 : -1;
}
}
if (endBits)
{
immutable i = fullWords;
immutable diff = p1[i] ^ p2[i];
if (diff)
{
immutable index = bsf(diff);
if (index < endBits)
{
return p1[i] & (size_t(1) << index) ? 1 : -1;
}
}
}
// Standard:
// A bool value can be implicitly converted to any integral type,
// with false becoming 0 and true becoming 1
return (this.length > a2.length) - (this.length < a2.length);
}
unittest
{
debug(bitarray) printf("BitArray.opCmp unittest\n");
static bool[] ba = [1,0,1,0,1];
static bool[] bb = [1,0,1];
static bool[] bc = [1,0,1,0,1,0,1];
static bool[] bd = [1,0,1,1,1];
static bool[] be = [1,0,1,0,1];
static bool[] bf = [1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1];
static bool[] bg = [1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
auto c = BitArray(bc);
auto d = BitArray(bd);
auto e = BitArray(be);
auto f = BitArray(bf);
auto g = BitArray(bg);
assert(a > b);
assert(a >= b);
assert(a < c);
assert(a <= c);
assert(a < d);
assert(a <= d);
assert(a == e);
assert(a <= e);
assert(a >= e);
assert(f < g);
assert(g <= g);
bool[] v;
foreach (i; 1 .. 256)
{
v.length = i;
v[] = false;
auto x = BitArray(v);
v[i-1] = true;
auto y = BitArray(v);
assert(x < y);
assert(x <= y);
}
BitArray a1, a2;
for (size_t len = 4; len <= 256; len <<= 1)
{
a1.length = a2.length = len;
a1[len-2] = a2[len-1] = true;
assert(a1 > a2);
a1[len-2] = a2[len-1] = false;
}
foreach (j; 1 .. a1.length)
{
a1[j-1] = a2[j] = true;
assert(a1 > a2);
a1[j-1] = a2[j] = false;
}
}
/***************************************
* Support for hashing for $(D BitArray).
*/
size_t toHash() const @nogc pure nothrow
{
size_t hash = 3557;
auto fullBytes = _len / 8;
foreach (i; 0 .. fullBytes)
{
hash *= 3559;
hash += (cast(byte*)this._ptr)[i];
}
foreach (i; 8*fullBytes .. _len)
{
hash *= 3571;
hash += this[i];
}
return hash;
}
// Explicitly undocumented. It will be removed in January 2017. @@@DEPRECATED_2017-01@@@
deprecated("Use the constructor instead.")
void init(bool[] ba) pure nothrow
{
this = BitArray(ba);
}
// Explicitly undocumented. It will be removed in January 2017. @@@DEPRECATED_2017-01@@@
deprecated("Use the constructor instead.")
void init(void[] v, size_t numbits) pure nothrow
{
this = BitArray(v, numbits);
}
/***************************************
* Set this $(D BitArray) to the contents of $(D ba).
*/
this(bool[] ba) pure nothrow
{
length = ba.length;
foreach (i, b; ba)
{
this[i] = b;
}
}
// Deliberately undocumented: raw initialization of bit array.
this(size_t len, size_t* ptr)
{
_len = len;
_ptr = ptr;
}
/***************************************
* Map the $(D BitArray) onto $(D v), with $(D numbits) being the number of bits
* in the array. Does not copy the data. $(D v.length) must be a multiple of
* $(D size_t.sizeof). If there are unmapped bits in the final mapped word then
* these will be set to 0.
*
* This is the inverse of $(D opCast).
*/
this(void[] v, size_t numbits) pure nothrow
in
{
assert(numbits <= v.length * 8);
assert(v.length % size_t.sizeof == 0);
}
body
{
_ptr = cast(size_t*)v.ptr;
_len = numbits;
if (endBits)
{
// Need to mask away extraneous bits from v.
_ptr[dim - 1] &= endMask;
}
}
unittest
{
debug(bitarray) printf("BitArray.init unittest\n");
static bool[] ba = [1,0,1,0,1];
auto a = BitArray(ba);
void[] v;
v = cast(void[])a;
auto b = BitArray(v, a.length);
assert(b[0] == 1);
assert(b[1] == 0);
assert(b[2] == 1);
assert(b[3] == 0);
assert(b[4] == 1);
a[0] = 0;
assert(b[0] == 0);
assert(a == b);
}
/***************************************
* Convert to $(D void[]).
*/
void[] opCast(T : void[])() @nogc pure nothrow
{
return cast(void[])_ptr[0 .. dim];
}
/***************************************
* Convert to $(D size_t[]).
*/
size_t[] opCast(T : size_t[])() @nogc pure nothrow
{
return _ptr[0 .. dim];
}
unittest
{
debug(bitarray) printf("BitArray.opCast unittest\n");
static bool[] ba = [1,0,1,0,1];
auto a = BitArray(ba);
void[] v = cast(void[])a;
assert(v.length == a.dim * size_t.sizeof);
}
/***************************************
* Support for unary operator ~ for $(D BitArray).
*/
BitArray opCom() const pure nothrow
{
auto dim = this.dim;
BitArray result;
result.length = _len;
result._ptr[0..dim] = ~this._ptr[0..dim];
// Avoid putting garbage in extra bits
// Remove once we zero on length extension
if (endBits)
result._ptr[dim - 1] &= endMask;
return result;
}
unittest
{
debug(bitarray) printf("BitArray.opCom unittest\n");
static bool[] ba = [1,0,1,0,1];
auto a = BitArray(ba);
BitArray b = ~a;
assert(b[0] == 0);
assert(b[1] == 1);
assert(b[2] == 0);
assert(b[3] == 1);
assert(b[4] == 0);
}
/***************************************
* Support for binary bitwise operators for $(D BitArray).
*/
BitArray opBinary(string op)(const BitArray e2) const pure nothrow
if (op == "-" || op == "&" || op == "|" || op == "^")
in
{
assert(_len == e2.length);
}
body
{
auto dim = this.dim;
BitArray result;
result.length = _len;
static if (op == "-")
result._ptr[0..dim] = this._ptr[0..dim] & ~e2._ptr[0..dim];
else
mixin("result._ptr[0..dim] = this._ptr[0..dim]"~op~" e2._ptr[0..dim];");
// Avoid putting garbage in extra bits
// Remove once we zero on length extension
if (endBits)
result._ptr[dim - 1] &= endMask;
return result;
}
unittest
{
debug(bitarray) printf("BitArray.opAnd unittest\n");
static bool[] ba = [1,0,1,0,1];
static bool[] bb = [1,0,1,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
BitArray c = a & b;
assert(c[0] == 1);
assert(c[1] == 0);
assert(c[2] == 1);
assert(c[3] == 0);
assert(c[4] == 0);
}
unittest
{
debug(bitarray) printf("BitArray.opOr unittest\n");
static bool[] ba = [1,0,1,0,1];
static bool[] bb = [1,0,1,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
BitArray c = a | b;
assert(c[0] == 1);
assert(c[1] == 0);
assert(c[2] == 1);
assert(c[3] == 1);
assert(c[4] == 1);
}
unittest
{
debug(bitarray) printf("BitArray.opXor unittest\n");
static bool[] ba = [1,0,1,0,1];
static bool[] bb = [1,0,1,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
BitArray c = a ^ b;
assert(c[0] == 0);
assert(c[1] == 0);
assert(c[2] == 0);
assert(c[3] == 1);
assert(c[4] == 1);
}
unittest
{
debug(bitarray) printf("BitArray.opSub unittest\n");
static bool[] ba = [1,0,1,0,1];
static bool[] bb = [1,0,1,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
BitArray c = a - b;
assert(c[0] == 0);
assert(c[1] == 0);
assert(c[2] == 0);
assert(c[3] == 0);
assert(c[4] == 1);
}
/***************************************
* Support for operator op= for $(D BitArray).
*/
BitArray opOpAssign(string op)(const BitArray e2) @nogc pure nothrow
if (op == "-" || op == "&" || op == "|" || op == "^")
in
{
assert(_len == e2.length);
}
body
{
foreach (i; 0 .. fullWords)
{
static if (op == "-")
_ptr[i] &= ~e2._ptr[i];
else
mixin("_ptr[i] "~op~"= e2._ptr[i];");
}
if (!endBits)
return this;
size_t i = fullWords;
size_t endWord = _ptr[i];
static if (op == "-")
endWord &= ~e2._ptr[i];
else
mixin("endWord "~op~"= e2._ptr[i];");
_ptr[i] = (_ptr[i] & ~endMask) | (endWord & endMask);
return this;
}
unittest
{
static bool[] ba = [1,0,1,0,1,1,0,1,0,1];
static bool[] bb = [1,0,1,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
BitArray c = a;
c.length = 5;
c &= b;
assert(a[5] == 1);
assert(a[6] == 0);
assert(a[7] == 1);
assert(a[8] == 0);
assert(a[9] == 1);
}
unittest
{
debug(bitarray) printf("BitArray.opAndAssign unittest\n");
static bool[] ba = [1,0,1,0,1];
static bool[] bb = [1,0,1,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
a &= b;
assert(a[0] == 1);
assert(a[1] == 0);
assert(a[2] == 1);
assert(a[3] == 0);
assert(a[4] == 0);
}
unittest
{
debug(bitarray) printf("BitArray.opOrAssign unittest\n");
static bool[] ba = [1,0,1,0,1];
static bool[] bb = [1,0,1,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
a |= b;
assert(a[0] == 1);
assert(a[1] == 0);
assert(a[2] == 1);
assert(a[3] == 1);
assert(a[4] == 1);
}
unittest
{
debug(bitarray) printf("BitArray.opXorAssign unittest\n");
static bool[] ba = [1,0,1,0,1];
static bool[] bb = [1,0,1,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
a ^= b;
assert(a[0] == 0);
assert(a[1] == 0);
assert(a[2] == 0);
assert(a[3] == 1);
assert(a[4] == 1);
}
unittest
{
debug(bitarray) printf("BitArray.opSubAssign unittest\n");
static bool[] ba = [1,0,1,0,1];
static bool[] bb = [1,0,1,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
a -= b;
assert(a[0] == 0);
assert(a[1] == 0);
assert(a[2] == 0);
assert(a[3] == 0);
assert(a[4] == 1);
}
/***************************************
* Support for operator ~= for $(D BitArray).
* $(RED Warning: This will overwrite a bit in the final word
* of the current underlying data regardless of whether it is
* shared between BitArray objects. i.e. D dynamic array
* concatenation semantics are not followed)
*/
BitArray opCatAssign(bool b) pure nothrow
{
length = _len + 1;
this[_len - 1] = b;
return this;
}
unittest
{
debug(bitarray) printf("BitArray.opCatAssign unittest\n");
static bool[] ba = [1,0,1,0,1];
auto a = BitArray(ba);
BitArray b;
b = (a ~= true);
assert(a[0] == 1);
assert(a[1] == 0);
assert(a[2] == 1);
assert(a[3] == 0);
assert(a[4] == 1);
assert(a[5] == 1);
assert(b == a);
}
/***************************************
* ditto
*/
BitArray opCatAssign(BitArray b) pure nothrow
{
auto istart = _len;
length = _len + b.length;
for (auto i = istart; i < _len; i++)
this[i] = b[i - istart];
return this;
}
unittest
{
debug(bitarray) printf("BitArray.opCatAssign unittest\n");
static bool[] ba = [1,0];
static bool[] bb = [0,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
BitArray c;
c = (a ~= b);
assert(a.length == 5);
assert(a[0] == 1);
assert(a[1] == 0);
assert(a[2] == 0);
assert(a[3] == 1);
assert(a[4] == 0);
assert(c == a);
}
/***************************************
* Support for binary operator ~ for $(D BitArray).
*/
BitArray opCat(bool b) const pure nothrow
{
BitArray r;
r = this.dup;
r.length = _len + 1;
r[_len] = b;
return r;
}
/** ditto */
BitArray opCat_r(bool b) const pure nothrow
{
BitArray r;
r.length = _len + 1;
r[0] = b;
foreach (i; 0 .. _len)
r[1 + i] = this[i];
return r;
}
/** ditto */
BitArray opCat(BitArray b) const pure nothrow
{
BitArray r;
r = this.dup;
r ~= b;
return r;
}
unittest
{
debug(bitarray) printf("BitArray.opCat unittest\n");
static bool[] ba = [1,0];
static bool[] bb = [0,1,0];
auto a = BitArray(ba);
auto b = BitArray(bb);
BitArray c;
c = (a ~ b);
assert(c.length == 5);
assert(c[0] == 1);
assert(c[1] == 0);
assert(c[2] == 0);
assert(c[3] == 1);
assert(c[4] == 0);
c = (a ~ true);
assert(c.length == 3);
assert(c[0] == 1);
assert(c[1] == 0);
assert(c[2] == 1);
c = (false ~ a);
assert(c.length == 3);
assert(c[0] == 0);
assert(c[1] == 1);
assert(c[2] == 0);
}
// Rolls double word (upper, lower) to the right by n bits and returns the
// lower word of the result.
private static size_t rollRight()(size_t upper, size_t lower, size_t nbits)
pure @safe nothrow @nogc
in
{
assert(nbits < bitsPerSizeT);
}
body
{
return (upper << (bitsPerSizeT - nbits)) | (lower >> nbits);
}
unittest
{
static if (size_t.sizeof == 8)
{
size_t x = 0x12345678_90ABCDEF;
size_t y = 0xFEDBCA09_87654321;
assert(rollRight(x, y, 32) == 0x90ABCDEF_FEDBCA09);
assert(rollRight(y, x, 4) == 0x11234567_890ABCDE);
}
else static if (size_t.sizeof == 4)
{
size_t x = 0x12345678;
size_t y = 0x90ABCDEF;
assert(rollRight(x, y, 16) == 0x567890AB);
assert(rollRight(y, x, 4) == 0xF1234567);
}
else
static assert(0, "Unsupported size_t width");
}
// Rolls double word (upper, lower) to the left by n bits and returns the
// upper word of the result.
private static size_t rollLeft()(size_t upper, size_t lower, size_t nbits)
pure @safe nothrow @nogc
in
{
assert(nbits < bitsPerSizeT);
}
body
{
return (upper << nbits) | (lower >> (bitsPerSizeT - nbits));
}
unittest
{
static if (size_t.sizeof == 8)
{
size_t x = 0x12345678_90ABCDEF;
size_t y = 0xFEDBCA09_87654321;
assert(rollLeft(x, y, 32) == 0x90ABCDEF_FEDBCA09);
assert(rollLeft(y, x, 4) == 0xEDBCA098_76543211);
}
else static if (size_t.sizeof == 4)
{
size_t x = 0x12345678;
size_t y = 0x90ABCDEF;
assert(rollLeft(x, y, 16) == 0x567890AB);
assert(rollLeft(y, x, 4) == 0x0ABCDEF1);
}
}
/**
* Operator $(D <<=) support.
*
* Shifts all the bits in the array to the left by the given number of
* bits. The leftmost bits are dropped, and 0's are appended to the end
* to fill up the vacant bits.
*
* $(RED Warning: unused bits in the final word up to the next word
* boundary may be overwritten by this operation. It does not attempt to
* preserve bits past the end of the array.)
*/
void opOpAssign(string op)(size_t nbits) @nogc pure nothrow
if (op == "<<")
{
size_t wordsToShift = nbits / bitsPerSizeT;
size_t bitsToShift = nbits % bitsPerSizeT;
if (wordsToShift < dim)
{
foreach_reverse (i; 1 .. dim - wordsToShift)
{
_ptr[i + wordsToShift] = rollLeft(_ptr[i], _ptr[i-1],
bitsToShift);
}
_ptr[wordsToShift] = rollLeft(_ptr[0], 0, bitsToShift);
}
import std.algorithm : min;
foreach (i; 0 .. min(wordsToShift, dim))
{
_ptr[i] = 0;
}
}
/**
* Operator $(D >>=) support.
*
* Shifts all the bits in the array to the right by the given number of
* bits. The rightmost bits are dropped, and 0's are inserted at the back
* to fill up the vacant bits.
*
* $(RED Warning: unused bits in the final word up to the next word
* boundary may be overwritten by this operation. It does not attempt to
* preserve bits past the end of the array.)
*/
void opOpAssign(string op)(size_t nbits) @nogc pure nothrow
if (op == ">>")
{
size_t wordsToShift = nbits / bitsPerSizeT;
size_t bitsToShift = nbits % bitsPerSizeT;
if (wordsToShift + 1 < dim)
{
foreach (i; 0 .. dim - wordsToShift - 1)
{
_ptr[i] = rollRight(_ptr[i + wordsToShift + 1],
_ptr[i + wordsToShift], bitsToShift);
}
}
// The last word needs some care, as it must shift in 0's from past the
// end of the array.
if (wordsToShift < dim)
{
_ptr[dim - wordsToShift - 1] = rollRight(0, _ptr[dim - 1] & endMask,
bitsToShift);
}
import std.algorithm : min;
foreach (i; 0 .. min(wordsToShift, dim))
{
_ptr[dim - i - 1] = 0;
}
}
unittest
{
import std.format : format;
auto b = BitArray([1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1]);
b <<= 1;
assert(format("%b", b) == "01100_10101101");
b >>= 1;
assert(format("%b", b) == "11001_01011010");
b <<= 4;
assert(format("%b", b) == "00001_10010101");
b >>= 5;
assert(format("%b", b) == "10010_10100000");
b <<= 13;
assert(format("%b", b) == "00000_00000000");
b = BitArray([1, 0, 1, 1, 0, 1, 1, 1]);
b >>= 8;
assert(format("%b", b) == "00000000");
}
// Test multi-word case
unittest
{
import std.format : format;
// This has to be long enough to occupy more than one size_t. On 64-bit
// machines, this would be at least 64 bits.
auto b = BitArray([
1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0,
1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0,
1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1,
]);
b <<= 8;
assert(format("%b", b) ==
"00000000_10000000_"~
"11000000_11100000_"~
"11110000_11111000_"~
"11111100_11111110_"~
"11111111_10101010");
// Test right shift of more than one size_t's worth of bits
b <<= 68;
assert(format("%b", b) ==
"00000000_00000000_"~
"00000000_00000000_"~
"00000000_00000000_"~
"00000000_00000000_"~
"00000000_00001000");
b = BitArray([
1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0,
1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0,
1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1,
]);
b >>= 8;
assert(format("%b", b) ==
"11000000_11100000_"~
"11110000_11111000_"~
"11111100_11111110_"~
"11111111_10101010_"~
"01010101_00000000");
// Test left shift of more than 1 size_t's worth of bits
b >>= 68;
assert(format("%b", b) ==
"01010000_00000000_"~
"00000000_00000000_"~
"00000000_00000000_"~
"00000000_00000000_"~
"00000000_00000000");
}
/***************************************
* Return a string representation of this BitArray.
*
* Two format specifiers are supported:
* $(LI $(B %s) which prints the bits as an array, and)
* $(LI $(B %b) which prints the bits as 8-bit byte packets)
* separated with an underscore.
*/
void toString(scope void delegate(const(char)[]) sink,
FormatSpec!char fmt) const
{
switch (fmt.spec)
{
case 'b':
return formatBitString(sink);
case 's':
return formatBitArray(sink);
default:
throw new Exception("Unknown format specifier: %" ~ fmt.spec);
}
}
///
unittest
{
import std.format : format;
debug(bitarray) printf("BitArray.toString unittest\n");
auto b = BitArray([0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]);
auto s1 = format("%s", b);
assert(s1 == "[0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]");
auto s2 = format("%b", b);
assert(s2 == "00001111_00001111");
}
/***************************************
* Return a lazy range of the indices of set bits.
*/
@property auto bitsSet() const nothrow
{
import std.algorithm : filter, map, joiner;
import std.range : iota;
return iota(dim).
filter!(i => _ptr[i])().
map!(i => BitsSet!size_t(_ptr[i], i * bitsPerSizeT))().
joiner();
}
///
unittest
{
import std.algorithm : equal;
auto b1 = BitArray([0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]);
assert(b1.bitsSet.equal([4, 5, 6, 7, 12, 13, 14, 15]));
BitArray b2;
b2.length = 1000;
b2[333] = true;
b2[666] = true;
b2[999] = true;
assert(b2.bitsSet.equal([333, 666, 999]));
}
unittest
{
import std.algorithm : equal;
import std.range : iota;
debug(bitarray) printf("BitArray.bitsSet unittest\n");
BitArray b;
enum wordBits = size_t.sizeof * 8;
b = BitArray([size_t.max], 0);
assert(b.bitsSet.empty);
b = BitArray([size_t.max], 1);
assert(b.bitsSet.equal([0]));
b = BitArray([size_t.max], wordBits);
assert(b.bitsSet.equal(iota(wordBits)));
b = BitArray([size_t.max, size_t.max], wordBits);
assert(b.bitsSet.equal(iota(wordBits)));
b = BitArray([size_t.max, size_t.max], wordBits + 1);
assert(b.bitsSet.equal(iota(wordBits + 1)));
b = BitArray([size_t.max, size_t.max], wordBits * 2);
assert(b.bitsSet.equal(iota(wordBits * 2)));
}
private void formatBitString(scope void delegate(const(char)[]) sink) const
{
if (!length)
return;
auto leftover = _len % 8;
foreach (idx; 0 .. leftover)
{
char[1] res = cast(char)(this[idx] + '0');
sink.put(res[]);
}
if (leftover && _len > 8)
sink.put("_");
size_t count;
foreach (idx; leftover .. _len)
{
char[1] res = cast(char)(this[idx] + '0');
sink.put(res[]);
if (++count == 8 && idx != _len - 1)
{
sink.put("_");
count = 0;
}
}
}
private void formatBitArray(scope void delegate(const(char)[]) sink) const
{
sink("[");
foreach (idx; 0 .. _len)
{
char[1] res = cast(char)(this[idx] + '0');
sink(res[]);
if (idx+1 < _len)
sink(", ");
}
sink("]");
}
}
unittest
{
import std.format : format;
BitArray b;
b = BitArray([]);
assert(format("%s", b) == "[]");
assert(format("%b", b) is null);
b = BitArray([1]);
assert(format("%s", b) == "[1]");
assert(format("%b", b) == "1");
b = BitArray([0, 0, 0, 0]);
assert(format("%b", b) == "0000");
b = BitArray([0, 0, 0, 0, 1, 1, 1, 1]);
assert(format("%s", b) == "[0, 0, 0, 0, 1, 1, 1, 1]");
assert(format("%b", b) == "00001111");
b = BitArray([0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]);
assert(format("%s", b) == "[0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]");
assert(format("%b", b) == "00001111_00001111");
b = BitArray([1, 0, 0, 0, 0, 1, 1, 1, 1]);
assert(format("%b", b) == "1_00001111");
b = BitArray([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]);
assert(format("%b", b) == "1_00001111_00001111");
}
/++
Swaps the endianness of the given integral value or character.
+/
T swapEndian(T)(T val) @safe pure nothrow @nogc
if (isIntegral!T || isSomeChar!T || isBoolean!T)
{
static if (val.sizeof == 1)
return val;
else static if (isUnsigned!T)
return swapEndianImpl(val);
else static if (isIntegral!T)
return cast(T)swapEndianImpl(cast(Unsigned!T) val);
else static if (is(Unqual!T == wchar))
return cast(T)swapEndian(cast(ushort)val);
else static if (is(Unqual!T == dchar))
return cast(T)swapEndian(cast(uint)val);
else
static assert(0, T.stringof ~ " unsupported by swapEndian.");
}
private ushort swapEndianImpl(ushort val) @safe pure nothrow @nogc
{
return ((val & 0xff00U) >> 8) |
((val & 0x00ffU) << 8);
}
private uint swapEndianImpl(uint val) @trusted pure nothrow @nogc
{
import core.bitop: bswap;
return bswap(val);
}
private ulong swapEndianImpl(ulong val) @trusted pure nothrow @nogc
{
import core.bitop: bswap;
immutable ulong res = bswap(cast(uint)val);
return res << 32 | bswap(cast(uint)(val >> 32));
}
unittest
{
import std.meta;
foreach (T; AliasSeq!(bool, byte, ubyte, short, ushort, int, uint, long, ulong, char, wchar, dchar))
{
scope(failure) writefln("Failed type: %s", T.stringof);
T val;
const T cval;
immutable T ival;
assert(swapEndian(swapEndian(val)) == val);
assert(swapEndian(swapEndian(cval)) == cval);
assert(swapEndian(swapEndian(ival)) == ival);
assert(swapEndian(swapEndian(T.min)) == T.min);
assert(swapEndian(swapEndian(T.max)) == T.max);
foreach (i; 2 .. 10)
{
immutable T maxI = cast(T)(T.max / i);
immutable T minI = cast(T)(T.min / i);
assert(swapEndian(swapEndian(maxI)) == maxI);
static if (isSigned!T)
assert(swapEndian(swapEndian(minI)) == minI);
}
static if (isSigned!T)
assert(swapEndian(swapEndian(cast(T)0)) == 0);
// used to trigger BUG6354
static if (T.sizeof > 1 && isUnsigned!T)
{
T left = 0xffU;
left <<= (T.sizeof - 1) * 8;
T right = 0xffU;
for (size_t i = 1; i < T.sizeof; ++i)
{
assert(swapEndian(left) == right);
assert(swapEndian(right) == left);
left >>= 8;
right <<= 8;
}
}
}
}
private union EndianSwapper(T)
if (canSwapEndianness!T)
{
Unqual!T value;
ubyte[T.sizeof] array;
static if (is(FloatingPointTypeOf!T == float))
uint intValue;
else static if (is(FloatingPointTypeOf!T == double))
ulong intValue;
}
/++
Converts the given value from the native endianness to big endian and
returns it as a $(D ubyte[n]) where $(D n) is the size of the given type.
Returning a $(D ubyte[n]) helps prevent accidentally using a swapped value
as a regular one (and in the case of floating point values, it's necessary,
because the FPU will mess up any swapped floating point values. So, you
can't actually have swapped floating point values as floating point values).
$(D real) is not supported, because its size is implementation-dependent
and therefore could vary from machine to machine (which could make it
unusable if you tried to transfer it to another machine).
+/
auto nativeToBigEndian(T)(T val) @safe pure nothrow @nogc
if (canSwapEndianness!T)
{
return nativeToBigEndianImpl(val);
}
///
unittest
{
int i = 12345;
ubyte[4] swappedI = nativeToBigEndian(i);
assert(i == bigEndianToNative!int(swappedI));
double d = 123.45;
ubyte[8] swappedD = nativeToBigEndian(d);
assert(d == bigEndianToNative!double(swappedD));
}
private auto nativeToBigEndianImpl(T)(T val) @safe pure nothrow @nogc
if (isIntegral!T || isSomeChar!T || isBoolean!T)
{
EndianSwapper!T es = void;
version(LittleEndian)
es.value = swapEndian(val);
else
es.value = val;
return es.array;
}
private auto nativeToBigEndianImpl(T)(T val) @safe pure nothrow @nogc
if (isFloatOrDouble!T)
{
version(LittleEndian)
return floatEndianImpl!(T, true)(val);
else
return floatEndianImpl!(T, false)(val);
}
unittest
{
import std.meta;
foreach (T; AliasSeq!(bool, byte, ubyte, short, ushort, int, uint, long, ulong,
char, wchar, dchar
/* The trouble here is with floats and doubles being compared against nan
* using a bit compare. There are two kinds of nans, quiet and signaling.
* When a nan passes through the x87, it converts signaling to quiet.
* When a nan passes through the XMM, it does not convert signaling to quiet.
* float.init is a signaling nan.
* The binary API sometimes passes the data through the XMM, sometimes through
* the x87, meaning these will fail the 'is' bit compare under some circumstances.
* I cannot think of a fix for this that makes consistent sense.
*/
/*,float, double*/))
{
scope(failure) writefln("Failed type: %s", T.stringof);
T val;
const T cval;
immutable T ival;
//is instead of == because of NaN for floating point values.
assert(bigEndianToNative!T(nativeToBigEndian(val)) is val);
assert(bigEndianToNative!T(nativeToBigEndian(cval)) is cval);
assert(bigEndianToNative!T(nativeToBigEndian(ival)) is ival);
assert(bigEndianToNative!T(nativeToBigEndian(T.min)) == T.min);
assert(bigEndianToNative!T(nativeToBigEndian(T.max)) == T.max);
static if (isSigned!T)
assert(bigEndianToNative!T(nativeToBigEndian(cast(T)0)) == 0);
static if (!is(T == bool))
{
foreach (i; [2, 4, 6, 7, 9, 11])
{
immutable T maxI = cast(T)(T.max / i);
immutable T minI = cast(T)(T.min / i);
assert(bigEndianToNative!T(nativeToBigEndian(maxI)) == maxI);
static if (T.sizeof > 1)
assert(nativeToBigEndian(maxI) != nativeToLittleEndian(maxI));
else
assert(nativeToBigEndian(maxI) == nativeToLittleEndian(maxI));
static if (isSigned!T)
{
assert(bigEndianToNative!T(nativeToBigEndian(minI)) == minI);
static if (T.sizeof > 1)
assert(nativeToBigEndian(minI) != nativeToLittleEndian(minI));
else
assert(nativeToBigEndian(minI) == nativeToLittleEndian(minI));
}
}
}
static if (isUnsigned!T || T.sizeof == 1 || is(T == wchar))
assert(nativeToBigEndian(T.max) == nativeToLittleEndian(T.max));
else
assert(nativeToBigEndian(T.max) != nativeToLittleEndian(T.max));
static if (isUnsigned!T || T.sizeof == 1 || isSomeChar!T)
assert(nativeToBigEndian(T.min) == nativeToLittleEndian(T.min));
else
assert(nativeToBigEndian(T.min) != nativeToLittleEndian(T.min));
}
}
/++
Converts the given value from big endian to the native endianness and
returns it. The value is given as a $(D ubyte[n]) where $(D n) is the size
of the target type. You must give the target type as a template argument,
because there are multiple types with the same size and so the type of the
argument is not enough to determine the return type.
Taking a $(D ubyte[n]) helps prevent accidentally using a swapped value
as a regular one (and in the case of floating point values, it's necessary,
because the FPU will mess up any swapped floating point values. So, you
can't actually have swapped floating point values as floating point values).
+/
T bigEndianToNative(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
if (canSwapEndianness!T && n == T.sizeof)
{
return bigEndianToNativeImpl!(T, n)(val);
}
///
unittest
{
ushort i = 12345;
ubyte[2] swappedI = nativeToBigEndian(i);
assert(i == bigEndianToNative!ushort(swappedI));
dchar c = 'D';
ubyte[4] swappedC = nativeToBigEndian(c);
assert(c == bigEndianToNative!dchar(swappedC));
}
private T bigEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
if ((isIntegral!T || isSomeChar!T || isBoolean!T) &&
n == T.sizeof)
{
EndianSwapper!T es = void;
es.array = val;
version(LittleEndian)
immutable retval = swapEndian(es.value);
else
immutable retval = es.value;
return retval;
}
private T bigEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
if (isFloatOrDouble!T && n == T.sizeof)
{
version(LittleEndian)
return cast(T) floatEndianImpl!(n, true)(val);
else
return cast(T) floatEndianImpl!(n, false)(val);
}
/++
Converts the given value from the native endianness to little endian and
returns it as a $(D ubyte[n]) where $(D n) is the size of the given type.
Returning a $(D ubyte[n]) helps prevent accidentally using a swapped value
as a regular one (and in the case of floating point values, it's necessary,
because the FPU will mess up any swapped floating point values. So, you
can't actually have swapped floating point values as floating point values).
+/
auto nativeToLittleEndian(T)(T val) @safe pure nothrow @nogc
if (canSwapEndianness!T)
{
return nativeToLittleEndianImpl(val);
}
///
unittest
{
int i = 12345;
ubyte[4] swappedI = nativeToLittleEndian(i);
assert(i == littleEndianToNative!int(swappedI));
double d = 123.45;
ubyte[8] swappedD = nativeToLittleEndian(d);
assert(d == littleEndianToNative!double(swappedD));
}
private auto nativeToLittleEndianImpl(T)(T val) @safe pure nothrow @nogc
if (isIntegral!T || isSomeChar!T || isBoolean!T)
{
EndianSwapper!T es = void;
version(BigEndian)
es.value = swapEndian(val);
else
es.value = val;
return es.array;
}
private auto nativeToLittleEndianImpl(T)(T val) @safe pure nothrow @nogc
if (isFloatOrDouble!T)
{
version(BigEndian)
return floatEndianImpl!(T, true)(val);
else
return floatEndianImpl!(T, false)(val);
}
unittest
{
import std.meta;
foreach (T; AliasSeq!(bool, byte, ubyte, short, ushort, int, uint, long, ulong,
char, wchar, dchar/*,
float, double*/))
{
scope(failure) writefln("Failed type: %s", T.stringof);
T val;
const T cval;
immutable T ival;
//is instead of == because of NaN for floating point values.
assert(littleEndianToNative!T(nativeToLittleEndian(val)) is val);
assert(littleEndianToNative!T(nativeToLittleEndian(cval)) is cval);
assert(littleEndianToNative!T(nativeToLittleEndian(ival)) is ival);
assert(littleEndianToNative!T(nativeToLittleEndian(T.min)) == T.min);
assert(littleEndianToNative!T(nativeToLittleEndian(T.max)) == T.max);
static if (isSigned!T)
assert(littleEndianToNative!T(nativeToLittleEndian(cast(T)0)) == 0);
static if (!is(T == bool))
{
foreach (i; 2 .. 10)
{
immutable T maxI = cast(T)(T.max / i);
immutable T minI = cast(T)(T.min / i);
assert(littleEndianToNative!T(nativeToLittleEndian(maxI)) == maxI);
static if (isSigned!T)
assert(littleEndianToNative!T(nativeToLittleEndian(minI)) == minI);
}
}
}
}
/++
Converts the given value from little endian to the native endianness and
returns it. The value is given as a $(D ubyte[n]) where $(D n) is the size
of the target type. You must give the target type as a template argument,
because there are multiple types with the same size and so the type of the
argument is not enough to determine the return type.
Taking a $(D ubyte[n]) helps prevent accidentally using a swapped value
as a regular one (and in the case of floating point values, it's necessary,
because the FPU will mess up any swapped floating point values. So, you
can't actually have swapped floating point values as floating point values).
$(D real) is not supported, because its size is implementation-dependent
and therefore could vary from machine to machine (which could make it
unusable if you tried to transfer it to another machine).
+/
T littleEndianToNative(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
if (canSwapEndianness!T && n == T.sizeof)
{
return littleEndianToNativeImpl!T(val);
}
///
unittest
{
ushort i = 12345;
ubyte[2] swappedI = nativeToLittleEndian(i);
assert(i == littleEndianToNative!ushort(swappedI));
dchar c = 'D';
ubyte[4] swappedC = nativeToLittleEndian(c);
assert(c == littleEndianToNative!dchar(swappedC));
}
private T littleEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
if ((isIntegral!T || isSomeChar!T || isBoolean!T) &&
n == T.sizeof)
{
EndianSwapper!T es = void;
es.array = val;
version(BigEndian)
immutable retval = swapEndian(es.value);
else
immutable retval = es.value;
return retval;
}
private T littleEndianToNativeImpl(T, size_t n)(ubyte[n] val) @safe pure nothrow @nogc
if (((isFloatOrDouble!T) &&
n == T.sizeof))
{
version(BigEndian)
return floatEndianImpl!(n, true)(val);
else
return floatEndianImpl!(n, false)(val);
}
private auto floatEndianImpl(T, bool swap)(T val) @safe pure nothrow @nogc
if (isFloatOrDouble!T)
{
EndianSwapper!T es = void;
es.value = val;
static if (swap)
es.intValue = swapEndian(es.intValue);
return es.array;
}
private auto floatEndianImpl(size_t n, bool swap)(ubyte[n] val) @safe pure nothrow @nogc
if (n == 4 || n == 8)
{
static if (n == 4) EndianSwapper!float es = void;
else static if (n == 8) EndianSwapper!double es = void;
es.array = val;
static if (swap)
es.intValue = swapEndian(es.intValue);
return es.value;
}
private template isFloatOrDouble(T)
{
enum isFloatOrDouble = isFloatingPoint!T &&
!is(Unqual!(FloatingPointTypeOf!T) == real);
}
unittest
{
import std.meta;
foreach (T; AliasSeq!(float, double))
{
static assert(isFloatOrDouble!(T));
static assert(isFloatOrDouble!(const T));
static assert(isFloatOrDouble!(immutable T));
static assert(isFloatOrDouble!(shared T));
static assert(isFloatOrDouble!(shared(const T)));
static assert(isFloatOrDouble!(shared(immutable T)));
}
static assert(!isFloatOrDouble!(real));
static assert(!isFloatOrDouble!(const real));
static assert(!isFloatOrDouble!(immutable real));
static assert(!isFloatOrDouble!(shared real));
static assert(!isFloatOrDouble!(shared(const real)));
static assert(!isFloatOrDouble!(shared(immutable real)));
}
private template canSwapEndianness(T)
{
enum canSwapEndianness = isIntegral!T ||
isSomeChar!T ||
isBoolean!T ||
isFloatOrDouble!T;
}
unittest
{
import std.meta;
foreach (T; AliasSeq!(bool, ubyte, byte, ushort, short, uint, int, ulong,
long, char, wchar, dchar, float, double))
{
static assert(canSwapEndianness!(T));
static assert(canSwapEndianness!(const T));
static assert(canSwapEndianness!(immutable T));
static assert(canSwapEndianness!(shared(T)));
static assert(canSwapEndianness!(shared(const T)));
static assert(canSwapEndianness!(shared(immutable T)));
}
//!
foreach (T; AliasSeq!(real, string, wstring, dstring))
{
static assert(!canSwapEndianness!(T));
static assert(!canSwapEndianness!(const T));
static assert(!canSwapEndianness!(immutable T));
static assert(!canSwapEndianness!(shared(T)));
static assert(!canSwapEndianness!(shared(const T)));
static assert(!canSwapEndianness!(shared(immutable T)));
}
}
/++
Takes a range of $(D ubyte)s and converts the first $(D T.sizeof) bytes to
$(D T). The value returned is converted from the given endianness to the
native endianness. The range is not consumed.
Params:
T = The integral type to convert the first $(D T.sizeof) bytes to.
endianness = The endianness that the bytes are assumed to be in.
range = The range to read from.
index = The index to start reading from (instead of starting at the
front). If index is a pointer, then it is updated to the index
after the bytes read. The overloads with index are only
available if $(D hasSlicing!R) is $(D true).
+/
T peek(T, Endian endianness = Endian.bigEndian, R)(R range)
if (canSwapEndianness!T &&
isForwardRange!R &&
is(ElementType!R : const ubyte))
{
static if (hasSlicing!R)
const ubyte[T.sizeof] bytes = range[0 .. T.sizeof];
else
{
ubyte[T.sizeof] bytes;
//Make sure that range is not consumed, even if it's a class.
range = range.save;
foreach (ref e; bytes)
{
e = range.front;
range.popFront();
}
}
static if (endianness == Endian.bigEndian)
return bigEndianToNative!T(bytes);
else
return littleEndianToNative!T(bytes);
}
/++ Ditto +/
T peek(T, Endian endianness = Endian.bigEndian, R)(R range, size_t index)
if (canSwapEndianness!T &&
isForwardRange!R &&
hasSlicing!R &&
is(ElementType!R : const ubyte))
{
return peek!(T, endianness)(range, &index);
}
/++ Ditto +/
T peek(T, Endian endianness = Endian.bigEndian, R)(R range, size_t* index)
if (canSwapEndianness!T &&
isForwardRange!R &&
hasSlicing!R &&
is(ElementType!R : const ubyte))
{
assert(index);
immutable begin = *index;
immutable end = begin + T.sizeof;
const ubyte[T.sizeof] bytes = range[begin .. end];
*index = end;
static if (endianness == Endian.bigEndian)
return bigEndianToNative!T(bytes);
else
return littleEndianToNative!T(bytes);
}
///
unittest
{
ubyte[] buffer = [1, 5, 22, 9, 44, 255, 8];
assert(buffer.peek!uint() == 17110537);
assert(buffer.peek!ushort() == 261);
assert(buffer.peek!ubyte() == 1);
assert(buffer.peek!uint(2) == 369700095);
assert(buffer.peek!ushort(2) == 5641);
assert(buffer.peek!ubyte(2) == 22);
size_t index = 0;
assert(buffer.peek!ushort(&index) == 261);
assert(index == 2);
assert(buffer.peek!uint(&index) == 369700095);
assert(index == 6);
assert(buffer.peek!ubyte(&index) == 8);
assert(index == 7);
}
unittest
{
{
//bool
ubyte[] buffer = [0, 1];
assert(buffer.peek!bool() == false);
assert(buffer.peek!bool(1) == true);
size_t index = 0;
assert(buffer.peek!bool(&index) == false);
assert(index == 1);
assert(buffer.peek!bool(&index) == true);
assert(index == 2);
}
{
//char (8bit)
ubyte[] buffer = [97, 98, 99, 100];
assert(buffer.peek!char() == 'a');
assert(buffer.peek!char(1) == 'b');
size_t index = 0;
assert(buffer.peek!char(&index) == 'a');
assert(index == 1);
assert(buffer.peek!char(&index) == 'b');
assert(index == 2);
}
{
//wchar (16bit - 2x ubyte)
ubyte[] buffer = [1, 5, 32, 29, 1, 7];
assert(buffer.peek!wchar() == 'ą');
assert(buffer.peek!wchar(2) == '”');
assert(buffer.peek!wchar(4) == 'ć');
size_t index = 0;
assert(buffer.peek!wchar(&index) == 'ą');
assert(index == 2);
assert(buffer.peek!wchar(&index) == '”');
assert(index == 4);
assert(buffer.peek!wchar(&index) == 'ć');
assert(index == 6);
}
{
//dchar (32bit - 4x ubyte)
ubyte[] buffer = [0, 0, 1, 5, 0, 0, 32, 29, 0, 0, 1, 7];
assert(buffer.peek!dchar() == 'ą');
assert(buffer.peek!dchar(4) == '”');
assert(buffer.peek!dchar(8) == 'ć');
size_t index = 0;
assert(buffer.peek!dchar(&index) == 'ą');
assert(index == 4);
assert(buffer.peek!dchar(&index) == '”');
assert(index == 8);
assert(buffer.peek!dchar(&index) == 'ć');
assert(index == 12);
}
{
//float (32bit - 4x ubyte)
ubyte[] buffer = [66, 0, 0, 0, 65, 200, 0, 0];
assert(buffer.peek!float()== 32.0);
assert(buffer.peek!float(4) == 25.0f);
size_t index = 0;
assert(buffer.peek!float(&index) == 32.0f);
assert(index == 4);
assert(buffer.peek!float(&index) == 25.0f);
assert(index == 8);
}
{
//double (64bit - 8x ubyte)
ubyte[] buffer = [64, 64, 0, 0, 0, 0, 0, 0, 64, 57, 0, 0, 0, 0, 0, 0];
assert(buffer.peek!double() == 32.0);
assert(buffer.peek!double(8) == 25.0);
size_t index = 0;
assert(buffer.peek!double(&index) == 32.0);
assert(index == 8);
assert(buffer.peek!double(&index) == 25.0);
assert(index == 16);
}
{
//enum
ubyte[] buffer = [0, 0, 0, 10, 0, 0, 0, 20, 0, 0, 0, 30];
enum Foo
{
one = 10,
two = 20,
three = 30
}
assert(buffer.peek!Foo() == Foo.one);
assert(buffer.peek!Foo(0) == Foo.one);
assert(buffer.peek!Foo(4) == Foo.two);
assert(buffer.peek!Foo(8) == Foo.three);
size_t index = 0;
assert(buffer.peek!Foo(&index) == Foo.one);
assert(index == 4);
assert(buffer.peek!Foo(&index) == Foo.two);
assert(index == 8);
assert(buffer.peek!Foo(&index) == Foo.three);
assert(index == 12);
}
{
//enum - bool
ubyte[] buffer = [0, 1];
enum Bool: bool
{
bfalse = false,
btrue = true,
}
assert(buffer.peek!Bool() == Bool.bfalse);
assert(buffer.peek!Bool(0) == Bool.bfalse);
assert(buffer.peek!Bool(1) == Bool.btrue);
size_t index = 0;
assert(buffer.peek!Bool(&index) == Bool.bfalse);
assert(index == 1);
assert(buffer.peek!Bool(&index) == Bool.btrue);
assert(index == 2);
}
{
//enum - float
ubyte[] buffer = [66, 0, 0, 0, 65, 200, 0, 0];
enum Float: float
{
one = 32.0f,
two = 25.0f
}
assert(buffer.peek!Float() == Float.one);
assert(buffer.peek!Float(0) == Float.one);
assert(buffer.peek!Float(4) == Float.two);
size_t index = 0;
assert(buffer.peek!Float(&index) == Float.one);
assert(index == 4);
assert(buffer.peek!Float(&index) == Float.two);
assert(index == 8);
}
{
//enum - double
ubyte[] buffer = [64, 64, 0, 0, 0, 0, 0, 0, 64, 57, 0, 0, 0, 0, 0, 0];
enum Double: double
{
one = 32.0,
two = 25.0
}
assert(buffer.peek!Double() == Double.one);
assert(buffer.peek!Double(0) == Double.one);
assert(buffer.peek!Double(8) == Double.two);
size_t index = 0;
assert(buffer.peek!Double(&index) == Double.one);
assert(index == 8);
assert(buffer.peek!Double(&index) == Double.two);
assert(index == 16);
}
{
//enum - real
ubyte[] buffer = [64, 64, 0, 0, 0, 0, 0, 0, 64, 57, 0, 0, 0, 0, 0, 0];
enum Real: real
{
one = 32.0,
two = 25.0
}
static assert(!__traits(compiles, buffer.peek!Real()));
}
}
unittest
{
import std.algorithm;
ubyte[] buffer = [1, 5, 22, 9, 44, 255, 7];
auto range = filter!"true"(buffer);
assert(range.peek!uint() == 17110537);
assert(range.peek!ushort() == 261);
assert(range.peek!ubyte() == 1);
}
/++
Takes a range of $(D ubyte)s and converts the first $(D T.sizeof) bytes to
$(D T). The value returned is converted from the given endianness to the
native endianness. The $(D T.sizeof) bytes which are read are consumed from
the range.
Params:
T = The integral type to convert the first $(D T.sizeof) bytes to.
endianness = The endianness that the bytes are assumed to be in.
range = The range to read from.
+/
T read(T, Endian endianness = Endian.bigEndian, R)(ref R range)
if (canSwapEndianness!T && isInputRange!R && is(ElementType!R : const ubyte))
{
static if (hasSlicing!R)
{
const ubyte[T.sizeof] bytes = range[0 .. T.sizeof];
range.popFrontN(T.sizeof);
}
else
{
ubyte[T.sizeof] bytes;
foreach (ref e; bytes)
{
e = range.front;
range.popFront();
}
}
static if (endianness == Endian.bigEndian)
return bigEndianToNative!T(bytes);
else
return littleEndianToNative!T(bytes);
}
///
unittest
{
ubyte[] buffer = [1, 5, 22, 9, 44, 255, 8];
assert(buffer.length == 7);
assert(buffer.read!ushort() == 261);
assert(buffer.length == 5);
assert(buffer.read!uint() == 369700095);
assert(buffer.length == 1);
assert(buffer.read!ubyte() == 8);
assert(buffer.empty);
}
unittest
{
{
//bool
ubyte[] buffer = [0, 1];
assert(buffer.length == 2);
assert(buffer.read!bool() == false);
assert(buffer.length == 1);
assert(buffer.read!bool() == true);
assert(buffer.empty);
}
{
//char (8bit)
ubyte[] buffer = [97, 98, 99];
assert(buffer.length == 3);
assert(buffer.read!char() == 'a');
assert(buffer.length == 2);
assert(buffer.read!char() == 'b');
assert(buffer.length == 1);
assert(buffer.read!char() == 'c');
assert(buffer.empty);
}
{
//wchar (16bit - 2x ubyte)
ubyte[] buffer = [1, 5, 32, 29, 1, 7];
assert(buffer.length == 6);
assert(buffer.read!wchar() == 'ą');
assert(buffer.length == 4);
assert(buffer.read!wchar() == '”');
assert(buffer.length == 2);
assert(buffer.read!wchar() == 'ć');
assert(buffer.empty);
}
{
//dchar (32bit - 4x ubyte)
ubyte[] buffer = [0, 0, 1, 5, 0, 0, 32, 29, 0, 0, 1, 7];
assert(buffer.length == 12);
assert(buffer.read!dchar() == 'ą');
assert(buffer.length == 8);
assert(buffer.read!dchar() == '”');
assert(buffer.length == 4);
assert(buffer.read!dchar() == 'ć');
assert(buffer.empty);
}
{
//float (32bit - 4x ubyte)
ubyte[] buffer = [66, 0, 0, 0, 65, 200, 0, 0];
assert(buffer.length == 8);
assert(buffer.read!float()== 32.0);
assert(buffer.length == 4);
assert(buffer.read!float() == 25.0f);
assert(buffer.empty);
}
{
//double (64bit - 8x ubyte)
ubyte[] buffer = [64, 64, 0, 0, 0, 0, 0, 0, 64, 57, 0, 0, 0, 0, 0, 0];
assert(buffer.length == 16);
assert(buffer.read!double() == 32.0);
assert(buffer.length == 8);
assert(buffer.read!double() == 25.0);
assert(buffer.empty);
}
{
//enum - uint
ubyte[] buffer = [0, 0, 0, 10, 0, 0, 0, 20, 0, 0, 0, 30];
assert(buffer.length == 12);
enum Foo
{
one = 10,
two = 20,
three = 30
}
assert(buffer.read!Foo() == Foo.one);
assert(buffer.length == 8);
assert(buffer.read!Foo() == Foo.two);
assert(buffer.length == 4);
assert(buffer.read!Foo() == Foo.three);
assert(buffer.empty);
}
{
//enum - bool
ubyte[] buffer = [0, 1];
assert(buffer.length == 2);
enum Bool: bool
{
bfalse = false,
btrue = true,
}
assert(buffer.read!Bool() == Bool.bfalse);
assert(buffer.length == 1);
assert(buffer.read!Bool() == Bool.btrue);
assert(buffer.empty);
}
{
//enum - float
ubyte[] buffer = [66, 0, 0, 0, 65, 200, 0, 0];
assert(buffer.length == 8);
enum Float: float
{
one = 32.0f,
two = 25.0f
}
assert(buffer.read!Float() == Float.one);
assert(buffer.length == 4);
assert(buffer.read!Float() == Float.two);
assert(buffer.empty);
}
{
//enum - double
ubyte[] buffer = [64, 64, 0, 0, 0, 0, 0, 0, 64, 57, 0, 0, 0, 0, 0, 0];
assert(buffer.length == 16);
enum Double: double
{
one = 32.0,
two = 25.0
}
assert(buffer.read!Double() == Double.one);
assert(buffer.length == 8);
assert(buffer.read!Double() == Double.two);
assert(buffer.empty);
}
{
//enum - real
ubyte[] buffer = [64, 64, 0, 0, 0, 0, 0, 0, 64, 57, 0, 0, 0, 0, 0, 0];
enum Real: real
{
one = 32.0,
two = 25.0
}
static assert(!__traits(compiles, buffer.read!Real()));
}
}
unittest
{
import std.algorithm;
ubyte[] buffer = [1, 5, 22, 9, 44, 255, 8];
auto range = filter!"true"(buffer);
assert(walkLength(range) == 7);
assert(range.read!ushort() == 261);
assert(walkLength(range) == 5);
assert(range.read!uint() == 369700095);
assert(walkLength(range) == 1);
assert(range.read!ubyte() == 8);
assert(range.empty);
}
/++
Takes an integral value, converts it to the given endianness, and writes it
to the given range of $(D ubyte)s as a sequence of $(D T.sizeof) $(D ubyte)s
starting at index. $(D hasSlicing!R) must be $(D true).
Params:
T = The integral type to convert the first $(D T.sizeof) bytes to.
endianness = The endianness to _write the bytes in.
range = The range to _write to.
value = The value to _write.
index = The index to start writing to. If index is a pointer, then it
is updated to the index after the bytes read.
+/
void write(T, Endian endianness = Endian.bigEndian, R)(R range, T value, size_t index)
if (canSwapEndianness!T &&
isForwardRange!R &&
hasSlicing!R &&
is(ElementType!R : ubyte))
{
write!(T, endianness)(range, value, &index);
}
/++ Ditto +/
void write(T, Endian endianness = Endian.bigEndian, R)(R range, T value, size_t* index)
if (canSwapEndianness!T &&
isForwardRange!R &&
hasSlicing!R &&
is(ElementType!R : ubyte))
{
assert(index);
static if (endianness == Endian.bigEndian)
immutable bytes = nativeToBigEndian!T(value);
else
immutable bytes = nativeToLittleEndian!T(value);
immutable begin = *index;
immutable end = begin + T.sizeof;
*index = end;
range[begin .. end] = bytes[0 .. T.sizeof];
}
///
unittest
{
{
ubyte[] buffer = [0, 0, 0, 0, 0, 0, 0, 0];
buffer.write!uint(29110231u, 0);
assert(buffer == [1, 188, 47, 215, 0, 0, 0, 0]);
buffer.write!ushort(927, 0);
assert(buffer == [3, 159, 47, 215, 0, 0, 0, 0]);
buffer.write!ubyte(42, 0);
assert(buffer == [42, 159, 47, 215, 0, 0, 0, 0]);
}
{
ubyte[] buffer = [0, 0, 0, 0, 0, 0, 0, 0, 0];
buffer.write!uint(142700095u, 2);
assert(buffer == [0, 0, 8, 129, 110, 63, 0, 0, 0]);
buffer.write!ushort(19839, 2);
assert(buffer == [0, 0, 77, 127, 110, 63, 0, 0, 0]);
buffer.write!ubyte(132, 2);
assert(buffer == [0, 0, 132, 127, 110, 63, 0, 0, 0]);
}
{
ubyte[] buffer = [0, 0, 0, 0, 0, 0, 0, 0];
size_t index = 0;
buffer.write!ushort(261, &index);
assert(buffer == [1, 5, 0, 0, 0, 0, 0, 0]);
assert(index == 2);
buffer.write!uint(369700095u, &index);
assert(buffer == [1, 5, 22, 9, 44, 255, 0, 0]);
assert(index == 6);
buffer.write!ubyte(8, &index);
assert(buffer == [1, 5, 22, 9, 44, 255, 8, 0]);
assert(index == 7);
}
}
unittest
{
{
//bool
ubyte[] buffer = [0, 0];
buffer.write!bool(false, 0);
assert(buffer == [0, 0]);
buffer.write!bool(true, 0);
assert(buffer == [1, 0]);
buffer.write!bool(true, 1);
assert(buffer == [1, 1]);
buffer.write!bool(false, 1);
assert(buffer == [1, 0]);
size_t index = 0;
buffer.write!bool(false, &index);
assert(buffer == [0, 0]);
assert(index == 1);
buffer.write!bool(true, &index);
assert(buffer == [0, 1]);
assert(index == 2);
}
{
//char (8bit)
ubyte[] buffer = [0, 0, 0];
buffer.write!char('a', 0);
assert(buffer == [97, 0, 0]);
buffer.write!char('b', 1);
assert(buffer == [97, 98, 0]);
size_t index = 0;
buffer.write!char('a', &index);
assert(buffer == [97, 98, 0]);
assert(index == 1);
buffer.write!char('b', &index);
assert(buffer == [97, 98, 0]);
assert(index == 2);
buffer.write!char('c', &index);
assert(buffer == [97, 98, 99]);
assert(index == 3);
}
{
//wchar (16bit - 2x ubyte)
ubyte[] buffer = [0, 0, 0, 0];
buffer.write!wchar('ą', 0);
assert(buffer == [1, 5, 0, 0]);
buffer.write!wchar('”', 2);
assert(buffer == [1, 5, 32, 29]);
size_t index = 0;
buffer.write!wchar('ć', &index);
assert(buffer == [1, 7, 32, 29]);
assert(index == 2);
buffer.write!wchar('ą', &index);
assert(buffer == [1, 7, 1, 5]);
assert(index == 4);
}
{
//dchar (32bit - 4x ubyte)
ubyte[] buffer = [0, 0, 0, 0, 0, 0, 0, 0];
buffer.write!dchar('ą', 0);
assert(buffer == [0, 0, 1, 5, 0, 0, 0, 0]);
buffer.write!dchar('”', 4);
assert(buffer == [0, 0, 1, 5, 0, 0, 32, 29]);
size_t index = 0;
buffer.write!dchar('ć', &index);
assert(buffer == [0, 0, 1, 7, 0, 0, 32, 29]);
assert(index == 4);
buffer.write!dchar('ą', &index);
assert(buffer == [0, 0, 1, 7, 0, 0, 1, 5]);
assert(index == 8);
}
{
//float (32bit - 4x ubyte)
ubyte[] buffer = [0, 0, 0, 0, 0, 0, 0, 0];
buffer.write!float(32.0f, 0);
assert(buffer == [66, 0, 0, 0, 0, 0, 0, 0]);
buffer.write!float(25.0f, 4);
assert(buffer == [66, 0, 0, 0, 65, 200, 0, 0]);
size_t index = 0;
buffer.write!float(25.0f, &index);
assert(buffer == [65, 200, 0, 0, 65, 200, 0, 0]);
assert(index == 4);
buffer.write!float(32.0f, &index);
assert(buffer == [65, 200, 0, 0, 66, 0, 0, 0]);
assert(index == 8);
}
{
//double (64bit - 8x ubyte)
ubyte[] buffer = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
buffer.write!double(32.0, 0);
assert(buffer == [64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
buffer.write!double(25.0, 8);
assert(buffer == [64, 64, 0, 0, 0, 0, 0, 0, 64, 57, 0, 0, 0, 0, 0, 0]);
size_t index = 0;
buffer.write!double(25.0, &index);
assert(buffer == [64, 57, 0, 0, 0, 0, 0, 0, 64, 57, 0, 0, 0, 0, 0, 0]);
assert(index == 8);
buffer.write!double(32.0, &index);
assert(buffer == [64, 57, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 0, 0, 0, 0]);
assert(index == 16);
}
{
//enum
ubyte[] buffer = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
enum Foo
{
one = 10,
two = 20,
three = 30
}
buffer.write!Foo(Foo.one, 0);
assert(buffer == [0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0]);
buffer.write!Foo(Foo.two, 4);
assert(buffer == [0, 0, 0, 10, 0, 0, 0, 20, 0, 0, 0, 0]);
buffer.write!Foo(Foo.three, 8);
assert(buffer == [0, 0, 0, 10, 0, 0, 0, 20, 0, 0, 0, 30]);
size_t index = 0;
buffer.write!Foo(Foo.three, &index);
assert(buffer == [0, 0, 0, 30, 0, 0, 0, 20, 0, 0, 0, 30]);
assert(index == 4);
buffer.write!Foo(Foo.one, &index);
assert(buffer == [0, 0, 0, 30, 0, 0, 0, 10, 0, 0, 0, 30]);
assert(index == 8);
buffer.write!Foo(Foo.two, &index);
assert(buffer == [0, 0, 0, 30, 0, 0, 0, 10, 0, 0, 0, 20]);
assert(index == 12);
}
{
//enum - bool
ubyte[] buffer = [0, 0];
enum Bool: bool
{
bfalse = false,
btrue = true,
}
buffer.write!Bool(Bool.btrue, 0);
assert(buffer == [1, 0]);
buffer.write!Bool(Bool.btrue, 1);
assert(buffer == [1, 1]);
size_t index = 0;
buffer.write!Bool(Bool.bfalse, &index);
assert(buffer == [0, 1]);
assert(index == 1);
buffer.write!Bool(Bool.bfalse, &index);
assert(buffer == [0, 0]);
assert(index == 2);
}
{
//enum - float
ubyte[] buffer = [0, 0, 0, 0, 0, 0, 0, 0];
enum Float: float
{
one = 32.0f,
two = 25.0f
}
buffer.write!Float(Float.one, 0);
assert(buffer == [66, 0, 0, 0, 0, 0, 0, 0]);
buffer.write!Float(Float.two, 4);
assert(buffer == [66, 0, 0, 0, 65, 200, 0, 0]);
size_t index = 0;
buffer.write!Float(Float.two, &index);
assert(buffer == [65, 200, 0, 0, 65, 200, 0, 0]);
assert(index == 4);
buffer.write!Float(Float.one, &index);
assert(buffer == [65, 200, 0, 0, 66, 0, 0, 0]);
assert(index == 8);
}
{
//enum - double
ubyte[] buffer = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
enum Double: double
{
one = 32.0,
two = 25.0
}
buffer.write!Double(Double.one, 0);
assert(buffer == [64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
buffer.write!Double(Double.two, 8);
assert(buffer == [64, 64, 0, 0, 0, 0, 0, 0, 64, 57, 0, 0, 0, 0, 0, 0]);
size_t index = 0;
buffer.write!Double(Double.two, &index);
assert(buffer == [64, 57, 0, 0, 0, 0, 0, 0, 64, 57, 0, 0, 0, 0, 0, 0]);
assert(index == 8);
buffer.write!Double(Double.one, &index);
assert(buffer == [64, 57, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 0, 0, 0, 0]);
assert(index == 16);
}
{
//enum - real
ubyte[] buffer = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
enum Real: real
{
one = 32.0,
two = 25.0
}
static assert(!__traits(compiles, buffer.write!Real(Real.one)));
}
}
/++
Takes an integral value, converts it to the given endianness, and appends
it to the given range of $(D ubyte)s (using $(D put)) as a sequence of
$(D T.sizeof) $(D ubyte)s starting at index. $(D hasSlicing!R) must be
$(D true).
Params:
T = The integral type to convert the first $(D T.sizeof) bytes to.
endianness = The endianness to write the bytes in.
range = The range to _append to.
value = The value to _append.
+/
void append(T, Endian endianness = Endian.bigEndian, R)(R range, T value)
if (canSwapEndianness!T && isOutputRange!(R, ubyte))
{
static if (endianness == Endian.bigEndian)
immutable bytes = nativeToBigEndian!T(value);
else
immutable bytes = nativeToLittleEndian!T(value);
put(range, bytes[]);
}
///
unittest
{
import std.array;
auto buffer = appender!(const ubyte[])();
buffer.append!ushort(261);
assert(buffer.data == [1, 5]);
buffer.append!uint(369700095u);
assert(buffer.data == [1, 5, 22, 9, 44, 255]);
buffer.append!ubyte(8);
assert(buffer.data == [1, 5, 22, 9, 44, 255, 8]);
}
unittest
{
import std.array;
{
//bool
auto buffer = appender!(const ubyte[])();
buffer.append!bool(true);
assert(buffer.data == [1]);
buffer.append!bool(false);
assert(buffer.data == [1, 0]);
}
{
//char wchar dchar
auto buffer = appender!(const ubyte[])();
buffer.append!char('a');
assert(buffer.data == [97]);
buffer.append!char('b');
assert(buffer.data == [97, 98]);
buffer.append!wchar('ą');
assert(buffer.data == [97, 98, 1, 5]);
buffer.append!dchar('ą');
assert(buffer.data == [97, 98, 1, 5, 0, 0, 1, 5]);
}
{
//float double
auto buffer = appender!(const ubyte[])();
buffer.append!float(32.0f);
assert(buffer.data == [66, 0, 0, 0]);
buffer.append!double(32.0);
assert(buffer.data == [66, 0, 0, 0, 64, 64, 0, 0, 0, 0, 0, 0]);
}
{
//enum
auto buffer = appender!(const ubyte[])();
enum Foo
{
one = 10,
two = 20,
three = 30
}
buffer.append!Foo(Foo.one);
assert(buffer.data == [0, 0, 0, 10]);
buffer.append!Foo(Foo.two);
assert(buffer.data == [0, 0, 0, 10, 0, 0, 0, 20]);
buffer.append!Foo(Foo.three);
assert(buffer.data == [0, 0, 0, 10, 0, 0, 0, 20, 0, 0, 0, 30]);
}
{
//enum - bool
auto buffer = appender!(const ubyte[])();
enum Bool: bool
{
bfalse = false,
btrue = true,
}
buffer.append!Bool(Bool.btrue);
assert(buffer.data == [1]);
buffer.append!Bool(Bool.bfalse);
assert(buffer.data == [1, 0]);
buffer.append!Bool(Bool.btrue);
assert(buffer.data == [1, 0, 1]);
}
{
//enum - float
auto buffer = appender!(const ubyte[])();
enum Float: float
{
one = 32.0f,
two = 25.0f
}
buffer.append!Float(Float.one);
assert(buffer.data == [66, 0, 0, 0]);
buffer.append!Float(Float.two);
assert(buffer.data == [66, 0, 0, 0, 65, 200, 0, 0]);
}
{
//enum - double
auto buffer = appender!(const ubyte[])();
enum Double: double
{
one = 32.0,
two = 25.0
}
buffer.append!Double(Double.one);
assert(buffer.data == [64, 64, 0, 0, 0, 0, 0, 0]);
buffer.append!Double(Double.two);
assert(buffer.data == [64, 64, 0, 0, 0, 0, 0, 0, 64, 57, 0, 0, 0, 0, 0, 0]);
}
{
//enum - real
auto buffer = appender!(const ubyte[])();
enum Real: real
{
one = 32.0,
two = 25.0
}
static assert(!__traits(compiles, buffer.append!Real(Real.one)));
}
}
unittest
{
import std.format : format;
import std.array;
import std.meta;
foreach (endianness; AliasSeq!(Endian.bigEndian, Endian.littleEndian))
{
auto toWrite = appender!(ubyte[])();
alias Types = AliasSeq!(uint, int, long, ulong, short, ubyte, ushort, byte, uint);
ulong[] values = [42, -11, long.max, 1098911981329L, 16, 255, 19012, 2, 17];
assert(Types.length == values.length);
size_t index = 0;
size_t length = 0;
foreach (T; Types)
{
toWrite.append!(T, endianness)(cast(T)values[index++]);
length += T.sizeof;
}
auto toRead = toWrite.data;
assert(toRead.length == length);
index = 0;
foreach (T; Types)
{
assert(toRead.peek!(T, endianness)() == values[index], format("Failed Index: %s", index));
assert(toRead.peek!(T, endianness)(0) == values[index], format("Failed Index: %s", index));
assert(toRead.length == length,
format("Failed Index [%s], Actual Length: %s", index, toRead.length));
assert(toRead.read!(T, endianness)() == values[index], format("Failed Index: %s", index));
length -= T.sizeof;
assert(toRead.length == length,
format("Failed Index [%s], Actual Length: %s", index, toRead.length));
++index;
}
assert(toRead.empty);
}
}
/**
Counts the number of trailing zeros in the binary representation of $(D value).
For signed integers, the sign bit is included in the count.
*/
private uint countTrailingZeros(T)(T value) @nogc pure nothrow
if (isIntegral!T)
{
import core.bitop : bsf;
// bsf doesn't give the correct result for 0.
if (!value)
return 8 * T.sizeof;
else
return bsf(value);
}
///
unittest
{
assert(countTrailingZeros(1) == 0);
assert(countTrailingZeros(0) == 32);
assert(countTrailingZeros(int.min) == 31);
assert(countTrailingZeros(256) == 8);
}
unittest
{
import std.meta;
foreach (T; AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong))
{
assert(countTrailingZeros(cast(T)0) == 8 * T.sizeof);
assert(countTrailingZeros(cast(T)1) == 0);
assert(countTrailingZeros(cast(T)2) == 1);
assert(countTrailingZeros(cast(T)3) == 0);
assert(countTrailingZeros(cast(T)4) == 2);
assert(countTrailingZeros(cast(T)5) == 0);
assert(countTrailingZeros(cast(T)64) == 6);
static if (isSigned!T)
{
assert(countTrailingZeros(cast(T)-1) == 0);
assert(countTrailingZeros(T.min) == 8 * T.sizeof - 1);
}
else
{
assert(countTrailingZeros(T.max) == 0);
}
}
assert(countTrailingZeros(1_000_000) == 6);
foreach (i; 0..63)
assert(countTrailingZeros(1UL << i) == i);
}
/**
Counts the number of set bits in the binary representation of $(D value).
For signed integers, the sign bit is included in the count.
*/
private uint countBitsSet(T)(T value) @nogc pure nothrow
if (isIntegral!T)
{
// http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
static if (T.sizeof == 8)
{
T c = value - ((value >> 1) & 0x55555555_55555555);
c = ((c >> 2) & 0x33333333_33333333) + (c & 0x33333333_33333333);
c = ((c >> 4) + c) & 0x0F0F0F0F_0F0F0F0F;
c = ((c >> 8) + c) & 0x00FF00FF_00FF00FF;
c = ((c >> 16) + c) & 0x0000FFFF_0000FFFF;
c = ((c >> 32) + c) & 0x00000000_FFFFFFFF;
}
else static if (T.sizeof == 4)
{
T c = value - ((value >> 1) & 0x55555555);
c = ((c >> 2) & 0x33333333) + (c & 0x33333333);
c = ((c >> 4) + c) & 0x0F0F0F0F;
c = ((c >> 8) + c) & 0x00FF00FF;
c = ((c >> 16) + c) & 0x0000FFFF;
}
else static if (T.sizeof == 2)
{
uint c = value - ((value >> 1) & 0x5555);
c = ((c >> 2) & 0x3333) + (c & 0X3333);
c = ((c >> 4) + c) & 0x0F0F;
c = ((c >> 8) + c) & 0x00FF;
}
else static if (T.sizeof == 1)
{
uint c = value - ((value >> 1) & 0x55);
c = ((c >> 2) & 0x33) + (c & 0X33);
c = ((c >> 4) + c) & 0x0F;
}
else
{
static assert("countBitsSet only supports 1, 2, 4, or 8 byte sized integers.");
}
return cast(uint)c;
}
///
unittest
{
assert(countBitsSet(1) == 1);
assert(countBitsSet(0) == 0);
assert(countBitsSet(int.min) == 1);
assert(countBitsSet(uint.max) == 32);
}
unittest
{
import std.meta;
foreach (T; AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong))
{
assert(countBitsSet(cast(T)0) == 0);
assert(countBitsSet(cast(T)1) == 1);
assert(countBitsSet(cast(T)2) == 1);
assert(countBitsSet(cast(T)3) == 2);
assert(countBitsSet(cast(T)4) == 1);
assert(countBitsSet(cast(T)5) == 2);
assert(countBitsSet(cast(T)127) == 7);
static if (isSigned!T)
{
assert(countBitsSet(cast(T)-1) == 8 * T.sizeof);
assert(countBitsSet(T.min) == 1);
}
else
{
assert(countBitsSet(T.max) == 8 * T.sizeof);
}
}
assert(countBitsSet(1_000_000) == 7);
foreach (i; 0..63)
assert(countBitsSet(1UL << i) == 1);
}
private struct BitsSet(T)
{
static assert(T.sizeof <= 8, "bitsSet assumes T is no more than 64-bit.");
@nogc pure nothrow:
this(T value, size_t startIndex = 0)
{
_value = value;
uint n = countTrailingZeros(value);
_index = startIndex + n;
_value >>>= n;
}
@property size_t front()
{
return _index;
}
@property bool empty() const
{
return !_value;
}
void popFront()
{
assert(_value, "Cannot call popFront on empty range.");
_value >>>= 1;
uint n = countTrailingZeros(_value);
_value >>>= n;
_index += n + 1;
}
@property auto save()
{
return this;
}
@property size_t length()
{
return countBitsSet(_value);
}
private T _value;
private size_t _index;
}
/**
Range that iterates the indices of the set bits in $(D value).
Index 0 corresponds to the least significant bit.
For signed integers, the highest index corresponds to the sign bit.
*/
auto bitsSet(T)(T value) @nogc pure nothrow
if (isIntegral!T)
{
return BitsSet!T(value);
}
///
unittest
{
import std.algorithm : equal;
import std.range : iota;
assert(bitsSet(1).equal([0]));
assert(bitsSet(5).equal([0, 2]));
assert(bitsSet(-1).equal(iota(32)));
assert(bitsSet(int.min).equal([31]));
}
unittest
{
import std.algorithm : equal;
import std.range: iota;
import std.meta;
foreach (T; AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong))
{
assert(bitsSet(cast(T)0).empty);
assert(bitsSet(cast(T)1).equal([0]));
assert(bitsSet(cast(T)2).equal([1]));
assert(bitsSet(cast(T)3).equal([0, 1]));
assert(bitsSet(cast(T)4).equal([2]));
assert(bitsSet(cast(T)5).equal([0, 2]));
assert(bitsSet(cast(T)127).equal(iota(7)));
static if (isSigned!T)
{
assert(bitsSet(cast(T)-1).equal(iota(8 * T.sizeof)));
assert(bitsSet(T.min).equal([8 * T.sizeof - 1]));
}
else
{
assert(bitsSet(T.max).equal(iota(8 * T.sizeof)));
}
}
assert(bitsSet(1_000_000).equal([6, 9, 14, 16, 17, 18, 19]));
foreach (i; 0..63)
assert(bitsSet(1UL << i).equal([i]));
}
| D |
/**
Copyright: Copyright (c) 2020, Joakim Brännström. All rights reserved.
License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
Author: Joakim Brännström (joakim.brannstrom@gmx.com)
*/
module my.filter;
import std.algorithm : filter;
import std.array : array, empty;
import logger = std.experimental.logger;
import my.optional;
import my.path;
@safe:
/** Filter strings by first cutting out regions (include) and then selectively
* remove (exclude) from region.
*
* It assumes that if `include` is empty everything should match.
*
* I often use this in my programs to allow a user to specify what files to
* process and have some control over what to exclude.
*
* `--re-include` and `--re-exclude` is a suggestion for parameters to use with
* `getopt`.
*/
struct ReFilter {
import std.regex : Regex, regex, matchFirst;
Regex!char[] includeRe;
Regex!char[] excludeRe;
/**
* The regular expressions are set to ignoring the case.
*
* Params:
* include = regular expression.
* exclude = regular expression.
*/
this(string[] include, string[] exclude) {
foreach (r; include)
includeRe ~= regex(r, "i");
foreach (r; exclude)
excludeRe ~= regex(r, "i");
}
/**
* Returns: true if `s` matches `ìncludeRe` and NOT matches any of `excludeRe`.
*/
bool match(string s, void delegate(string s, string type) @safe logFailed = null) {
const inclPassed = () {
if (includeRe.empty)
return true;
foreach (ref re; includeRe) {
if (!matchFirst(s, re).empty)
return true;
}
return false;
}();
if (!inclPassed) {
if (logFailed !is null)
logFailed(s, "include");
return false;
}
foreach (ref re; excludeRe) {
if (!matchFirst(s, re).empty) {
if (logFailed !is null)
logFailed(s, "exclude");
return false;
}
}
return true;
}
}
/// Example:
unittest {
auto r = ReFilter(["foo.*"], [".*bar.*", ".*batman"]);
assert(["foo", "foobar", "foo smurf batman", "batman", "fo",
"foo mother"].filter!(a => r.match(a)).array == [
"foo", "foo mother"
]);
}
@("shall match everything by default")
unittest {
ReFilter r;
assert(["foo", "foobar"].filter!(a => r.match(a)).array == ["foo", "foobar"]);
}
@("shall exclude the specified items")
unittest {
auto r = ReFilter(null, [".*bar.*", ".*batman"]);
assert(["foo", "foobar", "foo smurf batman", "batman", "fo",
"foo mother"].filter!(a => r.match(a)).array == [
"foo", "fo", "foo mother"
]);
}
/** Filter strings by first cutting out a region (include) and then selectively
* remove (exclude) from that region.
*
* I often use this in my programs to allow a user to specify what files to
* process and the have some control over what to exclude.
*/
struct GlobFilter {
string[] include;
string[] exclude;
/**
* The regular expressions are set to ignoring the case.
*
* Params:
* include = glob string patter
* exclude = glob string patterh
*/
this(string[] include, string[] exclude) {
this.include = include;
this.exclude = exclude;
}
/**
* Params:
* logFailed = called when `s` fails matching.
*
* Returns: true if `s` matches `ìncludeRe` and NOT matches any of `excludeRe`.
*/
bool match(string s, void delegate(string s, string[] filters) @safe logFailed = null) {
import std.algorithm : canFind;
import std.path : globMatch;
if (!include.empty && !canFind!((a, b) => globMatch(b, a))(include, s)) {
if (logFailed !is null)
logFailed(s, include);
return false;
}
if (canFind!((a, b) => globMatch(b, a))(exclude, s)) {
if (logFailed !is null)
logFailed(s, exclude);
return false;
}
return true;
}
}
/// Example:
unittest {
import std.algorithm : filter;
import std.array : array;
auto r = GlobFilter(["foo*"], ["*bar*", "*batman"]);
assert(["foo", "foobar", "foo smurf batman", "batman", "fo",
"foo mother"].filter!(a => r.match(a)).array == [
"foo", "foo mother"
]);
}
@("shall not crash")
unittest {
auto r = GlobFilter(["*"], ["bar/*"]);
assert(["foo", "bar", "bar/foo", "bar batman",].filter!(a => r.match(a))
.array == ["foo", "bar", "bar batman"]);
}
GlobFilter merge(GlobFilter a, GlobFilter b) {
return GlobFilter(a.include ~ b.include, a.exclude ~ b.exclude);
}
@("shall merge two filters")
unittest {
auto a = GlobFilter(["foo*"], ["*bar*", "*batman"]);
auto b = GlobFilter(["fun*"], ["*fun*"]);
auto c = merge(a, b);
assert(c.include == ["foo*", "fun*"]);
assert(c.exclude == ["*bar*", "*batman", "*fun*"]);
}
struct GlobFilterClosestMatch {
GlobFilter filter;
AbsolutePath base;
bool match(string s, void delegate(string s, string[] filters) @safe logFailed = null) {
import std.path : relativePath;
return filter.match(s.relativePath(base.toString), logFailed);
}
}
/** The closest matching filter.
*
* Use for example as:
* ```
* closest(filters, p).orElse(GlobFilterClosestMatch(defaultFilter, AbsolutePath("."))).match(p);
* ```
*/
Optional!GlobFilterClosestMatch closest(GlobFilter[AbsolutePath] filters, AbsolutePath p) {
import std.path : rootName;
if (filters.empty)
return typeof(return)(None.init);
const root = p.toString.rootName;
while (p != root) {
p = p.dirName;
if (auto v = p in filters)
return some(GlobFilterClosestMatch(*v, p));
}
return typeof(return)(None.init);
}
| D |
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module flow.common.persistence.entity.PropertyEntityManagerImpl;
import hunt.collection.List;
import flow.common.AbstractEngineConfiguration;
import flow.common.persistence.entity.data.PropertyDataManager;
import flow.common.persistence.entity.AbstractEngineEntityManager;
import flow.common.persistence.entity.PropertyEntityManager;
import flow.common.persistence.entity.PropertyEntity;
/**
* @author Tom Baeyens
* @author Joram Barrez
*/
class PropertyEntityManagerImpl
: AbstractEngineEntityManager!(AbstractEngineConfiguration, PropertyEntity, PropertyDataManager)
, PropertyEntityManager {
this(AbstractEngineConfiguration engineConfiguration, PropertyDataManager propertyDataManager) {
super(engineConfiguration, propertyDataManager);
}
public List!PropertyEntity findAll() {
return dataManager.findAll();
}
void upDateDbid(string id) {
dataManager.upDateDbid(id);
}
}
| D |
module bytied.types.vertex;
struct Vertex {
float x;
float y;
float z;
float r;
float g;
float b;
float a;
} | D |
/**
d2d.core.render.renderer holds the classes used to render the whole engine.
*/
module d2d.core.render.renderer;
import std.algorithm;
import gl3n.linalg;
import derelict.opengl3.gl3;
import d2d.core.base;
import d2d.core.render.objects;
import d2d.core.render.util;
/// The renderer manages the finalized rendering of all classes within the engine; it abstracts all calls to the graphics api away from the engine
class Renderer : Base
{
this()
{
registerAsService("d2d.renderer");
}
/// Adds a view that will be shown on screen
void pushView(View view)
{
_views ~= view;
}
/// Adds an object to be renderd
void pushObject(Renderable r)
{
_objects ~= r;
}
/// Renders the scene, cleans the pushed objects
override void postRender()
{
//clean everythin
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//glClearColor(1.0f,1.0f,0.0f,1.0f);
// sort views by z-index: higer index means later rendering
sort!("a.zindex < b.zindex",SwapStrategy.stable)(_views);
sort!("a.detailLevel < b.detailLevel",SwapStrategy.stable)(_objects);
// Render everything
foreach(ref v; _views) {
// we clamp the viewport to the pixel-grid. Overlapping is better than a black gap, and overlapped things will simply be invisible.
vec2i viewportPos = toPixel(v.viewportPos);
vec2i viewportSize = toPixel(v.viewportSize, true);
if(_currViewportPos != viewportPos || _currViewportSize != viewportSize) {
glViewport(viewportPos.x, viewportPos.y, viewportSize.x, viewportSize.y);
_currViewportPos = viewportPos;
_currViewportSize = viewportSize;
}
// some objects are renderd independendly of workd coordinates, so we want this thing
auto screenView = new ScreenSpaceView(v);
foreach(ref o; _objects) {
if (v.detailLevel >= o.detailLevel) {
if (o.ignoreView) {
o.render(screenView);
} else {
o.render(v);
}
}
}
}
//cleanup
_views.length = 0;
_objects.length = 0;
}
private:
/// The views
View[] _views;
/// Cached viewport offset
vec2i _currViewportPos = vec2i(0,0);
vec2i _currViewportSize = vec2i(0,0);
/// The scene objects
Renderable[] _objects;
}
| D |
module window;
/**
Contains various helpers, common code, and initialization routines.
*/
import std.algorithm : min;
import std.exception : enforce;
import std.functional : toDelegate;
import std.stdio : stderr;
import std.string : format;
import deimos.glfw.glfw3;
import glad.gl.enums;
import glad.gl.ext;
import glad.gl.funcs;
import glad.gl.loader;
import glad.gl.types;
import glwtf.input;
import glwtf.window;
/// init
shared static this()
{
enforce(glfwInit());
}
/// uninit
shared static ~this()
{
glfwTerminate();
}
///
enum WindowMode
{
fullscreen,
windowed,
}
/**
Create a window, an OpenGL 3.x context, and set up some other
common routines for error handling, window resizing, etc.
*/
Window createWindow(string windowName, WindowMode windowMode = WindowMode.windowed, int width = 1024, int height = 768)
{
auto vidMode = glfwGetVideoMode(glfwGetPrimaryMonitor());
// constrain the window size so it isn't larger than the desktop size.
width = min(width, vidMode.width);
height = min(height, vidMode.height);
// set the window to be initially inivisible since we're repositioning it.
glfwWindowHint(GLFW_VISIBLE, 0);
// enable debugging
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, 1);
Window window = createWindowContext(windowName, WindowMode.windowed, width, height);
// center the window on the screen
glfwSetWindowPos(window.window, (vidMode.width - width) / 2, (vidMode.height - height) / 2);
// glfw-specific error routine (not a generic GL error handler)
register_glfw_error_callback(&glfwErrorCallback);
// anti-aliasing number of samples.
window.samples = 4;
// activate an opengl context.
window.make_context_current();
// load all OpenGL function pointers via glad.
enforce(gladLoadGL());
enforce(glGenBuffers !is null);
// only interested in GL 3.x
enforce(GLVersion.major >= 3);
// turn v-sync off.
glfwSwapInterval(0);
// ensure the debug output extension is supported
enforce(GL_ARB_debug_output || GL_KHR_debug);
// cast: workaround for 'nothrow' propagation bug (haven't been able to reduce it)
auto hookDebugCallback = GL_ARB_debug_output ? glDebugMessageCallbackARB
: cast(typeof(glDebugMessageCallbackARB))glDebugMessageCallback;
// hook the debug callback
// cast: when using derelict it assumes its nothrow
hookDebugCallback(cast(GLDEBUGPROCARB)&glErrorCallback, null);
// enable proper stack tracing support (otherwise we'd get random failures at runtime)
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
// finally show the window
glfwShowWindow(window.window);
return window;
}
/** Create a window and an OpenGL context. */
Window createWindowContext(string windowName, WindowMode windowMode, int width, int height)
{
auto window = new Window();
auto monitor = windowMode == WindowMode.fullscreen ? glfwGetPrimaryMonitor() : null;
auto context = window.create_highest_available_context(width, height, windowName, monitor, null, GLFW_OPENGL_CORE_PROFILE);
// ensure we've loaded a proper context
enforce(context.major >= 3);
return window;
}
/** Just emit errors to stderr on GLFW errors. */
void glfwErrorCallback(int code, string msg)
{
stderr.writefln("Error (%s): %s", code, msg);
}
///
class GLException : Exception
{
@safe pure nothrow this(string msg = "", string file = __FILE__, size_t line = __LINE__, Throwable next = null)
{
super(msg, file, line, next);
}
@safe pure nothrow this(string msg, Throwable next, string file = __FILE__, size_t line = __LINE__)
{
super(msg, file, line, next);
}
}
/**
GL_ARB_debug_output or GL_KHR_debug callback.
Throwing exceptions across language boundaries is ok as
long as $(B GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB) is enabled.
*/
extern (Windows)
private void glErrorCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, in GLchar* message, GLvoid* userParam)
{
string msg = format("source: %s, type: %s, id: %s, severity: %s, length: %s, message: %s, userParam: %s",
source, type, id, severity, length, message.to!string, userParam);
throw new GLException(msg);
}
| D |
module android.java.android.graphics.Interpolator_Result;
public import android.java.android.graphics.Interpolator_Result_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!Interpolator_Result;
import import0 = android.java.android.graphics.Interpolator_Result;
import import2 = android.java.java.lang.Class;
| D |
module myversion; public static char[] author=cast(char[])"Itiu"; public static char[] date=cast(char[])"Mon Feb 11 18:06:14 2013 +0400"; public static char[] hash=cast(char[])"3ef387e"; | D |
/Users/mac/Assignment/build/Assignment.build/Debug-iphonesimulator/Assignment.build/Objects-normal/x86_64/AppDelegate.o : /Users/mac/Assignment/Assignment/Controller/AlarmPIC.swift /Users/mac/Assignment/Assignment/Controller/TicTacToeVC.swift /Users/mac/Assignment/Assignment/Controller/NoteVC.swift /Users/mac/Assignment/Assignment/Controller/SoundBrowsingVC.swift /Users/mac/Assignment/Assignment/Controller/MathVC.swift /Users/mac/Assignment/Assignment/Controller/AlarmVC.swift /Users/mac/Assignment/Assignment/Controller/SetMethodAlarmVC.swift /Users/mac/Assignment/Assignment/Controller/SetTimeAlarmVC.swift /Users/mac/Assignment/Assignment/Controller/ReminderVC.swift /Users/mac/Assignment/Assignment/Controller/WeekdaysVC.swift /Users/mac/Assignment/Assignment/Function/Line.swift /Users/mac/Assignment/Assignment/Controller/NewPicture.swift /Users/mac/Assignment/Assignment/App/AppDelegate.swift /Users/mac/Assignment/Assignment/Function/WeekdaysCell.swift /Users/mac/Assignment/Assignment/Controller/tableViewCellTableViewCell.swift /Users/mac/Assignment/Assignment/Controller/alarmTableViewCell.swift /Users/mac/Assignment/Assignment/Controller/imageUICollectionViewCell.swift /Users/mac/Assignment/Assignment/Persistent\ Data/Alarm.swift /Users/mac/Assignment/Assignment/Services/DayServices.swift /Users/mac/Assignment/Assignment/Model/Weekdays.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes
/Users/mac/Assignment/build/Assignment.build/Debug-iphonesimulator/Assignment.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/mac/Assignment/Assignment/Controller/AlarmPIC.swift /Users/mac/Assignment/Assignment/Controller/TicTacToeVC.swift /Users/mac/Assignment/Assignment/Controller/NoteVC.swift /Users/mac/Assignment/Assignment/Controller/SoundBrowsingVC.swift /Users/mac/Assignment/Assignment/Controller/MathVC.swift /Users/mac/Assignment/Assignment/Controller/AlarmVC.swift /Users/mac/Assignment/Assignment/Controller/SetMethodAlarmVC.swift /Users/mac/Assignment/Assignment/Controller/SetTimeAlarmVC.swift /Users/mac/Assignment/Assignment/Controller/ReminderVC.swift /Users/mac/Assignment/Assignment/Controller/WeekdaysVC.swift /Users/mac/Assignment/Assignment/Function/Line.swift /Users/mac/Assignment/Assignment/Controller/NewPicture.swift /Users/mac/Assignment/Assignment/App/AppDelegate.swift /Users/mac/Assignment/Assignment/Function/WeekdaysCell.swift /Users/mac/Assignment/Assignment/Controller/tableViewCellTableViewCell.swift /Users/mac/Assignment/Assignment/Controller/alarmTableViewCell.swift /Users/mac/Assignment/Assignment/Controller/imageUICollectionViewCell.swift /Users/mac/Assignment/Assignment/Persistent\ Data/Alarm.swift /Users/mac/Assignment/Assignment/Services/DayServices.swift /Users/mac/Assignment/Assignment/Model/Weekdays.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes
/Users/mac/Assignment/build/Assignment.build/Debug-iphonesimulator/Assignment.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/mac/Assignment/Assignment/Controller/AlarmPIC.swift /Users/mac/Assignment/Assignment/Controller/TicTacToeVC.swift /Users/mac/Assignment/Assignment/Controller/NoteVC.swift /Users/mac/Assignment/Assignment/Controller/SoundBrowsingVC.swift /Users/mac/Assignment/Assignment/Controller/MathVC.swift /Users/mac/Assignment/Assignment/Controller/AlarmVC.swift /Users/mac/Assignment/Assignment/Controller/SetMethodAlarmVC.swift /Users/mac/Assignment/Assignment/Controller/SetTimeAlarmVC.swift /Users/mac/Assignment/Assignment/Controller/ReminderVC.swift /Users/mac/Assignment/Assignment/Controller/WeekdaysVC.swift /Users/mac/Assignment/Assignment/Function/Line.swift /Users/mac/Assignment/Assignment/Controller/NewPicture.swift /Users/mac/Assignment/Assignment/App/AppDelegate.swift /Users/mac/Assignment/Assignment/Function/WeekdaysCell.swift /Users/mac/Assignment/Assignment/Controller/tableViewCellTableViewCell.swift /Users/mac/Assignment/Assignment/Controller/alarmTableViewCell.swift /Users/mac/Assignment/Assignment/Controller/imageUICollectionViewCell.swift /Users/mac/Assignment/Assignment/Persistent\ Data/Alarm.swift /Users/mac/Assignment/Assignment/Services/DayServices.swift /Users/mac/Assignment/Assignment/Model/Weekdays.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/simd.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes
| D |
/**
* Code generation 4
*
* Includes:
* - assignemt variations of operators (+= -= *= /= %= <<= >>=)
* - integer comparison (< > <= >=)
* - converting integers to a different size (e.g. short to int)
* - bit instructions (bit scan, population count)
*
* Compiler implementation of the
* $(LINK2 https://www.dlang.org, D programming language).
*
* Mostly code generation for assignment operators.
*
* Copyright: Copyright (C) 1985-1998 by Symantec
* Copyright (C) 2000-2022 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/cod4.d, backend/cod4.d)
* Documentation: https://dlang.org/phobos/dmd_backend_cod4.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/backend/cod4.d
*/
module dmd.backend.cod4;
version (SCPP)
version = COMPILE;
version (MARS)
version = COMPILE;
version (COMPILE)
{
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import dmd.backend.cc;
import dmd.backend.cdef;
import dmd.backend.code;
import dmd.backend.code_x86;
import dmd.backend.codebuilder;
import dmd.backend.mem;
import dmd.backend.el;
import dmd.backend.global;
import dmd.backend.oper;
import dmd.backend.ty;
import dmd.backend.evalu8 : el_toldoubled;
import dmd.backend.xmm;
extern (C++):
nothrow:
@safe:
int REGSIZE();
extern __gshared CGstate cgstate;
extern __gshared bool[FLMAX] datafl;
private extern (D) uint mask(uint m) { return 1 << m; }
/* AX,CX,DX,BX */
__gshared const reg_t[4] dblreg = [ BX,DX,NOREG,CX ];
// from divcoeff.c
extern (C)
{
bool choose_multiplier(int N, ulong d, int prec, ulong *pm, int *pshpost);
bool udiv_coefficients(int N, ulong d, int *pshpre, ulong *pm, int *pshpost);
}
/*******************************
* Return number of times symbol s appears in tree e.
*/
@trusted
private int intree(Symbol *s,elem *e)
{
if (!OTleaf(e.Eoper))
return intree(s,e.EV.E1) + (OTbinary(e.Eoper) ? intree(s,e.EV.E2) : 0);
return e.Eoper == OPvar && e.EV.Vsym == s;
}
/***********************************
* Determine if expression e can be evaluated directly into register
* variable s.
* Have to be careful about things like x=x+x+x, and x=a+x.
* Returns:
* !=0 can
* 0 can't
*/
@trusted
int doinreg(Symbol *s, elem *e)
{
int in_ = 0;
OPER op;
L1:
op = e.Eoper;
if (op == OPind ||
OTcall(op) ||
OTleaf(op) ||
(in_ = intree(s,e)) == 0 ||
(OTunary(op) && OTleaf(e.EV.E1.Eoper))
)
return 1;
if (in_ == 1)
{
switch (op)
{
case OPadd:
case OPmin:
case OPand:
case OPor:
case OPxor:
case OPshl:
case OPmul:
if (!intree(s,e.EV.E2))
{
e = e.EV.E1;
goto L1;
}
break;
default:
break;
}
}
return 0;
}
/****************************
* Return code for saving common subexpressions if EA
* turns out to be a register.
* This is called just before modifying an EA.
*/
void modEA(ref CodeBuilder cdb,code *c)
{
if ((c.Irm & 0xC0) == 0xC0) // addressing mode refers to a register
{
reg_t reg = c.Irm & 7;
if (c.Irex & REX_B)
{ reg |= 8;
assert(I64);
}
getregs(cdb,mask(reg));
}
}
/****************************
* Gen code for op= for doubles.
*/
@trusted
private void opassdbl(ref CodeBuilder cdb,elem *e,regm_t *pretregs,OPER op)
{
assert(config.exe & EX_windos); // for targets that may not have an 8087
static immutable uint[OPdivass - OPpostinc + 1] clibtab =
/* OPpostinc,OPpostdec,OPeq,OPaddass,OPminass,OPmulass,OPdivass */
[ CLIB.dadd, CLIB.dsub, cast(uint)-1, CLIB.dadd,CLIB.dsub,CLIB.dmul,CLIB.ddiv ];
if (config.inline8087)
{
opass87(cdb,e,pretregs);
return;
}
code cs;
regm_t retregs2,retregs,idxregs;
uint clib = clibtab[op - OPpostinc];
elem *e1 = e.EV.E1;
tym_t tym = tybasic(e1.Ety);
getlvalue(cdb,&cs,e1,DOUBLEREGS | mBX | mCX);
if (tym == TYfloat)
{
clib += CLIB.fadd - CLIB.dadd; /* convert to float operation */
// Load EA into FLOATREGS
getregs(cdb,FLOATREGS);
cs.Iop = LOD;
cs.Irm |= modregrm(0,AX,0);
cdb.gen(&cs);
if (!I32)
{
cs.Irm |= modregrm(0,DX,0);
getlvalue_msw(&cs);
cdb.gen(&cs);
getlvalue_lsw(&cs);
}
retregs2 = FLOATREGS2;
idxregs = FLOATREGS | idxregm(&cs);
retregs = FLOATREGS;
}
else
{
if (I32)
{
// Load EA into DOUBLEREGS
getregs(cdb,DOUBLEREGS_32);
cs.Iop = LOD;
cs.Irm |= modregrm(0,AX,0);
cdb.gen(&cs);
cs.Irm |= modregrm(0,DX,0);
getlvalue_msw(&cs);
cdb.gen(&cs);
getlvalue_lsw(&cs);
retregs2 = DOUBLEREGS2_32;
idxregs = DOUBLEREGS_32 | idxregm(&cs);
}
else
{
// Push EA onto stack
cs.Iop = 0xFF;
cs.Irm |= modregrm(0,6,0);
cs.IEV1.Voffset += DOUBLESIZE - REGSIZE;
cdb.gen(&cs);
getlvalue_lsw(&cs);
cdb.gen(&cs);
getlvalue_lsw(&cs);
cdb.gen(&cs);
getlvalue_lsw(&cs);
cdb.gen(&cs);
stackpush += DOUBLESIZE;
retregs2 = DOUBLEREGS_16;
idxregs = idxregm(&cs);
}
retregs = DOUBLEREGS;
}
if ((cs.Iflags & CFSEG) == CFes)
idxregs |= mES;
cgstate.stackclean++;
scodelem(cdb,e.EV.E2,&retregs2,idxregs,false);
cgstate.stackclean--;
callclib(cdb,e,clib,&retregs,0);
if (e1.Ecount)
cssave(e1,retregs,!OTleaf(e1.Eoper)); // if lvalue is a CSE
freenode(e1);
cs.Iop = STO; // MOV EA,DOUBLEREGS
fltregs(cdb,&cs,tym);
fixresult(cdb,e,retregs,pretregs);
}
/****************************
* Gen code for OPnegass for doubles.
*/
@trusted
private void opnegassdbl(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
assert(config.exe & EX_windos); // for targets that may not have an 8087
if (config.inline8087)
{
cdnegass87(cdb,e,pretregs);
return;
}
elem *e1 = e.EV.E1;
tym_t tym = tybasic(e1.Ety);
int sz = _tysize[tym];
code cs;
getlvalue(cdb,&cs,e1,*pretregs ? DOUBLEREGS | mBX | mCX : 0);
modEA(cdb,&cs);
cs.Irm |= modregrm(0,6,0);
cs.Iop = 0x80;
cs.IEV1.Voffset += sz - 1;
cs.IFL2 = FLconst;
cs.IEV2.Vuns = 0x80;
cdb.gen(&cs); // XOR 7[EA],0x80
if (tycomplex(tym))
{
cs.IEV1.Voffset -= sz / 2;
cdb.gen(&cs); // XOR 7[EA],0x80
}
regm_t retregs;
if (*pretregs || e1.Ecount)
{
cs.IEV1.Voffset -= sz - 1;
if (tym == TYfloat)
{
// Load EA into FLOATREGS
getregs(cdb,FLOATREGS);
cs.Iop = LOD;
NEWREG(cs.Irm, AX);
cdb.gen(&cs);
if (!I32)
{
NEWREG(cs.Irm, DX);
getlvalue_msw(&cs);
cdb.gen(&cs);
getlvalue_lsw(&cs);
}
retregs = FLOATREGS;
}
else
{
if (I32)
{
// Load EA into DOUBLEREGS
getregs(cdb,DOUBLEREGS_32);
cs.Iop = LOD;
cs.Irm &= ~cast(uint)modregrm(0,7,0);
cs.Irm |= modregrm(0,AX,0);
cdb.gen(&cs);
cs.Irm |= modregrm(0,DX,0);
getlvalue_msw(&cs);
cdb.gen(&cs);
getlvalue_lsw(&cs);
}
else
{
static if (1)
{
cs.Iop = LOD;
fltregs(cdb,&cs,TYdouble); // MOV DOUBLEREGS, EA
}
else
{
// Push EA onto stack
cs.Iop = 0xFF;
cs.Irm |= modregrm(0,6,0);
cs.IEV1.Voffset += DOUBLESIZE - REGSIZE;
cdb.gen(&cs);
cs.IEV1.Voffset -= REGSIZE;
cdb.gen(&cs);
cs.IEV1.Voffset -= REGSIZE;
cdb.gen(&cs);
cs.IEV1.Voffset -= REGSIZE;
cdb.gen(&cs);
stackpush += DOUBLESIZE;
}
}
retregs = DOUBLEREGS;
}
if (e1.Ecount)
cssave(e1,retregs,!OTleaf(e1.Eoper)); /* if lvalue is a CSE */
}
else
{
retregs = 0;
assert(e1.Ecount == 0);
}
freenode(e1);
fixresult(cdb,e,retregs,pretregs);
}
/************************
* Generate code for an assignment.
*/
@trusted
void cdeq(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
tym_t tymll;
reg_t reg;
code cs;
elem *e11;
bool regvar; // true means evaluate into register variable
regm_t varregm;
reg_t varreg;
targ_int postinc;
//printf("cdeq(e = %p, *pretregs = %s)\n", e, regm_str(*pretregs));
elem *e1 = e.EV.E1;
elem *e2 = e.EV.E2;
int e2oper = e2.Eoper;
tym_t tyml = tybasic(e1.Ety); // type of lvalue
regm_t retregs = *pretregs;
if (tyxmmreg(tyml) && config.fpxmmregs)
{
xmmeq(cdb, e, CMP, e1, e2, pretregs);
return;
}
if (tyfloating(tyml) && config.inline8087)
{
if (tycomplex(tyml))
{
complex_eq87(cdb, e, pretregs);
return;
}
if (!(retregs == 0 &&
(e2oper == OPconst || e2oper == OPvar || e2oper == OPind))
)
{
eq87(cdb,e,pretregs);
return;
}
if (config.target_cpu >= TARGET_PentiumPro &&
(e2oper == OPvar || e2oper == OPind)
)
{
eq87(cdb,e,pretregs);
return;
}
if (tyml == TYldouble || tyml == TYildouble)
{
eq87(cdb,e,pretregs);
return;
}
}
uint sz = _tysize[tyml]; // # of bytes to transfer
assert(cast(int)sz > 0);
if (retregs == 0) // if no return value
{
int fl;
/* If registers are tight, and we might need them for the lvalue,
* prefer to not use them for the rvalue
*/
bool plenty = true;
if (e1.Eoper == OPind)
{
/* Will need 1 register for evaluation, +2 registers for
* e1's addressing mode
*/
regm_t m = allregs & ~regcon.mvar; // mask of non-register variables
m &= m - 1; // clear least significant bit
m &= m - 1; // clear least significant bit
plenty = m != 0; // at least 3 registers
}
if ((e2oper == OPconst || // if rvalue is a constant
e2oper == OPrelconst &&
!(I64 && (config.flags3 & CFG3pic || config.exe == EX_WIN64)) &&
((fl = el_fl(e2)) == FLdata ||
fl==FLudata || fl == FLextern)
&& !(e2.EV.Vsym.ty() & mTYcs)
) &&
!(evalinregister(e2) && plenty) &&
!e1.Ecount) // and no CSE headaches
{
// Look for special case of (*p++ = ...), where p is a register variable
if (e1.Eoper == OPind &&
((e11 = e1.EV.E1).Eoper == OPpostinc || e11.Eoper == OPpostdec) &&
e11.EV.E1.Eoper == OPvar &&
e11.EV.E1.EV.Vsym.Sfl == FLreg &&
(!I16 || e11.EV.E1.EV.Vsym.Sregm & IDXREGS)
)
{
Symbol *s = e11.EV.E1.EV.Vsym;
if (s.Sclass == SCfastpar || s.Sclass == SCshadowreg)
{
regcon.params &= ~s.Spregm();
}
postinc = e11.EV.E2.EV.Vint;
if (e11.Eoper == OPpostdec)
postinc = -postinc;
getlvalue(cdb,&cs,e1,RMstore);
freenode(e11.EV.E2);
}
else
{
postinc = 0;
getlvalue(cdb,&cs,e1,RMstore);
if (e2oper == OPconst &&
config.flags4 & CFG4speed &&
(config.target_cpu == TARGET_Pentium ||
config.target_cpu == TARGET_PentiumMMX) &&
(cs.Irm & 0xC0) == 0x80
)
{
if (I64 && sz == 8 && e2.EV.Vpointer)
{
// MOV reg,imm64
// MOV EA,reg
regm_t rregm = allregs & ~idxregm(&cs);
reg_t regx;
regwithvalue(cdb,rregm,e2.EV.Vpointer,®x,64);
cs.Iop = STO;
cs.Irm |= modregrm(0,regx & 7,0);
if (regx & 8)
cs.Irex |= REX_R;
cdb.gen(&cs);
freenode(e2);
goto Lp;
}
if ((sz == REGSIZE || (I64 && sz == 4)) && e2.EV.Vint)
{
// MOV reg,imm
// MOV EA,reg
regm_t rregm = allregs & ~idxregm(&cs);
reg_t regx;
regwithvalue(cdb,rregm,e2.EV.Vint,®x,0);
cs.Iop = STO;
cs.Irm |= modregrm(0,regx & 7,0);
if (regx & 8)
cs.Irex |= REX_R;
cdb.gen(&cs);
freenode(e2);
goto Lp;
}
if (sz == 2 * REGSIZE && e2.EV.Vllong == 0)
{
// MOV reg,imm
// MOV EA,reg
// MOV EA+2,reg
regm_t rregm = getscratch() & ~idxregm(&cs);
if (rregm)
{
reg_t regx;
regwithvalue(cdb,rregm,e2.EV.Vint,®x,0);
cs.Iop = STO;
cs.Irm |= modregrm(0,regx,0);
cdb.gen(&cs);
getlvalue_msw(&cs);
cdb.gen(&cs);
freenode(e2);
goto Lp;
}
}
}
}
// If loading result into a register
if ((cs.Irm & 0xC0) == 0xC0)
{
modEA(cdb,&cs);
if (sz == 2 * REGSIZE && cs.IFL1 == FLreg)
getregs(cdb,cs.IEV1.Vsym.Sregm);
}
cs.Iop = (sz == 1) ? 0xC6 : 0xC7;
if (e2oper == OPrelconst)
{
cs.IEV2.Voffset = e2.EV.Voffset;
cs.IFL2 = cast(ubyte)fl;
cs.IEV2.Vsym = e2.EV.Vsym;
cs.Iflags |= CFoff;
cdb.gen(&cs); // MOV EA,&variable
if (I64 && sz == 8)
code_orrex(cdb.last(), REX_W);
if (sz > REGSIZE)
{
cs.Iop = 0x8C;
getlvalue_msw(&cs);
cs.Irm |= modregrm(0,3,0);
cdb.gen(&cs); // MOV EA+2,DS
}
}
else
{
assert(e2oper == OPconst);
cs.IFL2 = FLconst;
targ_size_t *p = cast(targ_size_t *) &(e2.EV);
cs.IEV2.Vsize_t = *p;
// Look for loading a register variable
if ((cs.Irm & 0xC0) == 0xC0)
{
reg_t regx = cs.Irm & 7;
if (cs.Irex & REX_B)
regx |= 8;
if (I64 && sz == 8)
movregconst(cdb,regx,*p,64);
else
movregconst(cdb,regx,*p,1 ^ (cs.Iop & 1));
if (sz == 2 * REGSIZE)
{ getlvalue_msw(&cs);
if (REGSIZE == 2)
movregconst(cdb,cs.Irm & 7,(cast(ushort *)p)[1],0);
else if (REGSIZE == 4)
movregconst(cdb,cs.Irm & 7,(cast(uint *)p)[1],0);
else if (REGSIZE == 8)
movregconst(cdb,cs.Irm & 7,p[1],0);
else
assert(0);
}
}
else if (I64 && sz == 8 && *p >= 0x80000000)
{ // Use 64 bit MOV, as the 32 bit one gets sign extended
// MOV reg,imm64
// MOV EA,reg
regm_t rregm = allregs & ~idxregm(&cs);
reg_t regx;
regwithvalue(cdb,rregm,*p,®x,64);
cs.Iop = STO;
cs.Irm |= modregrm(0,regx & 7,0);
if (regx & 8)
cs.Irex |= REX_R;
cdb.gen(&cs);
}
else
{
int off = sz;
do
{ int regsize = REGSIZE;
if (off >= 4 && I16 && config.target_cpu >= TARGET_80386)
{
regsize = 4;
cs.Iflags |= CFopsize; // use opsize to do 32 bit operation
}
else if (I64 && sz == 16 && *p >= 0x80000000)
{
regm_t rregm = allregs & ~idxregm(&cs);
reg_t regx;
regwithvalue(cdb,rregm,*p,®x,64);
cs.Iop = STO;
cs.Irm |= modregrm(0,regx & 7,0);
if (regx & 8)
cs.Irex |= REX_R;
}
else
{
regm_t retregsx = (sz == 1) ? BYTEREGS : allregs;
reg_t regx;
if (reghasvalue(retregsx,*p,®x))
{
cs.Iop = (cs.Iop & 1) | 0x88;
cs.Irm |= modregrm(0,regx & 7,0); // MOV EA,regx
if (regx & 8)
cs.Irex |= REX_R;
if (I64 && sz == 1 && regx >= 4)
cs.Irex |= REX;
}
if (!I16 && off == 2) // if 16 bit operand
cs.Iflags |= CFopsize;
if (I64 && sz == 8)
cs.Irex |= REX_W;
}
cdb.gen(&cs); // MOV EA,const
p = cast(targ_size_t *)(cast(char *) p + regsize);
cs.Iop = (cs.Iop & 1) | 0xC6;
cs.Irm &= cast(ubyte)~cast(int)modregrm(0,7,0);
cs.Irex &= ~REX_R;
cs.IEV1.Voffset += regsize;
cs.IEV2.Vint = cast(int)*p;
off -= regsize;
} while (off > 0);
}
}
freenode(e2);
goto Lp;
}
retregs = allregs; // pick a reg, any reg
if (sz == 2 * REGSIZE)
retregs &= ~mBP; // BP cannot be used for register pair
}
if (retregs == mPSW)
{
retregs = allregs;
if (sz == 2 * REGSIZE)
retregs &= ~mBP; // BP cannot be used for register pair
}
cs.Iop = STO;
if (sz == 1) // must have byte regs
{
cs.Iop = 0x88;
retregs &= BYTEREGS;
if (!retregs)
retregs = BYTEREGS;
}
else if (retregs & mES &&
(
(e1.Eoper == OPind &&
((tymll = tybasic(e1.EV.E1.Ety)) == TYfptr || tymll == TYhptr)) ||
(e1.Eoper == OPvar && e1.EV.Vsym.Sfl == FLfardata)
)
)
// getlvalue() needs ES, so we can't return it
retregs = allregs; // no conflicts with ES
else if (tyml == TYdouble || tyml == TYdouble_alias || retregs & mST0)
retregs = DOUBLEREGS;
regvar = false;
varregm = 0;
if (config.flags4 & CFG4optimized)
{
// Be careful of cases like (x = x+x+x). We cannot evaluate in
// x if x is in a register.
if (isregvar(e1,&varregm,&varreg) && // if lvalue is register variable
doinreg(e1.EV.Vsym,e2) && // and we can compute directly into it
!(sz == 1 && e1.EV.Voffset == 1)
)
{
if (varregm & XMMREGS)
{
// Could be an integer vector in the XMMREGS
xmmeq(cdb, e, CMP, e1, e2, pretregs);
return;
}
regvar = true;
retregs = varregm;
reg = varreg; // evaluate directly in target register
if (tysize(e1.Ety) == REGSIZE &&
tysize(e1.EV.Vsym.Stype.Tty) == 2 * REGSIZE)
{
if (e1.EV.Voffset)
retregs &= mMSW;
else
retregs &= mLSW;
reg = findreg(retregs);
}
}
}
if (*pretregs & mPSW && OTleaf(e1.Eoper)) // if evaluating e1 couldn't change flags
{ // Be careful that this lines up with jmpopcode()
retregs |= mPSW;
*pretregs &= ~mPSW;
}
scodelem(cdb,e2,&retregs,0,true); // get rvalue
// Look for special case of (*p++ = ...), where p is a register variable
if (e1.Eoper == OPind &&
((e11 = e1.EV.E1).Eoper == OPpostinc || e11.Eoper == OPpostdec) &&
e11.EV.E1.Eoper == OPvar &&
e11.EV.E1.EV.Vsym.Sfl == FLreg &&
(!I16 || e11.EV.E1.EV.Vsym.Sregm & IDXREGS)
)
{
Symbol *s = e11.EV.E1.EV.Vsym;
if (s.Sclass == SCfastpar || s.Sclass == SCshadowreg)
{
regcon.params &= ~s.Spregm();
}
postinc = e11.EV.E2.EV.Vint;
if (e11.Eoper == OPpostdec)
postinc = -postinc;
getlvalue(cdb,&cs,e1,RMstore | retregs);
freenode(e11.EV.E2);
}
else
{
postinc = 0;
getlvalue(cdb,&cs,e1,RMstore | retregs); // get lvalue (cl == null if regvar)
}
getregs(cdb,varregm);
assert(!(retregs & mES && (cs.Iflags & CFSEG) == CFes));
if ((tyml == TYfptr || tyml == TYhptr) && retregs & mES)
{
reg = findreglsw(retregs);
cs.Irm |= modregrm(0,reg,0);
cdb.gen(&cs); // MOV EA,reg
getlvalue_msw(&cs); // point to where segment goes
cs.Iop = 0x8C;
NEWREG(cs.Irm,0);
cdb.gen(&cs); // MOV EA+2,ES
}
else
{
if (!I16)
{
reg = findreg(retregs &
((sz > REGSIZE) ? mBP | mLSW : mBP | ALLREGS));
cs.Irm |= modregrm(0,reg & 7,0);
if (reg & 8)
cs.Irex |= REX_R;
for (; true; sz -= REGSIZE)
{
// Do not generate mov from register onto itself
if (regvar && reg == ((cs.Irm & 7) | (cs.Irex & REX_B ? 8 : 0)))
break;
if (sz == 2) // if 16 bit operand
cs.Iflags |= CFopsize;
else if (sz == 1 && reg >= 4)
cs.Irex |= REX;
cdb.gen(&cs); // MOV EA+offset,reg
if (sz <= REGSIZE)
break;
getlvalue_msw(&cs);
reg = findregmsw(retregs);
code_newreg(&cs, reg);
}
}
else
{
if (sz > REGSIZE)
cs.IEV1.Voffset += sz - REGSIZE; // 0,2,6
reg = findreg(retregs &
(sz > REGSIZE ? mMSW : ALLREGS));
if (tyml == TYdouble || tyml == TYdouble_alias)
reg = AX;
cs.Irm |= modregrm(0,reg,0);
// Do not generate mov from register onto itself
if (!regvar || reg != (cs.Irm & 7))
for (; true; sz -= REGSIZE) // 1,2,4
{
cdb.gen(&cs); // MOV EA+offset,reg
if (sz <= REGSIZE)
break;
cs.IEV1.Voffset -= REGSIZE;
if (tyml == TYdouble || tyml == TYdouble_alias)
reg = dblreg[reg];
else
reg = findreglsw(retregs);
NEWREG(cs.Irm,reg);
}
}
}
if (e1.Ecount || // if lvalue is a CSE or
regvar) // rvalue can't be a CSE
{
getregs_imm(cdb,retregs); // necessary if both lvalue and
// rvalue are CSEs (since a reg
// can hold only one e at a time)
cssave(e1,retregs,!OTleaf(e1.Eoper)); // if lvalue is a CSE
}
fixresult(cdb,e,retregs,pretregs);
Lp:
if (postinc)
{
reg_t ireg = findreg(idxregm(&cs));
if (*pretregs & mPSW)
{ // Use LEA to avoid touching the flags
uint rm = cs.Irm & 7;
if (cs.Irex & REX_B)
rm |= 8;
cdb.genc1(LEA,buildModregrm(2,ireg,rm),FLconst,postinc);
if (tysize(e11.EV.E1.Ety) == 8)
code_orrex(cdb.last(), REX_W);
}
else if (I64)
{
cdb.genc2(0x81,modregrmx(3,0,ireg),postinc);
if (tysize(e11.EV.E1.Ety) == 8)
code_orrex(cdb.last(), REX_W);
}
else
{
if (postinc == 1)
cdb.gen1(0x40 + ireg); // INC ireg
else if (postinc == -cast(targ_int)1)
cdb.gen1(0x48 + ireg); // DEC ireg
else
{
cdb.genc2(0x81,modregrm(3,0,ireg),postinc);
}
}
}
freenode(e1);
}
/************************
* Generate code for += -= &= |= ^= negass
*/
@trusted
void cdaddass(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
//printf("cdaddass(e=%p, *pretregs = %s)\n",e,regm_str(*pretregs));
OPER op = e.Eoper;
regm_t retregs = 0;
uint reverse = 0;
elem *e1 = e.EV.E1;
tym_t tyml = tybasic(e1.Ety); // type of lvalue
int sz = _tysize[tyml];
int isbyte = (sz == 1); // 1 for byte operation, else 0
// See if evaluate in XMM registers
if (config.fpxmmregs && tyxmmreg(tyml) && op != OPnegass && !(*pretregs & mST0))
{
xmmopass(cdb,e,pretregs);
return;
}
if (tyfloating(tyml))
{
if (config.exe & EX_posix)
{
if (op == OPnegass)
cdnegass87(cdb,e,pretregs);
else
opass87(cdb,e,pretregs);
}
else
{
if (op == OPnegass)
opnegassdbl(cdb,e,pretregs);
else
opassdbl(cdb,e,pretregs,op);
}
return;
}
uint opsize = (I16 && tylong(tyml) && config.target_cpu >= TARGET_80386)
? CFopsize : 0;
uint cflags = 0;
regm_t forccs = *pretregs & mPSW; // return result in flags
regm_t forregs = *pretregs & ~mPSW; // return result in regs
// true if we want the result in a register
uint wantres = forregs || (e1.Ecount && !OTleaf(e1.Eoper));
reg_t reg;
uint op1,op2,mode;
code cs;
elem *e2;
regm_t varregm;
reg_t varreg;
uint jop;
switch (op) // select instruction opcodes
{
case OPpostinc: op = OPaddass; // i++ => +=
goto case OPaddass;
case OPaddass: op1 = 0x01; op2 = 0x11;
cflags = CFpsw;
mode = 0; break; // ADD, ADC
case OPpostdec: op = OPminass; // i-- => -=
goto case OPminass;
case OPminass: op1 = 0x29; op2 = 0x19;
cflags = CFpsw;
mode = 5; break; // SUB, SBC
case OPandass: op1 = op2 = 0x21;
mode = 4; break; // AND, AND
case OPorass: op1 = op2 = 0x09;
mode = 1; break; // OR , OR
case OPxorass: op1 = op2 = 0x31;
mode = 6; break; // XOR, XOR
case OPnegass: op1 = 0xF7; // NEG
break;
default:
assert(0);
}
op1 ^= isbyte; // bit 0 is 0 for byte operation
if (op == OPnegass)
{
getlvalue(cdb,&cs,e1,0);
modEA(cdb,&cs);
cs.Irm |= modregrm(0,3,0);
cs.Iop = op1;
switch (_tysize[tyml])
{
case CHARSIZE:
cdb.gen(&cs);
break;
case SHORTSIZE:
cdb.gen(&cs);
if (!I16 && *pretregs & mPSW)
cdb.last().Iflags |= CFopsize | CFpsw;
break;
case LONGSIZE:
if (!I16 || opsize)
{ cdb.gen(&cs);
cdb.last().Iflags |= opsize;
break;
}
neg_2reg:
getlvalue_msw(&cs);
cdb.gen(&cs); // NEG EA+2
getlvalue_lsw(&cs);
cdb.gen(&cs); // NEG EA
code_orflag(cdb.last(),CFpsw);
cs.Iop = 0x81;
getlvalue_msw(&cs);
cs.IFL2 = FLconst;
cs.IEV2.Vuns = 0;
cdb.gen(&cs); // SBB EA+2,0
break;
case LLONGSIZE:
if (I16)
assert(0); // not implemented yet
if (I32)
goto neg_2reg;
cdb.gen(&cs);
break;
default:
assert(0);
}
forccs = 0; // flags already set by NEG
*pretregs &= ~mPSW;
}
else if ((e2 = e.EV.E2).Eoper == OPconst && // if rvalue is a const
el_signx32(e2) &&
// Don't evaluate e2 in register if we can use an INC or DEC
(((sz <= REGSIZE || tyfv(tyml)) &&
(op == OPaddass || op == OPminass) &&
(el_allbits(e2, 1) || el_allbits(e2, -1))
) ||
(!evalinregister(e2)
&& tyml != TYhptr
)
)
)
{
getlvalue(cdb,&cs,e1,0);
modEA(cdb,&cs);
cs.IFL2 = FLconst;
cs.IEV2.Vsize_t = e2.EV.Vint;
if (sz <= REGSIZE || tyfv(tyml) || opsize)
{
targ_int i = cs.IEV2.Vint;
// Handle shortcuts. Watch out for if result has
// to be in flags.
if (reghasvalue(isbyte ? BYTEREGS : ALLREGS,i,®) && i != 1 && i != -1 &&
!opsize)
{
cs.Iop = op1;
cs.Irm |= modregrm(0,reg & 7,0);
if (I64)
{ if (isbyte && reg >= 4)
cs.Irex |= REX;
if (reg & 8)
cs.Irex |= REX_R;
}
}
else
{
cs.Iop = 0x81;
cs.Irm |= modregrm(0,mode,0);
switch (op)
{
case OPminass: // convert to +=
cs.Irm ^= modregrm(0,5,0);
i = -i;
cs.IEV2.Vsize_t = i;
goto case OPaddass;
case OPaddass:
if (i == 1) // INC EA
goto L1;
else if (i == -1) // DEC EA
{ cs.Irm |= modregrm(0,1,0);
L1: cs.Iop = 0xFF;
}
break;
default:
break;
}
cs.Iop ^= isbyte; // for byte operations
}
cs.Iflags |= opsize;
if (forccs)
cs.Iflags |= CFpsw;
else if (!I16 && cs.Iflags & CFopsize)
{
switch (op)
{ case OPorass:
case OPxorass:
cs.IEV2.Vsize_t &= 0xFFFF;
cs.Iflags &= ~CFopsize; // don't worry about MSW
break;
case OPandass:
cs.IEV2.Vsize_t |= ~0xFFFFL;
cs.Iflags &= ~CFopsize; // don't worry about MSW
break;
case OPminass:
case OPaddass:
static if (1)
{
if ((cs.Irm & 0xC0) == 0xC0) // EA is register
cs.Iflags &= ~CFopsize;
}
else
{
if ((cs.Irm & 0xC0) == 0xC0 && // EA is register and
e1.Eoper == OPind) // not a register var
cs.Iflags &= ~CFopsize;
}
break;
default:
assert(0);
}
}
// For scheduling purposes, we wish to replace:
// OP EA
// with:
// MOV reg,EA
// OP reg
// MOV EA,reg
if (forregs && sz <= REGSIZE && (cs.Irm & 0xC0) != 0xC0 &&
(config.target_cpu == TARGET_Pentium ||
config.target_cpu == TARGET_PentiumMMX) &&
config.flags4 & CFG4speed)
{
regm_t sregm;
code cs2;
// Determine which registers to use
sregm = allregs & ~idxregm(&cs);
if (isbyte)
sregm &= BYTEREGS;
if (sregm & forregs)
sregm &= forregs;
allocreg(cdb,&sregm,®,tyml); // allocate register
cs2 = cs;
cs2.Iflags &= ~CFpsw;
cs2.Iop = LOD ^ isbyte;
code_newreg(&cs2, reg);
cdb.gen(&cs2); // MOV reg,EA
cs.Irm = (cs.Irm & modregrm(0,7,0)) | modregrm(3,0,reg & 7);
if (reg & 8)
cs.Irex |= REX_B;
cdb.gen(&cs); // OP reg
cs2.Iop ^= 2;
cdb.gen(&cs2); // MOV EA,reg
retregs = sregm;
wantres = 0;
if (e1.Ecount)
cssave(e1,retregs,!OTleaf(e1.Eoper));
}
else
{
cdb.gen(&cs);
cs.Iflags &= ~opsize;
cs.Iflags &= ~CFpsw;
if (I16 && opsize) // if DWORD operand
cs.IEV1.Voffset += 2; // compensate for wantres code
}
}
else if (sz == 2 * REGSIZE)
{
targ_uns msw;
cs.Iop = 0x81;
cs.Irm |= modregrm(0,mode,0);
cs.Iflags |= cflags;
cdb.gen(&cs);
cs.Iflags &= ~CFpsw;
getlvalue_msw(&cs); // point to msw
msw = cast(uint)MSREG(e.EV.E2.EV.Vllong);
cs.IEV2.Vuns = msw; // msw of constant
switch (op)
{
case OPminass:
cs.Irm ^= modregrm(0,6,0); // SUB => SBB
break;
case OPaddass:
cs.Irm |= modregrm(0,2,0); // ADD => ADC
break;
default:
break;
}
cdb.gen(&cs);
}
else
assert(0);
freenode(e.EV.E2); // don't need it anymore
}
else if (isregvar(e1,&varregm,&varreg) &&
(e2.Eoper == OPvar || e2.Eoper == OPind) &&
!evalinregister(e2) &&
sz <= REGSIZE) // deal with later
{
getlvalue(cdb,&cs,e2,0);
freenode(e2);
getregs(cdb,varregm);
code_newreg(&cs, varreg);
if (I64 && sz == 1 && varreg >= 4)
cs.Irex |= REX;
cs.Iop = op1 ^ 2; // toggle direction bit
if (forccs)
cs.Iflags |= CFpsw;
reverse = 2; // remember we toggled it
cdb.gen(&cs);
retregs = 0; // to trigger a bug if we attempt to use it
}
else if ((op == OPaddass || op == OPminass) &&
sz <= REGSIZE &&
!e2.Ecount &&
((jop = jmpopcode(e2)) == JC || jop == JNC ||
(OTconv(e2.Eoper) && !e2.EV.E1.Ecount && ((jop = jmpopcode(e2.EV.E1)) == JC || jop == JNC)))
)
{
/* e1 += (x < y) ADC EA,0
* e1 -= (x < y) SBB EA,0
* e1 += (x >= y) SBB EA,-1
* e1 -= (x >= y) ADC EA,-1
*/
getlvalue(cdb,&cs,e1,0); // get lvalue
modEA(cdb,&cs);
regm_t keepmsk = idxregm(&cs);
retregs = mPSW;
if (OTconv(e2.Eoper))
{
scodelem(cdb,e2.EV.E1,&retregs,keepmsk,true);
freenode(e2);
}
else
scodelem(cdb,e2,&retregs,keepmsk,true);
cs.Iop = 0x81 ^ isbyte; // ADC EA,imm16/32
uint regop = 2; // ADC
if ((op == OPaddass) ^ (jop == JC))
regop = 3; // SBB
code_newreg(&cs,regop);
cs.Iflags |= opsize;
if (forccs)
cs.Iflags |= CFpsw;
cs.IFL2 = FLconst;
cs.IEV2.Vsize_t = (jop == JC) ? 0 : ~cast(targ_size_t)0;
cdb.gen(&cs);
retregs = 0; // to trigger a bug if we attempt to use it
}
else // evaluate e2 into register
{
retregs = (isbyte) ? BYTEREGS : ALLREGS; // pick working reg
if (tyml == TYhptr)
retregs &= ~mCX; // need CX for shift count
scodelem(cdb,e.EV.E2,&retregs,0,true); // get rvalue
getlvalue(cdb,&cs,e1,retregs); // get lvalue
modEA(cdb,&cs);
cs.Iop = op1;
if (sz <= REGSIZE || tyfv(tyml))
{
reg = findreg(retregs);
code_newreg(&cs, reg); // OP1 EA,reg
if (sz == 1 && reg >= 4 && I64)
cs.Irex |= REX;
if (forccs)
cs.Iflags |= CFpsw;
}
else if (tyml == TYhptr)
{
uint mreg = findregmsw(retregs);
uint lreg = findreglsw(retregs);
getregs(cdb,retregs | mCX);
// If h -= l, convert to h += -l
if (e.Eoper == OPminass)
{
cdb.gen2(0xF7,modregrm(3,3,mreg)); // NEG mreg
cdb.gen2(0xF7,modregrm(3,3,lreg)); // NEG lreg
code_orflag(cdb.last(),CFpsw);
cdb.genc2(0x81,modregrm(3,3,mreg),0); // SBB mreg,0
}
cs.Iop = 0x01;
cs.Irm |= modregrm(0,lreg,0);
cdb.gen(&cs); // ADD EA,lreg
code_orflag(cdb.last(),CFpsw);
cdb.genc2(0x81,modregrm(3,2,mreg),0); // ADC mreg,0
genshift(cdb); // MOV CX,offset __AHSHIFT
cdb.gen2(0xD3,modregrm(3,4,mreg)); // SHL mreg,CL
NEWREG(cs.Irm,mreg); // ADD EA+2,mreg
getlvalue_msw(&cs);
}
else if (sz == 2 * REGSIZE)
{
cs.Irm |= modregrm(0,findreglsw(retregs),0);
cdb.gen(&cs); // OP1 EA,reg+1
code_orflag(cdb.last(),cflags);
cs.Iop = op2;
NEWREG(cs.Irm,findregmsw(retregs)); // OP2 EA+1,reg
getlvalue_msw(&cs);
}
else
assert(0);
cdb.gen(&cs);
retregs = 0; // to trigger a bug if we attempt to use it
}
// See if we need to reload result into a register.
// Need result in registers in case we have a 32 bit
// result and we want the flags as a result.
if (wantres || (sz > REGSIZE && forccs))
{
if (sz <= REGSIZE)
{
regm_t possregs;
possregs = ALLREGS;
if (isbyte)
possregs = BYTEREGS;
retregs = forregs & possregs;
if (!retregs)
retregs = possregs;
// If reg field is destination
if (cs.Iop & 2 && cs.Iop < 0x40 && (cs.Iop & 7) <= 5)
{
reg = (cs.Irm >> 3) & 7;
if (cs.Irex & REX_R)
reg |= 8;
retregs = mask(reg);
allocreg(cdb,&retregs,®,tyml);
}
// If lvalue is a register, just use that register
else if ((cs.Irm & 0xC0) == 0xC0)
{
reg = cs.Irm & 7;
if (cs.Irex & REX_B)
reg |= 8;
retregs = mask(reg);
allocreg(cdb,&retregs,®,tyml);
}
else
{
allocreg(cdb,&retregs,®,tyml);
cs.Iop = LOD ^ isbyte ^ reverse;
code_newreg(&cs, reg);
if (I64 && isbyte && reg >= 4)
cs.Irex |= REX_W;
cdb.gen(&cs); // MOV reg,EA
}
}
else if (tyfv(tyml) || tyml == TYhptr)
{
regm_t idxregs;
if (tyml == TYhptr)
getlvalue_lsw(&cs);
idxregs = idxregm(&cs);
retregs = forregs & ~idxregs;
if (!(retregs & IDXREGS))
retregs |= IDXREGS & ~idxregs;
if (!(retregs & mMSW))
retregs |= mMSW & ALLREGS;
allocreg(cdb,&retregs,®,tyml);
NEWREG(cs.Irm,findreglsw(retregs));
if (retregs & mES) // if want ES loaded
{
cs.Iop = 0xC4;
cdb.gen(&cs); // LES lreg,EA
}
else
{
cs.Iop = LOD;
cdb.gen(&cs); // MOV lreg,EA
getlvalue_msw(&cs);
if (I32)
cs.Iflags |= CFopsize;
NEWREG(cs.Irm,reg);
cdb.gen(&cs); // MOV mreg,EA+2
}
}
else if (sz == 2 * REGSIZE)
{
regm_t idx = idxregm(&cs);
retregs = forregs;
if (!retregs)
retregs = ALLREGS;
allocreg(cdb,&retregs,®,tyml);
cs.Iop = LOD;
NEWREG(cs.Irm,reg);
code csl = cs;
NEWREG(csl.Irm,findreglsw(retregs));
getlvalue_lsw(&csl);
if (mask(reg) & idx)
{
cdb.gen(&csl); // MOV reg+1,EA
cdb.gen(&cs); // MOV reg,EA+2
}
else
{
cdb.gen(&cs); // MOV reg,EA+2
cdb.gen(&csl); // MOV reg+1,EA
}
}
else
assert(0);
if (e1.Ecount) // if we gen a CSE
cssave(e1,retregs,!OTleaf(e1.Eoper));
}
freenode(e1);
if (sz <= REGSIZE)
*pretregs &= ~mPSW; // flags are already set
fixresult(cdb,e,retregs,pretregs);
}
/********************************
* Generate code for *=
*/
@trusted
void cdmulass(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
code cs;
regm_t retregs;
reg_t resreg;
uint opr,isbyte;
//printf("cdmulass(e=%p, *pretregs = %s)\n",e,regm_str(*pretregs));
elem *e1 = e.EV.E1;
elem *e2 = e.EV.E2;
OPER op = e.Eoper; // OPxxxx
tym_t tyml = tybasic(e1.Ety); // type of lvalue
char uns = tyuns(tyml) || tyuns(e2.Ety);
uint sz = _tysize[tyml];
uint rex = (I64 && sz == 8) ? REX_W : 0;
uint grex = rex << 16; // 64 bit operands
// See if evaluate in XMM registers
if (config.fpxmmregs && tyxmmreg(tyml) && !(*pretregs & mST0))
{
xmmopass(cdb,e,pretregs);
return;
}
if (tyfloating(tyml))
{
if (config.exe & EX_posix)
{
opass87(cdb,e,pretregs);
}
else
{
opassdbl(cdb,e,pretregs,op);
}
return;
}
if (sz <= REGSIZE) // if word or byte
{
if (e2.Eoper == OPconst &&
(I32 || I64) &&
el_signx32(e2) &&
sz >= 4)
{
// See if we can use an LEA instruction
int ss;
int ss2 = 0;
int shift;
targ_size_t e2factor = cast(targ_size_t)el_tolong(e2);
switch (e2factor)
{
case 12: ss = 1; ss2 = 2; goto L4;
case 24: ss = 1; ss2 = 3; goto L4;
case 6:
case 3: ss = 1; goto L4;
case 20: ss = 2; ss2 = 2; goto L4;
case 40: ss = 2; ss2 = 3; goto L4;
case 10:
case 5: ss = 2; goto L4;
case 36: ss = 3; ss2 = 2; goto L4;
case 72: ss = 3; ss2 = 3; goto L4;
case 18:
case 9: ss = 3; goto L4;
L4:
{
getlvalue(cdb,&cs,e1,0); // get EA
modEA(cdb,&cs);
freenode(e2);
regm_t idxregs = idxregm(&cs);
regm_t regm = *pretregs & ~(idxregs | mBP | mR13); // don't use EBP
if (!regm)
regm = allregs & ~(idxregs | mBP | mR13);
reg_t reg;
allocreg(cdb,®m,®,tyml);
cs.Iop = LOD;
code_newreg(&cs,reg);
cs.Irex |= rex;
cdb.gen(&cs); // MOV reg,EA
assert((reg & 7) != BP);
cdb.gen2sib(LEA,grex | modregxrm(0,reg,4),
modregxrmx(ss,reg,reg)); // LEA reg,[ss*reg][reg]
if (ss2)
{
cdb.gen2sib(LEA,grex | modregxrm(0,reg,4),
modregxrm(ss2,reg,5));
cdb.last().IFL1 = FLconst;
cdb.last().IEV1.Vint = 0; // LEA reg,0[ss2*reg]
}
else if (!(e2factor & 1)) // if even factor
{
genregs(cdb,0x03,reg,reg); // ADD reg,reg
code_orrex(cdb.last(),rex);
}
opAssStoreReg(cdb,cs,e,reg,pretregs);
return;
}
case 37:
case 74: shift = 2;
goto L5;
case 13:
case 26: shift = 0;
goto L5;
L5:
{
getlvalue(cdb,&cs,e1,0); // get EA
modEA(cdb,&cs);
freenode(e2);
regm_t idxregs = idxregm(&cs);
regm_t regm = *pretregs & ~(idxregs | mBP | mR13); // don't use EBP
if (!regm)
regm = allregs & ~(idxregs | mBP | mR13);
reg_t reg; // return register
allocreg(cdb,®m,®,tyml);
reg_t sreg = allocScratchReg(cdb, allregs & ~(regm | idxregs | mBP | mR13));
cs.Iop = LOD;
code_newreg(&cs,sreg);
cs.Irex |= rex;
cdb.gen(&cs); // MOV sreg,EA
assert((sreg & 7) != BP);
assert((reg & 7) != BP);
cdb.gen2sib(LEA,grex | modregxrm(0,reg,4),
modregxrmx(2,sreg,sreg)); // LEA reg,[sreg*4][sreg]
if (shift)
cdb.genc2(0xC1,grex | modregrmx(3,4,sreg),shift); // SHL sreg,shift
cdb.gen2sib(LEA,grex | modregxrm(0,reg,4),
modregxrmx(3,sreg,reg)); // LEA reg,[sreg*8][reg]
if (!(e2factor & 1)) // if even factor
{
genregs(cdb,0x03,reg,reg); // ADD reg,reg
code_orrex(cdb.last(),rex);
}
opAssStoreReg(cdb,cs,e,reg,pretregs);
return;
}
default:
break;
}
}
isbyte = (sz == 1); // 1 for byte operation
if (config.target_cpu >= TARGET_80286 &&
e2.Eoper == OPconst && !isbyte)
{
targ_size_t e2factor = cast(targ_size_t)el_tolong(e2);
if (I64 && sz == 8 && e2factor != cast(int)e2factor)
goto L1;
freenode(e2);
getlvalue(cdb,&cs,e1,0); // get EA
regm_t idxregs = idxregm(&cs);
retregs = *pretregs & (ALLREGS | mBP) & ~idxregs;
if (!retregs)
retregs = ALLREGS & ~idxregs;
allocreg(cdb,&retregs,&resreg,tyml);
cs.Iop = 0x69; // IMUL reg,EA,e2value
cs.IFL2 = FLconst;
cs.IEV2.Vint = cast(int)e2factor;
opr = resreg;
}
else if (!I16 && !isbyte)
{
L1:
retregs = *pretregs & (ALLREGS | mBP);
if (!retregs)
retregs = ALLREGS;
codelem(cdb,e2,&retregs,false); // load rvalue in reg
getlvalue(cdb,&cs,e1,retregs); // get EA
getregs(cdb,retregs); // destroy these regs
cs.Iop = 0x0FAF; // IMUL resreg,EA
resreg = findreg(retregs);
opr = resreg;
}
else
{
retregs = mAX;
codelem(cdb,e2,&retregs,false); // load rvalue in AX
getlvalue(cdb,&cs,e1,mAX); // get EA
getregs(cdb,isbyte ? mAX : mAX | mDX); // destroy these regs
cs.Iop = 0xF7 ^ isbyte; // [I]MUL EA
opr = uns ? 4 : 5; // MUL/IMUL
resreg = AX; // result register for *
}
code_newreg(&cs,opr);
cdb.gen(&cs);
opAssStoreReg(cdb, cs, e, resreg, pretregs);
return;
}
else if (sz == 2 * REGSIZE)
{
if (e2.Eoper == OPconst && I32)
{
/* if (msw)
IMUL EDX,EDX,lsw
IMUL reg,EAX,msw
ADD reg,EDX
else
IMUL reg,EDX,lsw
MOV EDX,lsw
MUL EDX
ADD EDX,reg
*/
freenode(e2);
retregs = mDX|mAX;
reg_t rhi, rlo;
opAssLoadPair(cdb, cs, e, rhi, rlo, retregs, 0);
const regm_t keepmsk = idxregm(&cs);
reg_t reg = allocScratchReg(cdb, allregs & ~(retregs | keepmsk));
targ_size_t e2factor = cast(targ_size_t)el_tolong(e2);
const lsw = cast(targ_int)(e2factor & ((1L << (REGSIZE * 8)) - 1));
const msw = cast(targ_int)(e2factor >> (REGSIZE * 8));
if (msw)
{
genmulimm(cdb,DX,DX,lsw); // IMUL EDX,EDX,lsw
genmulimm(cdb,reg,AX,msw); // IMUL reg,EAX,msw
cdb.gen2(0x03,modregrm(3,reg,DX)); // ADD reg,EAX
}
else
genmulimm(cdb,reg,DX,lsw); // IMUL reg,EDX,lsw
movregconst(cdb,DX,lsw,0); // MOV EDX,lsw
getregs(cdb,mDX);
cdb.gen2(0xF7,modregrm(3,4,DX)); // MUL EDX
cdb.gen2(0x03,modregrm(3,DX,reg)); // ADD EDX,reg
}
else
{
retregs = mDX | mAX;
regm_t rretregs = (config.target_cpu >= TARGET_PentiumPro) ? allregs & ~retregs : mCX | mBX;
codelem(cdb,e2,&rretregs,false);
getlvalue(cdb,&cs,e1,retregs | rretregs);
getregs(cdb,retregs);
cs.Iop = LOD;
cdb.gen(&cs); // MOV AX,EA
getlvalue_msw(&cs);
cs.Irm |= modregrm(0,DX,0);
cdb.gen(&cs); // MOV DX,EA+2
getlvalue_lsw(&cs);
if (config.target_cpu >= TARGET_PentiumPro)
{
regm_t rlo = findreglsw(rretregs);
regm_t rhi = findregmsw(rretregs);
/* IMUL rhi,EAX
IMUL EDX,rlo
ADD rhi,EDX
MUL rlo
ADD EDX,Erhi
*/
getregs(cdb,mAX|mDX|mask(rhi));
cdb.gen2(0x0FAF,modregrm(3,rhi,AX));
cdb.gen2(0x0FAF,modregrm(3,DX,rlo));
cdb.gen2(0x03,modregrm(3,rhi,DX));
cdb.gen2(0xF7,modregrm(3,4,rlo));
cdb.gen2(0x03,modregrm(3,DX,rhi));
}
else
{
callclib(cdb,e,CLIB.lmul,&retregs,idxregm(&cs));
}
}
opAssStorePair(cdb, cs, e, findregmsw(retregs), findreglsw(retregs), pretregs);
return;
}
else
{
assert(0);
}
}
/********************************
* Generate code for /= %=
*/
@trusted
void cddivass(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
elem *e1 = e.EV.E1;
elem *e2 = e.EV.E2;
tym_t tyml = tybasic(e1.Ety); // type of lvalue
OPER op = e.Eoper; // OPxxxx
// See if evaluate in XMM registers
if (config.fpxmmregs && tyxmmreg(tyml) && op != OPmodass && !(*pretregs & mST0))
{
xmmopass(cdb,e,pretregs);
return;
}
if (tyfloating(tyml))
{
if (config.exe & EX_posix)
{
opass87(cdb,e,pretregs);
}
else
{
opassdbl(cdb,e,pretregs,op);
}
return;
}
code cs = void;
//printf("cddivass(e=%p, *pretregs = %s)\n",e,regm_str(*pretregs));
char uns = tyuns(tyml) || tyuns(e2.Ety);
uint sz = _tysize[tyml];
uint rex = (I64 && sz == 8) ? REX_W : 0;
uint grex = rex << 16; // 64 bit operands
if (sz <= REGSIZE) // if word or byte
{
uint isbyte = (sz == 1); // 1 for byte operation
reg_t resreg;
targ_size_t e2factor;
targ_size_t d;
bool neg;
int pow2;
assert(!isbyte); // should never happen
assert(I16 || sz != SHORTSIZE);
if (e2.Eoper == OPconst)
{
e2factor = cast(targ_size_t)el_tolong(e2);
pow2 = ispow2(e2factor);
d = e2factor;
if (!uns && cast(targ_llong)e2factor < 0)
{
neg = true;
d = -d;
}
}
// Signed divide by a constant
if (config.flags4 & CFG4speed &&
e2.Eoper == OPconst &&
!uns &&
(d & (d - 1)) &&
((I32 && sz == 4) || (I64 && (sz == 4 || sz == 8))))
{
/* R1 / 10
*
* MOV EAX,m
* IMUL R1
* MOV EAX,R1
* SAR EAX,31
* SAR EDX,shpost
* SUB EDX,EAX
* IMUL EAX,EDX,d
* SUB R1,EAX
*
* EDX = quotient
* R1 = remainder
*/
assert(sz == 4 || sz == 8);
ulong m;
int shpost;
const int N = sz * 8;
const bool mhighbit = choose_multiplier(N, d, N - 1, &m, &shpost);
freenode(e2);
getlvalue(cdb,&cs,e1,mAX | mDX);
reg_t reg;
opAssLoadReg(cdb, cs, e, reg, allregs & ~( mAX | mDX | idxregm(&cs))); // MOV reg,EA
getregs(cdb, mAX|mDX);
/* Algorithm 5.2
* if m>=2**(N-1)
* q = SRA(n + MULSH(m-2**N,n), shpost) - XSIGN(n)
* else
* q = SRA(MULSH(m,n), shpost) - XSIGN(n)
* if (neg)
* q = -q
*/
const bool mgt = mhighbit || m >= (1UL << (N - 1));
movregconst(cdb, AX, cast(targ_size_t)m, (sz == 8) ? 0x40 : 0); // MOV EAX,m
cdb.gen2(0xF7,grex | modregrmx(3,5,reg)); // IMUL reg
if (mgt)
cdb.gen2(0x03,grex | modregrmx(3,DX,reg)); // ADD EDX,reg
getregsNoSave(mAX); // EAX no longer contains 'm'
genmovreg(cdb, AX, reg); // MOV EAX,reg
cdb.genc2(0xC1,grex | modregrm(3,7,AX),sz * 8 - 1); // SAR EAX,31
if (shpost)
cdb.genc2(0xC1,grex | modregrm(3,7,DX),shpost); // SAR EDX,shpost
reg_t r3;
if (neg && op == OPdivass)
{
cdb.gen2(0x2B,grex | modregrm(3,AX,DX)); // SUB EAX,EDX
r3 = AX;
}
else
{
cdb.gen2(0x2B,grex | modregrm(3,DX,AX)); // SUB EDX,EAX
r3 = DX;
}
// r3 is quotient
reg_t resregx;
switch (op)
{ case OPdivass:
resregx = r3;
break;
case OPmodass:
assert(reg != AX && r3 == DX);
if (sz == 4 || (sz == 8 && cast(targ_long)d == d))
{
cdb.genc2(0x69,grex | modregrm(3,AX,DX),d); // IMUL EAX,EDX,d
}
else
{
movregconst(cdb,AX,d,(sz == 8) ? 0x40 : 0); // MOV EAX,d
cdb.gen2(0x0FAF,grex | modregrmx(3,AX,DX)); // IMUL EAX,EDX
getregsNoSave(mAX); // EAX no longer contains 'd'
}
cdb.gen2(0x2B,grex | modregxrm(3,reg,AX)); // SUB R1,EAX
resregx = reg;
break;
default:
assert(0);
}
opAssStoreReg(cdb, cs, e, resregx, pretregs);
return;
}
// Unsigned divide by a constant
void unsignedDivideByConstant(ref CodeBuilder cdb)
{
assert(sz == 4 || sz == 8);
reg_t r3;
reg_t reg;
ulong m;
int shpre;
int shpost;
code cs = void;
if (udiv_coefficients(sz * 8, e2factor, &shpre, &m, &shpost))
{
/* t1 = MULUH(m, n)
* q = SRL(t1 + SRL(n - t1, 1), shpost - 1)
* MOV EAX,reg
* MOV EDX,m
* MUL EDX
* MOV EAX,reg
* SUB EAX,EDX
* SHR EAX,1
* LEA R3,[EAX][EDX]
* SHR R3,shpost-1
*/
assert(shpre == 0);
freenode(e2);
getlvalue(cdb,&cs,e1,mAX | mDX);
regm_t idxregs = idxregm(&cs);
opAssLoadReg(cdb, cs, e, reg, allregs & ~(mAX|mDX | idxregs)); // MOV reg,EA
getregs(cdb, mAX|mDX);
genmovreg(cdb,AX,reg); // MOV EAX,reg
movregconst(cdb, DX, cast(targ_size_t)m, (sz == 8) ? 0x40 : 0); // MOV EDX,m
getregs(cdb,mask(reg) | mDX | mAX);
cdb.gen2(0xF7,grex | modregrmx(3,4,DX)); // MUL EDX
genmovreg(cdb,AX,reg); // MOV EAX,reg
cdb.gen2(0x2B,grex | modregrm(3,AX,DX)); // SUB EAX,EDX
cdb.genc2(0xC1,grex | modregrm(3,5,AX),1); // SHR EAX,1
regm_t regm3 = allregs & ~idxregs;
if (op == OPmodass)
{
regm3 &= ~mask(reg);
if (!el_signx32(e2))
regm3 &= ~mAX;
}
allocreg(cdb,®m3,&r3,TYint);
cdb.gen2sib(LEA,grex | modregxrm(0,r3,4),modregrm(0,AX,DX)); // LEA R3,[EAX][EDX]
if (shpost != 1)
cdb.genc2(0xC1,grex | modregrmx(3,5,r3),shpost-1); // SHR R3,shpost-1
}
else
{
/* q = SRL(MULUH(m, SRL(n, shpre)), shpost)
* SHR EAX,shpre
* MOV reg,m
* MUL reg
* SHR EDX,shpost
*/
freenode(e2);
getlvalue(cdb,&cs,e1,mAX | mDX);
regm_t idxregs = idxregm(&cs);
opAssLoadReg(cdb, cs, e, reg, allregs & ~(mAX|mDX | idxregs)); // MOV reg,EA
getregs(cdb, mAX|mDX);
if (reg != AX)
{
getregs(cdb,mAX);
genmovreg(cdb,AX,reg); // MOV EAX,reg
}
if (shpre)
{
getregs(cdb,mAX);
cdb.genc2(0xC1,grex | modregrm(3,5,AX),shpre); // SHR EAX,shpre
}
getregs(cdb,mDX);
movregconst(cdb, DX, cast(targ_size_t)m, (sz == 8) ? 0x40 : 0); // MOV EDX,m
getregs(cdb,mDX | mAX);
cdb.gen2(0xF7,grex | modregrmx(3,4,DX)); // MUL EDX
if (shpost)
cdb.genc2(0xC1,grex | modregrm(3,5,DX),shpost); // SHR EDX,shpost
r3 = DX;
}
reg_t resregx;
switch (op)
{
case OPdivass:
// r3 = quotient
resregx = r3;
break;
case OPmodass:
/* reg = original value
* r3 = quotient
*/
assert(reg != AX);
if (el_signx32(e2))
{
cdb.genc2(0x69,grex | modregrmx(3,AX,r3),e2factor); // IMUL EAX,r3,e2factor
}
else
{
assert(!(mask(r3) & mAX));
movregconst(cdb,AX,e2factor,(sz == 8) ? 0x40 : 0); // MOV EAX,e2factor
getregs(cdb,mAX);
cdb.gen2(0x0FAF,grex | modregrmx(3,AX,r3)); // IMUL EAX,r3
}
getregs(cdb,mask(reg));
cdb.gen2(0x2B,grex | modregxrm(3,reg,AX)); // SUB reg,EAX
resregx = reg;
break;
default:
assert(0);
}
opAssStoreReg(cdb, cs, e, resregx, pretregs);
return;
}
if (config.flags4 & CFG4speed &&
e2.Eoper == OPconst &&
uns &&
e2factor > 2 && (e2factor & (e2factor - 1)) &&
((I32 && sz == 4) || (I64 && (sz == 4 || sz == 8))))
{
unsignedDivideByConstant(cdb);
return;
}
if (config.flags4 & CFG4speed &&
e2.Eoper == OPconst && !uns &&
(sz == REGSIZE || (I64 && sz == 4)) &&
pow2 != -1 &&
e2factor == cast(int)e2factor &&
!(config.target_cpu < TARGET_80286 && pow2 != 1 && op == OPdivass)
)
{
freenode(e2);
if (pow2 == 1 && op == OPdivass && config.target_cpu > TARGET_80386)
{
/* This is better than the code further down because it is
* not constrained to using AX and DX.
*/
getlvalue(cdb,&cs,e1,0);
regm_t idxregs = idxregm(&cs);
reg_t reg;
opAssLoadReg(cdb,cs,e,reg,allregs & ~idxregs); // MOV reg,EA
reg_t r = allocScratchReg(cdb, allregs & ~(idxregs | mask(reg)));
genmovreg(cdb,r,reg); // MOV r,reg
cdb.genc2(0xC1,grex | modregxrmx(3,5,r),(sz * 8 - 1)); // SHR r,31
cdb.gen2(0x03,grex | modregxrmx(3,reg,r)); // ADD reg,r
cdb.gen2(0xD1,grex | modregrmx(3,7,reg)); // SAR reg,1
opAssStoreReg(cdb, cs, e, reg, pretregs);
return;
}
// Signed divide or modulo by power of 2
getlvalue(cdb,&cs,e1,mAX | mDX);
reg_t reg;
opAssLoadReg(cdb,cs,e,reg,mAX);
getregs(cdb,mDX); // DX is scratch register
cdb.gen1(0x99); // CWD
code_orrex(cdb.last(), rex);
if (pow2 == 1)
{
if (op == OPdivass)
{
cdb.gen2(0x2B,grex | modregrm(3,AX,DX)); // SUB AX,DX
cdb.gen2(0xD1,grex | modregrm(3,7,AX)); // SAR AX,1
resreg = AX;
}
else // OPmod
{
cdb.gen2(0x33,grex | modregrm(3,AX,DX)); // XOR AX,DX
cdb.genc2(0x81,grex | modregrm(3,4,AX),1); // AND AX,1
cdb.gen2(0x03,grex | modregrm(3,DX,AX)); // ADD DX,AX
resreg = DX;
}
}
else
{
assert(pow2 < 32);
targ_ulong m = (1 << pow2) - 1;
if (op == OPdivass)
{
cdb.genc2(0x81,grex | modregrm(3,4,DX),m); // AND DX,m
cdb.gen2(0x03,grex | modregrm(3,AX,DX)); // ADD AX,DX
// Be careful not to generate this for 8088
assert(config.target_cpu >= TARGET_80286);
cdb.genc2(0xC1,grex | modregrm(3,7,AX),pow2); // SAR AX,pow2
resreg = AX;
}
else // OPmodass
{
cdb.gen2(0x33,grex | modregrm(3,AX,DX)); // XOR AX,DX
cdb.gen2(0x2B,grex | modregrm(3,AX,DX)); // SUB AX,DX
cdb.genc2(0x81,grex | modregrm(3,4,AX),m); // AND AX,m
cdb.gen2(0x33,grex | modregrm(3,AX,DX)); // XOR AX,DX
cdb.gen2(0x2B,grex | modregrm(3,AX,DX)); // SUB AX,DX
resreg = AX;
}
}
}
else
{
regm_t retregs = ALLREGS & ~(mAX|mDX); // DX gets sign extension
codelem(cdb,e2,&retregs,false); // load rvalue in retregs
reg_t reg = findreg(retregs);
getlvalue(cdb,&cs,e1,mAX | mDX | retregs); // get EA
getregs(cdb,mAX | mDX); // destroy these regs
cs.Irm |= modregrm(0,AX,0);
cs.Iop = LOD;
cdb.gen(&cs); // MOV AX,EA
if (uns) // if uint
movregconst(cdb,DX,0,0); // CLR DX
else // else signed
{
cdb.gen1(0x99); // CWD
code_orrex(cdb.last(),rex);
}
getregs(cdb,mDX | mAX); // DX and AX will be destroyed
const uint opr = uns ? 6 : 7; // DIV/IDIV
genregs(cdb,0xF7,opr,reg); // OPR reg
code_orrex(cdb.last(),rex);
resreg = (op == OPmodass) ? DX : AX; // result register
}
opAssStoreReg(cdb, cs, e, resreg, pretregs);
return;
}
assert(sz == 2 * REGSIZE);
targ_size_t e2factor;
int pow2;
if (e2.Eoper == OPconst)
{
e2factor = cast(targ_size_t)el_tolong(e2);
pow2 = ispow2(e2factor);
}
// Register pair signed divide by power of 2
if (op == OPdivass &&
!uns &&
e.Eoper == OPconst &&
pow2 != -1 &&
I32 // not set up for I16 or I64 cent
)
{
freenode(e2);
regm_t retregs = mDX|mAX | mCX|mBX; // LSW must be byte reg because of later SETZ
reg_t rhi, rlo;
opAssLoadPair(cdb, cs, e, rhi, rlo, retregs, 0);
const regm_t keepmsk = idxregm(&cs);
retregs = mask(rhi) | mask(rlo);
if (pow2 < 32)
{
reg_t r1 = allocScratchReg(cdb, allregs & ~(retregs | keepmsk));
genmovreg(cdb,r1,rhi); // MOV r1,rhi
if (pow2 == 1)
cdb.genc2(0xC1,grex | modregrmx(3,5,r1),REGSIZE * 8 - 1); // SHR r1,31
else
{
cdb.genc2(0xC1,grex | modregrmx(3,7,r1),REGSIZE * 8 - 1); // SAR r1,31
cdb.genc2(0x81,grex | modregrmx(3,4,r1),(1 << pow2) - 1); // AND r1,mask
}
cdb.gen2(0x03,grex | modregxrmx(3,rlo,r1)); // ADD rlo,r1
cdb.genc2(0x81,grex | modregxrmx(3,2,rhi),0); // ADC rhi,0
cdb.genc2(0x0FAC,grex | modregrm(3,rhi,rlo),pow2); // SHRD rlo,rhi,pow2
cdb.genc2(0xC1,grex | modregrmx(3,7,rhi),pow2); // SAR rhi,pow2
}
else if (pow2 == 32)
{
reg_t r1 = allocScratchReg(cdb, allregs & ~(retregs | keepmsk));
genmovreg(cdb,r1,rhi); // MOV r1,rhi
cdb.genc2(0xC1,grex | modregrmx(3,7,r1),REGSIZE * 8 - 1); // SAR r1,31
cdb.gen2(0x03,grex | modregxrmx(3,rlo,r1)); // ADD rlo,r1
cdb.genc2(0x81,grex | modregxrmx(3,2,rhi),0); // ADC rhi,0
cdb.genmovreg(rlo,rhi); // MOV rlo,rhi
cdb.genc2(0xC1,grex | modregrmx(3,7,rhi),REGSIZE * 8 - 1); // SAR rhi,31
}
else if (pow2 < 63)
{
reg_t r1 = allocScratchReg(cdb, allregs & ~(retregs | keepmsk));
reg_t r2 = allocScratchReg(cdb, allregs & ~(retregs | keepmsk | mask(r1)));
genmovreg(cdb,r1,rhi); // MOV r1,rhi
cdb.genc2(0xC1,grex | modregrmx(3,7,r1),REGSIZE * 8 - 1); // SAR r1,31
cdb.genmovreg(r2,r1); // MOV r2,r1
if (pow2 == 33)
{
cdb.gen2(0xF7,modregrmx(3,3,r1)); // NEG r1
cdb.gen2(0x03,grex | modregxrmx(3,rlo,r2)); // ADD rlo,r2
cdb.gen2(0x13,grex | modregxrmx(3,rhi,r1)); // ADC rhi,r1
}
else
{
cdb.genc2(0x81,grex | modregrmx(3,4,r2),(1 << (pow2-32)) - 1); // AND r2,mask
cdb.gen2(0x03,grex | modregxrmx(3,rlo,r1)); // ADD rlo,r1
cdb.gen2(0x13,grex | modregxrmx(3,rhi,r2)); // ADC rhi,r2
}
cdb.genmovreg(rlo,rhi); // MOV rlo,rhi
cdb.genc2(0xC1,grex | modregrmx(3,7,rlo),pow2 - 32); // SAR rlo,pow2-32
cdb.genc2(0xC1,grex | modregrmx(3,7,rhi),REGSIZE * 8 - 1); // SAR rhi,31
}
else
{
// This may be better done by cgelem.d
assert(pow2 == 63);
assert(mask(rlo) & BYTEREGS); // for SETZ
cdb.genc2(0x81,grex | modregrmx(3,4,rhi),0x8000_0000); // ADD rhi,0x8000_000
cdb.genregs(0x09,rlo,rhi); // OR rlo,rhi
cdb.gen2(0x0F94,modregrmx(3,0,rlo)); // SETZ rlo
cdb.genregs(MOVZXb,rlo,rlo); // MOVZX rlo,rloL
movregconst(cdb,rhi,0,0); // MOV rhi,0
}
opAssStorePair(cdb, cs, e, rlo, rhi, pretregs);
return;
}
// Register pair signed modulo by power of 2
if (op == OPmodass &&
!uns &&
e.Eoper == OPconst &&
pow2 != -1 &&
I32 // not set up for I64 cent yet
)
{
freenode(e2);
regm_t retregs = mDX|mAX;
reg_t rhi, rlo;
opAssLoadPair(cdb, cs, e, rhi, rlo, retregs, 0);
const regm_t keepmsk = idxregm(&cs);
regm_t scratchm = allregs & ~(retregs | keepmsk);
if (pow2 == 63)
scratchm &= BYTEREGS; // because of SETZ
reg_t r1 = allocScratchReg(cdb, scratchm);
if (pow2 < 32)
{
cdb.genmovreg(r1,rhi); // MOV r1,rhi
cdb.genc2(0xC1,grex | modregrmx(3,7,r1),REGSIZE * 8 - 1); // SAR r1,31
cdb.gen2(0x33,grex | modregxrmx(3,rlo,r1)); // XOR rlo,r1
cdb.gen2(0x2B,grex | modregxrmx(3,rlo,r1)); // SUB rlo,r1
cdb.genc2(0x81,grex | modregrmx(3,4,rlo),(1<<pow2)-1); // AND rlo,(1<<pow2)-1
cdb.gen2(0x33,grex | modregxrmx(3,rlo,r1)); // XOR rlo,r1
cdb.gen2(0x2B,grex | modregxrmx(3,rlo,r1)); // SUB rlo,r1
cdb.gen2(0x1B,grex | modregxrmx(3,rhi,rhi)); // SBB rhi,rhi
}
else if (pow2 == 32)
{
cdb.genmovreg(r1,rhi); // MOV r1,rhi
cdb.genc2(0xC1,grex | modregrmx(3,7,r1),REGSIZE * 8 - 1); // SAR r1,31
cdb.gen2(0x03,grex | modregxrmx(3,rlo,r1)); // ADD rlo,r1
cdb.gen2(0x2B,grex | modregxrmx(3,rlo,r1)); // SUB rlo,r1
cdb.gen2(0x1B,grex | modregxrmx(3,rhi,rhi)); // SBB rhi,rhi
}
else if (pow2 < 63)
{
scratchm = allregs & ~(retregs | scratchm);
reg_t r2;
allocreg(cdb,&scratchm,&r2,TYint);
cdb.genmovreg(r1,rhi); // MOV r1,rhi
cdb.genc2(0xC1,grex | modregrmx(3,7,r1),REGSIZE * 8 - 1); // SAR r1,31
cdb.genmovreg(r2,r1); // MOV r2,r1
cdb.genc2(0x0FAC,grex | modregrm(3,r2,r1),64-pow2); // SHRD r1,r2,64-pow2
cdb.genc2(0xC1,grex | modregrmx(3,5,r2),64-pow2); // SHR r2,64-pow2
cdb.gen2(0x03,grex | modregxrmx(3,rlo,r1)); // ADD rlo,r1
cdb.gen2(0x13,grex | modregxrmx(3,rhi,r2)); // ADC rhi,r2
cdb.genc2(0x81,grex | modregrmx(3,4,rhi),(1<<(pow2-32))-1); // AND rhi,(1<<(pow2-32))-1
cdb.gen2(0x2B,grex | modregxrmx(3,rlo,r1)); // SUB rlo,r1
cdb.gen2(0x1B,grex | modregxrmx(3,rhi,r2)); // SBB rhi,r2
}
else
{
// This may be better done by cgelem.d
assert(pow2 == 63);
cdb.genc1(LEA,grex | modregxrmx(2,r1,rhi), FLconst, 0x8000_0000); // LEA r1,0x8000_0000[rhi]
cdb.gen2(0x0B,grex | modregxrmx(3,r1,rlo)); // OR r1,rlo
cdb.gen2(0x0F94,modregrmx(3,0,r1)); // SETZ r1
cdb.genc2(0xC1,grex | modregrmx(3,4,r1),REGSIZE * 8 - 1); // SHL r1,31
cdb.gen2(0x2B,grex | modregxrmx(3,rhi,r1)); // SUB rhi,r1
}
opAssStorePair(cdb, cs, e, rlo, rhi, pretregs);
return;
}
regm_t rretregs = mCX|mBX;
codelem(cdb,e2,&rretregs,false); // load e2 into CX|BX
reg_t rlo;
reg_t rhi;
opAssLoadPair(cdb, cs, e, rhi, rlo, mDX|mAX, rretregs);
regm_t retregs = (op == OPmodass) ? mCX|mBX : mDX|mAX;
uint lib = uns ? CLIB.uldiv : CLIB.ldiv;
if (op == OPmodass)
++lib;
callclib(cdb,e,lib,&retregs,idxregm(&cs));
opAssStorePair(cdb, cs, e, findregmsw(retregs), findreglsw(retregs), pretregs);
}
/********************************
* Generate code for <<= and >>=
*/
@trusted
void cdshass(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
code cs;
regm_t retregs;
uint op1,op2;
reg_t reg;
elem *e1 = e.EV.E1;
elem *e2 = e.EV.E2;
tym_t tyml = tybasic(e1.Ety); // type of lvalue
uint sz = _tysize[tyml];
uint isbyte = tybyte(e.Ety) != 0; // 1 for byte operations
tym_t tym = tybasic(e.Ety); // type of result
OPER oper = e.Eoper;
assert(tysize(e2.Ety) <= REGSIZE);
uint rex = (I64 && sz == 8) ? REX_W : 0;
// if our lvalue is a cse, make sure we evaluate for result in register
if (e1.Ecount && !(*pretregs & (ALLREGS | mBP)) && !isregvar(e1,&retregs,®))
*pretregs |= ALLREGS;
version (SCPP)
{
// Do this until the rest of the compiler does OPshr/OPashr correctly
if (oper == OPshrass)
oper = tyuns(tyml) ? OPshrass : OPashrass;
}
// Select opcodes. op2 is used for msw for long shifts.
switch (oper)
{
case OPshlass:
op1 = 4; // SHL
op2 = 2; // RCL
break;
case OPshrass:
op1 = 5; // SHR
op2 = 3; // RCR
break;
case OPashrass:
op1 = 7; // SAR
op2 = 3; // RCR
break;
default:
assert(0);
}
uint v = 0xD3; // for SHIFT xx,CL cases
uint loopcnt = 1;
uint conste2 = false;
uint shiftcnt = 0; // avoid "use before initialized" warnings
if (e2.Eoper == OPconst)
{
conste2 = true; // e2 is a constant
shiftcnt = e2.EV.Vint; // byte ordering of host
if (config.target_cpu >= TARGET_80286 &&
sz <= REGSIZE &&
shiftcnt != 1)
v = 0xC1; // SHIFT xx,shiftcnt
else if (shiftcnt <= 3)
{
loopcnt = shiftcnt;
v = 0xD1; // SHIFT xx,1
}
}
if (v == 0xD3) // if COUNT == CL
{
retregs = mCX;
codelem(cdb,e2,&retregs,false);
}
else
freenode(e2);
getlvalue(cdb,&cs,e1,mCX); // get lvalue, preserve CX
modEA(cdb,&cs); // check for modifying register
if (*pretregs == 0 || // if don't return result
(*pretregs == mPSW && conste2 && _tysize[tym] <= REGSIZE) ||
sz > REGSIZE
)
{
retregs = 0; // value not returned in a register
cs.Iop = v ^ isbyte;
while (loopcnt--)
{
NEWREG(cs.Irm,op1); // make sure op1 is first
if (sz <= REGSIZE)
{
if (conste2)
{
cs.IFL2 = FLconst;
cs.IEV2.Vint = shiftcnt;
}
cdb.gen(&cs); // SHIFT EA,[CL|1]
if (*pretregs & mPSW && !loopcnt && conste2)
code_orflag(cdb.last(),CFpsw);
}
else // TYlong
{
cs.Iop = 0xD1; // plain shift
code *ce = gennop(null); // ce: NOP
if (v == 0xD3)
{
getregs(cdb,mCX);
if (!conste2)
{
assert(loopcnt == 0);
genjmp(cdb,JCXZ,FLcode,cast(block *) ce); // JCXZ ce
}
}
code *cg;
if (oper == OPshlass)
{
cdb.gen(&cs); // cg: SHIFT EA
cg = cdb.last();
code_orflag(cg,CFpsw);
getlvalue_msw(&cs);
NEWREG(cs.Irm,op2);
cdb.gen(&cs); // SHIFT EA
getlvalue_lsw(&cs);
}
else
{
getlvalue_msw(&cs);
cdb.gen(&cs);
cg = cdb.last();
code_orflag(cg,CFpsw);
NEWREG(cs.Irm,op2);
getlvalue_lsw(&cs);
cdb.gen(&cs);
}
if (v == 0xD3) // if building a loop
{
genjmp(cdb,LOOP,FLcode,cast(block *) cg); // LOOP cg
regimmed_set(CX,0); // note that now CX == 0
}
cdb.append(ce);
}
}
// If we want the result, we must load it from the EA
// into a register.
if (sz == 2 * REGSIZE && *pretregs)
{
retregs = *pretregs & (ALLREGS | mBP);
if (retregs)
{
retregs &= ~idxregm(&cs);
allocreg(cdb,&retregs,®,tym);
cs.Iop = LOD;
// be careful not to trash any index regs
// do MSW first (which can't be an index reg)
getlvalue_msw(&cs);
NEWREG(cs.Irm,reg);
cdb.gen(&cs);
getlvalue_lsw(&cs);
reg = findreglsw(retregs);
NEWREG(cs.Irm,reg);
cdb.gen(&cs);
if (*pretregs & mPSW)
tstresult(cdb,retregs,tyml,true);
}
else // flags only
{
retregs = ALLREGS & ~idxregm(&cs);
allocreg(cdb,&retregs,®,TYint);
cs.Iop = LOD;
NEWREG(cs.Irm,reg);
cdb.gen(&cs); // MOV reg,EA
cs.Iop = 0x0B; // OR reg,EA+2
cs.Iflags |= CFpsw;
getlvalue_msw(&cs);
cdb.gen(&cs);
}
}
if (e1.Ecount && !(retregs & regcon.mvar)) // if lvalue is a CSE
cssave(e1,retregs,!OTleaf(e1.Eoper));
freenode(e1);
*pretregs = retregs;
return;
}
else // else must evaluate in register
{
if (sz <= REGSIZE)
{
regm_t possregs = ALLREGS & ~mCX & ~idxregm(&cs);
if (isbyte)
possregs &= BYTEREGS;
retregs = *pretregs & possregs;
if (retregs == 0)
retregs = possregs;
allocreg(cdb,&retregs,®,tym);
cs.Iop = LOD ^ isbyte;
code_newreg(&cs, reg);
if (isbyte && I64 && (reg >= 4))
cs.Irex |= REX;
cdb.gen(&cs); // MOV reg,EA
if (!I16)
{
assert(!isbyte || (mask(reg) & BYTEREGS));
cdb.genc2(v ^ isbyte,modregrmx(3,op1,reg),shiftcnt);
if (isbyte && I64 && (reg >= 4))
cdb.last().Irex |= REX;
code_orrex(cdb.last(), rex);
// We can do a 32 bit shift on a 16 bit operand if
// it's a left shift and we're not concerned about
// the flags. Remember that flags are not set if
// a shift of 0 occurs.
if (_tysize[tym] == SHORTSIZE &&
(oper == OPshrass || oper == OPashrass ||
(*pretregs & mPSW && conste2)))
cdb.last().Iflags |= CFopsize; // 16 bit operand
}
else
{
while (loopcnt--)
{ // Generate shift instructions.
cdb.genc2(v ^ isbyte,modregrm(3,op1,reg),shiftcnt);
}
}
if (*pretregs & mPSW && conste2)
{
assert(shiftcnt);
*pretregs &= ~mPSW; // result is already in flags
code_orflag(cdb.last(),CFpsw);
}
opAssStoreReg(cdb,cs,e,reg,pretregs);
return;
}
assert(0);
}
}
/**********************************
* Generate code for compares.
* Handles lt,gt,le,ge,eqeq,ne for all data types.
*/
@trusted
void cdcmp(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
regm_t retregs,rretregs;
reg_t reg,rreg;
int fl;
//printf("cdcmp(e = %p, pretregs = %s)\n",e,regm_str(*pretregs));
// Collect extra parameter. This is pretty ugly...
int flag = cdcmp_flag;
cdcmp_flag = 0;
elem *e1 = e.EV.E1;
elem *e2 = e.EV.E2;
if (*pretregs == 0) // if don't want result
{
codelem(cdb,e1,pretregs,false);
*pretregs = 0; // in case e1 changed it
codelem(cdb,e2,pretregs,false);
return;
}
uint jop = jmpopcode(e); // must be computed before
// leaves are free'd
uint reverse = 0;
OPER op = e.Eoper;
assert(OTrel(op));
bool eqorne = (op == OPeqeq) || (op == OPne);
tym_t tym = tybasic(e1.Ety);
uint sz = _tysize[tym];
uint isbyte = sz == 1;
uint rex = (I64 && sz == 8) ? REX_W : 0;
uint grex = rex << 16; // 64 bit operands
code cs;
code *ce;
if (tyfloating(tym)) // if floating operation
{
if (config.fpxmmregs)
{
retregs = mPSW;
if (tyxmmreg(tym))
orthxmm(cdb,e,&retregs);
else
orth87(cdb,e,&retregs);
}
else if (config.inline8087)
{ retregs = mPSW;
orth87(cdb,e,&retregs);
}
else
{
if (config.exe & EX_windos)
{
int clib;
retregs = 0; /* skip result for now */
if (iffalse(e2)) /* second operand is constant 0 */
{
assert(!eqorne); /* should be OPbool or OPnot */
if (tym == TYfloat)
{
retregs = FLOATREGS;
clib = CLIB.ftst0;
}
else
{
retregs = DOUBLEREGS;
clib = CLIB.dtst0;
}
if (rel_exception(op))
clib += CLIB.dtst0exc - CLIB.dtst0;
codelem(cdb,e1,&retregs,false);
retregs = 0;
callclib(cdb,e,clib,&retregs,0);
freenode(e2);
}
else
{
clib = CLIB.dcmp;
if (rel_exception(op))
clib += CLIB.dcmpexc - CLIB.dcmp;
opdouble(cdb,e,&retregs,clib);
}
}
else
{
assert(0);
}
}
goto L3;
}
/* If it's a signed comparison of longs, we have to call a library */
/* routine, because we don't know the target of the signed branch */
/* (have to set up flags so that jmpopcode() will do it right) */
if (!eqorne &&
(I16 && tym == TYlong && tybasic(e2.Ety) == TYlong ||
I32 && tym == TYllong && tybasic(e2.Ety) == TYllong)
)
{
assert(jop != JC && jop != JNC);
retregs = mDX | mAX;
codelem(cdb,e1,&retregs,false);
retregs = mCX | mBX;
scodelem(cdb,e2,&retregs,mDX | mAX,false);
if (I16)
{
retregs = 0;
callclib(cdb,e,CLIB.lcmp,&retregs,0); // gross, but it works
}
else
{
/* Generate:
* CMP EDX,ECX
* JNE C1
* XOR EDX,EDX
* CMP EAX,EBX
* JZ C1
* JA C3
* DEC EDX
* JMP C1
* C3: INC EDX
* C1:
*/
getregs(cdb,mDX);
genregs(cdb,0x39,CX,DX); // CMP EDX,ECX
code *c1 = gennop(null);
genjmp(cdb,JNE,FLcode,cast(block *)c1); // JNE C1
movregconst(cdb,DX,0,0); // XOR EDX,EDX
genregs(cdb,0x39,BX,AX); // CMP EAX,EBX
genjmp(cdb,JE,FLcode,cast(block *)c1); // JZ C1
code *c3 = gen1(null,0x40 + DX); // INC EDX
genjmp(cdb,JA,FLcode,cast(block *)c3); // JA C3
cdb.gen1(0x48 + DX); // DEC EDX
genjmp(cdb,JMPS,FLcode,cast(block *)c1); // JMP C1
cdb.append(c3);
cdb.append(c1);
getregs(cdb,mDX);
retregs = mPSW;
}
goto L3;
}
/* See if we should reverse the comparison, so a JA => JC, and JBE => JNC
* (This is already reflected in the jop)
*/
if ((jop == JC || jop == JNC) &&
(op == OPgt || op == OPle) &&
(tyuns(tym) || tyuns(e2.Ety))
)
{ // jmpopcode() sez comparison should be reversed
assert(e2.Eoper != OPconst && e2.Eoper != OPrelconst);
reverse ^= 2;
}
/* See if we should swap operands */
if (e1.Eoper == OPvar && e2.Eoper == OPvar && evalinregister(e2))
{
e1 = e.EV.E2;
e2 = e.EV.E1;
reverse ^= 2;
}
retregs = allregs;
if (isbyte)
retregs = BYTEREGS;
ce = null;
cs.Iflags = (!I16 && sz == SHORTSIZE) ? CFopsize : 0;
cs.Irex = cast(ubyte)rex;
if (sz > REGSIZE)
ce = gennop(ce);
switch (e2.Eoper)
{
default:
L2:
scodelem(cdb,e1,&retregs,0,true); // compute left leaf
rretregs = allregs & ~retregs;
if (isbyte)
rretregs &= BYTEREGS;
scodelem(cdb,e2,&rretregs,retregs,true); // get right leaf
if (sz <= REGSIZE) // CMP reg,rreg
{
reg = findreg(retregs); // get reg that e1 is in
rreg = findreg(rretregs);
genregs(cdb,0x3B ^ isbyte ^ reverse,reg,rreg);
code_orrex(cdb.last(), rex);
if (!I16 && sz == SHORTSIZE)
cdb.last().Iflags |= CFopsize; // compare only 16 bits
if (I64 && isbyte && (reg >= 4 || rreg >= 4))
cdb.last().Irex |= REX; // address byte registers
}
else
{
assert(sz <= 2 * REGSIZE);
// Compare MSW, if they're equal then compare the LSW
reg = findregmsw(retregs);
rreg = findregmsw(rretregs);
genregs(cdb,0x3B ^ reverse,reg,rreg); // CMP reg,rreg
if (I32 && sz == 6)
cdb.last().Iflags |= CFopsize; // seg is only 16 bits
else if (I64)
code_orrex(cdb.last(), REX_W);
genjmp(cdb,JNE,FLcode,cast(block *) ce); // JNE nop
reg = findreglsw(retregs);
rreg = findreglsw(rretregs);
genregs(cdb,0x3B ^ reverse,reg,rreg); // CMP reg,rreg
if (I64)
code_orrex(cdb.last(), REX_W);
}
break;
case OPrelconst:
if (I64 && (config.flags3 & CFG3pic || config.exe == EX_WIN64))
goto L2;
fl = el_fl(e2);
switch (fl)
{
case FLfunc:
fl = FLextern; // so it won't be self-relative
break;
case FLdata:
case FLudata:
case FLextern:
if (sz > REGSIZE) // compare against DS, not DGROUP
goto L2;
break;
case FLfardata:
break;
default:
goto L2;
}
cs.IFL2 = cast(ubyte)fl;
cs.IEV2.Vsym = e2.EV.Vsym;
if (sz > REGSIZE)
{
cs.Iflags |= CFseg;
cs.IEV2.Voffset = 0;
}
else
{
cs.Iflags |= CFoff;
cs.IEV2.Voffset = e2.EV.Voffset;
}
goto L4;
case OPconst:
// If compare against 0
if (sz <= REGSIZE && *pretregs == mPSW && !boolres(e2) &&
isregvar(e1,&retregs,®)
)
{ // Just do a TEST instruction
genregs(cdb,0x85 ^ isbyte,reg,reg); // TEST reg,reg
cdb.last().Iflags |= (cs.Iflags & CFopsize) | CFpsw;
code_orrex(cdb.last(), rex);
if (I64 && isbyte && reg >= 4)
cdb.last().Irex |= REX; // address byte registers
retregs = mPSW;
break;
}
if (!tyuns(tym) && !tyuns(e2.Ety) &&
!boolres(e2) && !(*pretregs & mPSW) &&
(sz == REGSIZE || (I64 && sz == 4)) &&
(!I16 || op == OPlt || op == OPge))
{
assert(*pretregs & (allregs));
codelem(cdb,e1,pretregs,false);
reg = findreg(*pretregs);
getregs(cdb,mask(reg));
switch (op)
{
case OPle:
cdb.genc2(0x81,grex | modregrmx(3,0,reg),cast(uint)-1); // ADD reg,-1
code_orflag(cdb.last(), CFpsw);
cdb.genc2(0x81,grex | modregrmx(3,2,reg),0); // ADC reg,0
goto oplt;
case OPgt:
cdb.gen2(0xF7,grex | modregrmx(3,3,reg)); // NEG reg
/* Flips the sign bit unless the value is 0 or int.min.
Also sets the carry bit when the value is not 0. */
code_orflag(cdb.last(), CFpsw);
cdb.genc2(0x81,grex | modregrmx(3,3,reg),0); // SBB reg,0
/* Subtracts the carry bit. This turns int.min into
int.max, flipping the sign bit.
For other negative and positive values, subtracting 1
doesn't affect the sign bit.
For 0, the carry bit is not set, so this does nothing
and the sign bit is not affected. */
goto oplt;
case OPlt:
oplt:
// Get the sign bit, i.e. 1 if the value is negative.
if (!I16)
cdb.genc2(0xC1,grex | modregrmx(3,5,reg),sz * 8 - 1); // SHR reg,31
else
{ /* 8088-286 do not have a barrel shifter, so use this
faster sequence
*/
genregs(cdb,0xD1,0,reg); // ROL reg,1
reg_t regi;
if (reghasvalue(allregs,1,®i))
genregs(cdb,0x23,reg,regi); // AND reg,regi
else
cdb.genc2(0x81,modregrm(3,4,reg),1); // AND reg,1
}
break;
case OPge:
genregs(cdb,0xD1,4,reg); // SHL reg,1
code_orrex(cdb.last(),rex);
code_orflag(cdb.last(), CFpsw);
genregs(cdb,0x19,reg,reg); // SBB reg,reg
code_orrex(cdb.last(),rex);
if (I64)
{
cdb.gen2(0xFF,modregrmx(3,0,reg)); // INC reg
code_orrex(cdb.last(), rex);
}
else
cdb.gen1(0x40 + reg); // INC reg
break;
default:
assert(0);
}
freenode(e2);
goto ret;
}
cs.IFL2 = FLconst;
if (sz == 16)
cs.IEV2.Vsize_t = cast(targ_size_t)e2.EV.Vcent.hi;
else if (sz > REGSIZE)
cs.IEV2.Vint = cast(int)MSREG(e2.EV.Vllong);
else
cs.IEV2.Vsize_t = cast(targ_size_t)e2.EV.Vllong;
// The cmp immediate relies on sign extension of the 32 bit immediate value
if (I64 && sz >= REGSIZE && cs.IEV2.Vsize_t != cast(int)cs.IEV2.Vint)
goto L2;
L4:
cs.Iop = 0x81 ^ isbyte;
/* if ((e1 is data or a '*' reference) and it's not a
* common subexpression
*/
if ((e1.Eoper == OPvar && datafl[el_fl(e1)] ||
e1.Eoper == OPind) &&
!evalinregister(e1))
{
getlvalue(cdb,&cs,e1,RMload);
freenode(e1);
if (evalinregister(e2))
{
retregs = idxregm(&cs);
if ((cs.Iflags & CFSEG) == CFes)
retregs |= mES; // take no chances
rretregs = allregs & ~retregs;
if (isbyte)
rretregs &= BYTEREGS;
scodelem(cdb,e2,&rretregs,retregs,true);
cs.Iop = 0x39 ^ isbyte ^ reverse;
if (sz > REGSIZE)
{
rreg = findregmsw(rretregs);
cs.Irm |= modregrm(0,rreg,0);
getlvalue_msw(&cs);
cdb.gen(&cs); // CMP EA+2,rreg
if (I32 && sz == 6)
cdb.last().Iflags |= CFopsize; // seg is only 16 bits
if (I64 && isbyte && rreg >= 4)
cdb.last().Irex |= REX;
genjmp(cdb,JNE,FLcode,cast(block *) ce); // JNE nop
rreg = findreglsw(rretregs);
NEWREG(cs.Irm,rreg);
getlvalue_lsw(&cs);
}
else
{
rreg = findreg(rretregs);
code_newreg(&cs, rreg);
if (I64 && isbyte && rreg >= 4)
cs.Irex |= REX;
}
}
else
{
cs.Irm |= modregrm(0,7,0);
if (sz > REGSIZE)
{
if (sz == 6)
assert(0);
if (e2.Eoper == OPrelconst)
{ cs.Iflags = (cs.Iflags & ~(CFoff | CFseg)) | CFseg;
cs.IEV2.Voffset = 0;
}
getlvalue_msw(&cs);
cdb.gen(&cs); // CMP EA+2,const
if (!I16 && sz == 6)
cdb.last().Iflags |= CFopsize; // seg is only 16 bits
genjmp(cdb,JNE,FLcode, cast(block *) ce); // JNE nop
if (e2.Eoper == OPconst)
cs.IEV2.Vint = cast(int)e2.EV.Vllong;
else if (e2.Eoper == OPrelconst)
{ // Turn off CFseg, on CFoff
cs.Iflags ^= CFseg | CFoff;
cs.IEV2.Voffset = e2.EV.Voffset;
}
else
assert(0);
getlvalue_lsw(&cs);
}
freenode(e2);
}
cdb.gen(&cs);
break;
}
if (evalinregister(e2) && !OTassign(e1.Eoper) &&
!isregvar(e1,null,null))
{
regm_t m;
m = allregs & ~regcon.mvar;
if (isbyte)
m &= BYTEREGS;
if (m & (m - 1)) // if more than one free register
goto L2;
}
if ((e1.Eoper == OPstrcmp || (OTassign(e1.Eoper) && sz <= REGSIZE)) &&
!boolres(e2) && !evalinregister(e1))
{
retregs = mPSW;
scodelem(cdb,e1,&retregs,0,false);
freenode(e2);
break;
}
if (sz <= REGSIZE && !boolres(e2) && e1.Eoper == OPadd && *pretregs == mPSW)
{
retregs |= mPSW;
scodelem(cdb,e1,&retregs,0,false);
freenode(e2);
break;
}
scodelem(cdb,e1,&retregs,0,true); // compute left leaf
if (sz == 1)
{
reg = findreg(retregs & allregs); // get reg that e1 is in
cs.Irm = modregrm(3,7,reg & 7);
if (reg & 8)
cs.Irex |= REX_B;
if (e1.Eoper == OPvar && e1.EV.Voffset == 1 && e1.EV.Vsym.Sfl == FLreg)
{ assert(reg < 4);
cs.Irm |= 4; // use upper register half
}
if (I64 && reg >= 4)
cs.Irex |= REX; // address byte registers
}
else if (sz <= REGSIZE)
{ // CMP reg,const
reg = findreg(retregs & allregs); // get reg that e1 is in
rretregs = allregs & ~retregs;
if (cs.IFL2 == FLconst && reghasvalue(rretregs,cs.IEV2.Vint,&rreg))
{
genregs(cdb,0x3B,reg,rreg);
code_orrex(cdb.last(), rex);
if (!I16)
cdb.last().Iflags |= cs.Iflags & CFopsize;
freenode(e2);
break;
}
cs.Irm = modregrm(3,7,reg & 7);
if (reg & 8)
cs.Irex |= REX_B;
}
else if (sz <= 2 * REGSIZE)
{
reg = findregmsw(retregs); // get reg that e1 is in
cs.Irm = modregrm(3,7,reg);
cdb.gen(&cs); // CMP reg,MSW
if (I32 && sz == 6)
cdb.last().Iflags |= CFopsize; // seg is only 16 bits
genjmp(cdb,JNE,FLcode, cast(block *) ce); // JNE ce
reg = findreglsw(retregs);
cs.Irm = modregrm(3,7,reg);
if (e2.Eoper == OPconst)
cs.IEV2.Vint = e2.EV.Vlong;
else if (e2.Eoper == OPrelconst)
{ // Turn off CFseg, on CFoff
cs.Iflags ^= CFseg | CFoff;
cs.IEV2.Voffset = e2.EV.Voffset;
}
else
assert(0);
}
else
assert(0);
cdb.gen(&cs); // CMP sucreg,LSW
freenode(e2);
break;
case OPind:
if (e2.Ecount)
goto L2;
goto L5;
case OPvar:
if (config.exe & (EX_OSX | EX_OSX64))
{
if (movOnly(e2))
goto L2;
}
if ((e1.Eoper == OPvar &&
isregvar(e2,&rretregs,®) &&
sz <= REGSIZE
) ||
(e1.Eoper == OPind &&
isregvar(e2,&rretregs,®) &&
!evalinregister(e1) &&
sz <= REGSIZE
)
)
{
// CMP EA,e2
getlvalue(cdb,&cs,e1,RMload);
freenode(e1);
cs.Iop = 0x39 ^ isbyte ^ reverse;
code_newreg(&cs,reg);
if (I64 && isbyte && reg >= 4)
cs.Irex |= REX; // address byte registers
cdb.gen(&cs);
freenode(e2);
break;
}
L5:
scodelem(cdb,e1,&retregs,0,true); // compute left leaf
if (sz <= REGSIZE) // CMP reg,EA
{
reg = findreg(retregs & allregs); // get reg that e1 is in
uint opsize = cs.Iflags & CFopsize;
loadea(cdb,e2,&cs,0x3B ^ isbyte ^ reverse,reg,0,RMload | retregs,0);
code_orflag(cdb.last(),opsize);
}
else if (sz <= 2 * REGSIZE)
{
reg = findregmsw(retregs); // get reg that e1 is in
// CMP reg,EA
loadea(cdb,e2,&cs,0x3B ^ reverse,reg,REGSIZE,RMload | retregs,0);
if (I32 && sz == 6)
cdb.last().Iflags |= CFopsize; // seg is only 16 bits
genjmp(cdb,JNE,FLcode, cast(block *) ce); // JNE ce
reg = findreglsw(retregs);
if (e2.Eoper == OPind)
{
NEWREG(cs.Irm,reg);
getlvalue_lsw(&cs);
cdb.gen(&cs);
}
else
loadea(cdb,e2,&cs,0x3B ^ reverse,reg,0,RMload | retregs,0);
}
else
assert(0);
freenode(e2);
break;
}
cdb.append(ce);
L3:
if ((retregs = (*pretregs & (ALLREGS | mBP))) != 0) // if return result in register
{
if (config.target_cpu >= TARGET_80386 && !flag && !(jop & 0xFF00))
{
regm_t resregs = retregs;
if (!I64)
{
resregs &= BYTEREGS;
if (!resregs)
resregs = BYTEREGS;
}
allocreg(cdb,&resregs,®,TYint);
cdb.gen2(0x0F90 + (jop & 0x0F),modregrmx(3,0,reg)); // SETcc reg
if (I64 && reg >= 4)
code_orrex(cdb.last(),REX);
if (tysize(e.Ety) > 1)
{
genregs(cdb,MOVZXb,reg,reg); // MOVZX reg,reg
if (I64 && sz == 8)
code_orrex(cdb.last(),REX_W);
if (I64 && reg >= 4)
code_orrex(cdb.last(),REX);
}
*pretregs &= ~mPSW;
fixresult(cdb,e,resregs,pretregs);
}
else
{
code *nop = null;
regm_t save = regcon.immed.mval;
allocreg(cdb,&retregs,®,TYint);
regcon.immed.mval = save;
if ((*pretregs & mPSW) == 0 &&
(jop == JC || jop == JNC))
{
getregs(cdb,retregs);
genregs(cdb,0x19,reg,reg); // SBB reg,reg
if (rex || flag & REX_W)
code_orrex(cdb.last(), REX_W);
if (flag)
{ } // cdcond() will handle it
else if (jop == JNC)
{
if (I64)
{
cdb.gen2(0xFF,modregrmx(3,0,reg)); // INC reg
code_orrex(cdb.last(), rex);
}
else
cdb.gen1(0x40 + reg); // INC reg
}
else
{
cdb.gen2(0xF7,modregrmx(3,3,reg)); // NEG reg
code_orrex(cdb.last(), rex);
}
}
else if (I64 && sz == 8)
{
assert(!flag);
movregconst(cdb,reg,1,64|8); // MOV reg,1
nop = gennop(nop);
genjmp(cdb,jop,FLcode,cast(block *) nop); // Jtrue nop
// MOV reg,0
movregconst(cdb,reg,0,(*pretregs & mPSW) ? 64|8 : 64);
regcon.immed.mval &= ~mask(reg);
}
else
{
assert(!flag);
movregconst(cdb,reg,1,8); // MOV reg,1
nop = gennop(nop);
genjmp(cdb,jop,FLcode,cast(block *) nop); // Jtrue nop
// MOV reg,0
movregconst(cdb,reg,0,(*pretregs & mPSW) ? 8 : 0);
regcon.immed.mval &= ~mask(reg);
}
*pretregs = retregs;
cdb.append(nop);
}
}
ret:
{ }
}
/**********************************
* Generate code for signed compare of longs.
* Input:
* targ block* or code*
*/
@trusted
void longcmp(ref CodeBuilder cdb,elem *e,bool jcond,uint fltarg,code *targ)
{
// <= > < >=
static immutable ubyte[4] jopmsw = [JL, JG, JL, JG ];
static immutable ubyte[4] joplsw = [JBE, JA, JB, JAE ];
//printf("longcmp(e = %p)\n", e);
elem *e1 = e.EV.E1;
elem *e2 = e.EV.E2;
OPER op = e.Eoper;
// See if we should swap operands
if (e1.Eoper == OPvar && e2.Eoper == OPvar && evalinregister(e2))
{
e1 = e.EV.E2;
e2 = e.EV.E1;
op = swaprel(op);
}
code cs;
cs.Iflags = 0;
cs.Irex = 0;
code *ce = gennop(null);
regm_t retregs = ALLREGS;
regm_t rretregs;
reg_t reg,rreg;
uint jop = jopmsw[op - OPle];
if (!(jcond & 1)) jop ^= (JL ^ JG); // toggle jump condition
CodeBuilder cdbjmp;
cdbjmp.ctor();
genjmp(cdbjmp,jop,fltarg, cast(block *) targ); // Jx targ
genjmp(cdbjmp,jop ^ (JL ^ JG),FLcode, cast(block *) ce); // Jy nop
switch (e2.Eoper)
{
default:
L2:
scodelem(cdb,e1,&retregs,0,true); // compute left leaf
rretregs = ALLREGS & ~retregs;
scodelem(cdb,e2,&rretregs,retregs,true); // get right leaf
cse_flush(cdb,1);
// Compare MSW, if they're equal then compare the LSW
reg = findregmsw(retregs);
rreg = findregmsw(rretregs);
genregs(cdb,0x3B,reg,rreg); // CMP reg,rreg
cdb.append(cdbjmp);
reg = findreglsw(retregs);
rreg = findreglsw(rretregs);
genregs(cdb,0x3B,reg,rreg); // CMP reg,rreg
break;
case OPconst:
cs.IEV2.Vint = cast(int)MSREG(e2.EV.Vllong); // MSW first
cs.IFL2 = FLconst;
cs.Iop = 0x81;
/* if ((e1 is data or a '*' reference) and it's not a
* common subexpression
*/
if ((e1.Eoper == OPvar && datafl[el_fl(e1)] ||
e1.Eoper == OPind) &&
!evalinregister(e1))
{
getlvalue(cdb,&cs,e1,0);
freenode(e1);
if (evalinregister(e2))
{
retregs = idxregm(&cs);
if ((cs.Iflags & CFSEG) == CFes)
retregs |= mES; // take no chances
rretregs = ALLREGS & ~retregs;
scodelem(cdb,e2,&rretregs,retregs,true);
cse_flush(cdb,1);
rreg = findregmsw(rretregs);
cs.Iop = 0x39;
cs.Irm |= modregrm(0,rreg,0);
getlvalue_msw(&cs);
cdb.gen(&cs); // CMP EA+2,rreg
cdb.append(cdbjmp);
rreg = findreglsw(rretregs);
NEWREG(cs.Irm,rreg);
}
else
{
cse_flush(cdb,1);
cs.Irm |= modregrm(0,7,0);
getlvalue_msw(&cs);
cdb.gen(&cs); // CMP EA+2,const
cdb.append(cdbjmp);
cs.IEV2.Vint = e2.EV.Vlong;
freenode(e2);
}
getlvalue_lsw(&cs);
cdb.gen(&cs); // CMP EA,rreg/const
break;
}
if (evalinregister(e2))
goto L2;
scodelem(cdb,e1,&retregs,0,true); // compute left leaf
cse_flush(cdb,1);
reg = findregmsw(retregs); // get reg that e1 is in
cs.Irm = modregrm(3,7,reg);
cdb.gen(&cs); // CMP reg,MSW
cdb.append(cdbjmp);
reg = findreglsw(retregs);
cs.Irm = modregrm(3,7,reg);
cs.IEV2.Vint = e2.EV.Vlong;
cdb.gen(&cs); // CMP sucreg,LSW
freenode(e2);
break;
case OPvar:
if (!e1.Ecount && e1.Eoper == OPs32_64)
{
reg_t msreg;
retregs = allregs;
scodelem(cdb,e1.EV.E1,&retregs,0,true);
freenode(e1);
reg = findreg(retregs);
retregs = allregs & ~retregs;
allocreg(cdb,&retregs,&msreg,TYint);
genmovreg(cdb,msreg,reg); // MOV msreg,reg
cdb.genc2(0xC1,modregrm(3,7,msreg),REGSIZE * 8 - 1); // SAR msreg,31
cse_flush(cdb,1);
loadea(cdb,e2,&cs,0x3B,msreg,REGSIZE,mask(reg),0);
cdb.append(cdbjmp);
loadea(cdb,e2,&cs,0x3B,reg,0,mask(reg),0);
freenode(e2);
}
else
{
scodelem(cdb,e1,&retregs,0,true); // compute left leaf
cse_flush(cdb,1);
reg = findregmsw(retregs); // get reg that e1 is in
loadea(cdb,e2,&cs,0x3B,reg,REGSIZE,retregs,0);
cdb.append(cdbjmp);
reg = findreglsw(retregs);
loadea(cdb,e2,&cs,0x3B,reg,0,retregs,0);
freenode(e2);
}
break;
}
jop = joplsw[op - OPle];
if (!(jcond & 1)) jop ^= 1; // toggle jump condition
genjmp(cdb,jop,fltarg,cast(block *) targ); // Jcond targ
cdb.append(ce);
freenode(e);
}
/*****************************
* Do conversions.
* Depends on OPd_s32 and CLIB.dbllng being in sequence.
*/
@trusted
void cdcnvt(ref CodeBuilder cdb,elem *e, regm_t *pretregs)
{
//printf("cdcnvt: %p *pretregs = %s\n", e, regm_str(*pretregs));
//elem_print(e);
static immutable ubyte[2][16] clib =
[
[ OPd_s32, CLIB.dbllng ],
[ OPs32_d, CLIB.lngdbl ],
[ OPd_s16, CLIB.dblint ],
[ OPs16_d, CLIB.intdbl ],
[ OPd_u16, CLIB.dbluns ],
[ OPu16_d, CLIB.unsdbl ],
[ OPd_u32, CLIB.dblulng ],
[ OPu32_d, CLIB.ulngdbl ],
[ OPd_s64, CLIB.dblllng ],
[ OPs64_d, CLIB.llngdbl ],
[ OPd_u64, CLIB.dblullng ],
[ OPu64_d, CLIB.ullngdbl ],
[ OPd_f, CLIB.dblflt ],
[ OPf_d, CLIB.fltdbl ],
[ OPvp_fp, CLIB.vptrfptr ],
[ OPcvp_fp, CLIB.cvptrfptr]
];
if (!*pretregs)
{
codelem(cdb,e.EV.E1,pretregs,false);
return;
}
regm_t retregs;
if (config.inline8087)
{
switch (e.Eoper)
{
case OPld_d:
case OPd_ld:
{
if (tycomplex(e.EV.E1.Ety))
{
Lcomplex:
regm_t retregsx = mST01 | (*pretregs & mPSW);
codelem(cdb,e.EV.E1, &retregsx, false);
fixresult_complex87(cdb, e, retregsx, pretregs);
return;
}
regm_t retregsx = mST0 | (*pretregs & mPSW);
codelem(cdb,e.EV.E1, &retregsx, false);
fixresult87(cdb, e, retregsx, pretregs);
return;
}
case OPf_d:
case OPd_f:
if (tycomplex(e.EV.E1.Ety))
goto Lcomplex;
if (config.fpxmmregs && *pretregs & XMMREGS)
{
xmmcnvt(cdb, e, pretregs);
return;
}
/* if won't do us much good to transfer back and */
/* forth between 8088 registers and 8087 registers */
if (OTcall(e.EV.E1.Eoper) && !(*pretregs & allregs))
{
retregs = regmask(e.EV.E1.Ety, e.EV.E1.EV.E1.Ety);
if (retregs & (mXMM1 | mXMM0 |mST01 | mST0)) // if return in ST0
{
codelem(cdb,e.EV.E1,pretregs,false);
if (*pretregs & mST0)
note87(e, 0, 0);
return;
}
else
break;
}
goto Lload87;
case OPs64_d:
if (!I64)
goto Lload87;
goto case OPs32_d;
case OPs32_d:
if (config.fpxmmregs && *pretregs & XMMREGS)
{
xmmcnvt(cdb, e, pretregs);
return;
}
goto Lload87;
case OPs16_d:
case OPu16_d:
Lload87:
load87(cdb,e,0,pretregs,null,-1);
return;
case OPu32_d:
if (I64 && config.fpxmmregs && *pretregs & XMMREGS)
{
xmmcnvt(cdb,e,pretregs);
return;
}
else if (!I16)
{
regm_t retregsx = ALLREGS;
codelem(cdb,e.EV.E1, &retregsx, false);
reg_t reg = findreg(retregsx);
cdb.genfltreg(STO, reg, 0);
regwithvalue(cdb,ALLREGS,0,®,0);
cdb.genfltreg(STO, reg, 4);
push87(cdb);
cdb.genfltreg(0xDF,5,0); // FILD m64int
regm_t retregsy = mST0 /*| (*pretregs & mPSW)*/;
fixresult87(cdb, e, retregsy, pretregs);
return;
}
break;
case OPd_s64:
if (!I64)
goto Lcnvt87;
goto case OPd_s32;
case OPd_s16:
case OPd_s32:
if (config.fpxmmregs)
{
xmmcnvt(cdb,e,pretregs);
return;
}
goto Lcnvt87;
case OPd_u16:
Lcnvt87:
cnvt87(cdb,e,pretregs);
return;
case OPd_u32: // use subroutine, not 8087
if (I64 && config.fpxmmregs)
{
xmmcnvt(cdb,e,pretregs);
return;
}
if (I32 || I64)
{
cdd_u32(cdb,e,pretregs);
return;
}
if (config.exe & EX_posix)
{
retregs = mST0;
}
else
{
retregs = DOUBLEREGS;
}
goto L1;
case OPd_u64:
if (I32 || I64)
{
cdd_u64(cdb,e,pretregs);
return;
}
retregs = DOUBLEREGS;
goto L1;
case OPu64_d:
if (*pretregs & mST0)
{
regm_t retregsx = I64 ? mAX : mAX|mDX;
codelem(cdb,e.EV.E1,&retregsx,false);
callclib(cdb,e,CLIB.u64_ldbl,pretregs,0);
return;
}
break;
case OPld_u64:
{
if (I32 || I64)
{
cdd_u64(cdb,e,pretregs);
return;
}
regm_t retregsx = mST0;
codelem(cdb,e.EV.E1,&retregsx,false);
callclib(cdb,e,CLIB.ld_u64,pretregs,0);
return;
}
default:
break;
}
}
retregs = regmask(e.EV.E1.Ety, TYnfunc);
L1:
codelem(cdb,e.EV.E1,&retregs,false);
for (int i = 0; 1; i++)
{
assert(i < clib.length);
if (clib[i][0] == e.Eoper)
{
callclib(cdb,e,clib[i][1],pretregs,0);
break;
}
}
}
/***************************
* Convert short to long.
* For OPs16_32, OPu16_32, OPnp_fp, OPu32_64, OPs32_64,
* OPu64_128, OPs64_128
*/
@trusted
void cdshtlng(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
reg_t reg;
regm_t retregs;
//printf("cdshtlng(e = %p, *pretregs = %s)\n", e, regm_str(*pretregs));
int e1comsub = e.EV.E1.Ecount;
ubyte op = e.Eoper;
if ((*pretregs & (ALLREGS | mBP)) == 0) // if don't need result in regs
{
codelem(cdb,e.EV.E1,pretregs,false); // then conversion isn't necessary
return;
}
else if (
op == OPnp_fp ||
(I16 && op == OPu16_32) ||
(I32 && op == OPu32_64) ||
(I64 && op == OPu64_128)
)
{
/* Result goes into a register pair.
* Zero extend by putting a zero into most significant reg.
*/
regm_t retregsx = *pretregs & mLSW;
assert(retregsx);
tym_t tym1 = tybasic(e.EV.E1.Ety);
codelem(cdb,e.EV.E1,&retregsx,false);
regm_t regm = *pretregs & (mMSW & ALLREGS);
if (regm == 0) // *pretregs could be mES
regm = mMSW & ALLREGS;
allocreg(cdb,®m,®,TYint);
if (e1comsub)
getregs(cdb,retregsx);
if (op == OPnp_fp)
{
int segreg;
// BUG: what about pointers to functions?
switch (tym1)
{
case TYimmutPtr:
case TYnptr: segreg = SEG_DS; break;
case TYcptr: segreg = SEG_CS; break;
case TYsptr: segreg = SEG_SS; break;
default: assert(0);
}
cdb.gen2(0x8C,modregrm(3,segreg,reg)); // MOV reg,segreg
}
else
movregconst(cdb,reg,0,0); // 0 extend
fixresult(cdb,e,retregsx | regm,pretregs);
return;
}
else if (I64 && op == OPu32_64)
{
elem *e1 = e.EV.E1;
retregs = *pretregs;
if (e1.Eoper == OPvar || (e1.Eoper == OPind && !e1.Ecount))
{
code cs;
allocreg(cdb,&retregs,®,TYint);
loadea(cdb,e1,&cs,LOD,reg,0,retregs,retregs); // MOV Ereg,EA
freenode(e1);
}
else
{
*pretregs &= ~mPSW; // flags are set by eval of e1
codelem(cdb,e1,&retregs,false);
/* Determine if high 32 bits are already 0
*/
if (e1.Eoper == OPu16_32 && !e1.Ecount)
{
}
else
{
// Zero high 32 bits
getregs(cdb,retregs);
reg = findreg(retregs);
// Don't use x89 because that will get optimized away
genregs(cdb,LOD,reg,reg); // MOV Ereg,Ereg
}
}
fixresult(cdb,e,retregs,pretregs);
return;
}
else if (I64 && op == OPs32_64 && OTrel(e.EV.E1.Eoper) && !e.EV.E1.Ecount)
{
/* Due to how e1 is calculated, the high 32 bits of the register
* are already 0.
*/
retregs = *pretregs;
codelem(cdb,e.EV.E1,&retregs,false);
fixresult(cdb,e,retregs,pretregs);
return;
}
else if (!I16 && (op == OPs16_32 || op == OPu16_32) ||
I64 && op == OPs32_64)
{
elem *e11;
elem *e1 = e.EV.E1;
if (e1.Eoper == OPu8_16 && !e1.Ecount &&
((e11 = e1.EV.E1).Eoper == OPvar || (e11.Eoper == OPind && !e11.Ecount))
)
{
code cs;
retregs = *pretregs & BYTEREGS;
if (!retregs)
retregs = BYTEREGS;
allocreg(cdb,&retregs,®,TYint);
movregconst(cdb,reg,0,0); // XOR reg,reg
loadea(cdb,e11,&cs,0x8A,reg,0,retregs,retregs); // MOV regL,EA
freenode(e11);
freenode(e1);
}
else if (e1.Eoper == OPvar ||
(e1.Eoper == OPind && !e1.Ecount))
{
code cs = void;
if (I32 && op == OPu16_32 && config.flags4 & CFG4speed)
goto L2;
retregs = *pretregs;
allocreg(cdb,&retregs,®,TYint);
const opcode = (op == OPu16_32) ? MOVZXw : MOVSXw; // MOVZX/MOVSX reg,EA
if (op == OPs32_64)
{
assert(I64);
// MOVSXD reg,e1
loadea(cdb,e1,&cs,0x63,reg,0,0,retregs);
code_orrex(cdb.last(), REX_W);
}
else
loadea(cdb,e1,&cs,opcode,reg,0,0,retregs);
freenode(e1);
}
else
{
L2:
retregs = *pretregs;
if (op == OPs32_64)
retregs = mAX | (*pretregs & mPSW);
*pretregs &= ~mPSW; // flags are already set
CodeBuilder cdbx;
cdbx.ctor();
codelem(cdbx,e1,&retregs,false);
code *cx = cdbx.finish();
cdb.append(cdbx);
getregs(cdb,retregs);
if (op == OPu16_32 && cx)
{
cx = code_last(cx);
if (cx.Iop == 0x81 && (cx.Irm & modregrm(3,7,0)) == modregrm(3,4,0) &&
mask(cx.Irm & 7) == retregs)
{
// Convert AND of a word to AND of a dword, zeroing upper word
if (cx.Irex & REX_B)
retregs = mask(8 | (cx.Irm & 7));
cx.Iflags &= ~CFopsize;
cx.IEV2.Vint &= 0xFFFF;
goto L1;
}
}
if (op == OPs16_32 && retregs == mAX)
cdb.gen1(0x98); // CWDE
else if (op == OPs32_64 && retregs == mAX)
{
cdb.gen1(0x98); // CDQE
code_orrex(cdb.last(), REX_W);
}
else
{
reg = findreg(retregs);
if (config.flags4 & CFG4speed && op == OPu16_32)
{ // AND reg,0xFFFF
cdb.genc2(0x81,modregrmx(3,4,reg),0xFFFFu);
}
else
{
opcode_t iop = (op == OPu16_32) ? MOVZXw : MOVSXw; // MOVZX/MOVSX reg,reg
genregs(cdb,iop,reg,reg);
}
}
L1:
if (e1comsub)
getregs(cdb,retregs);
}
fixresult(cdb,e,retregs,pretregs);
return;
}
else if (*pretregs & mPSW || config.target_cpu < TARGET_80286)
{
// OPs16_32, OPs32_64
// CWD doesn't affect flags, so we can depend on the integer
// math to provide the flags.
retregs = mAX | mPSW; // want integer result in AX
*pretregs &= ~mPSW; // flags are already set
codelem(cdb,e.EV.E1,&retregs,false);
getregs(cdb,mDX); // sign extend into DX
cdb.gen1(0x99); // CWD/CDQ
if (e1comsub)
getregs(cdb,retregs);
fixresult(cdb,e,mDX | retregs,pretregs);
return;
}
else
{
// OPs16_32, OPs32_64, OPs64_128
uint msreg,lsreg;
retregs = *pretregs & mLSW;
assert(retregs);
codelem(cdb,e.EV.E1,&retregs,false);
retregs |= *pretregs & mMSW;
allocreg(cdb,&retregs,®,e.Ety);
msreg = findregmsw(retregs);
lsreg = findreglsw(retregs);
genmovreg(cdb,msreg,lsreg); // MOV msreg,lsreg
assert(config.target_cpu >= TARGET_80286); // 8088 can't handle SAR reg,imm8
cdb.genc2(0xC1,modregrm(3,7,msreg),REGSIZE * 8 - 1); // SAR msreg,31
fixresult(cdb,e,retregs,pretregs);
return;
}
}
/***************************
* Convert byte to int.
* For OPu8_16 and OPs8_16.
*/
@trusted
void cdbyteint(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
regm_t retregs;
char size;
if ((*pretregs & (ALLREGS | mBP)) == 0) // if don't need result in regs
{
codelem(cdb,e.EV.E1,pretregs,false); // then conversion isn't necessary
return;
}
//printf("cdbyteint(e = %p, *pretregs = %s\n", e, regm_str(*pretregs));
char op = e.Eoper;
elem *e1 = e.EV.E1;
if (e1.Eoper == OPcomma)
docommas(cdb,&e1);
if (!I16)
{
if (e1.Eoper == OPvar || (e1.Eoper == OPind && !e1.Ecount))
{
code cs;
regm_t retregsx = *pretregs;
reg_t reg;
allocreg(cdb,&retregsx,®,TYint);
if (config.flags4 & CFG4speed &&
op == OPu8_16 && mask(reg) & BYTEREGS &&
config.target_cpu < TARGET_PentiumPro)
{
movregconst(cdb,reg,0,0); // XOR reg,reg
loadea(cdb,e1,&cs,0x8A,reg,0,retregsx,retregsx); // MOV regL,EA
}
else
{
const opcode = (op == OPu8_16) ? MOVZXb : MOVSXb; // MOVZX/MOVSX reg,EA
loadea(cdb,e1,&cs,opcode,reg,0,0,retregsx);
}
freenode(e1);
fixresult(cdb,e,retregsx,pretregs);
return;
}
size = tysize(e.Ety);
retregs = *pretregs & BYTEREGS;
if (retregs == 0)
retregs = BYTEREGS;
retregs |= *pretregs & mPSW;
*pretregs &= ~mPSW;
}
else
{
if (op == OPu8_16) // if uint conversion
{
retregs = *pretregs & BYTEREGS;
if (retregs == 0)
retregs = BYTEREGS;
}
else
{
// CBW doesn't affect flags, so we can depend on the integer
// math to provide the flags.
retregs = mAX | (*pretregs & mPSW); // want integer result in AX
}
}
CodeBuilder cdb1;
cdb1.ctor();
codelem(cdb1,e1,&retregs,false);
code *c1 = cdb1.finish();
cdb.append(cdb1);
reg_t reg = findreg(retregs);
code *c;
if (!c1)
goto L1;
// If previous instruction is an AND bytereg,value
c = cdb.last();
if (c.Iop == 0x80 && c.Irm == modregrm(3,4,reg & 7) &&
(op == OPu8_16 || (c.IEV2.Vuns & 0x80) == 0))
{
if (*pretregs & mPSW)
c.Iflags |= CFpsw;
c.Iop |= 1; // convert to word operation
c.IEV2.Vuns &= 0xFF; // dump any high order bits
*pretregs &= ~mPSW; // flags already set
}
else
{
L1:
if (!I16)
{
if (op == OPs8_16 && reg == AX && size == 2)
{
cdb.gen1(0x98); // CBW
cdb.last().Iflags |= CFopsize; // don't do a CWDE
}
else
{
// We could do better by not forcing the src and dst
// registers to be the same.
if (config.flags4 & CFG4speed && op == OPu8_16)
{ // AND reg,0xFF
cdb.genc2(0x81,modregrmx(3,4,reg),0xFF);
}
else
{
opcode_t iop = (op == OPu8_16) ? MOVZXb : MOVSXb; // MOVZX/MOVSX reg,reg
genregs(cdb,iop,reg,reg);
if (I64 && reg >= 4)
code_orrex(cdb.last(), REX);
}
}
}
else
{
if (op == OPu8_16)
genregs(cdb,0x30,reg+4,reg+4); // XOR regH,regH
else
{
cdb.gen1(0x98); // CBW
*pretregs &= ~mPSW; // flags already set
}
}
}
getregs(cdb,retregs);
fixresult(cdb,e,retregs,pretregs);
}
/***************************
* Convert long to short (OP32_16).
* Get offset of far pointer (OPoffset).
* Convert int to byte (OP16_8).
* Convert long long to long (OP64_32).
* OP128_64
*/
@trusted
void cdlngsht(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
debug
{
switch (e.Eoper)
{
case OP32_16:
case OPoffset:
case OP16_8:
case OP64_32:
case OP128_64:
break;
default:
assert(0);
}
}
regm_t retregs;
if (e.Eoper == OP16_8)
{
retregs = *pretregs ? BYTEREGS : 0;
codelem(cdb,e.EV.E1,&retregs,false);
}
else
{
if (e.EV.E1.Eoper == OPrelconst)
offsetinreg(cdb,e.EV.E1,&retregs);
else
{
retregs = *pretregs ? ALLREGS : 0;
codelem(cdb,e.EV.E1,&retregs,false);
bool isOff = e.Eoper == OPoffset;
if (I16 ||
I32 && (isOff || e.Eoper == OP64_32) ||
I64 && (isOff || e.Eoper == OP128_64))
retregs &= mLSW; // want LSW only
}
}
/* We "destroy" a reg by assigning it the result of a new e, even
* though the values are the same. Weakness of our CSE strategy that
* a register can only hold the contents of one elem at a time.
*/
if (e.Ecount)
getregs(cdb,retregs);
else
useregs(retregs);
debug
if (!(!*pretregs || retregs))
{
printf("%s *pretregs = %s, retregs = %s, e = %p\n",oper_str(e.Eoper),regm_str(*pretregs),regm_str(retregs),e);
}
assert(!*pretregs || retregs);
fixresult(cdb,e,retregs,pretregs); // lsw only
}
/**********************************************
* Get top 32 bits of 64 bit value (I32)
* or top 16 bits of 32 bit value (I16)
* or top 64 bits of 128 bit value (I64).
* OPmsw
*/
@trusted
void cdmsw(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
assert(e.Eoper == OPmsw);
regm_t retregs = *pretregs ? ALLREGS : 0;
codelem(cdb,e.EV.E1,&retregs,false);
retregs &= mMSW; // want MSW only
/* We "destroy" a reg by assigning it the result of a new e, even
* though the values are the same. Weakness of our CSE strategy that
* a register can only hold the contents of one elem at a time.
*/
if (e.Ecount)
getregs(cdb,retregs);
else
useregs(retregs);
debug
if (!(!*pretregs || retregs))
{
printf("%s *pretregs = %s, retregs = %s\n",oper_str(e.Eoper),regm_str(*pretregs),regm_str(retregs));
elem_print(e);
}
assert(!*pretregs || retregs);
fixresult(cdb,e,retregs,pretregs); // msw only
}
/******************************
* Handle operators OPinp and OPoutp.
*/
@trusted
void cdport(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
//printf("cdport\n");
ubyte op = 0xE4; // root of all IN/OUT opcodes
elem *e1 = e.EV.E1;
// See if we can use immediate mode of IN/OUT opcodes
ubyte port;
if (e1.Eoper == OPconst && e1.EV.Vuns <= 255 &&
(!evalinregister(e1) || regcon.mvar & mDX))
{
port = cast(ubyte)e1.EV.Vuns;
freenode(e1);
}
else
{
regm_t retregs = mDX; // port number is always DX
codelem(cdb,e1,&retregs,false);
op |= 0x08; // DX version of opcode
port = 0; // not logically needed, but
// quiets "uninitialized var" complaints
}
uint sz;
if (e.Eoper == OPoutp)
{
sz = tysize(e.EV.E2.Ety);
regm_t retregs = mAX; // byte/word to output is in AL/AX
scodelem(cdb,e.EV.E2,&retregs,((op & 0x08) ? mDX : 0),true);
op |= 0x02; // OUT opcode
}
else // OPinp
{
getregs(cdb,mAX);
sz = tysize(e.Ety);
}
if (sz != 1)
op |= 1; // word operation
cdb.genc2(op,0,port); // IN/OUT AL/AX,DX/port
if (op & 1 && sz != REGSIZE) // if need size override
cdb.last().Iflags |= CFopsize;
regm_t retregs = mAX;
fixresult(cdb,e,retregs,pretregs);
}
/************************
* Generate code for an asm elem.
*/
@trusted
void cdasm(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
// Assume only regs normally destroyed by a function are destroyed
getregs(cdb,(ALLREGS | mES) & ~fregsaved);
cdb.genasm(cast(char *)e.EV.Vstring, cast(uint) e.EV.Vstrlen);
fixresult(cdb,e,(I16 ? mDX | mAX : mAX),pretregs);
}
/************************
* Generate code for OPnp_f16p and OPf16p_np.
*/
@trusted
void cdfar16(ref CodeBuilder cdb, elem *e, regm_t *pretregs)
{
code *cnop;
code cs;
assert(I32);
codelem(cdb,e.EV.E1,pretregs,false);
reg_t reg = findreg(*pretregs);
getregs(cdb,*pretregs); // we will destroy the regs
cs.Iop = 0xC1;
cs.Irm = modregrm(3,0,reg);
cs.Iflags = 0;
cs.Irex = 0;
cs.IFL2 = FLconst;
cs.IEV2.Vuns = 16;
cdb.gen(&cs); // ROL ereg,16
cs.Irm |= modregrm(0,1,0);
cdb.gen(&cs); // ROR ereg,16
cs.IEV2.Vuns = 3;
cs.Iflags |= CFopsize;
if (e.Eoper == OPnp_f16p)
{
/* OR ereg,ereg
JE L1
ROR ereg,16
SHL reg,3
MOV rx,SS
AND rx,3 ;mask off CPL bits
OR rl,4 ;run on LDT bit
OR regl,rl
ROL ereg,16
L1: NOP
*/
reg_t rx;
regm_t retregs = BYTEREGS & ~*pretregs;
allocreg(cdb,&retregs,&rx,TYint);
cnop = gennop(null);
int jop = JCXZ;
if (reg != CX)
{
gentstreg(cdb,reg);
jop = JE;
}
genjmp(cdb,jop,FLcode, cast(block *)cnop); // Jop L1
NEWREG(cs.Irm,4);
cdb.gen(&cs); // SHL reg,3
genregs(cdb,0x8C,2,rx); // MOV rx,SS
int isbyte = (mask(reg) & BYTEREGS) == 0;
cdb.genc2(0x80 | isbyte,modregrm(3,4,rx),3); // AND rl,3
cdb.genc2(0x80,modregrm(3,1,rx),4); // OR rl,4
genregs(cdb,0x0A | isbyte,reg,rx); // OR regl,rl
}
else // OPf16p_np
{
/* ROR ereg,16
SHR reg,3
ROL ereg,16
*/
cs.Irm |= modregrm(0,5,0);
cdb.gen(&cs); // SHR reg,3
cnop = null;
}
}
/*************************
* Generate code for OPbtst
*/
@trusted
void cdbtst(ref CodeBuilder cdb, elem *e, regm_t *pretregs)
{
regm_t retregs;
reg_t reg;
//printf("cdbtst(e = %p, *pretregs = %s\n", e, regm_str(*pretregs));
opcode_t op = 0xA3; // BT EA,value
int mode = 4;
elem *e1 = e.EV.E1;
elem *e2 = e.EV.E2;
code cs;
cs.Iflags = 0;
if (*pretregs == 0) // if don't want result
{
codelem(cdb,e1,pretregs,false); // eval left leaf
*pretregs = 0; // in case they got set
codelem(cdb,e2,pretregs,false);
return;
}
regm_t idxregs;
if ((e1.Eoper == OPind && !e1.Ecount) || e1.Eoper == OPvar)
{
getlvalue(cdb, &cs, e1, RMload); // get addressing mode
idxregs = idxregm(&cs); // mask if index regs used
}
else
{
retregs = tysize(e1.Ety) == 1 ? BYTEREGS : allregs;
codelem(cdb,e1, &retregs, false);
reg = findreg(retregs);
cs.Irm = modregrm(3,0,reg & 7);
cs.Iflags = 0;
cs.Irex = 0;
if (reg & 8)
cs.Irex |= REX_B;
idxregs = retregs;
}
tym_t ty1 = tybasic(e1.Ety);
const sz = tysize(e1.Ety);
ubyte word = (!I16 && _tysize[ty1] == SHORTSIZE) ? CFopsize : 0;
// if (e2.Eoper == OPconst && e2.EV.Vuns < 0x100) // should do this instead?
if (e2.Eoper == OPconst)
{
cs.Iop = 0x0FBA; // BT rm,imm8
cs.Irm |= modregrm(0,mode,0);
cs.Iflags |= CFpsw | word;
cs.IFL2 = FLconst;
if (sz <= SHORTSIZE)
{
cs.IEV2.Vint = e2.EV.Vint & 15;
}
else if (sz == 4)
{
cs.IEV2.Vint = e2.EV.Vint & 31;
}
else
{
cs.IEV2.Vint = e2.EV.Vint & 63;
if (I64)
cs.Irex |= REX_W;
}
cdb.gen(&cs);
}
else
{
retregs = ALLREGS & ~idxregs;
/* A register variable may not have its upper 32
* bits 0, so pick a different register to force
* a MOV which will clear it
*/
if (I64 && sz == 8 && tysize(e2.Ety) == 4)
{
regm_t rregm;
if (isregvar(e2, &rregm, null))
retregs &= ~rregm;
}
scodelem(cdb,e2,&retregs,idxregs,true);
reg = findreg(retregs);
cs.Iop = 0x0F00 | op; // BT rm,reg
code_newreg(&cs,reg);
cs.Iflags |= CFpsw | word;
if (I64 && _tysize[ty1] == 8)
cs.Irex |= REX_W;
cdb.gen(&cs);
}
if ((retregs = (*pretregs & (ALLREGS | mBP))) != 0) // if return result in register
{
if (tysize(e.Ety) == 1)
{
assert(I64 || retregs & BYTEREGS);
allocreg(cdb,&retregs,®,TYint);
cdb.gen2(0x0F92,modregrmx(3,0,reg)); // SETC reg
if (I64 && reg >= 4)
code_orrex(cdb.last(), REX);
*pretregs = retregs;
}
else
{
code *cnop = null;
regm_t save = regcon.immed.mval;
allocreg(cdb,&retregs,®,TYint);
regcon.immed.mval = save;
if ((*pretregs & mPSW) == 0)
{
getregs(cdb,retregs);
genregs(cdb,0x19,reg,reg); // SBB reg,reg
cdb.gen2(0xF7,modregrmx(3,3,reg)); // NEG reg
}
else
{
movregconst(cdb,reg,1,8); // MOV reg,1
cnop = gennop(null);
genjmp(cdb,JC,FLcode, cast(block *) cnop); // Jtrue nop
// MOV reg,0
movregconst(cdb,reg,0,8);
regcon.immed.mval &= ~mask(reg);
}
*pretregs = retregs;
cdb.append(cnop);
}
}
}
/*************************
* Generate code for OPbt, OPbtc, OPbtr, OPbts
*/
@trusted
void cdbt(ref CodeBuilder cdb,elem *e, regm_t *pretregs)
{
//printf("cdbt(%p, %s)\n", e, regm_str(*pretregs));
regm_t retregs;
reg_t reg;
opcode_t op;
int mode;
switch (e.Eoper)
{
case OPbt: op = 0xA3; mode = 4; break;
case OPbtc: op = 0xBB; mode = 7; break;
case OPbtr: op = 0xB3; mode = 6; break;
case OPbts: op = 0xAB; mode = 5; break;
default:
assert(0);
}
elem *e1 = e.EV.E1;
elem *e2 = e.EV.E2;
code cs;
cs.Iflags = 0;
getlvalue(cdb, &cs, e, RMload); // get addressing mode
if (e.Eoper == OPbt && *pretregs == 0)
{
codelem(cdb,e2,pretregs,false);
return;
}
const ty1 = tybasic(e1.Ety);
const ty2 = tybasic(e2.Ety);
ubyte word = (!I16 && _tysize[ty1] == SHORTSIZE) ? CFopsize : 0;
regm_t idxregs = idxregm(&cs); // mask if index regs used
// if (e2.Eoper == OPconst && e2.EV.Vuns < 0x100) // should do this instead?
if (e2.Eoper == OPconst)
{
cs.Iop = 0x0FBA; // BT rm,imm8
cs.Irm |= modregrm(0,mode,0);
cs.Iflags |= CFpsw | word;
cs.IFL2 = FLconst;
if (_tysize[ty1] == SHORTSIZE)
{
cs.IEV1.Voffset += (e2.EV.Vuns & ~15) >> 3;
cs.IEV2.Vint = e2.EV.Vint & 15;
}
else if (_tysize[ty1] == 4)
{
cs.IEV1.Voffset += (e2.EV.Vuns & ~31) >> 3;
cs.IEV2.Vint = e2.EV.Vint & 31;
}
else
{
cs.IEV1.Voffset += (e2.EV.Vuns & ~63) >> 3;
cs.IEV2.Vint = e2.EV.Vint & 63;
if (I64)
cs.Irex |= REX_W;
}
cdb.gen(&cs);
}
else
{
retregs = ALLREGS & ~idxregs;
scodelem(cdb,e2,&retregs,idxregs,true);
reg = findreg(retregs);
cs.Iop = 0x0F00 | op; // BT rm,reg
code_newreg(&cs,reg);
cs.Iflags |= CFpsw | word;
if (_tysize[ty2] == 8 && I64)
cs.Irex |= REX_W;
cdb.gen(&cs);
}
if ((retregs = (*pretregs & (ALLREGS | mBP))) != 0) // if return result in register
{
if (_tysize[e.Ety] == 1)
{
assert(I64 || retregs & BYTEREGS);
allocreg(cdb,&retregs,®,TYint);
cdb.gen2(0x0F92,modregrmx(3,0,reg)); // SETC reg
if (I64 && reg >= 4)
code_orrex(cdb.last(), REX);
*pretregs = retregs;
}
else
{
code *cnop = null;
const save = regcon.immed.mval;
allocreg(cdb,&retregs,®,TYint);
regcon.immed.mval = save;
if ((*pretregs & mPSW) == 0)
{
getregs(cdb,retregs);
genregs(cdb,0x19,reg,reg); // SBB reg,reg
cdb.gen2(0xF7,modregrmx(3,3,reg)); // NEG reg
}
else
{
movregconst(cdb,reg,1,8); // MOV reg,1
cnop = gennop(null);
genjmp(cdb,JC,FLcode, cast(block *) cnop); // Jtrue nop
// MOV reg,0
movregconst(cdb,reg,0,8);
regcon.immed.mval &= ~mask(reg);
}
*pretregs = retregs;
cdb.append(cnop);
}
}
}
/*************************************
* Generate code for OPbsf and OPbsr.
*/
@trusted
void cdbscan(ref CodeBuilder cdb, elem *e, regm_t *pretregs)
{
//printf("cdbscan()\n");
//elem_print(e);
if (!*pretregs)
{
codelem(cdb,e.EV.E1,pretregs,false);
return;
}
const tyml = tybasic(e.EV.E1.Ety);
const sz = _tysize[tyml];
assert(sz == 2 || sz == 4 || sz == 8);
code cs = void;
if ((e.EV.E1.Eoper == OPind && !e.EV.E1.Ecount) || e.EV.E1.Eoper == OPvar)
{
getlvalue(cdb, &cs, e.EV.E1, RMload); // get addressing mode
}
else
{
regm_t retregs = allregs;
codelem(cdb,e.EV.E1, &retregs, false);
const reg = findreg(retregs);
cs.Irm = modregrm(3,0,reg & 7);
cs.Iflags = 0;
cs.Irex = 0;
if (reg & 8)
cs.Irex |= REX_B;
}
regm_t retregs = *pretregs & allregs;
if (!retregs)
retregs = allregs;
reg_t reg;
allocreg(cdb,&retregs, ®, e.Ety);
cs.Iop = (e.Eoper == OPbsf) ? 0x0FBC : 0x0FBD; // BSF/BSR reg,EA
code_newreg(&cs, reg);
if (!I16 && sz == SHORTSIZE)
cs.Iflags |= CFopsize;
cdb.gen(&cs);
if (sz == 8)
code_orrex(cdb.last(), REX_W);
fixresult(cdb,e,retregs,pretregs);
}
/************************
* OPpopcnt operator
*/
@trusted
void cdpopcnt(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
//printf("cdpopcnt()\n");
//elem_print(e);
assert(!I16);
if (!*pretregs)
{
codelem(cdb,e.EV.E1,pretregs,false);
return;
}
const tyml = tybasic(e.EV.E1.Ety);
const sz = _tysize[tyml];
assert(sz == 2 || sz == 4 || (sz == 8 && I64)); // no byte op
code cs = void;
if ((e.EV.E1.Eoper == OPind && !e.EV.E1.Ecount) || e.EV.E1.Eoper == OPvar)
{
getlvalue(cdb, &cs, e.EV.E1, RMload); // get addressing mode
}
else
{
regm_t retregs = allregs;
codelem(cdb,e.EV.E1, &retregs, false);
const reg = findreg(retregs);
cs.Irm = modregrm(3,0,reg & 7);
cs.Iflags = 0;
cs.Irex = 0;
if (reg & 8)
cs.Irex |= REX_B;
}
regm_t retregs = *pretregs & allregs;
if (!retregs)
retregs = allregs;
reg_t reg;
allocreg(cdb,&retregs, ®, e.Ety);
cs.Iop = POPCNT; // POPCNT reg,EA
code_newreg(&cs, reg);
if (sz == SHORTSIZE)
cs.Iflags |= CFopsize;
if (*pretregs & mPSW)
cs.Iflags |= CFpsw;
cdb.gen(&cs);
if (sz == 8)
code_orrex(cdb.last(), REX_W);
*pretregs &= mBP | ALLREGS; // flags already set
fixresult(cdb,e,retregs,pretregs);
}
/*******************************************
* Generate code for OPpair, OPrpair.
*/
@trusted
void cdpair(ref CodeBuilder cdb, elem *e, regm_t *pretregs)
{
if (*pretregs == 0) // if don't want result
{
codelem(cdb,e.EV.E1,pretregs,false); // eval left leaf
*pretregs = 0; // in case they got set
codelem(cdb,e.EV.E2,pretregs,false);
return;
}
//printf("\ncdpair(e = %p, *pretregs = %s)\n", e, regm_str(*pretregs));
//WRTYxx(e.Ety);printf("\n");
//printf("Ecount = %d\n", e.Ecount);
regm_t retregs = *pretregs;
if (retregs == mPSW && tycomplex(e.Ety) && config.inline8087)
{
if (config.fpxmmregs)
retregs |= mXMM0 | mXMM1;
else
retregs |= mST01;
}
if (retregs & mST01)
{
loadPair87(cdb, e, pretregs);
return;
}
regm_t regs1;
regm_t regs2;
if (retregs & XMMREGS)
{
retregs &= XMMREGS;
const reg = findreg(retregs);
regs1 = mask(reg);
regs2 = mask(findreg(retregs & ~regs1));
}
else
{
retregs &= allregs;
if (!retregs)
retregs = allregs;
regs1 = retregs & mLSW;
regs2 = retregs & mMSW;
}
if (e.Eoper == OPrpair)
{
// swap
regs1 ^= regs2;
regs2 ^= regs1;
regs1 ^= regs2;
}
//printf("1: regs1 = %s, regs2 = %s\n", regm_str(regs1), regm_str(regs2));
codelem(cdb,e.EV.E1, ®s1, false);
scodelem(cdb,e.EV.E2, ®s2, regs1, false);
if (e.EV.E1.Ecount)
getregs(cdb,regs1);
if (e.EV.E2.Ecount)
getregs(cdb,regs2);
fixresult(cdb,e,regs1 | regs2,pretregs);
}
/*************************
* Generate code for OPcmpxchg
*/
@trusted
void cdcmpxchg(ref CodeBuilder cdb, elem *e, regm_t *pretregs)
{
/* The form is:
* OPcmpxchg
* / \
* lvalue OPparam
* / \
* old new
*/
//printf("cdmulass(e=%p, *pretregs = %s)\n",e,regm_str(*pretregs));
elem *e1 = e.EV.E1;
elem *e2 = e.EV.E2;
assert(e2.Eoper == OPparam);
assert(!e2.Ecount);
const tyml = tybasic(e1.Ety); // type of lvalue
const sz = _tysize[tyml];
if (I32 && sz == 8)
{
regm_t retregsx = mDX|mAX;
codelem(cdb,e2.EV.E1,&retregsx,false); // [DX,AX] = e2.EV.E1
regm_t retregs = mCX|mBX;
scodelem(cdb,e2.EV.E2,&retregs,mDX|mAX,false); // [CX,BX] = e2.EV.E2
code cs = void;
getlvalue(cdb,&cs,e1,mCX|mBX|mAX|mDX); // get EA
getregs(cdb,mDX|mAX); // CMPXCHG destroys these regs
if (e1.Ety & mTYvolatile)
cdb.gen1(LOCK); // LOCK prefix
cs.Iop = 0x0FC7; // CMPXCHG8B EA
cs.Iflags |= CFpsw;
code_newreg(&cs,1);
cdb.gen(&cs);
assert(!e1.Ecount);
freenode(e1);
}
else
{
const uint isbyte = (sz == 1); // 1 for byte operation
const ubyte word = (!I16 && sz == SHORTSIZE) ? CFopsize : 0;
const uint rex = (I64 && sz == 8) ? REX_W : 0;
regm_t retregsx = mAX;
codelem(cdb,e2.EV.E1,&retregsx,false); // AX = e2.EV.E1
regm_t retregs = (ALLREGS | mBP) & ~mAX;
scodelem(cdb,e2.EV.E2,&retregs,mAX,false); // load rvalue in reg
code cs = void;
getlvalue(cdb,&cs,e1,mAX | retregs); // get EA
getregs(cdb,mAX); // CMPXCHG destroys AX
if (e1.Ety & mTYvolatile)
cdb.gen1(LOCK); // LOCK prefix
cs.Iop = 0x0FB1 ^ isbyte; // CMPXCHG EA,reg
cs.Iflags |= CFpsw | word;
cs.Irex |= rex;
const reg = findreg(retregs);
code_newreg(&cs,reg);
cdb.gen(&cs);
assert(!e1.Ecount);
freenode(e1);
}
if (regm_t retregs = *pretregs & (ALLREGS | mBP)) // if return result in register
{
assert(tysize(e.Ety) == 1);
assert(I64 || retregs & BYTEREGS);
reg_t reg;
allocreg(cdb,&retregs,®,TYint);
uint ea = modregrmx(3,0,reg);
if (I64 && reg >= 4)
ea |= REX << 16;
cdb.gen2(0x0F94,ea); // SETZ reg
*pretregs = retregs;
}
}
/*************************
* Generate code for OPprefetch
*/
@trusted
void cdprefetch(ref CodeBuilder cdb, elem *e, regm_t *pretregs)
{
/* Generate the following based on e2:
* 0: prefetch0
* 1: prefetch1
* 2: prefetch2
* 3: prefetchnta
* 4: prefetchw
* 5: prefetchwt1
*/
//printf("cdprefetch\n");
elem *e1 = e.EV.E1;
assert(*pretregs == 0);
assert(e.EV.E2.Eoper == OPconst);
opcode_t op;
reg_t reg;
switch (e.EV.E2.EV.Vuns)
{
case 0: op = PREFETCH; reg = 1; break; // PREFETCH0
case 1: op = PREFETCH; reg = 2; break; // PREFETCH1
case 2: op = PREFETCH; reg = 3; break; // PREFETCH2
case 3: op = PREFETCH; reg = 0; break; // PREFETCHNTA
case 4: op = 0x0F0D; reg = 1; break; // PREFETCHW
case 5: op = 0x0F0D; reg = 2; break; // PREFETCHWT1
default: assert(0);
}
freenode(e.EV.E2);
code cs = void;
getlvalue(cdb,&cs,e1,0);
cs.Iop = op;
cs.Irm |= modregrm(0,reg,0);
cs.Iflags |= CFvolatile; // do not schedule
cdb.gen(&cs);
}
/*********************
* Load register from EA of assignment operation.
* Params:
* cdb = store generated code here
* cs = instruction with EA already set in it
* e = assignment expression that will be evaluated
* reg = set to register loaded from EA
* retregs = register candidates for reg
*/
@trusted
private
void opAssLoadReg(ref CodeBuilder cdb, ref code cs, elem* e, out reg_t reg, regm_t retregs)
{
modEA(cdb, &cs);
allocreg(cdb,&retregs,®,TYoffset);
cs.Iop = LOD;
code_newreg(&cs,reg);
cdb.gen(&cs); // MOV reg,EA
}
/*********************
* Load register pair from EA of assignment operation.
* Params:
* cdb = store generated code here
* cs = instruction with EA already set in it
* e = assignment expression that will be evaluated
* rhi = set to most significant register of the pair
* rlo = set toleast significant register of the pair
* retregs = register candidates for rhi, rlo
* keepmsk = registers to not modify
*/
@trusted
private
void opAssLoadPair(ref CodeBuilder cdb, ref code cs, elem* e, out reg_t rhi, out reg_t rlo, regm_t retregs, regm_t keepmsk)
{
getlvalue(cdb,&cs,e.EV.E1,retregs | keepmsk);
const tym_t tyml = tybasic(e.EV.E1.Ety); // type of lvalue
reg_t reg;
allocreg(cdb,&retregs,®,tyml);
rhi = findregmsw(retregs);
rlo = findreglsw(retregs);
cs.Iop = LOD;
code_newreg(&cs,rlo);
cdb.gen(&cs); // MOV rlo,EA
getlvalue_msw(&cs);
code_newreg(&cs,rhi);
cdb.gen(&cs); // MOV rhi,EA+2
getlvalue_lsw(&cs);
}
/*********************************************************
* Store register result of assignment operation EA.
* Params:
* cdb = store generated code here
* cs = instruction with EA already set in it
* e = assignment expression that was evaluated
* reg = register of result
* pretregs = registers to store result in
*/
@trusted
private
void opAssStoreReg(ref CodeBuilder cdb, ref code cs, elem* e, reg_t reg, regm_t* pretregs)
{
elem* e1 = e.EV.E1;
const tym_t tyml = tybasic(e1.Ety); // type of lvalue
const uint sz = _tysize[tyml];
const ubyte isbyte = (sz == 1); // 1 for byte operation
cs.Iop = STO ^ isbyte;
code_newreg(&cs,reg);
cdb.gen(&cs); // MOV EA,resreg
if (e1.Ecount) // if we gen a CSE
cssave(e1,mask(reg),!OTleaf(e1.Eoper));
freenode(e1);
fixresult(cdb,e,mask(reg),pretregs);
}
/*********************************************************
* Store register pair result of assignment operation EA.
* Params:
* cdb = store generated code here
* cs = instruction with EA already set in it
* e = assignment expression that was evaluated
* rhi = most significant register of the pair
* rlo = least significant register of the pair
* pretregs = registers to store result in
*/
@trusted
private
void opAssStorePair(ref CodeBuilder cdb, ref code cs, elem* e, reg_t rhi, reg_t rlo, regm_t* pretregs)
{
cs.Iop = STO;
code_newreg(&cs,rlo);
cdb.gen(&cs); // MOV EA,lsreg
code_newreg(&cs,rhi);
getlvalue_msw(&cs);
cdb.gen(&cs); // MOV EA+REGSIZE,msreg
const regm_t retregs = mask(rhi) | mask(rlo);
elem* e1 = e.EV.E1;
if (e1.Ecount) // if we gen a CSE
cssave(e1,retregs,!OTleaf(e1.Eoper));
freenode(e1);
fixresult(cdb,e,retregs,pretregs);
}
}
| D |
module trajic.all;
public import trajic.predictor;
public import trajic.lfd;
public import trajic.minihuff;
public import trajic.util;
public import trajic.stream;
public import trajic.gpspoint;
public import trajic.gpsreader;
public import trajic.gpscompressor;
public import trajic.gpspredictor;
| D |
version https://git-lfs.github.com/spec/v1
oid sha256:e3f4ca62653ba6f274384b925aa01502b34f0bd52827f83ea2c206c717d82354
size 2982
| D |
module kurikame.scripts;
import kurikame.ircsocket;
import kurikame.log;
import kurikame.message;
import std.algorithm;
import std.string;
public void loadScripts(IrcSocket socket)
{
scripts ~= new EchoScript(socket);
// load up lua ;3
}
public void processWithScripts(Message message)
{
foreach (Script s; scripts)
{
if(s.Process(message))
{
break;
}
}
}
private Script[] scripts;
// Base class of scripts
private abstract class Script
{
protected:
IrcSocket socket;
// Maybe this is a bad idea?
@property abstract string keyword();
@property abstract bool adminOnly();
abstract void doWork(Message message);
public:
this(IrcSocket socket)
{
this.socket = socket;
}
bool Process(Message message)
{
if (message.MessageBody.indexOf(keyword) == 0)
{
doWork(message);
return true;
}
return false;
}
}
// TODO : Add lua script support
// Any hardcoded message scripts can be added below
private class EchoScript : Script
{
protected:
@property override string keyword()
{
return "kuriecho";
}
@property override bool adminOnly()
{
return false;
}
override void doWork(Message message)
{
if (message.Type == MessageType.PrivateMessage)
{
socket.SendMessage(message.Destination, message.MessageBody);
}
}
public:
this(IrcSocket socket)
{
super(socket);
}
}
| D |
module tests.optional;
import optional.optional;
import std.meta: AliasSeq;
import std.stdio: writeln;
import std.algorithm: equal;
alias QualifiedAlisesOf(T) = AliasSeq!(T, const T, immutable T);
alias OptionalsOfQualified(T) = AliasSeq!(Optional!T, Optional!(const T), Optional!(immutable T));
alias QualifiedOptionalsOfQualified(T) = AliasSeq!(QualifiedAlisesOf!(Optional!T), OptionalsOfQualified!T);
private enum isObject(T) = is(T == class) || is(T == interface);
import std.range, std.traits;
@("Should allow equalify with all qualifiers")
@nogc @safe unittest {
foreach (T; QualifiedOptionalsOfQualified!int) {
auto a = T();
auto b = T(3);
auto c = T(4);
assert(a == none);
assert(b == b);
assert(b != c);
assert(c == 4);
}
}
@("Should wotk with opUnary, opBinary, and opRightBinary")
@nogc @safe unittest {
import std.meta: AliasSeq;
import std.traits: isMutable;
import std.range: ElementType;
foreach (T; QualifiedOptionalsOfQualified!int) {
T a = 10;
T b = none;
static assert(!__traits(compiles, { int x = a; }));
static assert(!__traits(compiles, { void func(int n){} func(a); }));
assert(a == 10);
assert(b == none);
assert(a != 20);
assert(a != none);
assert((+a) == some(10));
assert((-b) == none);
assert((-a) == some(-10));
assert((+b) == none);
assert((-b) == none);
assert((a + 10) == some(20));
assert((b + 10) == none);
assert((a - 5) == some(5));
assert((b - 5) == none);
assert((a * 20) == some(200));
assert((b * 20) == none);
assert((a / 2) == some(5));
assert((b / 2) == none);
assert((10 + a) == some(20));
assert((10 + b) == none);
assert((15 - a) == some(5));
assert((15 - b) == none);
assert((20 * a) == some(200));
assert((20 * b) == none);
assert((50 / a) == some(5));
assert((50 / b) == none);
static if (isMutable!(ElementType!T) && isMutable!(T)) {
assert((++a) == some(11));
assert((a++) == some(11));
assert(a == some(12));
assert((--a) == some(11));
assert((a--) == some(11));
assert(a == some(10));
a = a;
assert(a == some(10));
a = 20;
assert(a == some(20));
} else {
static assert(!__traits(compiles, { ++a; }));
static assert(!__traits(compiles, { a++; }));
static assert(!__traits(compiles, { --a; }));
static assert(!__traits(compiles, { a--; }));
static assert(!__traits(compiles, { a = a; }));
static assert(!__traits(compiles, { a = 20; }));
}
}
}
@("Should be mappable")
@safe unittest {
import std.algorithm: map;
import std.conv: to;
auto a = some(10);
auto b = no!int;
assert(a.map!(to!double).equal([10.0]));
assert(b.map!(to!double).empty);
}
@("Should have opBinary return an optional")
@nogc @safe unittest {
auto a = some(3);
assert(a + 3 == some(6));
auto b = no!int;
assert(b + 3 == none);
}
@("Should allow equality and opAssign between all qualified combinations")
@nogc @safe unittest {
import std.meta: AliasSeq;
alias U = int;
alias T = Optional!U;
immutable U other = 4;
alias Constructors = AliasSeq!(
AliasSeq!(
() => T(),
() => const T(),
() => immutable T(),
() => T(U.init),
() => const T(U.init),
() => immutable T(U.init),
),
AliasSeq!(
() => no!U,
() => no!(const U),
() => no!(immutable U),
() => some!U(U.init),
() => some!(const U)(U.init),
() => some!(immutable U)(U.init),
)
);
static foreach (I; 0 .. 2) {{
auto nm = Constructors[I * 6 + 0]();
auto nc = Constructors[I * 6 + 1]();
auto ni = Constructors[I * 6 + 2]();
auto sm = Constructors[I * 6 + 3]();
auto sc = Constructors[I * 6 + 4]();
auto si = Constructors[I * 6 + 5]();
assert(sm != nm);
assert(sm != nc);
assert(sm != ni);
assert(sc != nm);
assert(sc != nc);
assert(sc != ni);
assert(si != nm);
assert(si != nc);
assert(si != ni);
assert(sm == sc);
assert(sm == si);
assert(sc == si);
assert(nm == nc);
assert(nm == ni);
assert(nc == ni);
sm = other;
nm = other;
assert(sm == nm);
static assert( __traits(compiles, { nm = other; }));
static assert(!__traits(compiles, { ni = other; }));
static assert(!__traits(compiles, { nc = other; }));
static assert( __traits(compiles, { sm = other; }));
static assert(!__traits(compiles, { si = other; }));
static assert(!__traits(compiles, { sc = other; }));
static assert(is(typeof(nm.unwrap) == int*));
static assert(is(typeof(nc.unwrap) == const(int)*));
static assert(is(typeof(ni.unwrap) == immutable(int)*));
static assert(is(typeof(sm.unwrap) == int*));
static assert(is(typeof(sc.unwrap) == const(int)*));
static assert(is(typeof(si.unwrap) == immutable(int)*));
}}
}
@("Should not allow properties of type to be reachable")
@nogc @safe unittest {
static assert(!__traits(compiles, some(3).max));
static assert(!__traits(compiles, some(some(3)).max));
}
@("Should be filterable")
@safe unittest {
import std.algorithm: filter;
import std.range: array;
foreach (T; QualifiedOptionalsOfQualified!int) {
const arr = [
T(),
T(3),
T(),
T(7),
];
assert(arr.filter!(a => a != none).array == [some(3), some(7)]);
}
}
@("Should print like a range")
unittest {
assert(no!int.toString == "[]");
assert(some(3).toString == "[3]");
static class A {
override string toString() { return "Yo"; }
}
Object a = new A;
assert(some(cast(A)a).toString == "[Yo]");
import std.algorithm: startsWith;
assert(some(cast(immutable A)a).toString == "[Yo]");
}
@("Should be joinerable and eachable")
@safe unittest {
import std.uni: toUpper;
import std.range: only;
import std.algorithm: joiner, map, each;
static maybeValues = only(no!string, some("hello"), some("world"));
assert(maybeValues.joiner.map!toUpper.joiner(" ").equal("HELLO WORLD"));
static moreValues = only(some("hello"), some("world"), no!string);
uint count = 0;
foreach (value; moreValues.joiner) ++count;
assert(count == 2);
moreValues.joiner.each!(value => ++count);
assert(count == 4);
}
@("Should not allow assignment to const")
@nogc @safe unittest {
Optional!(const int) opt = Optional!(const int)(42);
static assert(!__traits(compiles, opt = some(24)));
static assert(!__traits(compiles, opt = none));
}
@("Should treat null as valid values for pointer types")
@nogc @safe unittest {
auto a = no!(int*);
auto b = *a;
assert(a == no!(int*));
assert(b == no!(int));
b = 3;
assert(b == some(3));
a = null;
assert(a == some!(int*)(null));
assert(*a == no!int);
}
@("Should unwrap when there's a value")
unittest {
struct S {
int i = 1;
}
class C {
int i = 1;
}
auto a = some!C(null);
auto b = some!(S*)(null);
assert(a.unwrap is null);
assert(b.unwrap != null);
assert(*b.unwrap == null);
a = new C();
bool aUnwrapped = false;
if (auto c = a.unwrap) {
aUnwrapped = true;
assert(c.i == 1);
}
assert(aUnwrapped);
b = new S();
bool bUnwrapped = false;
if (auto s = b.unwrap) {
bUnwrapped = true;
assert((*s).i == 1);
}
assert(bUnwrapped);
auto c = no!int;
assert(c.unwrap is null);
c = some(3);
bool cUnwrapped = false;
if (auto p = c.unwrap) {
cUnwrapped = true;
assert(*p == 3);
}
assert(cUnwrapped);
}
@("Should allow 'is' on unwrap" )
unittest {
class C {}
auto a = no!C;
auto b = some(new C);
b = none;
Optional!C c = null;
auto d = some(new C);
d = null;
assert(a == none);
assert(a.unwrap is null);
assert(a.empty);
assert(b == none);
assert(b.unwrap is null);
assert(b.empty);
assert(c == none);
assert(c.unwrap is null);
assert(c.empty);
assert(d == none);
assert(d.unwrap is null);
assert(d.empty);
}
@("Should not allow assignment to immutable")
@nogc @safe unittest {
auto a = some!(immutable int)(1);
static assert(!__traits(compiles, { a = 2; }));
}
@("Should forward to opCall if callable")
@nogc @safe unittest {
static int f0(int) { return 4; }
alias A = typeof(&f0);
auto a0 = some(&f0);
auto a1 = no!A;
assert(a0(3) == some(4));
assert(a1(3) == no!int);
static void f1() {}
alias B = typeof(&f1);
auto b0 = some(&f1);
auto b1 = no!B;
static assert(is(typeof(b0()) == void));
static assert(is(typeof(b1()) == void));
}
@("Should work with disabled this")
@nogc @safe unittest {
struct S {
@disable this();
this(int) {}
}
Optional!S a = none;
static assert(__traits(compiles, { Optional!S a; }));
auto b = some(S(1));
auto c = b;
}
@("Should work with disabled post blit")
@nogc @safe unittest {
import std.conv: to;
static struct S {
int i;
@disable this(this);
this(int i) { this.i = i; }
}
auto a = Optional!S.construct(3);
assert(a != none);
assert(a.front.i == 3);
}
@("Should not destroy references")
unittest {
class C {
int i;
this(int ai) { i = ai; }
}
C my = new C(3);
Optional!C opt = some(my);
assert(my.i == 3);
opt = none;
assert(my.i == 3);
}
@("Should assign convertaible type optional")
unittest {
class A {}
class B : A {}
auto a = some(new A());
auto b = some(new B());
a = b;
assert(a.unwrap is b.unwrap);
}
@("Should call opOpAssign if value present")
@nogc @safe unittest {
import std.meta: AliasSeq;
import std.traits: isMutable;
import std.range: ElementType;
foreach (T; QualifiedOptionalsOfQualified!int) {
T a = 10;
T b = none;
static if (isMutable!(ElementType!T) && isMutable!(T)) {
a += 10;
b += 10;
assert(a == some(20));
assert(b == none);
a -= 5;
b -= 5;
assert(a == some(15));
assert(b == none);
a %= 2;
b %= 2;
assert(a == some(1));
assert(b == none);
} else {
static assert(!__traits(compiles, { a += 10; b += 10; } ));
static assert(!__traits(compiles, { a -= 10; b -= 10; } ));
static assert(!__traits(compiles, { a %= 10; b %= 10; } ));
}
}
}
@("Should work on arrays")
unittest {
foreach (T; QualifiedAlisesOf!(int[])) {
T data = [1, 2];
auto a = some(data);
auto b = no!T;
assert(a[0] == some(1));
assert(b[0] == none);
assert(a[1] == some(2));
assert(b[1] == none);
// Invalid index
assert(a[2] == none);
assert(b[2] == none);
// Slice
assert(a[] == data);
assert(b[] == none);
// opSlice
assert(a[0..1] == data[0..1]);
assert(b[0..1] == none);
// Invalid slice
assert(a[0..7] == none);
assert(b[0..7] == none);
// opDollar
assert(a[0 .. $] == data);
assert(b[0 .. $] == none);
}
}
@("Should compare with other ranges")
unittest {
import std.algorithm: map, filter;
auto a = some(1);
assert(a == [1]);
assert(a == [1].map!"a");
assert(a == [1].filter!"true");
}
@("Should maintain empty state after being assigned to another optional")
unittest {
Optional!string makeNone() {
Optional!string v;
return v;
}
Optional!string makeSome() {
auto v = Optional!string("hi");
return v;
}
Optional!string o;
o = makeNone();
assert(o.empty);
o = makeSome();
assert(!o.empty);
}
| D |
/Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/UserProfile.o : /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFURL.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFGeneric.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFTask.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/Bolts.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FacebookCore.build/unextended-module.modulemap /Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
/Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/UserProfile~partial.swiftmodule : /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFURL.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFGeneric.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFTask.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/Bolts.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FacebookCore.build/unextended-module.modulemap /Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
/Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/UserProfile~partial.swiftdoc : /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/eligitelman/Documents/GitHub/crushd/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFURL.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFGeneric.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFTask.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/Common/Bolts.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/eligitelman/Documents/GitHub/crushd/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/eligitelman/Documents/GitHub/crushd/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FacebookCore.build/unextended-module.modulemap /Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/eligitelman/Documents/GitHub/crushd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
| D |
module glued.testsuites.codescan.scanner;
import std.conv;
import std.traits;
import std.range;
import glued.logging;
import glued.set;
import glued.codescan.scanner;
enum CollectionEvent { SCANNABLE, TYPE, BUNDLE, FREEZE }
//if we customize indexer config, make sure to reflect it here
enum toScan(string s) = at(s, "", "scantest");
struct ColletionResult {
CollectionEvent event;
string pointer;
}
class AllColectionResults {
ColletionResult[] results;
void add(CollectionEvent e, string s){
results ~= ColletionResult(e, s);
}
}
class AllCollectingListener: ScanListener!(AllColectionResults)
{
AllColectionResults results = null;
void init(AllColectionResults results){
this.results = results;
}
void onScannable(alias scannable)() if (isScannable!scannable) {
results.add(CollectionEvent.SCANNABLE, to!string(scannable));
}
void onType(T)(){
results.add(CollectionEvent.TYPE, fullyQualifiedName!(T));
}
void onBundleModule(string modName)(){
results.add(CollectionEvent.BUNDLE, modName);
}
void onScannerFreeze(){
results.add(CollectionEvent.FREEZE, "");
}
}
unittest {
mixin CreateLogger;
auto sink = new StdoutSink;
Logger log = Logger(sink);
auto results = new AllColectionResults;
auto scanner = new CodebaseScanner!(AllColectionResults, AllCollectingListener)(results, sink);
scanner.scan!(toScan!("ex1"))();
with(CollectionEvent)
{
assert(results.results[0] == ColletionResult(SCANNABLE, to!string(toScan!("ex1"))));
assert(
Set!ColletionResult.of(results.results[1..$])
==
Set!ColletionResult.of([
ColletionResult(TYPE, "ex1.scan_aggregates.C"),
ColletionResult(TYPE, "ex1.scan_aggregates.I"),
ColletionResult(TYPE, "ex1.scan_aggregates.C2"),
ColletionResult(TYPE, "ex1.scan_aggregates.JustEnum"),
ColletionResult(TYPE, "ex1.scan_aggregates.StringEnum"),
ColletionResult(TYPE, "ex1.scan_aggregates.Struct")
])
);
}
results.results = [];
scanner.scan!(toScan!("ex2"))();
with(CollectionEvent)
{
assert(results.results[0] == ColletionResult(SCANNABLE, to!string(toScan!("ex2"))));
assert(
Set!ColletionResult.of(results.results[1..$])
==
Set!ColletionResult.of([
ColletionResult(TYPE, "ex2.sub1.m1.C"),
ColletionResult(TYPE, "ex2.sub2.m2.I")
])
);
}
results.results = [];
scanner.scan!(toScan!("bundles"))();
with(CollectionEvent)
{
assert(results.results[0] == ColletionResult(SCANNABLE, to!string(toScan!("bundles"))));
log.info.emit(results.results);
assert(
Set!ColletionResult.of(results.results[1..$])
==
Set!ColletionResult.of([
ColletionResult(BUNDLE, "bundles.content.onlysubpkgs._scantest_bundle"),
ColletionResult(BUNDLE, "bundles.content.onlysubpkgs.onlysubmods._scantest_bundle"),
ColletionResult(BUNDLE, "bundles.content.onlysubpkgs.mixed._scantest_bundle"),
ColletionResult(BUNDLE, "bundles.content.onlysubpkgs.mixed.empty._scantest_bundle")
])
);
}
results.results = [];
scanner.freeze();
assert(scanner.frozen);
//todo assert throws if we scan now
with(CollectionEvent)
{
assert(results.results[0] == ColletionResult(FREEZE, ""));
}
log.info.emit("Scanning one by one with single listener works");
}
unittest {
mixin CreateLogger;
auto sink = new StdoutSink;
Logger log = Logger(sink);
auto results = new AllColectionResults;
auto scanner = new CodebaseScanner!(AllColectionResults, AllCollectingListener)(results, sink);
scanner.scan!(toScan!("ex1"), toScan!("ex2"), toScan!("bundles"))();
scanner.freeze();
assert(scanner.frozen);
//todo assert throws if we scan now
with(CollectionEvent)
{
auto ex1Expected = Set!ColletionResult.of([
ColletionResult(TYPE, "ex1.scan_aggregates.C"),
ColletionResult(TYPE, "ex1.scan_aggregates.I"),
ColletionResult(TYPE, "ex1.scan_aggregates.C2"),
ColletionResult(TYPE, "ex1.scan_aggregates.JustEnum"),
ColletionResult(TYPE, "ex1.scan_aggregates.StringEnum"),
ColletionResult(TYPE, "ex1.scan_aggregates.Struct")
]);
auto ex2Expected = Set!ColletionResult.of([
ColletionResult(TYPE, "ex2.sub1.m1.C"),
ColletionResult(TYPE, "ex2.sub2.m2.I")
]);
auto bundlesExpected = Set!ColletionResult.of([
ColletionResult(BUNDLE, "bundles.content.onlysubpkgs._scantest_bundle"),
ColletionResult(BUNDLE, "bundles.content.onlysubpkgs.onlysubmods._scantest_bundle"),
ColletionResult(BUNDLE, "bundles.content.onlysubpkgs.mixed._scantest_bundle"),
ColletionResult(BUNDLE, "bundles.content.onlysubpkgs.mixed.empty._scantest_bundle")
]);
auto setBetween(size_t i1, size_t i2){
return Set!ColletionResult.of(results.results[i1..i2]);
}
size_t idx = 0;
assert(results.results[idx] == ColletionResult(SCANNABLE, to!string(toScan!("ex1"))));
idx += 1;
assert(setBetween(idx, idx + ex1Expected.length) == ex1Expected);
idx += ex1Expected.length;
assert(results.results[idx] == ColletionResult(SCANNABLE, to!string(toScan!("ex2"))));
idx += 1;
assert(setBetween(idx, idx + ex2Expected.length) == ex2Expected);
idx += ex2Expected.length;
assert(results.results[idx] == ColletionResult(SCANNABLE, to!string(toScan!("bundles"))));
idx += 1;
assert(setBetween(idx, idx + bundlesExpected.length) == bundlesExpected);
idx += bundlesExpected.length;
assert(results.results[idx] == ColletionResult(FREEZE, ""));
idx += 1;
assert(idx == results.results.length);
}
log.info.emit("Scanning several scannables at once with single listener works");
}
class ByKindResults
{
Scannable[] scannables;
string[] typeNames;
string[] bundleModNames;
bool frozen = false;
}
class ScannableListener: ScanListener!ByKindResults
{
ByKindResults results = null;
void init(ByKindResults results)
{
this.results = results;
}
void onScannable(alias scannable)() if (isScannable!scannable)
{
results.scannables ~= scannable;
}
void onType(T)()
{
}
void onBundleModule(string modName)()
{
}
void onScannerFreeze()
{
}
}
class TypeListener: ScanListener!ByKindResults
{
ByKindResults results = null;
void init(ByKindResults results)
{
this.results = results;
}
void onScannable(alias scannable)() if (isScannable!scannable)
{
}
void onType(T)()
{
results.typeNames ~= fullyQualifiedName!T;
}
void onBundleModule(string modName)()
{
}
void onScannerFreeze()
{
}
}
class BundleListener: ScanListener!ByKindResults
{
ByKindResults results = null;
void init(ByKindResults results)
{
this.results = results;
}
void onScannable(alias scannable)() if (isScannable!scannable)
{
}
void onType(T)()
{
}
void onBundleModule(string modName)()
{
results.bundleModNames ~= modName;
}
void onScannerFreeze()
{
}
}
class FreezeListener: ScanListener!ByKindResults
{
ByKindResults results = null;
void init(ByKindResults results)
{
this.results = results;
}
void onScannable(alias scannable)() if (isScannable!scannable)
{
}
void onType(T)()
{
}
void onBundleModule(string modName)()
{
}
void onScannerFreeze()
{
results.frozen = true;
}
}
unittest {
mixin CreateLogger;
auto sink = new StdoutSink;
Logger log = Logger(sink);
auto results = new ByKindResults;
auto scanner = new CodebaseScanner!(ByKindResults, ScannableListener, TypeListener, BundleListener, FreezeListener)(results, sink);
scanner.scan!(toScan!("ex1"))();
with(CollectionEvent)
{
assert(results.scannables == [toScan!("ex1")]);
assert(Set!string.of(results.typeNames) == Set!string.of([
"ex1.scan_aggregates.C",
"ex1.scan_aggregates.I",
"ex1.scan_aggregates.C2",
"ex1.scan_aggregates.JustEnum",
"ex1.scan_aggregates.StringEnum",
"ex1.scan_aggregates.Struct"
]));
assert(results.bundleModNames.empty);
assert(!results.frozen);
}
scanner.scan!(toScan!("ex2"))();
with(CollectionEvent)
{
assert(results.scannables == [toScan!("ex1"), toScan!("ex2")]);
assert(Set!string.of(results.typeNames) == Set!string.of([
"ex1.scan_aggregates.C",
"ex1.scan_aggregates.I",
"ex1.scan_aggregates.C2",
"ex1.scan_aggregates.JustEnum",
"ex1.scan_aggregates.StringEnum",
"ex1.scan_aggregates.Struct",
"ex2.sub1.m1.C",
"ex2.sub2.m2.I"
]));
assert(results.bundleModNames.empty);
assert(!results.frozen);
}
scanner.scan!(toScan!("bundles"))();
with(CollectionEvent)
{
assert(results.scannables == [toScan!("ex1"), toScan!("ex2"), toScan!("bundles")]);
assert(Set!string.of(results.typeNames) == Set!string.of([
"ex1.scan_aggregates.C",
"ex1.scan_aggregates.I",
"ex1.scan_aggregates.C2",
"ex1.scan_aggregates.JustEnum",
"ex1.scan_aggregates.StringEnum",
"ex1.scan_aggregates.Struct",
"ex2.sub1.m1.C",
"ex2.sub2.m2.I"
]));
assert(Set!string.of(results.bundleModNames) == Set!string.of([
"bundles.content.onlysubpkgs._scantest_bundle",
"bundles.content.onlysubpkgs.onlysubmods._scantest_bundle",
"bundles.content.onlysubpkgs.mixed._scantest_bundle",
"bundles.content.onlysubpkgs.mixed.empty._scantest_bundle"
]));
assert(!results.frozen);
}
scanner.freeze();
with(CollectionEvent)
{
assert(results.scannables == [toScan!("ex1"), toScan!("ex2"), toScan!("bundles")]);
assert(Set!string.of(results.typeNames) == Set!string.of([
"ex1.scan_aggregates.C",
"ex1.scan_aggregates.I",
"ex1.scan_aggregates.C2",
"ex1.scan_aggregates.JustEnum",
"ex1.scan_aggregates.StringEnum",
"ex1.scan_aggregates.Struct",
"ex2.sub1.m1.C",
"ex2.sub2.m2.I"
]));
assert(Set!string.of(results.bundleModNames) == Set!string.of([
"bundles.content.onlysubpkgs._scantest_bundle",
"bundles.content.onlysubpkgs.onlysubmods._scantest_bundle",
"bundles.content.onlysubpkgs.mixed._scantest_bundle",
"bundles.content.onlysubpkgs.mixed.empty._scantest_bundle"
]));
assert(results.frozen);
}
//todo assert throws if we scan now
log.info.emit("Scanning one by one with several listener works");
}
unittest {
mixin CreateLogger;
auto sink = new StdoutSink;
Logger log = Logger(sink);
auto results = new ByKindResults;
auto scanner = new CodebaseScanner!(ByKindResults, ScannableListener, TypeListener, BundleListener, FreezeListener)(results, sink);
scanner.scan!(toScan!("ex1"), toScan!("ex2"), toScan!("bundles"))();
//todo could check the same state as below, but !frozen
scanner.freeze();
with(CollectionEvent)
{
assert(results.scannables == [toScan!("ex1"), toScan!("ex2"), toScan!("bundles")]);
assert(Set!string.of(results.typeNames) == Set!string.of([
"ex1.scan_aggregates.C",
"ex1.scan_aggregates.I",
"ex1.scan_aggregates.C2",
"ex1.scan_aggregates.JustEnum",
"ex1.scan_aggregates.StringEnum",
"ex1.scan_aggregates.Struct",
"ex2.sub1.m1.C",
"ex2.sub2.m2.I"
]));
assert(Set!string.of(results.bundleModNames) == Set!string.of([
"bundles.content.onlysubpkgs._scantest_bundle",
"bundles.content.onlysubpkgs.onlysubmods._scantest_bundle",
"bundles.content.onlysubpkgs.mixed._scantest_bundle",
"bundles.content.onlysubpkgs.mixed.empty._scantest_bundle"
]));
assert(results.frozen);
}
//todo assert throws if we scan now
log.info.emit("Scanning several scannables at once with several listener works");
}
| D |
/Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Intermediates/FoodTracker.build/Debug-iphonesimulator/FoodTracker.build/Objects-normal/x86_64/imageViewController.o : /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/DateManager.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/listViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/Meal.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/imageViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/MealViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/imageCollectionViewCell.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/RatingControl.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/AppDelegate.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/MealTableViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/MealTableViewCell.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/calendarViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/CalendarCell.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Diary+CoreDataProperties.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/oneItemsFlowLayout.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Diary+CoreDataClass.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Photos.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/FontAwesome_swift.swiftmodule/x86_64.swiftmodule /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome_swift-Swift.h /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/module.modulemap
/Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Intermediates/FoodTracker.build/Debug-iphonesimulator/FoodTracker.build/Objects-normal/x86_64/imageViewController~partial.swiftmodule : /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/DateManager.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/listViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/Meal.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/imageViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/MealViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/imageCollectionViewCell.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/RatingControl.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/AppDelegate.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/MealTableViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/MealTableViewCell.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/calendarViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/CalendarCell.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Diary+CoreDataProperties.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/oneItemsFlowLayout.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Diary+CoreDataClass.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Photos.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/FontAwesome_swift.swiftmodule/x86_64.swiftmodule /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome_swift-Swift.h /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/module.modulemap
/Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Intermediates/FoodTracker.build/Debug-iphonesimulator/FoodTracker.build/Objects-normal/x86_64/imageViewController~partial.swiftdoc : /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/DateManager.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/listViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/Meal.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/imageViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/MealViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/imageCollectionViewCell.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/RatingControl.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/AppDelegate.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/MealTableViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/MealTableViewCell.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/calendarViewController.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/CalendarCell.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Diary+CoreDataProperties.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/FoodTracker/oneItemsFlowLayout.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Diary+CoreDataClass.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Photos.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/FontAwesome_swift.swiftmodule/x86_64.swiftmodule /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome_swift-Swift.h /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/module.modulemap
| D |
module mkk.tools.server_runner;
import std.process, core.thread, std.file, std.stdio, std.conv, std.datetime;
import core.stdc.stdlib: exit, EXIT_FAILURE, EXIT_SUCCESS;
import core.thread: Thread, dur;
import core.sys.posix.sys.stat: umask;
import core.sys.posix.unistd: fork, setsid, chdir, close, STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO;
import std.getopt;
extern (C)
{
void _Exit(int);
}
void daemonize()
{
// fork this process
auto pid = fork();
if (pid == -1) exit(EXIT_FAILURE);
// this is the parent; terminate it
if (pid > 0)
{
writefln("Starting daemon mode, process id = %d\n", pid);
_Exit(EXIT_SUCCESS);
}
//unmask the file mode
umask(0);
// become process group leader
auto sid = setsid();
if(sid < 0) exit(EXIT_FAILURE);
// do not lock any directories
//chdir("/");
// Close stdin, stdout and stderr
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);
}
Pid spawnApp(string appFile)
{
return spawnProcess( appFile, File("/dev/null"), File("/dev/null", "a"), File("/dev/null", "a") );
}
void writeLog(string logFile, string msg)
{
if( logFile.length && exists(logFile) ) {
std.file.append( logFile, Clock.currTime().toISOExtString() ~ `: ` ~ msg ~ "\n\n" );
}
}
void main(string[] args)
{
string appFile;
string logFile;
int timeout = 10;
getopt(args,
`app`, &appFile,
`log`, &logFile,
`timeout`, &timeout
);
daemonize();
bool started = false;
Pid childPid;
while( true )
{
if( !started ) {
try
{
childPid = spawnApp(appFile);
started = true;
writeLog( logFile, "Child process started" );
}
catch (Throwable e)
{
started = false;
writeLog( logFile, "Exception thrown during spawn site: " ~ e.msg );
Thread.sleep( dur!("seconds")( timeout ) );
continue;
}
}
if( started )
{
auto childInfo = tryWait( childPid );
if( childInfo.terminated )
{
started = false;
writeLog( logFile, "Child process terminated with code: " ~ childInfo.status.text );
continue;
}
}
Thread.sleep( dur!("seconds")( timeout ) );
}
} | D |
/Users/min/Code/Swift/Fireball/build/Fireball.build/Debug-iphoneos/Fireball.build/Objects-normal/armv7/FireballProtocol.o : /Users/min/Code/Swift/Fireball/Fireball/Fireball.swift /Users/min/Code/Swift/Fireball/Fireball/FireballProtocol.swift /Users/min/Code/Swift/Fireball/Fireball/NoError.swift /Users/min/Code/Swift/Fireball/Fireball/AnyError.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/SwiftOnoneSupport.swiftmodule /Users/min/Code/Swift/Fireball/Fireball/Fireball.h /Users/min/Code/Swift/Fireball/build/Fireball.build/Debug-iphoneos/Fireball.build/unextended-module.modulemap
/Users/min/Code/Swift/Fireball/build/Fireball.build/Debug-iphoneos/Fireball.build/Objects-normal/armv7/FireballProtocol~partial.swiftmodule : /Users/min/Code/Swift/Fireball/Fireball/Fireball.swift /Users/min/Code/Swift/Fireball/Fireball/FireballProtocol.swift /Users/min/Code/Swift/Fireball/Fireball/NoError.swift /Users/min/Code/Swift/Fireball/Fireball/AnyError.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/SwiftOnoneSupport.swiftmodule /Users/min/Code/Swift/Fireball/Fireball/Fireball.h /Users/min/Code/Swift/Fireball/build/Fireball.build/Debug-iphoneos/Fireball.build/unextended-module.modulemap
/Users/min/Code/Swift/Fireball/build/Fireball.build/Debug-iphoneos/Fireball.build/Objects-normal/armv7/FireballProtocol~partial.swiftdoc : /Users/min/Code/Swift/Fireball/Fireball/Fireball.swift /Users/min/Code/Swift/Fireball/Fireball/FireballProtocol.swift /Users/min/Code/Swift/Fireball/Fireball/NoError.swift /Users/min/Code/Swift/Fireball/Fireball/AnyError.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/armv7/SwiftOnoneSupport.swiftmodule /Users/min/Code/Swift/Fireball/Fireball/Fireball.h /Users/min/Code/Swift/Fireball/build/Fireball.build/Debug-iphoneos/Fireball.build/unextended-module.modulemap
| D |
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module dwtx.jface.text.formatter.IFormattingContext;
import dwtx.jface.text.formatter.MultiPassContentFormatter; // packageimport
import dwtx.jface.text.formatter.ContextBasedFormattingStrategy; // packageimport
import dwtx.jface.text.formatter.FormattingContext; // packageimport
import dwtx.jface.text.formatter.IFormattingStrategy; // packageimport
import dwtx.jface.text.formatter.IContentFormatterExtension; // packageimport
import dwtx.jface.text.formatter.IFormattingStrategyExtension; // packageimport
import dwtx.jface.text.formatter.IContentFormatter; // packageimport
import dwtx.jface.text.formatter.FormattingContextProperties; // packageimport
import dwtx.jface.text.formatter.ContentFormatter; // packageimport
import dwt.dwthelper.utils;
import dwtx.dwtxhelper.Collection;
import dwtx.jface.preference.IPreferenceStore;
/**
* Formatting context used in formatting strategies implementing interface
* <code>IFormattingStrategyExtension</code>.
*
* @see IFormattingStrategyExtension
* @since 3.0
*/
public interface IFormattingContext {
/**
* Dispose of the formatting context.
* <p>
* Must be called after the formatting context has been used in a
* formatting process.
*/
void dispose();
/**
* Returns the preference keys used for the retrieval of formatting
* preferences.
*
* @return The preference keys for formatting
*/
String[] getPreferenceKeys();
/**
* Retrieves the property <code>key</code> from the formatting context
*
* @param key
* Key of the property to store in the context
* @return The property <code>key</code> if available, <code>null</code>
* otherwise
*/
Object getProperty(Object key);
/**
* Is this preference key for a bool preference?
*
* @param key
* The preference key to query its type
* @return <code>true</code> iff this key is for a bool preference,
* <code>false</code> otherwise.
*/
bool isBooleanPreference(String key);
/**
* Is this preference key for a double preference?
*
* @param key
* The preference key to query its type
* @return <code>true</code> iff this key is for a double preference,
* <code>false</code> otherwise.
*/
bool isDoublePreference(String key);
/**
* Is this preference key for a float preference?
*
* @param key
* The preference key to query its type
* @return <code>true</code> iff this key is for a float preference,
* <code>false</code> otherwise.
*/
bool isFloatPreference(String key);
/**
* Is this preference key for an integer preference?
*
* @param key
* The preference key to query its type
* @return <code>true</code> iff this key is for an integer preference,
* <code>false</code> otherwise.
*/
bool isIntegerPreference(String key);
/**
* Is this preference key for a long preference?
*
* @param key
* The preference key to query its type
* @return <code>true</code> iff this key is for a long preference,
* <code>false</code> otherwise.
*/
bool isLongPreference(String key);
/**
* Is this preference key for a string preference?
*
* @param key
* The preference key to query its type
* @return <code>true</code> iff this key is for a string preference,
* <code>false</code> otherwise.
*/
bool isStringPreference(String key);
/**
* Stores the preferences from a map to a preference store.
* <p>
* Note that the preference keys returned by
* {@link #getPreferenceKeys()} must not be used in the preference store.
* Otherwise the preferences are overwritten.
* </p>
*
* @param map
* Map to retrieve the preferences from
* @param store
* Preference store to store the preferences in
*/
void mapToStore(Map map, IPreferenceStore store);
/**
* Stores the property <code>key</code> in the formatting context.
*
* @param key
* Key of the property to store in the context
* @param property
* Property to store in the context. If already present, the new
* property overwrites the present one.
*/
void setProperty(Object key, Object property);
/**
* Retrieves the preferences from a preference store in a map.
* <p>
* Note that the preference keys returned by
* {@link #getPreferenceKeys()} must not be used in the map. Otherwise the
* preferences are overwritten.
* </p>
*
* @param store
* Preference store to retrieve the preferences from
* @param map
* Map to store the preferences in
* @param useDefault
* <code>true</code> if the default preferences should be
* used, <code>false</code> otherwise
*/
void storeToMap(IPreferenceStore store, Map map, bool useDefault);
}
| D |
/Users/akhiltirumalasetty/Desktop/ReachabilityTest/build/ReachabilityTest.build/Debug-iphoneos/ReachabilityTest.build/Objects-normal/arm64/ViewController.o : /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/CommonFunction.swift /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/OfflineViewController.swift /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/ViewController.swift /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/ReachabilityTest-Bridging-Header.h /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/Reachability.h /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule
/Users/akhiltirumalasetty/Desktop/ReachabilityTest/build/ReachabilityTest.build/Debug-iphoneos/ReachabilityTest.build/Objects-normal/arm64/ViewController~partial.swiftmodule : /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/CommonFunction.swift /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/OfflineViewController.swift /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/ViewController.swift /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/ReachabilityTest-Bridging-Header.h /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/Reachability.h /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule
/Users/akhiltirumalasetty/Desktop/ReachabilityTest/build/ReachabilityTest.build/Debug-iphoneos/ReachabilityTest.build/Objects-normal/arm64/ViewController~partial.swiftdoc : /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/CommonFunction.swift /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/OfflineViewController.swift /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/ViewController.swift /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Swift.swiftmodule /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/ReachabilityTest-Bridging-Header.h /Users/akhiltirumalasetty/Desktop/ReachabilityTest/ReachabilityTest/Reachability.h /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos/arm64/CoreImage.swiftmodule
| D |
module android.java.android.security.ConfirmationAlreadyPresentingException;
public import android.java.android.security.ConfirmationAlreadyPresentingException_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!ConfirmationAlreadyPresentingException;
import import4 = android.java.java.lang.Class;
import import3 = android.java.java.lang.StackTraceElement;
import import0 = android.java.java.lang.JavaThrowable;
| D |
/**
* Comb4P hash combiner
*
* Copyright:
* (C) 2010 Jack Lloyd
* (C) 2014-2015 Etienne Cimon
*
* License:
* Botan is released under the Simplified BSD License (see LICENSE.md)
*/
module botan.hash.comb4p;
import botan.constants;
static if (BOTAN_HAS_COMB4P):
import botan.hash.hash;
import botan.utils.xor_buf;
import botan.utils.types;
import botan.utils.mem_ops;
import std.exception;
import std.algorithm : max, min;
/**
* Combines two hash functions using a Feistel scheme. Described in
* "On the Security of Hash Function Combiners", Anja Lehmann
*/
class Comb4P : HashFunction
{
public:
/**
* Params:
* h1 = the first hash
* h2 = the second hash
*/
this(HashFunction h1, HashFunction h2)
{
m_hash1 = h1;
m_hash2 = h2;
if (m_hash1.name == m_hash2.name)
throw new InvalidArgument("Comb4P: Must use two distinct hashes");
if (m_hash1.outputLength != m_hash2.outputLength)
throw new InvalidArgument("Comb4P: Incompatible hashes " ~
m_hash1.name ~ " and " ~
m_hash2.name);
clear();
}
override @property size_t hashBlockSize() const
{
if (m_hash1.hashBlockSize == m_hash2.hashBlockSize)
return m_hash1.hashBlockSize;
/*
* Return LCM of the block sizes? This would probably be OK for
* HMAC, which is the main thing relying on knowing the block size.
*/
return 0;
}
override @property size_t outputLength() const
{
return m_hash1.outputLength + m_hash2.outputLength;
}
override HashFunction clone() const
{
return new Comb4P(m_hash1.clone(), m_hash2.clone());
}
override @property string name() const
{
return "Comb4P(" ~ m_hash1.name ~ "," ~ m_hash2.name ~ ")";
}
override void clear()
{
m_hash1.clear();
m_hash2.clear();
// Prep for processing next message, if any
m_hash1.update(0);
m_hash2.update(0);
}
protected:
override void addData(const(ubyte)* input, size_t length)
{
m_hash1.update(input, length);
m_hash2.update(input, length);
}
override void finalResult(ubyte* output)
{
SecureVector!ubyte h1 = m_hash1.finished();
SecureVector!ubyte h2 = m_hash2.finished();
// First round
xorBuf(h1.ptr, h2.ptr, min(h1.length, h2.length));
// Second round
comb4p_round(h2, h1, 1, *m_hash1, *m_hash2);
// Third round
comb4p_round(h1, h2, 2, *m_hash1, *m_hash2);
copyMem(output , h1.ptr, h1.length);
copyMem(output + h1.length, h2.ptr, h2.length);
// Prep for processing next message, if any
m_hash1.update(0);
m_hash2.update(0);
}
Unique!HashFunction m_hash1, m_hash2;
}
private:
void comb4p_round(ref SecureVector!ubyte output,
const ref SecureVector!ubyte input,
ubyte round_no,
HashFunction h1,
HashFunction h2)
{
h1.update(round_no);
h2.update(round_no);
h1.update(input.ptr, input.length);
h2.update(input.ptr, input.length);
SecureVector!ubyte h_buf = h1.finished();
xorBuf(output.ptr, h_buf.ptr, min(output.length, h_buf.length));
h_buf = h2.finished();
xorBuf(output.ptr, h_buf.ptr, min(output.length, h_buf.length));
} | D |
/Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/UserProfile.FetchResult.o : /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/Bolts.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFTask.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFTask+Exceptions.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFURL.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
/Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/UserProfile.FetchResult~partial.swiftmodule : /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/Bolts.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFTask.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFTask+Exceptions.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFURL.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
/Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/Objects-normal/x86_64/UserProfile.FetchResult~partial.swiftdoc : /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/AccessToken.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.Builtin.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEvent.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventName.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventParameterName.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.FlushBehavior.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/AppEvents/AppEventsLogger.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Internal/Extensions/Dictionary+KeyValueMap.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphAPIVersion.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequest.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.Delegate.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestConnection.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestDataAttachment.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestProtocol.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphRequestResult.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponse.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/GraphRequest/GraphResponseProtocol.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Internal/Extensions/Optional+OnSome.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Permissions/Permission.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Permissions/PublishPermission.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Permissions/ReadPermission.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/SDKApplicationDelegate.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/SDKLoggingBehavior.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/Common/SDKSettings.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.FetchResult.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.PictureView.swift /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FacebookCore/Sources/Core/UserProfile/UserProfile.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Target\ Support\ Files/FacebookCore/FacebookCore-umbrella.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/FacebookCore.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/Bolts.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFTaskCompletionSource.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFTask.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFTask+Exceptions.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFExecutor.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFCancellationTokenSource.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFCancellationTokenRegistration.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/Common/BFCancellationToken.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFWebViewAppLinkResolver.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFURL.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFMeasurementEvent.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkTarget.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererView.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkResolving.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLinkNavigation.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Bolts/Bolts/iOS/BFAppLink.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Target\ Support\ Files/Bolts/Bolts-umbrella.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/Bolts.build/module.modulemap /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfilePictureView.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKProfile.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMutableCopying.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKUtility.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKTestUsersManager.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestDataAttachment.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequest.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKConstants.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKButton.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkUtility.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKApplicationDelegate.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKMacros.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKCopying.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAccessToken.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/Pods/Target\ Support\ Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h /Users/alexmorin/Desktop/Projet375/ios/Projet375/build/Pods.build/Debug-iphonesimulator/FBSDKCoreKit.build/module.modulemap
| D |
a town in northeastern Massachusetts on Cape Ann to the northeast of Boston
a city in southwestern England in Gloucestershire on the Severn
| D |
/*
* Copyright (c) 2007 Erin Catto http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
module testRepulsor;
import demo;
class TestRepulsor : Demo
{
ShapeDef sd;
BodyDef bd;
this() {
bVec2 gravity = bVec2(0.0f, -5.0f);
super(gravity);
init();
}
void init() {
Body ground;
{
sd = new PolyDef();
sd.setAsBox(50.0f, 10.0f);
bVec2 position = bVec2(0.0f, -10.0f);
float angle = 0.0f;
bd = new BodyDef(position, angle);
ground = world.createBody(bd);
ground.createShape(sd);
}
{
// Create attractor force
bVec2 center = bVec2(0, 13);
float minRadius = 3;
float maxRadius = 15;
float strength = 500;
ForceGenerator repulsor;
// Create circle
bVec2 position = center;
float angle = 0.0f;
bd = new BodyDef(position, angle);
auto rBody = world.createBody(bd);
float radius = 1.0f;
float density = 7.5f;
sd = new CircleDef(density, radius);
float friction = 1.0f;
float restitution = 0.1f;
sd.friction = friction;
sd.restitution = restitution;
rBody.createShape(sd);
// Create shapes
for(int i = 0; i < 50; i++) {
// Define shape
float a = randomRange(0.075f, 0.5f);
float b = randomRange(0.075f, 0.5f);
float xPos = randomRange(-10, 10f);
float yPos = randomRange(5.0f, 25.0f);
sd = new PolyDef();
sd.setAsBox(a, b);
sd.density = 5.0f;
// Create body1
position = bVec2(xPos, yPos);
bd = new BodyDef(position, angle);
rBody = world.createBody(bd);
rBody.createShape(sd);
rBody.setMassFromShapes();
repulsor = new Repulsor(rBody, center, strength, minRadius, maxRadius);
world.addForce(repulsor);
}
}
}
void update() {}
}
| D |
Ddoc
$(D_S D Change Log,
$(UPCOMING
$(LI Shared libraries for Linux)
)
$(VERSION 074, Apr 12, 2012, =================================================,
$(WHATSNEW
$(LI Add predefined Ddoc macro SRCFILENAME)
$(LI Added std.c.stdint)
)
$(BUGSFIXED
$(LI $(BUGZILLA 176): [module] message "module and package have the same name")
$(LI $(BUGZILLA 783): Cannot use an array w/ const or variable index as new[] size argument.)
$(LI $(BUGZILLA 977): Expressions inside a struct or array initializer get wrong line number)
$(LI $(BUGZILLA 3354): invalid number of args accepted for 1/2 arg floating point instructions)
$(LI $(BUGZILLA 3509): Cannot forward reference a template mixin's members in a compile-time context)
$(LI $(BUGZILLA 3510): Cannot forward reference a templated type from within a template mixin)
$(LI $(BUGZILLA 3559): DMD 1.048+ fails to take function pointer from overloaded member functions)
$(LI $(BUGZILLA 3630): bad error location in "has no effect in expression" error)
$(LI $(BUGZILLA 3682): Regression(2.038) is expression fails to match types)
$(LI $(BUGZILLA 3812): Missing line number for implicit cast of variadic function to array)
$(LI $(BUGZILLA 3822): Invalid optimization of alloca called with constant size)
$(LI $(BUGZILLA 4241): duplicate union initialization error doesn't give a file location)
$(LI $(BUGZILLA 4269): Regression(2.031): invalid type accepted if evaluated while errors are gagged)
$(LI $(BUGZILLA 4820): Regression(1.058, 2.044) in DStress caused by changeset 452)
$(LI $(BUGZILLA 4993): Temporary values and opIndexAssign)
$(LI $(BUGZILLA 5181): Excess cast on in-place operation op= involving conversion)
$(LI $(BUGZILLA 5554): [qtd] Covariance detection failure)
$(LI $(BUGZILLA 5879): Not all frontend errors use stderr)
$(LI $(BUGZILLA 6391): Line-less error when passing the '.im' of floating pointer value by reference)
$(LI $(BUGZILLA 6438): [CTFE] wrong error "value used before set" when slicing =void array)
$(LI $(BUGZILLA 6699): More cases of __error in error messages)
$(LI $(BUGZILLA 6681): struct constructor call is converted to struct literal that breaks union initialization)
$(LI $(BUGZILLA 7380): Crash trying to use address of variable in struct constructor at module level)
$(LI $(BUGZILLA 7399): Broken import statement in trySemantic() causes silent compiler error)
$(LI $(BUGZILLA 7406): tuple foreach doesn't work with mixed tuples)
$(LI $(BUGZILLA 7462): Error message with _error_ in overridden function)
$(LI $(BUGZILLA 7463): Duplicated error message with bad template value parameter)
$(LI $(BUGZILLA 7473): [CTFE] Non-ref argument behaves as if it's a ref argument)
$(LI $(BUGZILLA 7493): Initialization of void[][N])
$(LI $(BUGZILLA 7527): [CTFE] Segfault when slicing a pointer at compile time)
$(LI $(BUGZILLA 7536): ctfeAdrOnStack triggered)
$(LI $(BUGZILLA 7544): ICE(interpret.c) Catching an exception with a null catch block)
$(LI $(BUGZILLA 7547): -deps output lists object as a top level module)
$(LI $(BUGZILLA 7550): Missing AVX instruction VPMULDQ)
$(LI $(BUGZILLA 7557): Sea of errors after template failure)
$(LI $(BUGZILLA 7563): Class members with default template arguments have no type)
$(LI $(BUGZILLA 7568): pragma(msg) segfaults with an aggregate including a class.)
$(LI $(BUGZILLA 7592): Conversion from ireal to ifloat broken when using xmm)
$(LI $(BUGZILLA 7633): Missing CTFE error message)
$(LI $(BUGZILLA 7639): Undefined enum AA key crashes compiler)
$(LI $(BUGZILLA 7641): std.typecons.Proxy incorrectly allows implicit conversion to class)
$(LI $(BUGZILLA 7667): ICE(interpret.c): 'ctfeStack.stackPointer() == 0')
$(LI $(BUGZILLA 7681): Regression(2.059head):ICE:opCatAssign(delegate) to undefined identifier)
$(LI $(BUGZILLA 7694): Internal error: e2ir.c 1251 when calling member function inside struct via alias param)
$(LI $(BUGZILLA 7699): Cannot get frame pointer to in contract when compiling with -inline)
$(LI $(BUGZILLA 7735): Functions with variadic void[][]... arguments corrupt passed data)
$(LI $(BUGZILLA 7745): Regression (1.x git-415e48a) Methods defined in external object files when a pointer to it is taken)
$(LI $(BUGZILLA 7754): static this() in template is stripped during header gen)
$(LI $(BUGZILLA 7755): regression(2.059head): ICE in glue.c)
$(LI $(BUGZILLA 7768): More readable template error messages)
$(LI $(BUGZILLA 7781): [CTFE] Segmentation fault on 'mixin({return;}());)
$(LI $(BUGZILLA 7782): [ICE] With wrong import syntax)
$(LI $(BUGZILLA 7785): [CTFE] ICE when slicing pointer to variable)
$(LI $(BUGZILLA 7786): dmd crashes with invalid module name)
$(LI $(BUGZILLA 7789): [CTFE] null pointer exception on setting array length)
$(LI $(BUGZILLA 7794): Sea of errors when calling regex() after compile error)
$(LI $(BUGZILLA 7812): Segfault on invalid code during template match deduction with errors gagged)
$(LI $(BUGZILLA 7814): Regression(2.059head) ICE(tocsym.c) using scope(failure) within foreach-range)
$(LI $(BUGZILLA 7817): opAssign to in declaration broken in dmd 1.074 beta1)
)
)
<div id=version>
$(UL
$(NEW1 074)
$(NEW1 073)
$(NEW1 072)
$(NEW1 071)
$(NEW1 070)
$(NEW1 069)
$(NEW1 068)
$(NEW1 067)
$(NEW1 066)
$(NEW1 065)
$(NEW1 064)
$(NEW1 063)
$(NEW1 062)
$(NEW1 061)
$(NEW1 060)
$(NEW1 059)
$(NEW1 058)
$(NEW1 057)
$(NEW1 056)
$(NEW1 055)
$(NEW1 054)
$(NEW1 053)
$(NEW1 052)
$(NEW1 051)
$(NEW1 050)
$(NEW1 049)
$(NEW1 048)
$(NEW1 047)
$(NEW1 046)
$(NEW1 045)
$(NEW1 044)
$(NEW1 043)
$(NEW1 042)
$(NEW1 041)
$(NEW1 040)
$(NEW1 039)
$(NEW1 038)
$(NEW1 037)
$(NEW1 036)
$(NEW1 035)
$(NEW1 034)
$(NEW1 033)
$(NEW1 032)
$(NEW1 031)
$(NEW1 030)
$(NEW1 029)
$(NEW1 028)
$(NEW1 027)
$(NEW1 026)
$(NEW1 025)
$(NEW1 024)
$(NEW1 023)
$(NEW1 022)
$(NEW1 021)
$(NEW1 020)
$(NEW1 019)
$(NEW1 018)
$(NEW1 017)
$(NEW1 016)
$(NEW1 015)
$(NEW1 014)
$(NEW1 013)
$(NEW1 012)
$(NEW1 011)
$(NEW1 010)
$(NEW1 009)
$(NEW1 007)
$(NEW1 006)
$(NEW1 005)
$(NEW1 004)
$(NEW1 003)
$(NEW1 002)
$(NEW1 001)
$(LI $(LINK2 http://www.digitalmars.com/d/changelog.html, change log for D 2.0))
$(LI $(LINK2 changelog2.html, older versions))
$(LI $(LINK2 changelog1.html, even older versions))
$(LI Download latest stable (1.030)
<a HREF="http://ftp.digitalmars.com/dmd.1.030.zip" title="download D compiler">
D compiler</a> for Win32 and x86 linux)
$(LI $(LINK2 http://www.digitalmars.com/pnews/index.php?category=2, tech support))
$(COMMENT
$(LI $(LINK2 http://www.digitalmars.com/drn-bin/wwwnews?newsgroups=*, tech support))
)
)
</div>
$(VERSION 073, Feb 8, 2012, =================================================,
$(WHATSNEW
$(LI Convert to -shared dmd switch instead of -dylib)
$(LI Better use of XMM registers in OS X 32 bit target.)
$(LI Add inline assembler support for AVX instructions (64 bit targets only).)
)
$(BUGSFIXED
$(LI $(BUGZILLA 516): Mutually calling constructors allowed)
$(LI $(BUGZILLA 664): is(func T == function) ignores variadic arguments)
$(LI $(BUGZILLA 678): Compiler accepts, for a function T[] t(), t().ptr but not t.ptr)
$(LI $(BUGZILLA 796): Asserting a null object reference throws AssertError Failure internal\invariant.d(14) or Access Violation)
$(LI $(BUGZILLA 949): Wrong spec/compiler behaviour for Strings, Integers and Floats)
$(LI $(BUGZILLA 955): Passing arguments into functions - in, out, inout, const, and contracts)
$(LI $(BUGZILLA 1313): out/body disables escape analysis)
$(LI $(BUGZILLA 1521): Ambiguous documentation)
$(LI $(BUGZILLA 1563): dynamic cast is not always performed)
$(LI $(BUGZILLA 1570): Wrong return for address operator)
$(LI $(BUGZILLA 1918): __traits(getVirtualFunctions) returns final functions)
$(LI $(BUGZILLA 1920): Class documentation incomplete)
$(LI $(BUGZILLA 1943): Templates can't take function pointer parameters)
$(LI $(BUGZILLA 2106): export class doesn't affect, what is exported)
$(LI $(BUGZILLA 2351): enum with no members allowed)
$(LI $(BUGZILLA 2382): spec is not clear on what is allowed as global/static initializers)
$(LI $(BUGZILLA 2387): Static array terminology)
$(LI $(BUGZILLA 2417): [module] protected base member is not available via base handle in a derived class if it is defined in a separate module)
$(LI $(BUGZILLA 2483): DMD allows assignment to a scope variable)
$(LI $(BUGZILLA 2494): describe explicit casting of arrays)
$(LI $(BUGZILLA 2495): const syntax for member functions needs better description)
$(LI $(BUGZILLA 2497): delete and null relationship needs more details)
$(LI $(BUGZILLA 2639): Hex and octal string values not completely specified)
$(LI $(BUGZILLA 2819): array.sort segfaults if array length >=0x8F_FFFF)
$(LI $(BUGZILLA 2894): abstract classes sometimes allow non-abstract bodyless functions)
$(LI $(BUGZILLA 3084): Formatting of lazy in parameters section)
$(LI $(BUGZILLA 3092): Indexing a tuple produces a tuple containing the indexed element)
$(LI $(BUGZILLA 3111): 'mangleof' can't be member of a struct not documented)
$(LI $(BUGZILLA 3187): Nested foreach over opApply doesn't work)
$(LI $(BUGZILLA 3204): Document global properties)
$(LI $(BUGZILLA 3265): .classinfo for Interface-typed reference does not return instance's ClassInfo)
$(LI $(BUGZILLA 3492): Can't overload nested functions)
$(LI $(BUGZILLA 3578): Impossible to run a struct invariant using assert(s))
$(LI $(BUGZILLA 3735): op=)
$(LI $(BUGZILLA 3757): Overloading const function with overridden non-const function results in seg fault.)
$(LI $(BUGZILLA 3777): size_t is undefined)
$(LI $(BUGZILLA 3783): Text inconsistent with EscapeSequence rules)
$(LI $(BUGZILLA 3787): clarification: assigment to 'this')
$(LI $(BUGZILLA 3791): Reference anonymous nested classes when describing new expressions)
$(LI $(BUGZILLA 3838): PrimaryExpression rule doesn't permit module scope template instances)
$(LI $(BUGZILLA 3886): Bad example of definition file for DLLs)
$(LI $(BUGZILLA 3906): Undefined struct and union declarations are not documented)
$(LI $(BUGZILLA 3954): DeclDef rule is missing TemplateMixinDeclaration)
$(LI $(BUGZILLA 3988): Provide canonical example for operator overloading)
$(LI $(BUGZILLA 4135): Regression(1.034): ICE(statement.c): mixin in bad foreach, D1 only)
$(LI $(BUGZILLA 4180): D DWARF extensions conflict with DWARF-4)
$(LI $(BUGZILLA 4235): !in not working (D1))
$(LI $(BUGZILLA 4371): segfault(template.c) template tuple in is() expression)
$(LI $(BUGZILLA 4413): typeof(this) doesn't work in method template signature)
$(LI $(BUGZILLA 4523): [tdpl] .remove method for Associative Arrays returns void in all cases)
$(LI $(BUGZILLA 4545): Alias to members possible without "this" instance)
$(LI $(BUGZILLA 4647): [tdpl] Cannot explicitly call final interface method, ambiguous calls allowed)
$(LI $(BUGZILLA 4711): Incorrect handling of && operator with void operand)
$(LI $(BUGZILLA 4887): Right-shifting by 32 is allowed and broken)
$(LI $(BUGZILLA 4956): remove direct references to gcc from linux.mak)
$(LI $(BUGZILLA 5023): Docs about order of execution of invariant and pre/post conditions)
$(LI $(BUGZILLA 5111): Static function-level variables are not in the language spec.)
$(LI $(BUGZILLA 5114): Too many error messages)
$(LI $(BUGZILLA 5132): ~ unary operator silently different from C)
$(LI $(BUGZILLA 5138): Special token sequence)
$(LI $(BUGZILLA 5337): Documentation regarding interfacing with C does not account for TLS differences)
$(LI $(BUGZILLA 5476): spec: attributes have an optional else clause)
$(LI $(BUGZILLA 5527): Bug in http://www.digitalmars.com/d/2.0/ctod.html#closures)
$(LI $(BUGZILLA 5648): dmd command line option list inconsistencies)
$(LI $(BUGZILLA 5715): Contradiction in spec: meaning of variable.init)
$(LI $(BUGZILLA 5796): ICE with pragma(msg, ...) after missing ';' in a template)
$(LI $(BUGZILLA 5820): Documentation states string literals can implicitly convert to char*)
$(LI $(BUGZILLA 5841): alias grammar is incorrect)
$(LI $(BUGZILLA 6013): private ignored for aliases)
$(LI $(BUGZILLA 6037): [CTFE] recursive ref parameters evaluated incorrectly)
$(LI $(BUGZILLA 6451): [64bit] ICE(expression.c:4434): SymbolExp::SymbolExp(Loc, TOK, int, Declaration*, int): Assertion 'var' failed)
$(LI $(BUGZILLA 6504): Regression(2.041): "str" ~ [arr] allows string literal to be modified)
$(LI $(BUGZILLA 6701): template specialization resolution failure)
$(LI $(BUGZILLA 6933): Segfault(declaration.c) using struct with destructor in CTFE)
$(LI $(BUGZILLA 6934): [CTFE] can't use $ in a slice of an array passed by ref)
$(LI $(BUGZILLA 6964): Error message with __error: static assert(undefined+1))
$(LI $(BUGZILLA 6968): Segmantation fault, if exclamation mark absent)
$(LI $(BUGZILLA 6971): [lex.dd] Type of string literals are outdated)
$(LI $(BUGZILLA 6984): CTFE generates a torrent of spurious errors, if there was a previous error)
$(LI $(BUGZILLA 6985): [CTFE] Non-constant case expressions can't be interpreted)
$(LI $(BUGZILLA 6995): [CTFE] can't interpret static template method)
$(LI $(BUGZILLA 7011): No line number error for vector power)
$(LI $(BUGZILLA 7043): CTFE: ICE illegal reference value 0LU, only with -inline)
$(LI $(BUGZILLA 7073): Parsing of class-returning varargs function inside module ctor fails)
$(LI $(BUGZILLA 7108): ICE: TraitsExp::semantic(Scope*) 2.056 -> 2.057 regression - segfault)
$(LI $(BUGZILLA 7120): Scope Delegates + Delegate Literals)
$(LI $(BUGZILLA 7123): static assert(is(typeof(toDelegate(&main)))) is false)
$(LI $(BUGZILLA 7127): Const-related infinite recursion in DWARF generation)
$(LI $(BUGZILLA 7143): [CTFE] cannot compare class references with "is")
$(LI $(BUGZILLA 7144): [CTFE] base class does not call overridden members)
$(LI $(BUGZILLA 7154): [CTFE] failing downcast causes error)
$(LI $(BUGZILLA 7158): [CTFE] ICE(interpret.c) calling a class member using a dotvar expression)
$(LI $(BUGZILLA 7162): [CTFE] "bool || void" expression crashes dmd)
$(LI $(BUGZILLA 7165): [CTFE] ice converting null pointer to bool with constant member function)
$(LI $(BUGZILLA 7166): Internal error: ../ztc/cgxmm.c 60)
$(LI $(BUGZILLA 7173): dmd: glue.c:1065: virtual unsigned int Type::totym(): Assertion `0' failed.)
$(LI $(BUGZILLA 7178): Segfault with import of invalid template)
$(LI $(BUGZILLA 7185): [CTFE] ICE on changing char array length)
$(LI $(BUGZILLA 7187): Regression(head 12d62ca5): [CTFE] ICE on slicing)
$(LI $(BUGZILLA 7188): "import phobos;" crashes DMD)
$(LI $(BUGZILLA 7189): inline failed)
$(LI $(BUGZILLA 7190): Tuple length incorrect)
$(LI $(BUGZILLA 7194): [CTFE] Incorrect behaviour with pointers as local struct variable)
$(LI $(BUGZILLA 7197): enum string doesn't work with CTFE)
$(LI $(BUGZILLA 7216): [CTFE] Can't call struct member function using pointer field)
$(LI $(BUGZILLA 7217): [CTFE] ICE on accessing struct array field)
$(LI $(BUGZILLA 7218): Nested function with contract is rejected)
$(LI $(BUGZILLA 7228): MOVDQ2Q instruction is emitted with swapped register indices)
$(LI $(BUGZILLA 7231): Segfault using opDispatch with property notation)
$(LI $(BUGZILLA 7232): Warning: statement is not reachable has no line number)
$(LI $(BUGZILLA 7239): C style struct initialization doesn't work with aliases)
$(LI $(BUGZILLA 7245): [CTFE] Address of ref foreach parameter changes to point after array)
$(LI $(BUGZILLA 7248): [CTFE] Stack overflow on using struct filed pointer with address of array element)
$(LI $(BUGZILLA 7266): [CTFE] Assign to ref param (that's taken from struct member) is noop)
$(LI $(BUGZILLA 7277): [CTFE ICE] Assertion failure: 'thisval' on line 1690 in file 'interpret.c')
$(LI $(BUGZILLA 7285): Implicit fixed-size array cast)
$(LI $(BUGZILLA 7309): [2.058] Regression caused by new inlining code)
$(LI $(BUGZILLA 7335): sometimes the OUT - block have undefined class members-acces)
$(LI $(BUGZILLA 7351): Possible asm bug: bad type/size of operands 'xadd')
$(LI $(BUGZILLA 7359): Template function with typesafe variadic rejects more than one string arguments)
$(LI $(BUGZILLA 7367): wrong char comparison result)
$(LI $(BUGZILLA 7373): (Regression git) Renamed imports conflict with other implicitly imported symbols)
$(LI $(BUGZILLA 7375): Regression(2.057): Invalid downcast permitted with derived/aliased template classes)
$(LI $(BUGZILLA 7377): Compiler segfault in: TemplateMixin::hasPointers())
$(LI $(BUGZILLA 7383): Blank lines in code sections cause premature section termination)
$(LI $(BUGZILLA 7419): [2.058/CTFE] Constructor of struct is overwritten inside a unittest with -inline)
$(LI $(BUGZILLA 7435): Regression(master):dmd crashes when 'scope(failure) debug ...' without -debug option.)
)
)
$(VERSION 072, Dec 10, 2011, =================================================,
$(WHATSNEW
$(LI Better use of XMM registers in 64 bit targets.)
$(LI Add Mach-O 64 bit support for obj2asm and dumpobj)
$(LI Add OSX 64 bit target)
$(LI classes, interfaces, and exceptions are supported in CTFE)
)
$(BUGSFIXED
$(LI $(BUGZILLA 2532): '=' does not give a boolean result)
$(LI $(BUGZILLA 2856): static opIndex does not compile for a templated struct/class)
$(LI $(BUGZILLA 3990): Deferencing a dynamic array as pointer)
$(LI $(BUGZILLA 4047): [CTFE] class/struct heap allocation)
$(LI $(BUGZILLA 4511): Contravariance problem)
$(LI $(BUGZILLA 4583): PIC code not working: EBX register set incorrectly)
$(LI $(BUGZILLA 5311): Pure is broken when accessing globals / static data through instance reference)
$(LI $(BUGZILLA 5364): optimizer kills high dword of -1)
$(LI $(BUGZILLA 6077): CTFE: Cannot append null array to null array.)
$(LI $(BUGZILLA 6354): Optimizer bug on x86_64: Bitshift optimized out when foreach and scope(failure) are used)
$(LI $(BUGZILLA 6416): [CTFE] Declaration static struct is not yet implemented in CTFE)
$(LI $(BUGZILLA 6522): [CTFE] Problem with opAssign call in foreach(ref))
$(LI $(BUGZILLA 6603): [CTFE] Can't call through a manifest constant function pointer)
$(LI $(BUGZILLA 6792): [CTFE] ICE with pointer cast of indexed array)
$(LI $(BUGZILLA 6800): [CTFE] dangerous pointer casts should be rejected)
$(LI $(BUGZILLA 6816): [CTFE] nested function can't access this)
$(LI $(BUGZILLA 6817): [CTFE] Error on interpreting inlined IfStatement)
$(LI $(BUGZILLA 6851): [CTFE] Cannot deref pointer passed by argument)
$(LI $(BUGZILLA 6859): Segfault when abstract method uses with contract.)
$(LI $(BUGZILLA 6868): IsExp + incorrect static array type = error)
$(LI $(BUGZILLA 6877): [XMM] regression, clobbered float value)
$(LI $(BUGZILLA 6879): The difference of between template matching and IsExp)
$(LI $(BUGZILLA 6881): [XMM] ICE with painted float)
$(LI $(BUGZILLA 6885): [CTFE] wrong code with dynamically allocated 2D array)
$(LI $(BUGZILLA 6886): [CTFE] ICE(interpret.c) new array with initializer)
$(LI $(BUGZILLA 6901): wrong error "override cannot be applied to variable" in CTFE forward reference)
$(LI $(BUGZILLA 6910): __traits(hasMember, "<name>") does not work, if template has alias param)
$(LI $(BUGZILLA 6919): [CTFE] Cannot get effect to local variable through its pointer)
$(LI $(BUGZILLA 6972): [CTFE] ICE with ubyte/=uint)
$(LI $(BUGZILLA 6997): 64bit optimizer bug)
$(LI $(BUGZILLA 7004): Iterating tuple with index which explicitly typed as size_t causes an error)
$(LI $(BUGZILLA 7026): 64 bit optimizer bug)
$(LI $(BUGZILLA 7028): Fails to save FPU regs when executing finally block)
)
)
$(VERSION 071, Oct 26, 2011, =================================================,
$(WHATSNEW
$(LI add -gs compiler switch)
$(LI $(BUGZILLA 6752): Add separate option to control stack frame generation)
)
$(BUGSFIXED
$(LI $(BUGZILLA 546): Error message for accessing a deprecated variable is doubled)
$(LI $(BUGZILLA 1891): Array-concatenation of T* and T*[] produces corrupted result)
$(LI $(BUGZILLA 1993): Error calling vararg delegate with null)
$(LI $(BUGZILLA 2315): DMD Stack Overflow on unwanted ctfe recursion)
$(LI $(BUGZILLA 2553): Excess attribute propagation for interfaces)
$(LI $(BUGZILLA 2740): Template Mixins do not work as advertised)
$(LI $(BUGZILLA 2953): tuple.length rejected as a tuple parameter in a static foreach)
$(LI $(BUGZILLA 3069): Array literals do not implicitly cast to void[])
$(LI $(BUGZILLA 3133): Compiler does not check that static array casts are legal)
$(LI $(BUGZILLA 4022): [CTFE] AA get)
$(LI $(BUGZILLA 4197): ICE(glue.c): error in forward-referenced in/out contract)
$(LI $(BUGZILLA 4206): type accepted as enum initializer)
$(LI $(BUGZILLA 4237): Typedefs of the same name cause initializer conflict)
$(LI $(BUGZILLA 4269): Regression(2.031): invalid type accepted if evaluated while errors are gagged)
$(LI $(BUGZILLA 4284): empty string[] alias lacks .length in a template)
$(LI $(BUGZILLA 5453): ICE(statement.c): invalid switch statement forward referenced by CTFE)
$(LI $(BUGZILLA 5696): Templates typetuple iteration)
$(LI $(BUGZILLA 5932): Internal error: s2ir.c 339)
$(LI $(BUGZILLA 6073): Cannot pass __traits(parent, ...) as a template parameter if it is a module)
$(LI $(BUGZILLA 6084): Impossible to instantiate local template with TypeTuple-foreach iterator variable.)
$(LI $(BUGZILLA 6087): typeof(this) doesn't work outside member function)
$(LI $(BUGZILLA 6139): Duplicate error message on compile-time out of bounds array index)
$(LI $(BUGZILLA 6296): ICE(glue.c): invalid template instantiated in is(typeof()).)
$(LI $(BUGZILLA 6584): ICE on large version number/debug level)
$(LI $(BUGZILLA 6599): Segfault: invalid expression in initializer)
$(LI $(BUGZILLA 6661): Templates instantiated only through is(typeof()) shouldn't cause errors)
$(LI $(BUGZILLA 6665): Regression(2.055) ICE(cg87.c): static double inside closure)
$(LI $(BUGZILLA 6672): [CTFE] ICE on compile time std.algorithm.sort)
$(LI $(BUGZILLA 6693): [CTFE] Cannot set value to nested AA)
$(LI $(BUGZILLA 6695): typeof(this) does not take into account const/immutable attributes inside member functions)
$(LI $(BUGZILLA 6721): [CTFE] Cannot get pointer to start of char[])
$(LI $(BUGZILLA 6727): [CTFE] ICE(interpret.c): assignment from string literal.dup.ptr)
$(LI $(BUGZILLA 6733): Regression(2.054) ICE(cod2.c) pure nothrow func with side-effect parameters)
$(LI $(BUGZILLA 6739): [CTFE] Cannot set a value to an outer AA of a nested AA)
$(LI $(BUGZILLA 6749): [CTFE] problem with array of structs)
$(LI $(BUGZILLA 6751): [CTFE] ref argument of AA doesn't work)
$(LI $(BUGZILLA 6765): [CTFE]: AA.length doesn't compile when AA is null)
$(LI $(BUGZILLA 6769): [CTFE] AA.keys doesn't compile when -inline is used)
$(LI $(BUGZILLA 6775): Regression(2.054) ICE(glue.c) template parameter deduction with errors gagged)
$(LI $(BUGZILLA 6813): Yet another "cannot get frame pointer" error)
$(LI $(BUGZILLA 6825): Regression(2.055+): Address of templated method incorrectly taken)
)
)
$(VERSION 070, Sep 4, 2011, =================================================,
$(WHATSNEW
$(LI Add support for Mac OS X 10.7 Lion)
$(LI Add protection to json output)
$(LI Add SSE4.1 and SSE4.2 assembly instructions)
)
$(BUGSFIXED
$(LI $(BUGZILLA 1471): Linker error on template function. Error 42: Symbol Undefined ...)
$(LI $(BUGZILLA 1567): call to private super-constructor should not be allowed)
$(LI $(BUGZILLA 1684): offsetof does not work, adding cast is workaround)
$(LI $(BUGZILLA 1904): wrong protection lookup for private template functions)
$(LI $(BUGZILLA 2156): [] and null should be accepted where a compile-time string is required)
$(LI $(BUGZILLA 2246): Regression(2.046, 1.061): Specialization of template to template containing int arguments fails)
$(LI $(BUGZILLA 2355): is() doesn't resolve aliases before template matching)
$(LI $(BUGZILLA 2634): Function literals are non-constant.)
$(LI $(BUGZILLA 2774): Functions-as-properties makes it impossible to get the .mangleof a function)
$(LI $(BUGZILLA 2941): Wrong code for inline asm because CPU type is set too late)
$(LI $(BUGZILLA 3512): dchar iteration over string in CTFE fails)
$(LI $(BUGZILLA 4021): [CTFE] AA rehash)
$(LI $(BUGZILLA 4444): Cannot index built-in array with expression tuple)
$(LI $(BUGZILLA 4460): Regression(2.036) ICE(e2ir.c) when compiling foreach over associative array literal)
$(LI $(BUGZILLA 4682): [CTFE] Run-time Vs Compile-time of int.min % -1)
$(LI $(BUGZILLA 4837): ICE(constfold.c) CTFE with >>>=)
$(LI $(BUGZILLA 5046): Wrong type of implicit 'this' in struct/class templates)
$(LI $(BUGZILLA 5239): optimizer misreports an used before set error)
$(LI $(BUGZILLA 5585): bad debug line number info for return statements with enumerator expressions)
$(LI $(BUGZILLA 5790): 'Error: variable result used before set' when -release -inline -O)
$(LI $(BUGZILLA 5799): Address-of operator fails on nested conditional operator expression)
$(LI $(BUGZILLA 5953): Too many trailing commas are accepted)
$(LI $(BUGZILLA 6097): SSSE3 not working with MMX instructions)
$(LI $(BUGZILLA 6215): LLVM-compiled DMD segfaults due to mem.c alignment issues)
$(LI $(BUGZILLA 6250): [CTFE] Crash when swapping two pointers to arrays.)
$(LI $(BUGZILLA 6270): XMMREGS not preserved on indirect function call)
$(LI $(BUGZILLA 6276): [CTFE] Strange behavior of using ~= operator twice)
$(LI $(BUGZILLA 6280): [CTFE] Cannot put 'in' expression of AA in an 'if' condition)
$(LI $(BUGZILLA 6281): [CTFE] A null pointer '!is null' returns 'true'.)
$(LI $(BUGZILLA 6282): [CTFE] ICE when dereferencing a pointer to reference type from 'in' of an AA)
$(LI $(BUGZILLA 6283): [CTFE][Regression 2.054] Failed to assign to AA using a constness-changed array as key)
$(LI $(BUGZILLA 6306): Regression(2.054): [CTFE] Strange behavior of indirect recursive call in CTFE)
$(LI $(BUGZILLA 6331): [CTFE] Cannot evaluate SliceExp on if condition)
$(LI $(BUGZILLA 6337): [CTFE] ICE when touching member variable of struct during CTFE)
$(LI $(BUGZILLA 6344): [CTFE] Assertion Failure in interpret.c when create an empty slice from null pointer)
$(LI $(BUGZILLA 6355): Template constructor cannot initialize non-mutable field)
$(LI $(BUGZILLA 6374): [CTFE] Cannot subscript using pointer to array)
$(LI $(BUGZILLA 6375): [CTFE] Segfault when using std.array.appender with an initial array)
$(LI $(BUGZILLA 6386): [CTFE] ICE on pointer casting)
$(LI $(BUGZILLA 6399): [CTFE] struct member array.length -= x doesn't work, while array[0..$-x] works)
$(LI $(BUGZILLA 6418): [CTFE] Cannot call a struct member function with name 'length'.)
$(LI $(BUGZILLA 6429): Nested function error in reduce)
$(LI $(BUGZILLA 6491): Fully qualified values in default arguments of non-template functions are generated with an extra 'module' keyword)
$(LI $(BUGZILLA 6505): Wrong code for expression involving 8 floats, only with -O)
$(LI $(BUGZILLA 6512): [CTFE] new T[][] doesn't work)
$(LI $(BUGZILLA 6516): Regression(2.055 beta) [CTFE] ICE(constfold.c) involving new dchar[])
$(LI $(BUGZILLA 6558): [CTFE] UTF-decoding foreach gives wrong index (1-indexed))
$(LI $(BUGZILLA 6563): wrong code when using at least 8 XMM regs)
$(LI $(BUGZILLA 6601): Regression(2.053): CTFE segfault taking address of function template)
$(LI $(BUGZILLA 6602): Invalid template instantiations leaked by is(typeof())/__traits(compiles, )/Type::trySemantic)
)
)
$(VERSION 069, Jul 10, 2011, =================================================,
$(WHATSNEW
$(LI Allow labelled break and continue in CTFE)
$(LI Pointers are now supported in CTFE)
$(LI Heap-allocated structs are now supported in CTFE)
$(LI Added SSSE3 instructions to inline assembler)
$(LI Change win32 dmd to not emit a map file unless asked for with -map)
)
$(BUGSFIXED
$(LI $(BUGZILLA 693): 'this' can't be used as an alias parameter for a mixin)
$(LI $(BUGZILLA 1373): typeof(func).stringof fails when func has parameters.)
$(LI $(BUGZILLA 1570): Wrong return for address operator)
$(LI $(BUGZILLA 2180): filename error with #line)
$(LI $(BUGZILLA 2842): std.file.listdir on OSX produces invalid UTF-8 sequence)
$(LI $(BUGZILLA 3445): partial fix)
$(LI $(BUGZILLA 3722): A method without an in contract should always succeed, even if overridden)
$(LI $(BUGZILLA 4063): [CTFE] key not found in AA gives bad error message)
$(LI $(BUGZILLA 4065): [CTFE] AA "in" operator doesn't work)
$(LI $(BUGZILLA 4107): Duplicate documentation for member function templates)
$(LI $(BUGZILLA 4448): [CTFE] labeled break doesn't work in CTFE)
$(LI $(BUGZILLA 4494): ICE(cod1.c) Array literal filled with results of void function)
$(LI $(BUGZILLA 4633): typeof({return 1;}()) declaration fails if inside main)
$(LI $(BUGZILLA 4745): Non-uniform handling of commas in static initialization of structs)
$(LI $(BUGZILLA 4910): [CTFE] Cannot evaluate a function that has failed at once)
$(LI $(BUGZILLA 4963): ICE(type.c:320) for struct append where T.sizeof < 3)
$(LI $(BUGZILLA 4969): nothrow check can't handle multiple catches)
$(LI $(BUGZILLA 5086): Regression(1.061): Stack overflow with recursive alias declaration)
$(LI $(BUGZILLA 5258): [CTFE] Stack overflow with struct by ref)
$(LI $(BUGZILLA 5396): [CTFE] Invalid code with nested functions in CTFE)
$(LI $(BUGZILLA 5615): [CTFE] std.string.indexOf broken at compile time)
$(LI $(BUGZILLA 5633): [CTFE] ICE(constfold.c): is expression with struct, struct pointer, array literal...)
$(LI $(BUGZILLA 5676): [CTFE] segfault using tuple containing struct that has opAssign)
$(LI $(BUGZILLA 5682): [CTFE] Silently wrong result possibly related to operator overloading and expression order)
$(LI $(BUGZILLA 5682): Wrong CTFE with operator overloading)
$(LI $(BUGZILLA 5708): [CTFE] Incorrect string constant folding with -inline)
$(LI $(BUGZILLA 5845): Regression(2.041) [CTFE] "stack overflow" with recursive ref argument)
$(LI $(BUGZILLA 5936): Invalid code with nested functions in CTFE)
$(LI $(BUGZILLA 5946): failing lookup 'this' from function in template)
$(LI $(BUGZILLA 5963): iasm does not accept 64bit integer literal)
$(LI $(BUGZILLA 5885): wrong codegen for OPu32_d)
$(LI $(BUGZILLA 6001): [CTFE] ICE(interpret.c) mutating ref array)
$(LI $(BUGZILLA 6015): [CTFE] Strange behavior of assignment appears in a situation)
$(LI $(BUGZILLA 6049): [CTFE] Array literals of structs with invariant() are wrong)
$(LI $(BUGZILLA 6052): [CTFE] Struct elements in an array are treated like reference type)
$(LI $(BUGZILLA 6053): [CTFE] Two ICEs involving pointers (dereference and assign; pointer variable on stack))
$(LI $(BUGZILLA 6054): [CTFE] ICE when returning a returned compile-time associative array containing a key of an idup-ed array literal)
$(LI $(BUGZILLA 6072): [CTFE] Regression(git master): Cannot declare variable inside an 'if' condition)
$(LI $(BUGZILLA 6077): [CTFE] Cannot append null array to null array.)
$(LI $(BUGZILLA 6078): [CTFE] ICE on foreach over array struct member which is null)
$(LI $(BUGZILLA 6079): [CTFE] Array index out of bound detection is off-by-one)
$(LI $(BUGZILLA 6090): DDoc parenthesis escape issues.)
$(LI $(BUGZILLA 6100): [CTFE] Regression: struct return values wrong if used in array initializer)
$(LI $(BUGZILLA 6120): [CTFE] ICE on calling constructor of template struct with -inline in function/delegate literal.)
$(LI $(BUGZILLA 6123): [CTFE] Cannot call a template member method inside delegate/function literal with -inline.)
$(LI $(BUGZILLA 6137): [CTFE] Foreach on semantically wrong initialized array crashes the compiler)
$(LI $(BUGZILLA 6164): [CTFE] Local arrays in a recursive local function behave funny)
$(LI $(BUGZILLA 6242): Disallow inoperant "in" contracts)
)
)
$(VERSION 068, May 12, 2011, =================================================,
$(WHATSNEW
$(LI Added 64 bit tools to Linux)
$(LI Renamed linux/bin to linux/bin32, added linux/bin64)
$(LI $(BUGZILLA 4833): dmd -od doesn't make it to optlink's command line for map files)
$(LI Added cmpxchg16b, 64 bit bswap and movq instructions to IASM)
)
$(BUGSFIXED
$(LI $(BUGZILLA 937): C-style variadic functions broken)
$(LI $(BUGZILLA 1330): Array slicing does not work the same way in CTFE as at runtime)
$(LI $(BUGZILLA 1389): Can't use mixin expressions when start of a statement.)
$(LI $(BUGZILLA 2436): Unexpected OPTLINK termination EIP = 00425303 with /co)
$(LI $(BUGZILLA 2990): TypeInfo.init() returns invalid array)
$(LI $(BUGZILLA 3214): Incorrect DWARF line number debugging information on Linux)
$(LI $(BUGZILLA 3372): optlink silently mistreats object files with more than 16384 symbols)
$(LI $(BUGZILLA 3779): ["123"][0][$-1] causes __dollar unresolved in compile-time.)
$(LI $(BUGZILLA 3792): Regression(1.053) "non-constant expression" for a template inside)
$(LI $(BUGZILLA 3801): CTFE: this.arr[i] cannot be evaluated at compile time for structs)
$(LI $(BUGZILLA 3809): Struct initializers apparently always CTFE'd)
$(LI $(BUGZILLA 3835): ref foreach does not work in CTFE)
$(LI $(BUGZILLA 4001): const variables should be readable inside CTFE)
$(LI $(BUGZILLA 4048): [CTFE] struct initializer: missing line number in error message)
$(LI $(BUGZILLA 4050): [CTFE] array struct member slice update)
$(LI $(BUGZILLA 4051): [CTFE] array struct member item update)
$(LI $(BUGZILLA 4140): Error: non-constant expression "hello"[1u..__dollar])
$(LI $(BUGZILLA 4275): Unexpected optlink termination when 'export' attribute is missing)
$(LI $(BUGZILLA 4543): Regression(1.054, 2.038) typedef circular definition and segfault)
$(LI $(BUGZILLA 4815): CodeView: Global and Static symbols should have unmangled names)
$(LI $(BUGZILLA 4817): CodeView: Enum members should have simple names)
$(LI $(BUGZILLA 4917): Symbol conflict error message refers to aliased symbol instead of the alias)
$(LI $(BUGZILLA 5147): [CTFE] Return fixed-sized matrix)
$(LI $(BUGZILLA 5362): checking $ in bracket is broken.)
$(LI $(BUGZILLA 5647): [64-bit] Valgrind complains about illegal instruction)
$(LI $(BUGZILLA 5664): Cannot compile static synchronized member function.)
$(LI $(BUGZILLA 5670): Optlink 8.00.11 crash)
$(LI $(BUGZILLA 5671): Issue 5671 - CTFE string concat problem)
$(LI $(BUGZILLA 5672): ICE(cod2.c): incorrect optimization of (long &1) == 1)
$(LI $(BUGZILLA 5680): wrong calling convention on wsprintfA/W)
$(LI $(BUGZILLA 5694): va_arg doesn't work with idouble and ifloat)
$(LI $(BUGZILLA 5706): Incorrect opcode prefix generated for x86_64 inline assembly)
$(LI $(BUGZILLA 5708): Incorrect string constant folding with -inline)
$(LI $(BUGZILLA 5717): 1.067 regression: appending Unicode char to string broken)
$(LI $(BUGZILLA 5722): Regression(2.052): Appending code-unit from multi-unit code-point at compile-time gives wrong result.)
$(LI $(BUGZILLA 5735): non-scalar types implicitly converted to boolean.)
$(LI $(BUGZILLA 5740): Unable to use "this" pointer in inline assembly)
$(LI $(BUGZILLA 5741): Add the SYSCALL and SYSRET opcodes to the inline assembler)
$(LI $(BUGZILLA 5840): Cannot assign to an array member of struct in CTFE)
$(LI $(BUGZILLA 5852): CTFE: wrong code for string[] ~= const(string))
$(LI $(BUGZILLA 5858): Import not acctept const string as arguments)
$(LI $(BUGZILLA 5865): __dollar cannot be read at compile time)
$(LI $(BUGZILLA 5916): DMD: bad message for incorrect operands error)
$(LI $(BUGZILLA 5966): [2.053 beta][CTFE] Stack overflow on trivial func)
$(LI $(BUGZILLA 5972): CTFE: Can't assign to elements of arrays of slices)
$(LI $(BUGZILLA 5975): [2.053 beta][CTFE] ICE: 'global.errors' on line 1416 in file 'constfold.c')
$(LI $(BUGZILLA 5976): "variable used before set" with foreach with ref + scope(failure) + structure method + -O -inline)
$(LI Fix spelling of $(CODE cmpxchgb8))
)
)
$(VERSION 067, Feb 17, 2011, =================================================,
$(WHATSNEW
$(LI 64 bit support for Linux)
$(LI Support HTML5 entities)
$(LI FreeBSD version upgraded to FreeBSD 8.1)
)
$(BUGSFIXED
$(LI $(BUGZILLA 190): Cannot forward reference typedef/alias in default value for function parameter)
$(LI $(BUGZILLA 1914): Array initialisation from const array yields memory trample)
$(LI $(BUGZILLA 3198): wrong initializer for structs arrays)
$(LI $(BUGZILLA 3681): ICE(go.c): when function takes too long to optimize, only with -O.)
$(LI $(BUGZILLA 4245): Declaring conflicting symbols in single function scope allowed)
$(LI $(BUGZILLA 4379): ICE(blockopt.c): foreach over huge tuple, only with -O)
$(LI $(BUGZILLA 4389): ICE(constfold.c, expression.c), or wrong code: string~=dchar in CTFE)
$(LI $(BUGZILLA 4486): CodeView debug info should contain absolute path names)
$(LI $(BUGZILLA 4753): fail_compilation/fail116.d sends dmd into a loop, exhausting memory)
$(LI $(BUGZILLA 4878): Ddoc: Default arguments can break Ddoc output)
$(LI $(BUGZILLA 4973): map file with spaces in file name passed without quotes to linker)
$(LI $(BUGZILLA 5015): Regression(1.061): Cyclic import breaks is() in a static if)
$(LI $(BUGZILLA 5090): ICE(todt.c) struct literal initializing zero length array)
$(LI $(BUGZILLA 5105): Member function template cannot be synchronized)
$(LI $(BUGZILLA 5221): entity.c: Merge Walter's list with Thomas')
$(LI $(BUGZILLA 5241): dmd: ABI breakage/regression (TypeInfo.toString() returns partially corrupted string))
$(LI $(BUGZILLA 5242): self referencing template constraint crashes compiler)
$(LI $(BUGZILLA 5244): PATCH: fix use of uninitialised variable in toObj.c)
$(LI $(BUGZILLA 5246): PATCH(s): fix a couple more uninitialised variables)
$(LI $(BUGZILLA 5349): ICE(toir.c): nested class in static member function)
$(LI $(BUGZILLA 5391): Crash with recursive alias declaration)
$(LI $(BUGZILLA 5439): 64bit struct alignment inconsistent with C ABI)
$(LI $(BUGZILLA 5455): ICE(cgcod.c): Optimization (register allocation?) regression in DMD 1.065)
$(LI $(BUGZILLA 5486): Missing define for running dmd as 64 bit)
$(LI $(BUGZILLA 5534): [64-bit] Inexplicable segfault in small code snippet, -O -release -m64 only)
$(LI $(BUGZILLA 5536): Array append with dollar op on 64-bit)
$(LI $(BUGZILLA 5545): [64-bit] DMD fails to postincrement ubytes.)
$(LI $(BUGZILLA 5549): [64-bit] Internal error: backend/cgcod.c 1845)
$(LI $(BUGZILLA 5556): [64-bit] Wrong Implicit Conversion to Double)
$(LI $(BUGZILLA 5557): [64-Bit] FP (alignment?) issues with Rvalues)
$(LI $(BUGZILLA 5564): [64-bit] loading of wrong constant byte value)
$(LI $(BUGZILLA 5565): [64-bit] Wrong Floating Point Results, Related to Mixing With size_t)
$(LI $(BUGZILLA 5566): [64-bit] More erratic FP results with size_t)
$(LI $(BUGZILLA 5571): [64-bit] new bool returns bogus address)
$(LI $(BUGZILLA 5572): [64-bit] Global Hidden Mutexes Seem to share Addresses W/ Global Variables)
$(LI $(BUGZILLA 5580): [64-bit] String switch statements broken in 64-bit mode)
$(LI $(BUGZILLA 5581): [64-bit] Wrong code with bitwise operations on bools)
$(LI $(BUGZILLA 5592): Previous definition different: __arrayExpSliceMulSliceAddass_d)
)
)
$(VERSION 066, Dec 21, 2010, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(LI $(BUGZILLA 603): Undocumented behaviour: case and default create a scope)
$(LI $(BUGZILLA 632): Typedef/enum promotions spec ambiguous - ultimate base type or lowest common denominator?)
$(LI $(BUGZILLA 679): Spec needs allowances for copying garbage collection)
$(LI $(BUGZILLA 690): ABI not fully documented)
$(LI $(BUGZILLA 1351): Discrepancies in the language specification)
$(LI $(BUGZILLA 1466): Spec claims maximal munch technique always works: not for "1..3")
$(LI $(BUGZILLA 2206): unnamed template mixin of class inside function or class has incorrect classinfo and mangleof)
$(LI $(BUGZILLA 2385): spec says all structs are returned via hidden pointer on linux, but it uses registers)
$(LI $(BUGZILLA 2392): Parsing ambiguity between function pointer declaration and function call)
$(LI $(BUGZILLA 2406): Declarator2 definition error)
$(LI $(BUGZILLA 2556): Property classinfo needs better documentation (RTTI, typeof, typeid, runtime type information))
$(LI $(BUGZILLA 2616): Undocumented behaviour: part-explicit, part-implicit instantiations of function templates are accepted)
$(LI $(BUGZILLA 2651): class body declaration grammar incorrect)
$(LI $(BUGZILLA 2652): DeclDef grammar is wrong)
$(LI $(BUGZILLA 2734): Ambiguity in tokenizing: _._ as a float literal)
$(LI $(BUGZILLA 2994): Incomplete "Predefined Versions" documentation)
$(LI $(BUGZILLA 3112): Specification on what operations call the GC is missing)
$(LI $(BUGZILLA 3276): Recursion broken by alias template parameter)
$(LI $(BUGZILLA 3554): Ddoc generates invalid output for documentation comments with non paired parantheses)
$(LI $(BUGZILLA 4529): Segfault(typinf.c) involving typeid(typeof(functionName)))
$(LI $(BUGZILLA 4728): Segfault(toctype.c) by protected/private constructor in an other module)
$(LI $(BUGZILLA 4864): ICE(statement.c) Crash on invalid 'if statement' body inside mixin)
$(LI $(BUGZILLA 5110): Excess attribute propagation of structs and classes)
$(LI $(BUGZILLA 5117): [CTFE] Member function call with rather complex this: side effects ignored)
$(LI $(BUGZILLA 5120): ICE(mtype.c) void associative arrays)
$(LI $(BUGZILLA 5145): Regression(2.050, 1.065) override error with forward ref of superclass)
$(LI $(BUGZILLA 5159): Segfault(interpret.c): calling a static function pointer variable in CTFE)
$(LI $(BUGZILLA 5164): Error without line number using "is (T...)")
$(LI $(BUGZILLA 5180): ICE(arrayop.c) in-place array operation on incompatible types)
$(LI $(BUGZILLA 5182): ICE(expression.c): calling unittest from a function)
$(LI $(BUGZILLA 5195): Forward references ignore const)
$(LI $(BUGZILLA 5230): Regression(2.041, 1.057) ICE(tocsym.c) overriding a method that has an out contract)
$(LI $(BUGZILLA 5238): PATCH: fix return of uninitialised var in interpret.c)
$(LI $(BUGZILLA 5275): x86_64 related hidden function parameter mishandled)
$(LI $(BUGZILLA 5294): -O optimization breaks for loop)
$(LI $(BUGZILLA 5331): mach format problem)
)
)
$(VERSION 065, Oct 29, 2010, =================================================,
$(WHATSNEW
$(LI added talign() and argTypes() to TypeInfo)
$(LI Upgrade zlib support to zlib 1.2.5)
)
$(BUGSFIXED
$(LI Unlisted bug: signed long comparisons under OS X)
$(LI $(BUGZILLA 3602): ICE(tocsym.c) compiling a class, if its super class has preconditions)
$(LI $(BUGZILLA 3665): Regression(1.051, 2.036) Assignment with array slicing does not work)
$(LI $(BUGZILLA 4398): dmd always uses Windows name mangling for _d_throw
$(RED may require update to Tango))
$(LI $(BUGZILLA 4623): Non-integer type allowed as static array size)
$(LI $(BUGZILLA 4768): Regression(1.056): wrong code with forward declaration of enum)
$(LI $(BUGZILLA 4825): Regression(1.057, 2.040) "Error: non-constant expression" with -inline)
$(LI $(BUGZILLA 4873): Assertion failure: '0' on line 1483 in file 'expression.c')
$(LI $(BUGZILLA 4897): CodeView: No locals or parameters are shown when debugging, because of missing function info)
$(LI $(BUGZILLA 4925): [ICE] segfault with module-scope assert(0))
$(LI $(BUGZILLA 4926): ICE: PREC_zero assertion failure due to unset precedence)
$(LI $(BUGZILLA 4941): Built-in tuple slice boundaries are not CTFE'd)
$(LI $(BUGZILLA 4949): ICE on invalid static if using value of 'this')
$(LI $(BUGZILLA 5026): ICE(expression.c) Incomplete mixin expression + char[] to char assignment)
)
)
$(VERSION 064, Sep 13, 2010, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(xxLI $(BUGZILLA 190): Cannot forward reference typedef/alias in default value for function parameter)
$(LI $(BUGZILLA 1715): Template specialization checks for equality rather than convertibility)
$(LI $(BUGZILLA 1970): Templated interfaces not matched)
$(LI $(BUGZILLA 2511): Covariant return type doesn't work with circular import)
$(LI $(BUGZILLA 2716): Confusion of auto and scope as the class attribute)
$(LI $(BUGZILLA 3046): Segfault with C++ static variable (Linux only))
$(LI $(BUGZILLA 3418): link error with cast(ulong)(ulong*real))
$(xxLI $(BUGZILLA 3493): Segfault(cast.c) Forward reference with type inference, D1 only.)
$(LI $(BUGZILLA 3544): optlink termination 0041338f with recursive nested functions)
$(LI $(BUGZILLA 3554): Ddoc generats invalid output for documentation comments with non paired paranthasis)
$(LI $(BUGZILLA 3627): -of with a filename with a double extension confuses linker)
$(LI $(BUGZILLA 4009): OPTLINK ruins the day yet again)
$(LI $(BUGZILLA 4173): Regression(2.037) Explicitly instantiated templates still try to do IFTI in some cases)
$(LI $(BUGZILLA 4278): allow inlining of super calls (undo limitations of bug3500's fix))
$(LI $(BUGZILLA 4302): Regression(2.046, 1.061): compiler errors using startsWith in CTFE)
$(LI $(BUGZILLA 4645): to!string(const char*) in library causes Optlink to issue warning)
$(LI $(BUGZILLA 4652): Compiler hangs on template with zero-length tuple and another argument)
$(LI $(BUGZILLA 4655): Regression(1.063, 2.048) goto to a try block ICEs)
$(LI $(BUGZILLA 4676): Overload resolution rejects valid code when mixing variadics, non-variadics)
$(LI $(BUGZILLA 4691): Incorrect comparison of double and long)
$(LI $(BUGZILLA 4721): compilation slow when compiling unittests on dcollections)
$(LI $(BUGZILLA 4751): Regression(1.062, 2.047) ICE(constfold.c) >> after error)
$(LI $(BUGZILLA 4752): fail_compilation/fail345.d asserts in expression.c)
$(LI $(BUGZILLA 4771): fail_compilation/fail274.d hits a halt in iasm.c)
$(LI $(BUGZILLA 4828): ICE w/ non-boolean dot expression sth.template_instance in static if)
)
)
$(VERSION 063, Aug 8, 2010, =================================================,
$(WHATSNEW
$(LI $(BUGZILLA 4080): Patch for building dynamic libraries on Mac OS X)
)
$(BUGSFIXED
$(LI $(BUGZILLA 1418): tupleof bug on nested classes)
$(LI $(BUGZILLA 1678): ref with varargs generates invalid code)
$(LI $(BUGZILLA 2931): Initialization struct with array from another struct)
$(LI $(BUGZILLA 3326): $ in delegate literal causes Access Violation)
$(LI $(BUGZILLA 3560): foreach over nested function generates wrong code)
$(LI $(BUGZILLA 3569): DMD Stack Overflow with a struct member function inside a C-style struct initializer)
$(LI $(BUGZILLA 3679): Regression(2.031) template forward reference regression)
$(LI $(BUGZILLA 3706): delegates of interfaces with multiple inheritance fail)
$(LI $(BUGZILLA 4191): [FreeBSD] real constants are rounded to double precision)
$(LI $(BUGZILLA 4198): [FreeBSD] imprecision in decimal floating-point literals)
$(LI $(BUGZILLA 4238): Segfault(statement.c): with(typeof(int)))
$(LI $(BUGZILLA 4303): __traits(compiles) returns wrong result when used recursively)
$(LI $(BUGZILLA 4314): Regression(1.062): Expression array1 && array2 doesn't compile)
$(LI $(BUGZILLA 4339): Struct destructor + invariant + struct parameter = horrific error message)
$(LI $(BUGZILLA 4396): mkdir race prevents concurrent compiling with DMD using make -j)
$(LI $(BUGZILLA 4443): Optimizer produces wrong code for || or && with struct arrays)
$(LI $(BUGZILLA 4503): forward reference to aliased template instance)
$(LI $(BUGZILLA 4506): Regression(2.034): -O flag breaks some recursive functions)
$(LI $(BUGZILLA 4514): Regression: Cannot cast from X* to X)
$(LI $(BUGZILLA 4569): extern(c++) doesn't understand const types, produces bad mangled symbol)
$(LI $(BUGZILLA 4578): Regression(2.047,1.062): ICE(cgcod.c): var+arr[])
)
)
$(VERSION 062, Jun 9, 2010, =================================================,
$(WHATSNEW
$(LI $(BUGZILLA 2008): Poor optimization of functions with ref parameters)
$(LI $(BUGZILLA 4296): Reduce parasitic error messages)
)
$(BUGSFIXED
$(LI $(BUGZILLA 1193): regression: "matches more than one template declaration" doesn't list the location of the conflicting templates)
$(LI $(BUGZILLA 1894): scope(exit) is ignored except in compound statements)
$(LI $(BUGZILLA 1941): missing line on inaccesable external private module member)
$(LI $(BUGZILLA 2127): inliner turns struct "return *this" from by-value into by-ref)
$(LI $(BUGZILLA 2276): Error message missing line number on array operation)
$(LI $(BUGZILLA 2546): Array Ops silently fail when no slice symbol is used.)
$(LI $(BUGZILLA 2881): x.stringof returns typeof(x).stringof when x is an enum)
$(LI $(BUGZILLA 3064): Invalid array operation accepted, generates bad code)
$(LI $(BUGZILLA 3323): Segfault or ICE(e2ir.c) using struct with destructor almost anywhere)
$(LI $(BUGZILLA 3398): Attributes inside a union screws data alignment)
$(LI $(BUGZILLA 3547): for option -od for relative path the path is added twice)
$(LI $(BUGZILLA 3548): ICE occurs when an array is returned from a function is incorrectly used in an array op expression.)
$(LI $(BUGZILLA 3651): mangleof broken for enums)
$(LI $(BUGZILLA 3854): Error on static initialization of arrays with trailing comma.)
$(LI $(BUGZILLA 4003): The result changes only with the order of source files.)
$(LI $(BUGZILLA 4045): [CTFE] increasing array length)
$(LI $(BUGZILLA 4052): [CTFE] increment from array item)
$(LI $(BUGZILLA 4078): [CTFE] Failed return of dynamic array item)
$(LI $(BUGZILLA 4084): Ignored missing main() closing bracket)
$(LI $(BUGZILLA 4143): fix warnings in dmd build)
$(LI $(BUGZILLA 4156): Segfault with array+=array)
$(LI $(BUGZILLA 4169): building dmd with a modern gcc produces a buggy compiler)
$(LI $(BUGZILLA 4175): linux.mak doesn't declare sufficient dependencies to support parallel builds)
$(LI $(BUGZILLA 4210): Random crashes / heisenbugs caused by dmd commit 478: compiler messes up vtables)
$(LI $(BUGZILLA 4212): DWARF: void arrays cause gdb errors)
$(LI $(BUGZILLA 4213): Strange behaviour with static void[] arrays)
$(LI $(BUGZILLA 4242): ICE(module.c): importing a module with same name as package)
$(LI $(BUGZILLA 4252): [CTFE] No array bounds checking in assignment to char[] array)
$(LI $(BUGZILLA 4257): ICE(interpret.c): passing parameter into CTFE as ref parameter)
$(LI $(BUGZILLA 4259): Header generation omits leading '@' for properties)
$(LI $(BUGZILLA 4270): Missing line number in 'can only catch class objects' error message)
)
)
$(VERSION 061, May 10, 2010, =================================================,
$(WHATSNEW
$(LI Add hints for missing import declarations.)
$(LI Speed up compilation.)
)
$(BUGSFIXED
$(LI Fix hanging problem on undefined identifiers.)
$(LI $(BUGZILLA 461): Constant not understood to be constant when circular module dependency exists.)
$(LI $(BUGZILLA 945): template forward reference with named nested struct only)
$(LI $(BUGZILLA 1055): union forward reference "overlapping initialization" error)
$(LI $(BUGZILLA 2085): CTFE fails if the function is forward referenced)
$(LI $(BUGZILLA 2386): Array of forward referenced struct doesn't compile)
$(LI $(BUGZILLA 4015): forward reference in alias causes error)
$(LI $(BUGZILLA 4016): const initializer cannot forward reference other const initializer)
$(LI $(BUGZILLA 4042): Unable to instantiate a struct template.)
$(LI $(BUGZILLA 4100): Break and continue to label should mention foreach)
)
)
$(VERSION 060, May 4, 2010, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(LI Another try at fixing the Dwarf issues.)
)
)
$(VERSION 059, Apr 30, 2010, =================================================,
$(WHATSNEW
$(LI Improve spelling checking distance to 2.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 1079): gdb: Dwarf Error: Cannot find DIE at 0xb705 referenced from DIE at 0x250)
$(LI $(BUGZILLA 2549): Segfault on array multiplication.)
$(LI $(BUGZILLA 3066): Array operation without a slice as the lvalue accepted, bad codegen)
$(LI $(BUGZILLA 3207): gdb: Push D patches upstream)
$(LI $(BUGZILLA 3415): broken JSON output)
$(LI $(BUGZILLA 3522): ICE(cg87.c): variable*array[].)
$(LI $(BUGZILLA 3974): ICE(init.c): Static array initializer with more elements than destination array)
$(LI $(BUGZILLA 3987): [gdb] Invalid DWARF output for function pointers)
$(LI $(BUGZILLA 4036): Segfault with -inline and literal of struct containing union)
$(LI $(BUGZILLA 4037): [gdb] Invalid DWARF output for wchar)
$(LI $(BUGZILLA 4038): [gdb] Invalid DWARF output for function pointers with ref args)
$(LI $(BUGZILLA 4067): [CTFE] Code inside try-catch blocks is silently ignored)
$(LI $(BUGZILLA 4089): crash when creating JSON output for incomplete struct)
$(LI $(BUGZILLA 4093): Segfault(interpret.c): with recursive struct templates)
$(LI $(BUGZILLA 4105): Stack overflow involving alias template parameters and undefined identifier)
)
)
$(VERSION 058, Apr 6, 2010, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(LI $(BUGZILLA 122): DDoc newline behaviour produces suboptimal results)
$(LI $(BUGZILLA 1628): Ddoc produces invalid documentation for --- blocks)
$(LI $(BUGZILLA 2609): No documentation generated for destructor)
$(LI $(BUGZILLA 3808): Assertion Failure : Assertion failure: 'classinfo->structsize == CLASSINFO_SIZE' on line 870 in file 'toobj.c')
$(LI $(BUGZILLA 3842): ICE(expression.c) using pointer in CTFE)
$(LI $(BUGZILLA 3884): Segfault: defining a typedef with an invalid object.d)
$(LI $(BUGZILLA 3885): No multithread support for Windows DLL)
$(LI $(BUGZILLA 3899): CTFE: poor error message for use of uninitialized variable)
$(LI $(BUGZILLA 3900): CTFE: Wrong return value for array.var assignment)
$(LI $(BUGZILLA 3901): PATCH: Nested struct assignment for CTFE)
$(LI $(BUGZILLA 3914): Struct as argument that fits in register has member accessed wrong)
$(LI $(BUGZILLA 3919): ICE(expression.c, 9944): * or / with typedef ireal)
$(LI $(BUGZILLA 3920): Assertion failure: '0' on line 10018 in file 'expression.c')
$(LI $(BUGZILLA 3958): mixin(non-static method) crashes compiler)
$(LI $(BUGZILLA 3972): Regarding module with name different from its file name)
$(LI $(BUGZILLA 4002): dmd.conf and binary path in dmd -v output)
$(LI $(BUGZILLA 4004): DMD 2.042 CTFE regression with functions taking ref parameters)
$(LI $(BUGZILLA 4005): std.c.stdlib.exit in CTFE and more)
$(LI $(BUGZILLA 4011): Incorrect function overloading using mixins)
$(LI $(BUGZILLA 4019): [CTFE] Adding an item to an empty AA)
$(LI $(BUGZILLA 4020): [ICE][CTFE] struct postblit in CTFE)
$(LI $(BUGZILLA 4027): Closures in CTFE generate wrong code)
$(LI $(BUGZILLA 4029): CTFE: cannot invoke delegate returned from function)
)
)
$(VERSION 057, Mar 7, 2010, =================================================,
$(WHATSNEW
$(LI Warnings no longer halt the parsing/semantic passes, though they still return
an error status and still do not generate output files. They also no longer count
as errors when testing with "compiles" traits.)
$(LI Added $(B -wi) switch for $(BUGZILLA 2567))
$(LI Associative array contents can now be compared for equality)
$(LI Add simple spell checking.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 2321): spec on inline asm can be misunderstood)
$(LI $(BUGZILLA 2463): No line number in "statement is not reachable" warning)
$(LI $(BUGZILLA 3029): Bug in array value mangling rule)
$(LI $(BUGZILLA 3306): bad function/delegate literal generated into header files)
$(LI $(BUGZILLA 3373): bad codeview debug info for long and ulong)
$(LI Posix only, $(BUGZILLA 3420): [PATCH] Allow string import of files using subdirectories)
$(LI $(BUGZILLA 3450): incorrect result for is (typeof({ ... }())) inside a struct)
$(LI $(BUGZILLA 3500): super behaves differently with -inline)
$(LI $(BUGZILLA 3558): Optimizer bug results in false if condition being taken)
$(LI $(BUGZILLA 3670): Declarator grammar rule is broken)
$(LI $(BUGZILLA 3710): Typo in allMembers description?)
$(LI $(BUGZILLA 3736): corrupted struct returned by function with optimizations (-O))
$(LI $(BUGZILLA 3737): SEG-V at expression.c:6255 from bad opDispatch)
$(LI $(BUGZILLA 3768): reapeted quotes in ddoc.html)
$(LI $(BUGZILLA 3769): Regression: Segfault(constfold.c) array literals and case statements)
$(LI $(BUGZILLA 3775): Segfault(cast.c): casting no-parameter template function using property syntax)
$(LI $(BUGZILLA 3781): ICE(interpret.c): using no-argument C-style variadic function in CTFE)
$(LI $(BUGZILLA 3792): Regression: "non-constant expression" for a template inside a struct using a struct initializer)
$(LI $(BUGZILLA 3803): compiler segfaults)
$(LI $(BUGZILLA 3840): Jump to: section in the docs should be sorted)
)
)
$(VERSION 056, Jan 29, 2010, =================================================,
$(WHATSNEW
$(LI Clarification: function returns are not lvalues)
$(LI Add $(B -map) command line switch)
$(LI Delegates and function pointers may be used in CTFE)
$(LI Delegate literals and function literals may be used in CTFE)
$(LI Lazy function parameters may now be used in CTFE)
$(LI Slicing of char[] arrays may now be used in CTFE)
)
$(BUGSFIXED
$(LI $(CPPBUGZILLA 48): Internal error: cgreg 784)
$(LI $(BUGZILLA 1298): CTFE: tuple foreach bugs)
$(LI $(BUGZILLA 1790): CTFE: foreach(Tuple) won't compile if Tuple contains string)
$(LI $(BUGZILLA 2101): CTFE: Please may I use mutable arrays at compile time?)
$(LI Partial fix for $(BUGZILLA 3569), stops the stack overflow)
$(LI $(BUGZILLA 3668): foreach over typedef'd array crashes dmd)
$(LI $(BUGZILLA 3674): forward reference error with multiple overloads with same name)
$(LI $(BUGZILLA 3685): Regression(D1 only): DMD silently exits on valid code)
$(LI $(BUGZILLA 3687): Array operation "slice times scalar" tramples over memory)
$(LI $(BUGZILLA 3719): forward references can cause out-of-memory error)
$(LI $(BUGZILLA 3723): Regression: forward referenced enum)
$(LI $(BUGZILLA 3724): bug in Expression::arraySyntaxCopy (null pointer dereference on struct->union->struct))
$(LI $(BUGZILLA 3726): Regression: ICE(mangle.c 81): struct forward reference with static this)
$(LI $(BUGZILLA 3740): Regression: class with fwd reference of a nested struct breaks abstract)
)
)
$(VERSION 055, Jan 1, 2010, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(LI $(BUGZILLA 3663): struct forward reference regresssion)
$(LI $(BUGZILLA 3664): struct forward declaration causes enum to conflict with itself)
)
)
$(VERSION 054, Dec 30, 2009, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(LI $(CPPBUGZILLA 45): Internal error: cgcod 1594)
$(LI $(CPPBUGZILLA 46): Constant folding with long doubles)
$(LI $(NG_digitalmars_D 103391): D1 garbage collector + threads + malloc = garbage?)
$(LI $(BUGZILLA 282): Bizarre circular import nested name invisibility issue)
$(LI $(BUGZILLA 390): Cannot forward reference enum nested in struct)
$(LI $(BUGZILLA 400): forward reference error; no propety X for type Y (struct within struct))
$(LI $(BUGZILLA 1160): enums can not be forward referenced)
$(LI $(BUGZILLA 1564): Forward reference error for enum in circular import)
$(LI $(BUGZILLA 2029): Typesafe variadic functions don't work in CTFE)
$(LI $(BUGZILLA 2816): Sudden-death static assert is not very useful)
$(LI $(BUGZILLA 3455): Some Unicode characters not allowed in identifiers)
$(LI $(BUGZILLA 3575): CTFE: member structs not initialized correctly)
$(LI $(BUGZILLA 3584): DeclDef rule is missing entries)
$(LI $(BUGZILLA 3585): Duplicate clauses in EqualExpression and RelExpression rules)
$(LI $(BUGZILLA 3587): Aggregate rule references undefined Tuple)
$(LI $(BUGZILLA 3588): WithStatement rule references unspecified Symbol)
$(LI $(BUGZILLA 3589): BaseClassList and InterfaceClasses rules are incorrect, missing ',')
$(LI $(BUGZILLA 3590): FunctionParameterList rule is missing)
$(LI $(BUGZILLA 3591): TemplateIdentifier rule is misspelled)
$(LI $(BUGZILLA 3592): ClassTemplateDeclaration and FunctionTemplateDeclaration rules are unreferenced)
$(LI $(BUGZILLA 3593): IntegerExpression rule unspecified)
$(LI $(BUGZILLA 3594): AsmPrimaryExp rule references unspecified rules)
$(LI $(BUGZILLA 3595): Several rules are missing ':' after rule name)
$(LI $(BUGZILLA 3601): Debug and Release builds of DMD produce different object files)
$(LI $(BUGZILLA 3611): Enum forward referencing regression)
$(LI $(BUGZILLA 3612): ExpressionList is undefined)
$(LI $(BUGZILLA 3617): CTFE: wrong code for if(x) where x is int or smaller)
$(LI $(BUGZILLA 3628): can't cast null to int)
$(LI $(BUGZILLA 3633): Optimizer causes access violation)
$(LI $(BUGZILLA 3645): manifest constant (enum) crashes dmd)
)
)
$(VERSION 053, Dec 3, 2009, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(LI $(BUGZILLA 111): appending a dchar to a char[])
$(LI $(BUGZILLA 370): Compiler stack overflow on recursive typeof in function declaration.)
$(LI $(BUGZILLA 2229): ICE(template.c) instantiating an invalid variadic template with more than one argument)
$(LI $(BUGZILLA 2967): spec does not mention that inline asm is a valid "return" statement)
$(LI $(BUGZILLA 3115): >>> and >>>= generate wrong code)
$(LI $(BUGZILLA 3171): % not implemented correctly for floats)
$(LI $(BUGZILLA 3381): [tdpl] Incorrect assessment of overriding in triangular-shaped hierarchy)
$(LI $(BUGZILLA 3469): ICE(func.c): Regression. Calling non-template function as a template, from another module)
$(LI $(BUGZILLA 3495): Segfault(typinf.c) instantiating D variadic function with too few arguments)
$(LI $(BUGZILLA 3496): ICE(cgelem.c, optimizer bug) cast(void *)(x&1)== null.)
$(LI $(BUGZILLA 3502): Fix for dropped Mac OS X 10.5)
$(LI $(BUGZILLA 3521): Optimized code access popped register)
$(LI $(BUGZILLA 3540): Another DWARF line number fix)
)
)
$(VERSION 052, Nov 12, 2009, =================================================,
$(WHATSNEW
$(LI OSX versions 10.5 and older are no longer supported.)
)
$(BUGSFIXED
$(LI Works on OSX 10.6 now.)
)
)
$(VERSION 051, Nov 5, 2009, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(LI Problem with complicated array op expressions)
$(LI $(BUGZILLA 195): DDoc generates bad output when example contains "protected" attribute)
$(LI $(BUGZILLA 424): Unexpected OPTLINK Termination at EIP=0044C37B (too many fixups))
$(LI $(BUGZILLA 874): Bad codegen: wrong value variable in tuple foreach, D1 only)
$(LI $(BUGZILLA 1117): ddoc generates corrupted docs if code examples contain attributes with colons)
$(LI $(BUGZILLA 1812): DDOC - Unicode identifiers are not correctly marked.)
$(LI $(BUGZILLA 2862): ICE(template.c) using type tuple as function argument)
$(LI $(BUGZILLA 3292): ICE(todt.c) when using a named mixin with an initializer as template alias parameter)
$(LI $(BUGZILLA 3397): Unintended function call to static opCall)
$(LI $(BUGZILLA 3401): Compiler crash on invariant + method overload)
$(LI $(BUGZILLA 3422): ICE(cgcod.c) Structs with default initializers bigger than register size cannot be default parameters)
$(LI $(BUGZILLA 3426): ICE(optimize.c): struct literal with cast, as function default parameter.)
$(LI $(BUGZILLA 3432): ICE(e2ir.c): casting template expression)
)
)
$(VERSION 050, Oct 14, 2009, =================================================,
$(WHATSNEW
$(LI Use $(B -X) to generate JSON files.)
)
$(BUGSFIXED
$(LI Fold in patch from $(BUGZILLA 1170))
$(LI $(BUGZILLA 923): No constant folding for template value default arguments, D1 only)
$(LI $(BUGZILLA 1534): Can't mix in a case statement.)
$(LI $(BUGZILLA 2423): Erroneous unreachable statement warning)
$(LI $(BUGZILLA 3392): a cast of this to void in tango.core.Thread is not allowed)
)
)
$(VERSION 049, Oct 11, 2009, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(LI $(BUGZILLA 258): Undefined identifier error for circular import)
$(LI $(BUGZILLA 928): nested struct definition in unittest section of a templated class, hangs DMD)
$(LI $(BUGZILLA 1140): ICE(cod1.c) casting last function parameter to 8 byte value)
$(LI $(BUGZILLA 1592): dmd fail to resolve class symbol when i put files in a package)
$(LI $(BUGZILLA 1787): Compiler segfaults on circular references.)
$(LI $(BUGZILLA 1897): ICE(template.c) with tuple delegate)
$(LI $(BUGZILLA 1934): ICE(e2ir.c) using static array as AA key)
$(LI $(BUGZILLA 2229): ICE(template.c) instantiating an invalid variadic template with more than one argument)
$(LI $(BUGZILLA 2687): ICE(statement.c): tuple foreach in an erroneous template.)
$(LI $(BUGZILLA 2773): ICE(go.c) array assignment through a pointer, only with -O.)
$(LI $(BUGZILLA 2829): ICE(expression.c) static array block-initialized in struct literal)
$(LI $(BUGZILLA 2851): Segfault(expression.c) using C-style struct initializer with too few arguments)
$(LI $(BUGZILLA 3006): ICE(e2ir.c, tocsym.c) template module using array operation)
$(LI $(BUGZILLA 3041): Array slices can be compared to their element type: bad codegen or ICE)
$(LI $(BUGZILLA 3101): Stack overflow: declaring aggregate member twice with static if)
$(LI $(BUGZILLA 3174): ICE(mtype.c): Compiler crash or compiler error with auto returns and const / immutable / invarient / pure)
$(LI $(BUGZILLA 3176): Compiler hangs on poorly formed mixin in variadic template)
$(LI $(BUGZILLA 3261): compiler crash with mixin and forward reference)
$(LI $(BUGZILLA 3286): Default parameter prevents to resolve inter-module circular dependency)
$(LI $(BUGZILLA 3301): Undefined identifier error dependent on order of imports when a circular import is involved)
$(LI $(BUGZILLA 3325): ICE(func.c) function literal with post-contract)
$(LI $(BUGZILLA 3343): Crash by "auto main(){}")
$(LI $(BUGZILLA 3344): ICE(e2ir.c) returning an invalid function from main())
$(LI $(BUGZILLA 3357): ICE(cod1.c) using 'in' with a static char array as AA key)
$(LI $(BUGZILLA 3366): Segfault(declaration.c) variadic template with unmatched constraint)
$(LI $(BUGZILLA 3374): [tdpl] ICE(init.c): Associative array type not inferred)
)
)
$(VERSION 048, Oct 5, 2009, =================================================,
$(WHATSNEW
$(LI Compiler now detects some cases of illegal null dereferencing when compiled with -O)
$(LI $(BUGZILLA 2905): Faster +-*/ involving a floating-pointing literal)
)
$(BUGSFIXED
$(LI gdb stack trace should work now)
$(LI $(BUGZILLA 302): in/out contract inheritance yet to be implemented)
$(LI $(BUGZILLA 718): ICE(cgcod.c) with int /= cast(creal))
$(LI $(BUGZILLA 814): lazy argument + variadic arguments = segfault)
$(LI $(BUGZILLA 1168): Passing a .stringof of an expression as a template value parameter results in the string of the type)
$(LI $(BUGZILLA 1571): Segfault(class.c) const on function parameters not carried through to .di file)
$(LI $(BUGZILLA 1731): forward reference of function type alias resets calling convention)
$(LI $(BUGZILLA 2202): Error getting type of non-static member of a class)
$(LI $(BUGZILLA 2469): ICE(cod1.c) arbitrary struct accepted as struct initializer)
$(LI $(BUGZILLA 2697): Cast of float function return to ulong or uint gives bogus value)
$(LI $(BUGZILLA 2702): Struct initialisation silently inserts deadly casts)
$(LI $(BUGZILLA 2839): ICE(cgcs.c) with int /= imaginary)
$(LI $(BUGZILLA 3049): ICE(cod4.c) or segfault: Array operation on void[] array)
$(LI $(BUGZILLA 3059): Nonsensical complex op= should be illegal)
$(LI $(BUGZILLA 3160): ICE(cgcod.c 1511-D1) or bad code-D2 returning string from void main)
$(LI $(BUGZILLA 3304): Segfault using 'is' with a pointer enum.)
$(LI $(BUGZILLA 3305): Segfault(expression.c) with recursive struct template alias expressions)
$(LI $(BUGZILLA 3335): minor warning cleanups)
$(LI $(BUGZILLA 3336): ICE(glue.c) declaring AA with tuple key, only with -g)
$(LI $(BUGZILLA 3353): storage class of a member function is propagated to default arguments)
)
)
$(VERSION 047, Sep 2, 2009, =================================================,
$(WHATSNEW
$(LI $(BUGZILLA 3122): [patch] Adding support for fast and reliable build tools to the frontend)
$(LI Added support for:
---
a[i].var = e2
---
and:
---
a[] = e
---
in CTFE. $(I (thanks, Don!)))
$(LI Member functions can now be used in CTFE)
$(LI Operator overloading can now be used in CTFE)
$(LI Nested functions can now be used in CTFE)
$(LI CTFE error messages now explain why the function could not be
interpreted at compile time)
)
$(BUGSFIXED
$(LI Fixed bug processing spaces in dmd's directory)
$(LI $(BUGZILLA 601): statement.html - Formatting/markup errors in BNF)
$(LI $(BUGZILLA 1461): Local variable as template alias parameter breaks CTFE)
$(LI $(BUGZILLA 1605): break in switch with goto breaks in ctfe)
$(LI $(BUGZILLA 1948): CTFE fails when mutating a struct in an array)
$(LI $(BUGZILLA 1950): CTFE doesn't work correctly for structs passed by ref)
$(LI $(BUGZILLA 2569): static arrays in CTFE functions don't compile)
$(LI $(BUGZILLA 2575): gdb can not show code)
$(LI $(BUGZILLA 2604): DW_TAG_module and GDB)
$(LI $(BUGZILLA 2940): null is null cannot be evaluated at compile time)
$(LI $(BUGZILLA 2960): CTFE rejects static array to dynamic array casts)
$(LI $(BUGZILLA 3039): -vtls compiler flag not listed in man file)
$(LI $(BUGZILLA 3165): What kind of integer division does D use?)
$(LI $(BUGZILLA 3166): "positive" -> "non-negative" in modulo operator description)
$(LI $(BUGZILLA 3168): Declaring structs as incomplete types no longer works)
$(LI $(BUGZILLA 3170): Forward reference of nested class fails if outer class is not plain)
$(LI $(BUGZILLA 3183): Spec of align attribute needs work)
$(LI $(BUGZILLA 3186): corrections for http://www.digitalmars.com/d/2.0/dmd-osx.html)
$(LI $(BUGZILLA 3192): asm in a anonymous delegate crash the compiler)
$(LI $(BUGZILLA 3196): Segfault(mtype.c) after almost any error involving a delegate literal)
$(LI $(BUGZILLA 3205): CTFE: $ cannot be used in lvalues)
$(LI $(BUGZILLA 3246): ICE(init.c) using indexed array initializer on local array)
$(LI $(BUGZILLA 3264): -O causes wrong "used before set" error when using enum.)
)
)
$(VERSION 046, Jul 6, 2009, =================================================,
$(WHATSNEW
$(LI $(BUGZILLA 3080): dmd should output compilation errors to stderr, not stdout)
)
$(BUGSFIXED
$(LI Fix dmd crash on multicore Windows.)
$(LI $(BUGZILLA 106): template - mixin sequence)
$(LI $(BUGZILLA 810): Cannot forward reference template)
$(LI $(BUGZILLA 852): ICE(toir.c) using local class in non-static nested function in nested static function)
$(LI $(BUGZILLA 854): TypeTuple in anonymous delegate causes ice in glue.c)
$(LI $(BUGZILLA 1054): regression: circular aliases cause compiler stack overflow)
$(LI $(BUGZILLA 1343): Various errors with static initialization of structs and arrays)
$(LI $(BUGZILLA 1358): ICE(root.c) on Unicode codepoints greater than 0x7FFFFFFF)
$(LI $(BUGZILLA 1459): ICE(cgcs.c) on attempt to set value of non-lvalue return struct)
$(LI $(BUGZILLA 1524): ICE(constfold.c) on using "is" with strings in CTFE)
$(LI $(BUGZILLA 1984): Assertion failure: 'e1->type' on line 1198 in file 'constfold.c')
$(LI $(BUGZILLA 2323): ICE(cgcs.c): taking address of a method of a temporary struct)
$(LI $(BUGZILLA 2429): std.stream.File incorrect flag parsing and sharing mode)
$(LI $(BUGZILLA 2432): complex alias -> mtype.c:125: virtual Type* Type::syntaxCopy(): Assertion `0' failed.)
$(LI $(BUGZILLA 2603): ICE(cgcs.c) on subtracting string literals)
$(LI $(BUGZILLA 2843): ICE(constfold.c) with is-expression with invalid dot-expression in is-expression involving typeid)
$(LI $(BUGZILLA 2884): ICE: Assert: 'template.c', line 3773, 'global.errors')
$(LI $(BUGZILLA 2888): [PATCH] speedup for float * 2.0)
$(LI $(BUGZILLA 2915): [Patch]: Optimize -a*-b into a*b)
$(LI $(BUGZILLA 2923): -O generates bad code for ?:)
$(LI $(BUGZILLA 2932): bad e_ehsize (36 != 52))
$(LI $(BUGZILLA 2952): Segfault on exit when using array ops with arrays of doubles larger than 8 elements)
$(LI $(BUGZILLA 3003): Need to implicitly add () on member template function calls)
$(LI $(BUGZILLA 3014): ICE(template.c) instantiating template with tuple)
$(LI $(BUGZILLA 3016): Errors in the documentation of std.math.acos)
$(LI $(BUGZILLA 3026): Segfault with incomplete static array initializer)
$(LI $(BUGZILLA 3044): Segfault(template.c) instantiating struct tuple constructor with zero arguments.)
$(LI $(BUGZILLA 3078): NaN reported as equal to zero)
$(LI $(BUGZILLA 3114): optlink failing on multicore machines)
$(LI $(BUGZILLA 3117): dmd crash by *1)
$(LI $(BUGZILLA 3128): Internal error: ..\ztc\cod4.c 2737)
$(LI $(BUGZILLA 3130): Crashed with triple stars)
)
)
$(VERSION 045, May 11, 2009, =================================================,
$(WHATSNEW
$(LI Folded in compiler/library changes by Unknown W. Brackets
to support Solaris.)
$(LI Migrate Posix uses of std.c.linux.linux to std.c.posix.posix)
$(LI added .typeinfo to ClassInfo $(BUGZILLA 2836): Navigate from ClassInfo to TypeInfo)
)
$(BUGSFIXED
$(LI Fix instruction scheduler bug on Linux)
$(LI $(BUGZILLA 642): error: mixin "static this" into where it cannot be)
$(LI $(BUGZILLA 713): circular const definitions with module operator "." cause the compiler to segfault)
$(LI $(BUGZILLA 752): Assertion failure: 'e->type->ty != Ttuple' on line 4518 in file 'mtype.c')
$(LI $(BUGZILLA 858): Forward reference to struct inside class crashes the compiler)
$(LI $(BUGZILLA 884): Segfault in recursive template)
$(LI $(BUGZILLA 934): Segfault taking mangleof a forward reference in a template.)
$(LI $(BUGZILLA 1011): illegal import declaration causes compile time segfault)
$(LI $(BUGZILLA 1054): regression: circular aliases cause segfaults)
$(LI $(BUGZILLA 1061): "asm inc [;" segfaults compiler.)
$(LI $(BUGZILLA 1195): regression: aliasing an enum member causes compile time segfaults)
$(LI $(BUGZILLA 1305): Compiler hangs with templated opCmp returning templated class)
$(LI $(BUGZILLA 1385): Stack Overflow with huge array literal.)
$(LI $(BUGZILLA 1428): Segfault on template specialization with delegates and tuples)
$(LI $(BUGZILLA 1586): DMD and GDC segfaults on incomplete code segment.)
$(LI $(BUGZILLA 1791): Segmentation fault with anon class in anon class and non-constant variable init)
$(LI $(BUGZILLA 1916): segfault on invalid string concat)
$(LI $(BUGZILLA 1946): Compiler crashes on attempt to implicit cast const typedef to non-const.)
$(LI $(BUGZILLA 2048): DMD crash on CTFE that involves assigning to member variables of void-initialized struct)
$(LI $(BUGZILLA 2061): wrong vtable call with multiple interface inheritance)
$(LI $(BUGZILLA 2215): Forward reference enum with base type within a struct causes Segmentation Fault in the compiler)
$(LI $(BUGZILLA 2309): Crash on a template mixing in a variadic template with an undefined template identifier)
$(LI $(BUGZILLA 2346): ICE when comparing typedef'd class)
$(LI $(BUGZILLA 2821): struct alignment inconsistent with C for { int, long })
$(LI $(BUGZILLA 2920): recursive templates blow compiler stack)
)
)
$(VERSION 044, Apr 9, 2009, =================================================,
$(WHATSNEW
$(LI Added std.c.posix.* to Phobos.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 675): %a format has an out-by-1 bug for denormals.)
$(LI $(BUGZILLA 2064): Segfault with mixin(for/foreach) with empty loop body)
$(LI $(BUGZILLA 2199): Segfault using array operation in function call)
$(LI $(BUGZILLA 2203): typeof(class.template.foo) crashes compiler)
)
)
$(VERSION 043, Apr 6, 2009, =================================================,
$(WHATSNEW
$(LI Added FreeBSD 7.1 support.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 2796): Dependency on libstdc++-v3)
)
)
$(VERSION 042, Mar 31, 2009, =================================================,
$(WHATSNEW
$(LI Added response files for Linux and OSX)
$(LI On Windows, if there are multiple source files on the command
line they are now read with a background thread. This may speed up
compilation.)
$(LI Folded in patches for LDC compatibility from Tomas Lindquist Olsen)
$(LI The $(B Posix) version identifier can now be set even though
it is reserved and predefined, because many build systems and makefiles
try to set it.)
)
$(BUGSFIXED
$(LI std.math.hypot is wrong for subnormal arguments)
$(LI Fix bug where / wasn't recognized as a path separator on Windows.)
$(LI $(BUGZILLA 920): Fix one more out of date reference to 'auto' rather than 'scope')
$(LI $(BUGZILLA 1923): GC optimization for contiguous pointers to the same page)
$(LI $(BUGZILLA 2319): "Win32 Exception" not very useful)
$(LI $(BUGZILLA 2570): Patch for some mistakes in Ddoc comments)
$(LI $(BUGZILLA 2591): custom allocator new argument should be size_t instead of uint)
$(LI $(BUGZILLA 2689): seek behaves incorrectly on MAC OSX)
$(LI $(BUGZILLA 2692): alignment of double on x86 linux is incorrect)
$(LI $(BUGZILLA 2705): Response file size cannot exceed 64kb)
$(LI $(BUGZILLA 2711): -H produces bad headers files if function defintion is templated and have auto return value)
$(LI $(BUGZILLA 2731): Errors in associative array example)
$(LI $(BUGZILLA 2743): dumpobj gives "buss error" on Tiger)
$(LI $(BUGZILLA 2744): wrong init tocbuffer of forstatement)
$(LI $(BUGZILLA 2745): missing token tochars in lexer.c)
$(LI $(BUGZILLA 2747): improper toCBuffer of funcexp)
$(LI $(BUGZILLA 2750): Optimize slice copy with size known at compile time)
$(LI $(BUGZILLA 2751): incorrect scope storage class vardeclaration tocbuffer)
$(LI $(BUGZILLA 2767): DMD incorrectly mangles NTFS stream names)
$(LI $(BUGZILLA 2772): lib can't open response file)
)
)
$(VERSION 041, Mar 3, 2009, =================================================,
$(WHATSNEW
$(LI Added buildable dmd source.)
$(LI Improved accuracy of exp, expm1, exp2, sinh, cosh, tanh on Mac OSX,
and tripled speed on all platforms.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 1629): Link error: Previous Definition Different: blablah__initZ)
$(LI $(BUGZILLA 1662): Falls back to libphobos if -debuglib isn't used when -g is)
$(LI $(BUGZILLA 1681): cast(real) ulong.max == 0)
$(LI $(BUGZILLA 2416): Slice of typedef'ed array should preserve the typedef'ed type)
$(LI $(BUGZILLA 2582): Significantly Increased Compile Times For DWT)
$(LI $(BUGZILLA 2670): std.file.read() should read files of 0 length)
$(LI $(BUGZILLA 2673): Static constructors sometimes do not run when compiling with -lib)
$(LI $(BUGZILLA 2678): for loops are already assumed to terminate)
$(LI $(BUGZILLA 2679): Spurious "warning - " messages and erratic behaviour with is(typeof({void function}())))
$(LI $(BUGZILLA 2690): DMD aborts with MALLOC_CHECK_ set)
)
)
$(VERSION 040, Feb 11, 2009, =================================================,
$(WHATSNEW
$(LI Added Mac OSX support.)
$(LI Separated bin and lib directories into windows, linux,
and osx.)
$(LI No longer need to download dmc to use the windows version.)
$(LI Use version(OSX) for Mac OSX. Although version(darwin) is
also supported for the time being, it is deprecated.)
)
$(BUGSFIXED
)
)
$(VERSION 039, Jan 14, 2009, =================================================,
$(WHATSNEW
$(LI Improved speed of long division.)
$(LI Added predefined $(LINK2 version.html#PredefinedVersions, version)
$(B D_Ddoc) which is predefined when $(B -D) switch is thrown.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 2517): DDoc omits abstract on classes)
$(LI $(BUGZILLA 2518): scope(success) not execuate and RAII variable destructor is not called)
$(LI $(BUGZILLA 2519): Segfault when >> used in an invalid slice)
$(LI $(BUGZILLA 2527): Alias Template Params Are Always Same Type As First Instantiation (according to typeof(x).stringof))
$(LI $(BUGZILLA 2531): DDoc not generated correctly for struct methods inside static if)
$(LI $(BUGZILLA 2537): compiler crashes on this code:)
$(LI $(BUGZILLA 2542): array casts behave differently at compile and runtime)
)
)
$(VERSION 038, Dec 11, 2008, =================================================,
$(WHATSNEW
$(LI Changed IUnknown to use the extern(System) interface rather
that extern(Windows).)
$(LI Added Partial IFTI $(BUGZILLA 493))
)
$(BUGSFIXED
$(LI $(BUGZILLA 1518): Crash using 'scope', 'with' and undefined 'RegExp')
$(LI $(BUGZILLA 1685): Array index is evaluated twice)
$(LI $(BUGZILLA 1963): -H creates broken headers)
$(LI $(BUGZILLA 2041): Spec implies relationship between interfaces and COM objects)
$(LI $(BUGZILLA 2105): added patch)
$(LI $(BUGZILLA 2468): result type of AndAndExp and OrOrExp deduced incorrectly)
$(LI $(BUGZILLA 2489): import in struct causes assertion failure)
$(LI $(BUGZILLA 2490): extern(C++) can not handle structs as return types)
$(LI $(BUGZILLA 2492): ICE building on Linux with -lib option)
$(LI $(BUGZILLA 2499): Template alias default value cannot be template instantiation)
$(LI $(BUGZILLA 2500): template struct methods are left unresolved if imported from multiple modules)
$(LI $(BUGZILLA 2501): member function marked as final override ignores override requirements)
$(LI Incorporated some of the patches from $(BUGZILLA 1752))
)
)
$(VERSION 037, Nov 25, 2008, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(LI $(BUGZILLA 313): Fully qualified names bypass private imports)
$(LI $(BUGZILLA 341): Undocumented function void print() in object.d)
$(LI $(BUGZILLA 929): Resizing array of associative arrays (uint[char[]][]) causes infinite loop / hang)
$(LI $(BUGZILLA 1372): Compiler accepts pragma(msg,))
$(LI $(BUGZILLA 1610): Enum.stringof is int, not the name of the enum)
$(LI $(BUGZILLA 1663): pragma(lib, "") don't work on linux)
$(LI $(BUGZILLA 1797): Documentation comments - ///)
$(LI $(BUGZILLA 2326): Methods within final class are not considered final when optimizing)
$(LI $(BUGZILLA 2429): std.stream.File incorrect flag parsing and sharing mode)
$(LI $(BUGZILLA 2431): Internal error: ../ztc/cgcod.c 1031 when using -O)
$(LI $(BUGZILLA 2470): Cannot build libraries from other libraries)
$(LI unittest functions now always use D linkage)
)
)
$(VERSION 036, Oct 20, 2008, =================================================,
$(WHATSNEW
$(LI Improved performance of AAs by rebalancing trees when rehashing.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 1229): Linker fills disk)
$(LI $(BUGZILLA 2340): Template properties don't work)
$(LI $(BUGZILLA 2365): compilation error: static const array in struct)
$(LI $(BUGZILLA 2368): Calling a function with an address of another function, then calling a returned object is rejected)
$(LI $(BUGZILLA 2373): freebsd select does not accept values > 999,999)
$(LI $(BUGZILLA 2376): CTFE fails on array literal of array literals of chars)
$(LI $(BUGZILLA 2380): static struct initializer accepted as non static initializer is not documented)
$(LI $(BUGZILLA 2383): default arguments can implicitly access private global variables that are not visible at call site)
$(LI $(BUGZILLA 2385): spec says all structs are returned via hidden pointer on linux, but it uses registers)
$(LI $(BUGZILLA 2390): Missing warning on conversion from int to char)
)
)
$(VERSION 035, Sep 2, 2008, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(LI $(BUGZILLA 1627): ICE with a method called _ctor)
$(LI $(BUGZILLA 1633): Nonsensical "C style cast illegal" message with !is)
$(LI $(BUGZILLA 1637): regression: new unittest failure in std/math2.d, odd cosh() behavior)
$(LI $(BUGZILLA 1763): EndianStream doesn't handle ubyte/byte read/writes. Simple fix.)
$(LI $(BUGZILLA 1771): dmd fails to execute on linux)
$(LI $(BUGZILLA 1773): excessively long integer literal)
$(LI $(BUGZILLA 1785): Mixing in an incorrect array literal causes infinite loop.)
$(LI $(BUGZILLA 2176): Assertion failure: 'sz == es2->sz' on line 1339 in file 'constfold.c' (concatenating strings of different types))
$(LI $(BUGZILLA 2183): Bad formatting in std.c.stdlib)
$(LI $(BUGZILLA 2232): DMD generates invalid code when an object file is compiled -inline)
$(LI $(BUGZILLA 2241): DMD abort)
$(LI $(BUGZILLA 2243): const bool = is(function literal), badly miscast)
$(LI $(BUGZILLA 2262): -inline breaks -lib library)
$(LI $(BUGZILLA 2286): movmskpd compiled incorrectly)
$(LI $(BUGZILLA 2308): CTFE crash on foreach over nonexistent variable)
$(LI $(BUGZILLA 2311): Static destructors in templates are never run)
$(LI $(BUGZILLA 2314): Crash on anonymous class variable instantiation)
$(LI $(BUGZILLA 2317): asm offsetof generates: Internal error: ../ztc/cod3.c 2651)
)
)
$(VERSION 034, Aug 7, 2008, =================================================,
$(WHATSNEW
$(LI Now supports $(LINK2 arrays.html#array-operations, array operations).)
)
$(BUGSFIXED
$(LI Added hash to generated module names when building libs to reduce collisions)
$(LI $(BUGZILLA 1622): parameters to TypeInfo_Struct.compare seem to be switched around.)
$(LI $(BUGZILLA 2216): bad code generation for static arrays of zero length static arrays)
$(LI $(BUGZILLA 2223): Typo in error message)
$(LI $(BUGZILLA 2242): linux system calls are canceled by GC)
$(LI $(BUGZILLA 2247): bad header file generated for if (auto o = ...) {})
$(LI $(BUGZILLA 2248): .di should be a supported file extension)
$(LI $(BUGZILLA 2250): Update of user32.lib and kernel32.lib)
$(LI $(BUGZILLA 2254): Size of executable almost triples)
$(LI $(BUGZILLA 2258): Docs -> Inline Assembler -> Operand Types -> qword missing)
$(LI $(BUGZILLA 2259): Assertion failure: '0' on line 122 in file 'statement.c')
$(LI $(BUGZILLA 2269): D BUG: cosine of complex)
$(LI $(BUGZILLA 2272): synchronized attribute documentation)
$(LI $(BUGZILLA 2273): Whitespace is not inserted after commas)
)
)
$(VERSION 033, Jul 11, 2008, =================================================,
$(WHATSNEW
)
$(BUGSFIXED
$(LI $(BUGZILLA 870): contradictory error messages for templates)
$(LI $(BUGZILLA 2207): overload resolution fails with deprecation)
$(LI $(BUGZILLA 2208): Deprecated function declarations cannot use deprecated types)
$(LI $(BUGZILLA 2209): Typo in doc for offsetof)
)
)
$(VERSION 032, Jul 9, 2008, =================================================,
$(WHATSNEW
$(LI Added $(B .__vptr) and $(B .__monitor) properties for class objects
for use in the internal runtime library.
)
)
$(BUGSFIXED
$(LI $(NG_digitalmars_D_announce 12322): mixin regression)
$(LI $(BUGZILLA 203): std.format.doFormat() pads width incorrectly on Unicode strings)
$(LI $(BUGZILLA 211): Linking error with alias mixin params and anonymous methods)
$(LI $(BUGZILLA 224): Incorrect warning "no return at end of function")
$(LI $(BUGZILLA 252): -w and switch returns = bogus "no return at end of function" warning)
$(LI $(BUGZILLA 253): Invalid <dl> tag generated by Ddoc)
$(LI $(BUGZILLA 294): DDoc: Function templates get double and incomplete documentation)
$(LI $(BUGZILLA 398): No way to abort compilation in a doubly recursive mixin)
$(LI $(BUGZILLA 423): dmd ignores empty commandline arguments)
$(LI $(BUGZILLA 515): Spec incorrect in where .offsetof can be applied)
$(LI $(BUGZILLA 520): Invariants allowed to call public functions)
$(LI $(BUGZILLA 542): Function parameter of a deprecated type (other than a class) is not caught)
$(LI $(BUGZILLA 543): Function return of a deprecated type is not caught)
$(LI $(BUGZILLA 544): Variable declared of a deprecated type (other than a class) is not caught)
$(LI $(BUGZILLA 545): Attempt to access a static built-in property of a deprecated struct, union, enum or typedef is not caught)
$(LI $(BUGZILLA 547): Accessing a deprecated member variable through an explicit object reference is not caught)
$(LI $(BUGZILLA 548): Accessing a value of a deprecated enum is not caught)
$(LI $(BUGZILLA 566): Adding non-static members and functions to classes using a template doesn't error)
$(LI $(BUGZILLA 570): Bogus recursive mixin error)
$(LI $(BUGZILLA 571): class instance member template returns strange value)
$(LI $(BUGZILLA 572): parse error when using template instantiation with typeof)
$(LI $(BUGZILLA 581): Error message w/o line number in dot-instantiated template)
$(LI $(BUGZILLA 617): IFTI doesn't use normal promotion rules for non-template parameters)
$(LI $(BUGZILLA 951): Missing line number: no constructor provided for a class derived from a class with no default constructor)
$(LI $(BUGZILLA 1097): Missing line number: casting array to array of different element size)
$(LI $(BUGZILLA 1158): Missing line number: invalid mixin outside function scope)
$(LI $(BUGZILLA 1176): Error missing file and line number)
$(LI $(BUGZILLA 1187): Segfault with syntax error in two-level mixin.)
$(LI $(BUGZILLA 1194): fcmov* emmits incorrect code)
$(LI $(BUGZILLA 1207): Documentation on destructors is confusing)
$(LI $(BUGZILLA 1341): typeof(int) should probably be legal)
$(LI $(BUGZILLA 1601): shr and shl error message is missing line numbers)
$(LI $(BUGZILLA 1612): No file/line number for using an undefined label in inline assembly)
$(LI $(BUGZILLA 1907): Error message without a line number)
$(LI $(BUGZILLA 1912): Error without line number (Tuple, invalid value argument))
$(LI $(BUGZILLA 1936): Error with no line number (array dimension overflow))
$(LI $(BUGZILLA 2161): Modify compiler to pass array TypeInfo to _adEq and _adCmp instead of element TypeInfo)
$(LI $(BUGZILLA 2166): More stuff that doesn't compile in Phobos)
$(LI $(BUGZILLA 2178): 3 errors without line number: typeof)
)
)
$(VERSION 031, June 18, 2008, =================================================,
$(WHATSNEW
$(LI Added $(LINK2 version.html#PredefinedVersions, version identifier
$(B D_PIC)) when $(B -fPIC) switch is used.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 1383): Implicit Function Instantiation with typesafe-variadic of delegates doesn't work)
$(LI $(BUGZILLA 1559): version statement makes code outside of it disappear)
$(LI $(BUGZILLA 1675): "Identifier too long" error with OMF object files)
$(LI $(BUGZILLA 1963): -H creates broken headers)
$(LI $(BUGZILLA 2111): Protection incorrectly resolved when accessing super class' tupleof)
$(LI $(BUGZILLA 2118): Inconsistent use of string vs invariant(char[]) in doc)
$(LI $(BUGZILLA 2123): Anonymous class crashes)
$(LI $(BUGZILLA 2132): CTFE: can't evaluate ~= at compile time, D2 only.)
$(LI $(BUGZILLA 2136): typeof(super(...)) counted as a constructor call)
$(LI $(BUGZILLA 2140): static if as final statement with no code causes containing code to be skipped)
$(LI $(BUGZILLA 2143): Mixed-in identifier is not recognized by static if)
$(LI $(BUGZILLA 2144): 'is' is defined to be the same as '==' for non-class and non-array types, but does not call opEquals)
$(LI $(BUGZILLA 2146): Multiple execution of 'static this' defined in template)
$(LI $(BUGZILLA 2149): Auto variables loose the keyword "auto" in di files generated with -H option.)
)
)
$(VERSION 030, May 16, 2008, =================================================,
$(WHATSNEW
$(LI Added $(B -lib) switch to generate library files.)
$(LI Added $(B -man) switch to browse manual.)
$(LI When generating an executable file, only one object file
is now generated containing all the modules that were compiled, rather
than one object file per module.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 2031): Documentation: template value parameters)
$(LI $(BUGZILLA 2032): Documentation for creating a class on the stack is unintuitive)
$(LI $(BUGZILLA 2033): -g + circular refs => dmd hangs)
$(LI $(BUGZILLA 2039): -ignore switch is missing from compiler docs)
$(LI $(BUGZILLA 2044): -g hangs DMD)
$(LI $(BUGZILLA 2055): (ICE) Compiler crash on struct initializer with too many elements)
$(LI $(BUGZILLA 2058): Describe hidden value passed to class member functions)
$(LI $(BUGZILLA 2067): call from anonymous class makes access violation.)
$(LI $(BUGZILLA 2071): spec doesn't mention pointer arithmetic with two pointer operands)
$(LI $(BUGZILLA 2075): Spec does not specify how array literals are stored.)
$(LI $(BUGZILLA 2084): operator ?: does not compute the tightest type)
$(LI $(BUGZILLA 2086): Describe relationship between string and char[] more explicitly)
$(LI $(BUGZILLA 2089): Issues with CTFE and tuple indexes)
$(LI $(BUGZILLA 2090): Cannot alias a tuple member which is a template instance)
)
)
$(VERSION 029, Apr 23, 2008, =================================================,
$(WHATSNEW
$(LI Added $(B -ignore) switch to ignore unsupported pragmas.)
$(LI Unsupported pragmas now printed out with $(B -v) switch.)
$(LI Incorporated Benjamin Shropshire's doc changes)
)
$(BUGSFIXED
$(LI $(BUGZILLA 1712): vtbl[0] for interface not set to corresponding Interface*)
$(LI $(BUGZILLA 1741): crash on associative array with static array as index type)
$(LI $(BUGZILLA 1905): foreach docs inconsistency)
$(LI $(BUGZILLA 1906): foreach cannot use index with large arrays)
$(LI $(BUGZILLA 1908): fix closure14.d)
$(LI $(BUGZILLA 1935): The std.recls samples in the DMD .zip are obsolete.)
$(LI $(BUGZILLA 1967): getDirName does not seem to use altsep on windows)
$(LI $(BUGZILLA 1978): Wrong vtable call)
$(LI $(BUGZILLA 1991): Dmd hangs)
$(LI $(BUGZILLA 2019): Appending a one-element array literal doesn't work)
)
)
$(VERSION 028, Mar 6, 2008, =================================================,
$(WHATSNEW
$(LI Added compile time error for comparing class types against $(CODE null).)
)
$(BUGSFIXED
$(LI Fixed dwarf bug with DT_AT_upper_bound)
$(LI $(BUGZILLA 756): IFTI for tuples only works if tuple parameter is last)
$(LI $(BUGZILLA 1454): IFTI cant deduce parameter if alias argument used)
$(LI $(BUGZILLA 1661): Not possible to specialize on template with integer parameter)
$(LI $(BUGZILLA 1809): template.c:2600)
$(LI $(BUGZILLA 1810): MmFile anonymous mapping does not work under win32)
$(LI $(BUGZILLA 1819): spurious warning about missing return statement after synchronized)
$(LI $(BUGZILLA 1828): Several Thread Issues)
$(LI $(BUGZILLA 1833): std.c.windows.windows should use enums for constants, or be more selective about use of extern(Windows))
$(LI $(BUGZILLA 1836): Inline assembler can't use enum values as parameters.)
$(LI $(BUGZILLA 1837): Make dmd stop flooding the console: prints content of passed parameter file)
$(LI $(BUGZILLA 1843): Bogus unreachable statement on forward referenced struct, lacks line number)
$(LI $(BUGZILLA 1850): The compiler accepts lower case asm registers.)
$(LI $(BUGZILLA 1852): you get opCall missing when cast to a struct(diagnostic))
$(LI $(BUGZILLA 1853): opCmp documentation really needs some examples)
$(LI $(BUGZILLA 1857): Runtime segfault while profileing - jump to invalid code address)
$(LI $(BUGZILLA 1862): asm: [ESI+1*EAX] should be a legal addr mode)
$(LI $(BUGZILLA 1864): Variable incorrectly declared final in final class template)
$(LI $(BUGZILLA 1865): Escape sequences are flawed.)
$(LI $(BUGZILLA 1877): Errors in the documentation of std.math.atan2)
$(LI $(BUGZILLA 1879): Compiler segfaults on 'scope' and 'static if')
$(LI $(BUGZILLA 1882): Internal error: ..\ztc\cod1.c 2529)
)
)
$(VERSION 027, Feb 18, 2008, =================================================,
$(WHATSNEW
$(LI Re-enabled auto interfaces.)
)
$(BUGSFIXED
$(LI Fixed display of ddoc template parameters that were aliased)
$(LI $(BUGZILLA 1072): CTFE: crash on for loop with blank increment)
$(LI $(BUGZILLA 1435): DDoc: Don't apply DDOC_PSYMBOL everywhere)
$(LI $(BUGZILLA 1825): local instantiation and function nesting)
$(LI $(BUGZILLA 1837): Make dmd stop flooding the console: prints content of passed parameter file)
$(LI $(BUGZILLA 1842): Useless linker command line output during compilation on Linux)
)
)
$(VERSION 026, Jan 20, 2008, =================================================,
$(WHATSNEW
$(LI $(CODE WinMain) and $(CODE DllMain) can now be in template mixins.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 1697): Internal error: ..\ztc\cgcod.c 2322 with -O)
$(LI $(BUGZILLA 1707): '==' in TemplateParameterList in IsExpression causes segfault)
$(LI $(BUGZILLA 1711): typeof with delegate literal not allowed as template parameter)
$(LI $(BUGZILLA 1718): obscure exit with error code 5)
$(LI $(BUGZILLA 1719): Compiler crash or unstable code generation with scoped interface instances)
$(LI $(BUGZILLA 1724): Internal error: toir.c 177)
$(LI $(BUGZILLA 1725): std.stream.BufferedFile.create should use FileMode.OutNew)
$(LI $(BUGZILLA 1767): rejects-valid, diagnostic)
$(LI $(BUGZILLA 1769): Typo on the page about exceptions)
$(LI $(BUGZILLA 1773): excessively long integer literal)
$(LI $(BUGZILLA 1779): Compiler crash when deducing more than 2 type args)
$(LI $(BUGZILLA 1783): DMD 1.025 asserts on code with struct, template, and alias)
$(LI $(BUGZILLA 1788): dmd segfaults without info)
)
)
$(VERSION 025, Jan 1, 2008, =================================================,
$(BUGSFIXED
$(LI $(BUGZILLA 1111): enum value referred to by another value of same enum is considered as enum's base type, not enum type)
$(LI $(BUGZILLA 1720): std.math.NotImplemented missing a space in message)
$(LI $(BUGZILLA 1738): Error on struct without line number)
$(LI $(BUGZILLA 1742): CTFE fails on some template functions)
$(LI $(BUGZILLA 1743): interpret.c:1421 assertion failure on CTFE code)
$(LI $(BUGZILLA 1744): CTFE: crash on assigning void-returning function to variable)
$(LI $(BUGZILLA 1749): std.socket not thread-safe due to strerror)
$(LI $(BUGZILLA 1753): String corruption in recursive CTFE functions)
)
)
$(VERSION 024, Nov 27, 2007, =================================================,
$(WHATSNEW
$(LI Changed the way coverage analysis is done so it is independent
of order dependencies among modules.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 70): valgrind: Conditional jump or move depends on uninitialised value(s) in elf_findstr)
$(LI $(BUGZILLA 71): valgrind: Invalid read of size 4 in elf_renumbersyms)
$(LI $(BUGZILLA 204): Error message on attempting to instantiate an abstract class needs to be improved)
$(LI $(BUGZILLA 1508): dmd/linux template symbol issues)
$(LI $(BUGZILLA 1656): illegal declaration accepted)
$(LI $(BUGZILLA 1664): (1.23).stringof generates bad code)
$(LI $(BUGZILLA 1665): Internal error: ..\ztc\cod2.c 411)
)
)
$(VERSION 023, Oct 31, 2007, =================================================,
$(WHATSNEW
$(LI Data items in static data segment >= 16 bytes in size
are now paragraph aligned.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 318): wait does not release thread resources on Linux)
$(LI $(BUGZILLA 322): Spawning threads which allocate and free memory leads to pause error on collect)
$(LI $(BUGZILLA 645): Race condition in std.thread.Thread.pauseAll)
$(LI $(BUGZILLA 689): Clean up the spec printfs!)
$(LI $(BUGZILLA 697): No const folding on asm db,dw, etc)
$(LI $(BUGZILLA 706): incorrect type deduction for array literals in functions)
$(LI $(BUGZILLA 708): inline assembler: "CVTPS2PI mm, xmm/m128" fails to compile)
$(LI $(BUGZILLA 709): inline assembler: "CVTPD2PI mm, xmm/m128" fails to compile)
$(LI $(BUGZILLA 718): Internal error: ../ztc/cgcod.c 562)
$(LI $(BUGZILLA 723): bad mixin of class definitions at function level: func.c:535: virtual void FuncDeclaration::semantic3(Scope*): Assertion `0' failed)
$(LI $(BUGZILLA 725): expression.c:6516: virtual Expression* MinAssignExp::semantic(Scope*): Assertion `e2->type->isfloating()' failed.)
$(LI $(BUGZILLA 726): incorrect error line for "override" mixin)
$(LI $(BUGZILLA 729): scope(...) statement in SwitchBody causes compiler to segfault)
$(LI $(BUGZILLA 733): std.conv.toFloat does not catch errors)
$(LI $(BUGZILLA 1258): Garbage collector loses memory upon array concatenation)
$(LI $(BUGZILLA 1478): Avoid libc network api threadsafety issues)
$(LI $(BUGZILLA 1480): std.stream throws the new override warning all over the place)
$(LI $(BUGZILLA 1483): Errors in threads not directed to stderr)
$(LI $(BUGZILLA 1491): Suppress SIGPIPE when sending to a dead socket)
$(LI $(BUGZILLA 1557): std.zlib allocates void[]s instead of ubyte[]s, causing leaks.)
$(LI $(BUGZILLA 1562): Deduction of template alias parameter fails)
$(LI $(BUGZILLA 1575): Cannot do assignment of tuples)
$(LI $(BUGZILLA 1593): ICE compiler crash empty return statement in function)
$(LI $(BUGZILLA 1613): DMD hangs on syntax error)
$(LI $(BUGZILLA 1618): Typo in std\system.d)
)
)
$(VERSION 022, Oct 1, 2007, =================================================,
$(BUGSFIXED
$(LI Fix std.boxer boxing of Object's (unit test failure))
$(LI Fix std.demangle to not show hidden parameters (this and delegate context pointers))
$(LI $(BUGZILLA 217): typeof not working properly in internal/object.d)
$(LI $(BUGZILLA 218): Clean up old code for packed bit array support)
$(LI $(BUGZILLA 223): Error message for unset constants doesn't specify error location)
$(LI $(BUGZILLA 278): dmd.conf search path doesn't work)
$(LI $(BUGZILLA 479): can't compare arrayliteral statically with string)
$(LI $(BUGZILLA 549): A class derived from a deprecated class is not caught)
$(LI $(BUGZILLA 550): Shifting by more bits than size of quantity is allowed)
$(LI $(BUGZILLA 551): Modulo operator works with imaginary and complex operands)
$(LI $(BUGZILLA 556): is (Type Identifier : TypeSpecialization) doesn't work as it should)
$(LI $(BUGZILLA 668): Use of *.di files breaks the order of static module construction)
$(LI $(BUGZILLA 1125): Segfault using tuple in asm code, when size not specified)
$(LI $(BUGZILLA 1437): dmd crash: "Internal error: ..\ztc\cod4.c 357")
$(LI $(BUGZILLA 1474): regression: const struct with an initializer not recognized as a valid alias template param)
$(LI $(BUGZILLA 1484): Forward reference of enum member crashes DMD)
$(LI $(BUGZILLA 1488): Bad code generation when using tuple from asm)
$(LI $(BUGZILLA 1510): ICE: Assertion failure: 'ad' on line 925 in file 'func.c')
$(LI $(BUGZILLA 1523): struct literals not work with typedef)
$(LI $(BUGZILLA 1531): cannot access typedef'd class field)
$(LI $(BUGZILLA 1537): Internal error: ..\ztc\cgcod.c 1521)
$(LI $(BUGZILLA 1609): TypeInfo_Typedef has incorrect implementation of next())
)
)
$(VERSION 021, Sep 5, 2007, =================================================,
$(WHATSNEW
$(LI Added command line switches $(B -defaultlib) and $(B -debuglib))
$(LI $(BUGZILLA 1445): Add default library options to sc.ini / dmd.conf)
$(LI Added trace_term() to object.d to fix $(BUGZILLA 971): No profiling output is generated if the application terminates with exit)
$(LI Multiple module static constructors/destructors allowed.)
)
$(BUGSFIXED
$(LI $(BUGZILLA 961): std.windows.registry stack corruption)
$(LI $(BUGZILLA 1315): CTFE doesn't default initialise arrays of structs)
$(LI $(BUGZILLA 1363): Compile-time issue with structs in 'for')
$(LI $(BUGZILLA 1375): CTFE fails for null arrays)
$(LI $(BUGZILLA 1378): A function call in an array literal causes compiler to crash)
$(LI $(BUGZILLA 1384): Compiler segfaults when using struct variable like a function with no opCall member.)
$(LI $(BUGZILLA 1388): multiple static constructors allowed in module)
$(LI $(BUGZILLA 1414): compiler crashes with CTFE and structs)
$(LI $(BUGZILLA 1423): Registry: corrupted value)
$(LI $(BUGZILLA 1436): std.date.getLocalTZA() returns wrong values when in DST under Windows)
$(LI $(BUGZILLA 1447): CTFE does not work for static member functions of a class)
$(LI $(BUGZILLA 1448): UTF-8 output to console is seriously broken)
$(LI $(BUGZILLA 1450): Registry: invalid UTF-8 sequence)
$(LI $(BUGZILLA 1460): Compiler crash on valid code)
$(LI $(BUGZILLA 1464): "static" foreach breaks CTFE)
)
)
$(VERSION 020, Jul 23, 2007, =================================================,
$(BUGSFIXED
$(LI Fixed $(B extern (System)))
)
)
$(VERSION 019, Jul 21, 2007, =================================================,
$(WHATSNEW
$(LI Added 0x78 Codeview extension for type $(B dchar).)
$(LI Added $(B extern (System)))
$(LI $(BUGZILLA 345): updated std.uni.isUniAlpha to Unicode 5.0.0)
)
$(BUGSFIXED
$(LI $(BUGZILLA 46): Included man files should be updated)
$(LI $(BUGZILLA 268): Bug with SocketSet and classes)
$(LI $(BUGZILLA 406): std.loader is broken on linux)
$(LI $(BUGZILLA 561): Incorrect duplicate error message when trying to create instance of interface)
$(LI $(BUGZILLA 588): lazy argument and nested symbol support to std.demangle)
$(LI $(BUGZILLA 668): Use of *.di files breaks the order of static module construction)
$(LI $(BUGZILLA 1110): std.format.doFormat + struct without toString() == crash)
$(LI $(BUGZILLA 1199): Strange error messages when indexing empty arrays or strings at compile time)
$(LI $(BUGZILLA 1300): Issues with struct in compile-time function)
$(LI $(BUGZILLA 1306): extern (Windows) should work like extern (C) for variables)
$(LI $(BUGZILLA 1331): header file genaration generates a ":" instead of ";" at pragma)
$(LI $(BUGZILLA 1332): Internal error: ../ztc/cod4.c 357)
$(LI $(BUGZILLA 1333): -inline ICE: passing an array element to an inner class's constructor in a nested function, all in a class or struct)
$(LI $(BUGZILLA 1336): Internal error when trying to construct a class declared within a unittest from a templated class.)
)
)
$(VERSION 018, Jul 1, 2007, =================================================,
$(BUGSFIXED
$(LI $(BUGZILLA 540): Nested template member function error - "function expected before ()")
$(LI $(BUGZILLA 559): Final has no effect on methods)
$(LI $(BUGZILLA 627): Concatenation of strings to string arrays with ~ corrupts data)
$(LI $(BUGZILLA 629): Misleading error message "Can only append to dynamic arrays")
$(LI $(BUGZILLA 639): Escaped tuple parameter ICEs dmd)
$(LI $(BUGZILLA 641): Complex string operations in template argument ICEs dmd)
$(LI $(BUGZILLA 657): version(): ignored)
$(LI $(BUGZILLA 689): Clean up the spec printfs!)
$(LI $(BUGZILLA 1103): metastrings.ToString fails for long > 0xFFFF_FFFF)
$(LI $(BUGZILLA 1107): CodeView: wrong CV type for bool)
$(LI $(BUGZILLA 1118): weird switch statement behaviour)
$(LI $(BUGZILLA 1186): Bind needs a small fix)
$(LI $(BUGZILLA 1199): Strange error messages when indexing empty arrays or strings at compile time)
$(LI $(BUGZILLA 1200): DMD crash: some statements containing only a ConditionalStatement with a false condition)
$(LI $(BUGZILLA 1203): Cannot create Anonclass in loop)
$(LI $(BUGZILLA 1204): segfault using struct in CTFE)
$(LI $(BUGZILLA 1206): Compiler hangs on this() after method in class that forward references struct)
$(LI $(BUGZILLA 1207): Documentation on destructors is confusing)
$(LI $(BUGZILLA 1211): mixin("__LINE__") gives incorrect value)
$(LI $(BUGZILLA 1212): dmd generates bad line info)
$(LI $(BUGZILLA 1216): Concatenation gives 'non-constant expression' outside CTFE)
$(LI $(BUGZILLA 1217): Dollar ($) seen as non-constant expression in non-char[] array)
$(LI $(BUGZILLA 1219): long.max.stringof gets corrupted)
$(LI $(BUGZILLA 1224): Compilation does not stop on asserts during CTFE)
$(LI $(BUGZILLA 1228): Class invariants should not be called before the object is fully constructed)
$(LI $(BUGZILLA 1233): std.string.ifind(char[] s, char[] sub) fails on certain non ascii strings)
$(LI $(BUGZILLA 1234): Occurrence is misspelled almost everywhere)
$(LI $(BUGZILLA 1235): std.string.tolower() fails on certain utf8 characters)
$(LI $(BUGZILLA 1236): Grammar for Floating Literals is incomplete)
$(LI $(BUGZILLA 1239): ICE when empty tuple is passed to variadic template function)
$(LI $(BUGZILLA 1242): DMD AV)
$(LI $(BUGZILLA 1244): Type of array length is unspecified)
$(LI $(BUGZILLA 1247): No time zone info for India)
$(LI $(BUGZILLA 1285): Exception typedefs not distinguished by catch)
$(LI $(BUGZILLA 1287): Iterating over an array of tuples causes "glue.c:710: virtual unsigned int Type::totym(): Assertion `0' failed.")
$(LI $(BUGZILLA 1290): Two ICEs, both involving real, imaginary, ? : and +=.)
$(LI $(BUGZILLA 1291): .stringof for a class type returned from a template doesn't work)
$(LI $(BUGZILLA 1292): Template argument deduction doesn't work)
$(LI $(BUGZILLA 1294): referencing fields in static arrays of structs passed as arguments generates invalid code)
$(LI $(BUGZILLA 1295): Some minor errors in the lexer grammar)
)
)
$(VERSION 017, Jun 25, 2007, =================================================,
$(WHATSNEW
$(LI Added $(B __VENDOR__) and $(B __VERSION__).)
$(LI The $(B .init) property for a variable is now based on its
type, not its initializer.)
)
$(BUGSFIXED
$(LI $(B std.compiler) now is automatically updated.)
$(LI Fixed CFTE bug with e++ and e--.)
$(LI $(BUGZILLA 1254): Using a parameter initialized to void in a compile-time evaluated function doesn't work)
$(LI $(BUGZILLA 1256): "with" statement with symbol)
$(LI $(BUGZILLA 1259): Inline build triggers an illegal error msg "Error: S() is not an lvalue")
$(LI $(BUGZILLA 1260): Another tuple bug)
$(LI $(BUGZILLA 1261): Regression from overzealous error message)
$(LI $(BUGZILLA 1262): Local variable of struct type initialized by literal resets when compared to .init)
$(LI $(BUGZILLA 1263): Template function overload fails when overloading on both template and non-template class)
$(LI $(BUGZILLA 1268): Struct literals try to initialize static arrays of non-static structs incorrectly)
$(LI $(BUGZILLA 1269): Compiler crash on assigning to an element of a void-initialized array in CTFE)
$(LI $(BUGZILLA 1270): -inline produces an ICE)
$(LI $(BUGZILLA 1272): problems with the new 1.0 section)
$(LI $(BUGZILLA 1276): static assert message displayed with escaped characters)
$(LI $(BUGZILLA 1283): writefln: formatter applies to following variable)
)
)
$(VERSION 016, Jun 14, 2007, =================================================,
$(WHATSNEW
$(LI The compiler was not changed.)
$(LI Added aliases $(B string), $(B wstring), and $(B dstring) to ease
compatiblity with 2.0.)
)
$(BUGSFIXED
)
)
$(VERSION 015, Jun 5, 2007, =================================================,
$(BUGSFIXED
$(LI Added missing \n to exception message going to stderr.)
$(LI Fixed default struct initialization for CTFE.)
$(LI $(BUGZILLA 1226): ICE on a struct literal)
$(LI Fixed gc memory corrupting problem.)
)
)
$(VERSION 014, Apr 26, 2007, =================================================,
$(WHATSNEW
$(LI Added $(LINK2 expression.html#AssocArrayLiteral, associative array literals))
$(LI Added struct literals)
$(LI Array element assignments can now be done in CTFE)
)
$(BUGSFIXED
$(LI $(BUGZILLA 1000): writefln fails on nested arrays)
$(LI $(BUGZILLA 1143): Assertion failure: '0' on line 850 in 'template.c' - On specialization of IFTI template parameters.)
$(LI $(BUGZILLA 1144): template mixin causes DMD crash)
$(LI $(BUGZILLA 1146): mixin + assert() crashes compiler)
$(LI $(BUGZILLA 1153): dmd assertion failure)
$(LI $(BUGZILLA 1159): Various mixins cause "CompileExp::semantic" message, some crash DMD)
$(LI $(BUGZILLA 1174): Program hangs creating an array of enums with nonzero initializer)
$(LI $(BUGZILLA 1177): $(DOLLAR) no longer works inside CTFE functions.)
$(LI $(BUGZILLA 1180): the GC failes to handle large allocation requests propperly)
$(LI $(BUGZILLA 1189): Reverse the titles on web pages)
)
)
$(VERSION 013, Apr 19, 2007, =================================================,
$(BUGSFIXED
$(LI Fixed crash with std.format and static arrrays)
$(LI $(BUGZILLA 582): Cannot slice mixed tuples)
$(LI $(BUGZILLA 594): can't cast arrayliteral statically)
$(LI $(BUGZILLA 595): can't append to array/arrayliteral statically)
$(LI $(BUGZILLA 997): [Regression] Struct-returning function that conditionally passes the result of another function straight through doesn't work (NRVO bug?))
$(LI $(BUGZILLA 1090): Attribute specification: "}" vs "end of scope")
$(LI $(BUGZILLA 1091): Wrong size reserved for critical sections)
$(LI $(BUGZILLA 1094): switch bug)
$(LI $(BUGZILLA 1096): Mysterious hang with toUTCString + UTCtoLocalTime + d_time_nan)
$(LI $(BUGZILLA 1098): symbol collision in d/dmd/expression.c between math.h and port.h)
$(LI $(BUGZILLA 1119): Internal error: ../ztc/cgcod.c 2190 (template instantiation))
$(LI $(BUGZILLA 1121): Assertion codegen issue with templated function)
$(LI $(BUGZILLA 1132): DMD calling linker over commandline)
$(LI $(BUGZILLA 1134): incorrect calling convention used)
$(LI $(BUGZILLA 1135): invariant keyword parsing is messed up)
$(LI $(BUGZILLA 1147): Typo in phobos/std/file.d: 4069 should be 4096)
$(LI $(BUGZILLA 1148): Problems returning structs from functions)
$(LI $(BUGZILLA 1150): Compiler creates wrong code)
$(LI $(BUGZILLA 1156): Installed libraries need to be passed in different order)
$(LI $(BUGZILLA 1163): Can't initialize multiple variables with void.)
)
)
$(VERSION 012, Apr 12, 2007, =================================================,
$(BUGSFIXED
$(LI $(NG_digitalmars_D_announce 8190) now works with $(B -v1))
$(LI $(NG_digitalmars_D_announce 8193))
$(LI $(BUGZILLA 532): Wrong name mangling for template alias params of local vars)
$(LI $(BUGZILLA 1068): stack corruption with mixins and function templates)
$(LI $(BUGZILLA 1089): Unsafe pointer comparison in TypeInfo_Pointer.compare)
$(LI $(BUGZILLA 1127): -v1 doesn't disable the ref and macro keywords)
)
)
$(VERSION 011, Apr 11, 2007, =================================================,
$(WHATSNEW
$(LI Extended $(LINK2 abi.html#codeview, Codeview)
symbolic debug output with LF_OEM types.)
$(LI Extended $(LINK2 abi.html#dwarf, Dwarf)
symbolic debug output with DW_TAG_darray_type,
DW_TAG_aarray_type, and DW_TAG_delegate types.)
$(LI Added keywords $(B ref) and $(B macro).)
$(LI $(B final) classes cannot be subclassed.)
$(LI $(B final) for variables now works.)
$(LI $(B ref) now works as a replacement for $(B inout).)
$(LI Fixed so multiple type inferring declarations like
$(CODE auto a=1,c=2;) works.)
)
$(BUGSFIXED
$(LI Fixed problem with overloading of function templates that
have the same template parameter list, but different function
parameters.)
$(LI Fixed problems with type deduction from specializations that
are template instances.)
$(LI Fixed assert template.c(2956) s->parent)
$(LI Got .$(I property) to work for typeof.)
$(LI Fixed bug in DW_AT_comp_dir output for some linux versions.)
$(LI $(NG_digitalmars_D_announce 8027))
$(LI $(NG_digitalmars_D_announce 8047))
$(LI $(NG_digitalmars_D 51800))
$(LI $(BUGZILLA 1028): Segfault using tuple inside asm code.)
$(LI $(BUGZILLA 1052): DMD 1.009 - aliasing functions from superclasses may result in incorrect conflicts)
$(LI $(BUGZILLA 1080): Failed to link to std.windows.registry)
$(LI $(BUGZILLA 1081): with using real and -O option, dmd generate bug code)
$(LI $(BUGZILLA 1082): The .offsetof property yields a signed int, a size_t would be more appropriate)
$(LI $(BUGZILLA 1086): CodeView: missing line information for string switch)
$(LI $(BUGZILLA 1092): compiler crash in ..\ztc\cod1.c 2528)
$(LI $(BUGZILLA 1102): switch case couldn't contain template member)
$(LI $(BUGZILLA 1108): Indexing an int[] not evaluatable at compile time)
$(LI $(BUGZILLA 1122): dmd generate bad line number while reporting error message)
)
)
$(VERSION 010, Mar 24, 2007, =================================================,
$(WHATSNEW
$(LI Added template partial specialization derived from multiple
parameters.)
$(LI Added Object.factory(char[] classname) method to create
class objects based on a string.)
$(LI Added std.gc.malloc(), std.gc.extend() and std.gc.capacity().)
$(LI Added std.string.isEmail() and std.string.isURL().)
$(LI Added std.stdio.readln().)
$(LI Improved gc performance for array resize and append.)
$(LI $(BUGZILLA 64): Unhandled errors should go to stderr)
$(LI Added predefined Ddoc macro DOCFILENAME)
)
$(BUGSFIXED
$(LI Fixed $(LINK2 http://www.digitalmars.com/d/archives/digitalmars/D/bugs/Broken_link_in_http_digitalmars.com_d_comparison.html_10906.html, Broken link in http://digitalmars.com/d/comparison.html))
$(LI Fixed problem with CTFE and array literals)
$(LI $(BUGZILLA 931): D Strings vs C++ Strings Page Incorrect)
$(LI $(BUGZILLA 935): Extern Global C Variables)
$(LI $(BUGZILLA 948): operatoroverloading.html - Rationale section is both out of date and incomplete)
$(LI $(BUGZILLA 950): Missing filename and line number: conflict between implicit length in [...] and explicit length declared in the scope)
$(LI $(BUGZILLA 959): smaller ddoc documentation issue)
$(LI $(BUGZILLA 1056): segfault with pragma(msg) inside CTFE)
$(LI $(BUGZILLA 1062): Cannot catch typedef'd class)
$(LI $(BUGZILLA 1074): Dead link to std.c.locale webpage)
)
)
$(VERSION 009, Mar 10, 2007, =================================================,
$(BUGSFIXED
$(LI $(NG_digitalmars_D 49928) 1)
$(COMMENT $(NG_digitalmars_D_announce 7563))
$(LI $(LINK2 http://www.digitalmars.com/d/archives/digitalmars/D/announce/DMD_1.007_release_7507.html#N7563, D.announce 7563))
$(LI $(BUGZILLA 146): Wrong filename in DWARF debugging information for templates)
$(LI $(BUGZILLA 992): CTFE Failure with static if)
$(LI $(BUGZILLA 993): incorrect ABI documentation for float parameters)
$(LI $(BUGZILLA 995): compile-time function return element of Tuple / const array)
$(LI $(BUGZILLA 1005): dmd: tocsym.c:343: virtual Symbol* FuncDeclaration::toSymbol(): Assertion `0' failed.)
$(LI $(BUGZILLA 1009): CodeView: out and inout parameters are declared void*)
$(LI $(BUGZILLA 1014): Error with character literal escaping when generating header with -H)
$(LI $(BUGZILLA 1016): CTFE fails with recursive functions)
$(LI $(BUGZILLA 1017): CTFE doesn't support (string == string))
$(LI $(BUGZILLA 1018): regression: Error: divide by 0)
$(LI $(BUGZILLA 1019): regression: missing filename and line number: Error: array index X is out of bounds [0 .. Y])
$(LI $(BUGZILLA 1020): regression: mov EAX, func)
$(LI $(BUGZILLA 1021): CTFE and functions returning void)
$(LI $(BUGZILLA 1022): CodeView: unions have zero length in typeleafs and datasymbols)
$(LI $(BUGZILLA 1026): dmd SEGV when checking length of Tuple elements when length == 0)
$(LI $(BUGZILLA 1030): ICE one-liner; struct in delegate)
$(LI $(BUGZILLA 1038): explicit class cast breakage in 1.007)
)
)
$(VERSION 007, Feb 20, 2007, =================================================,
$(WHATSNEW
$(LI Comparison operators are no longer associative; comparison,
equality, identity and in operators all have the same precedence.)
$(LI $(CODE out) and $(CODE inout) parameters are now allowed
for compile time function execution.)
$(LI The $(CODE .dup) property is now allowed
for compile time function execution.)
$(LI Updated $(LINK2 http://www.digitalmars.com/ctg/lib.html, lib)
to insert COMDATs into symbol table.)
$(LI Class references can no longer be implicitly converted to
$(CODE void*).)
)
$(BUGSFIXED
$(LI $(NG_digitalmars_D 48806) crash)
$(LI $(NG_digitalmars_D 48811))
$(LI $(NG_digitalmars_D 48845))
$(LI $(NG_digitalmars_D 48869))
$(LI $(NG_digitalmars_D 48917))
$(LI $(NG_digitalmars_D 48953))
$(LI $(NG_digitalmars_D 48990))
$(LI $(NG_digitalmars_D 49033))
$(LI $(NG_digitalmars_D_announce 7496))
$(LI $(BUGZILLA 968): ICE on compile-time execution)
$(LI $(BUGZILLA 974): compile-time parenthesis bug)
$(LI $(BUGZILLA 975): compile-time const array makes dmd crash)
$(LI $(BUGZILLA 980): If a function tries to concatenate a char to a empty array, dmd complains that the function can't be evaluated at compile time)
$(LI $(BUGZILLA 981): CFTE fails in non-template and functions that takes no args.)
$(LI $(BUGZILLA 986): Internal error: e2ir.c 1098)
)
)
$(VERSION 006, Feb 15, 2007, =================================================,
$(WHATSNEW
$(LI Added $(B -J)$(I path) switch, which is now required in
order to import text files.)
$(LI Enhanced $(B -v) output to include actual filename.)
$(LI name string for TypeInfo_Struct now part of the
TypeInfo_Struct comdat.)
$(LI $(LINK2 function.html#interpretation, Compile time execution)
of functions)
)
$(BUGSFIXED
$(LI $(BUGZILLA 960): New: DMD 1.0 is in the past -- not the future)
$(LI Codeview for classes now gives correct LF_CLASS)
)
)
$(VERSION 005, Feb 5, 2007, =================================================,
$(WHATSNEW
$(LI $(B -v) now emits pragma library statements and
imported file names)
$(LI deprecated $(B ===), and $(B !==), tokens no longer recognized)
$(LI $(CODE length) can no longer shadow other $(CODE length) declarations)
$(LI Added $(LINK2 statement.html#MixinStatement, MixinStatement)s,
$(LINK2 expression.html#MixinExpression, MixinExpression)s,
and $(LINK2 module.html#MixinDeclaration, MixinDeclaration)s.)
$(LI Added $(LINK2 expression.html#ImportExpression, ImportExpression)s.)
$(LI Added $(LINK2 phobos/std_metastrings.html, std.metastrings))
)
$(BUGSFIXED
$(LI $(BUGZILLA 761): std.format.doFormat fails for items of a char[][] containing %s)
$(LI $(BUGZILLA 784): regression: [Issue 402] compiler crash with mixin and forward reference)
$(LI $(BUGZILLA 787): incorrect documentation of std.ctype.isprint)
$(LI $(BUGZILLA 788): Compiler rejects hex floats in the format: HexPrefix HexDigits . HexDigits(opt) with binary-exponent-part required)
$(LI $(BUGZILLA 789): const initialization in forwarding constructors doesn't work)
$(LI $(BUGZILLA 791): dhry.d example doesn't compile in 1.0 without trivial change)
$(LI $(BUGZILLA 794): std.math.exp2(0) equals 0 instead of 1)
$(LI $(BUGZILLA 800): writefln() on an associative array fails hard)
$(LI $(BUGZILLA 821): segfault with char array copy; mistaken samples in doc)
$(LI $(BUGZILLA 831): Warning!! String literals are read-only one some platforms.)
$(LI $(BUGZILLA 832): NRVO: return inside foreach results in junk)
$(LI $(BUGZILLA 835): RegExp.test wrongly matches strings on case insensitive attribute)
$(LI $(BUGZILLA 846): Error 42: Symbol Undefined _D1a7__arrayZ)
$(LI $(BUGZILLA 848): typo in C sorting example)
$(LI $(BUGZILLA 862): Selectively importing a nonexistent identifier results in spurious and incorrect error message)
$(LI $(BUGZILLA 872): Assertion in expression.c caused by taking typeof of "this.outer" in nested classes.)
$(LI $(BUGZILLA 875): crash in glue.c line 700)
$(LI $(BUGZILLA 886): std.zlib uncompression routines do not mark result as containing no pointers)
$(LI $(BUGZILLA 887): TypeInfo does not correctly override opCmp, toHash)
$(LI $(BUGZILLA 888): -cov and _ModuleInfo linking bugs)
$(LI $(BUGZILLA 890): Returning char[4] and assigning to char[] produces unexpected results.)
$(LI $(BUGZILLA 891): Crash when compiling the following code (tested with 1.0, 1.001 and 1.002))
$(LI $(BUGZILLA 893): The profile flag no longer seems to work on Linux x86 64)
$(LI $(BUGZILLA 894): base class with implemented abstract method problem)
$(LI $(BUGZILLA 897): fix default dmd.conf file)
$(LI $(BUGZILLA 898): std.conv.toInt doesn't raise ConvOverflowError)
$(LI $(BUGZILLA 901): Comparison of array literals fails)
$(LI $(BUGZILLA 903): Example with printf and string literals crashes)
$(LI $(BUGZILLA 908): compiler dies trying to inline static method call to nonstatic method in template code.)
$(LI $(BUGZILLA 910): Error in description of "this" and "super" keywords)
$(LI $(BUGZILLA 913): deprecated tokens still listed)
$(LI $(BUGZILLA 915): dmd generate bad form return(retn 4) for invariant func)
$(LI $(BUGZILLA 916): regression: Internal error: ../ztc/gloop.c 1305)
$(LI $(BUGZILLA 917): regression: circular typedefs cause segfaults)
$(LI $(BUGZILLA 924): GC collects valid objects)
$(LI $(NG_digitalmars_D_announce 6983))
)
)
$(VERSION 004, Jan 26, 2007, =================================================,
$(BUGSFIXED
$(LI $(BUGZILLA 892): Another bug in the new GC - pointers in mixins)
)
)
$(VERSION 003, Jan 26, 2007, =================================================,
$(BUGSFIXED
$(LI $(NG_digitalmars_D_announce 6929))
$(LI $(NG_digitalmars_D_announce 6953))
)
)
$(VERSION 002, Jan 24, 2007, =================================================,
$(BUGSFIXED
$(LI $(NG_digitalmars_D_announce 6893): ClassInfo.flags incorrectly set)
$(LI $(NG_digitalmars_D_announce 6906): Three subtle cases of tail recursion item 1 and 2)
)
)
$(VERSION 001, Jan 23, 2007, =================================================,
$(WHATSNEW
$(LI tail recursion works again)
$(LI New type aware GC)
)
$(BUGSFIXED
$(LI $(BUGZILLA 621): When inside a loop, if you call break inside a try block the finally block is never executed)
$(LI $(BUGZILLA 804): missing linux functions)
$(LI $(BUGZILLA 815): scope(exit) isn't executed when "continue" is used to continue a while-loop)
$(LI $(BUGZILLA 817): const char[] = string_literal - string_literal gets included for every reference)
$(LI $(BUGZILLA 819): mention response files in cmd line usage)
$(LI $(BUGZILLA 820): gc should scan only pointer types for pointers)
$(LI $(BUGZILLA 823): frontend: incorrect verror declaration in mars.h)
$(LI $(BUGZILLA 824): "mov EAX, func;" and "lea EAX, func;" generate incorrect code)
$(LI $(BUGZILLA 825): dmd segmentation fault with large char[] template value parameter)
$(LI $(BUGZILLA 826): ICE: is-expression with invalid template instantiation)
)
)
)
Macros:
TITLE=Change Log
WIKI=ChangeLog
NEW1 = $(LI What's new for <a href="#new1_$0">D 1.$0</a>)
VERSION=
<div id=version>
$(B $(LARGE <a name="new1_$1">
Version
<a HREF="http://ftp.digitalmars.com/dmd.1.$1.zip" title="D 1.$1">D 1.$1</a>
))
$(SMALL $(I $2, $3))
$5
</div>
BUGZILLA = <a href="http://d.puremagic.com/issues/show_bug.cgi?id=$0">Bugzilla $0</a>
CPPBUGZILLA = <a href="http://bugzilla.digitalmars.com/issues/show_bug.cgi?id=$0">Bugzilla $0</a>
DSTRESS = dstress $0
BUGSFIXED = <h4>Bugs Fixed</h4> $(UL $0 )
UPCOMING = <h4>Under Construction</h4> $(OL $0 )
WHATSNEW = <h4>New/Changed Features</h4> $(UL $0 )
LARGE=<font size=4>$0</font>
| D |
instance Mil_313_Boltan(Npc_Default)
{
name[0] = "Boltan";
guild = GIL_MIL;
id = 313;
voice = 5;
flags = 0;
npcType = NPCTYPE_AMBIENT;
B_SetAttributesToChapter(self,3);
fight_tactic = FAI_HUMAN_STRONG;
EquipItem(self,ItMw_1h_Mil_Sword);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Fighter",Face_B_Normal01,BodyTex_B,ITAR_Mil_L);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Militia.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,55);
daily_routine = Rtn_Start_313;
};
func void Rtn_Start_313()
{
TA_Sit_Chair(6,55,21,0,"NW_CITY_HABOUR_KASERN_PRISON_SIT");
TA_Stand_Guarding(21,0,6,55,"NW_CITY_HABOUR_KASERN_PRISON_02");
};
| D |
instance BAU_912_Pepe(Npc_Default)
{
name[0] = "Οεοε";
guild = GIL_BAU;
id = 912;
voice = 3;
flags = 0;
npcType = npctype_main;
B_SetAttributesToChapter(self,1);
fight_tactic = FAI_HUMAN_COWARD;
EquipItem(self,ItMw_1h_Bau_Mace);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Bald",Face_N_Weak_Markus_Kark,BodyTex_N,ITAR_Bau_L);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Relaxed.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,10);
daily_routine = Rtn_Start_912;
};
func void Rtn_Start_912()
{
TA_Stand_Eating(10,0,16,0,"NW_BIGFARM_SHEEP2_02");
TA_Stand_Drinking(16,0,22,0,"NW_BIGFARM_SHEEP2_03");
TA_Stand_ArmsCrossed(22,0,4,0,"NW_BIGFARM_SHEEP2_04");
TA_Stand_ArmsCrossed(4,0,10,0,"NW_BIGFARM_SHEEP2_01");
};
| D |
instance Mod_1744_PSITPL_Templer_MT (Npc_Default)
{
// ------ NSC ------
name = "Fanatischer Templer";
guild = GIL_strf;
id = 1744;
voice = 13;
flags = 0; //NPC_FLAG_IMMORTAL oder 0
npctype = NPCTYPE_mt_fanatiker;
// ------ Attribute ------
B_SetAttributesToChapter (self, 4); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_STRONG; // MASTER / STRONG / COWARD
// ------ Equippte Waffen ------ //Munition wird automatisch generiert, darf aber angegeben werden
EquipItem (self, ItMw_2H_Axe_L_01);
// ------ Inventory ------
B_CreateAmbientInv (self);
// ------ visuals ------ //Muss NACH Attributen kommen, weil in B_SetNpcVisual die Breite abh. v. STR skaliert wird
B_SetNpcVisual (self, MALE, "Hum_Head_Bald", Face_N_Weak_BaalNetbek, BodyTex_N, ITAR_TemplerFanatiker);
Mdl_SetModelFatness (self, 0);
Mdl_ApplyOverlayMds (self, "Humans_Militia.mds"); // Tired / Militia / Mage / Arrogance / Relaxed
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------ //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt
B_SetFightSkills (self, 50); //Grenzen für Talent-Level liegen bei 30 und 60
// ------ TA anmelden ------
daily_routine = Rtn_Start_1744;
};
FUNC VOID Rtn_Start_1744 ()
{
TA_Stand_WP (08,00,23,00,"WP_MT_PALAMINE_03");
TA_Stand_WP (23,00,08,00,"WP_MT_PALAMINE_03");
};
| D |
/home/adamfries92/git-repo/rust/rustTheProgrammingLanguage/guessing_game_2_0/target/debug/deps/guessing_game_2_0-dd61a5d08f8b00c9: src/main.rs
/home/adamfries92/git-repo/rust/rustTheProgrammingLanguage/guessing_game_2_0/target/debug/deps/guessing_game_2_0-dd61a5d08f8b00c9.d: src/main.rs
src/main.rs:
| D |
# FIXED
pwm.obj: C:/ti/motorware/motorware_1_01_00_17/sw/drivers/pwm/src/32b/f28x/f2802x/pwm.c
pwm.obj: C:/ti/motorware/motorware_1_01_00_17/sw/drivers/pwm/src/32b/f28x/f2802x/pwm.h
pwm.obj: C:/ti/motorware/motorware_1_01_00_17/sw/modules/types/src/types.h
pwm.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/stdbool.h
pwm.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/string.h
pwm.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/linkage.h
pwm.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/stdint.h
pwm.obj: C:/ti/motorware/motorware_1_01_00_17/sw/drivers/cpu/src/32b/f28x/f2802x/cpu.h
C:/ti/motorware/motorware_1_01_00_17/sw/drivers/pwm/src/32b/f28x/f2802x/pwm.c:
C:/ti/motorware/motorware_1_01_00_17/sw/drivers/pwm/src/32b/f28x/f2802x/pwm.h:
C:/ti/motorware/motorware_1_01_00_17/sw/modules/types/src/types.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/stdbool.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/string.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/linkage.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/stdint.h:
C:/ti/motorware/motorware_1_01_00_17/sw/drivers/cpu/src/32b/f28x/f2802x/cpu.h:
| D |
/** SHIFT-JIS の扱いに。
* Dmd: 2.085.1
* Date: 2019-Apr-01 01:18:26
* Authors: KUMA
* License: CC0
*/
module sworks.win32.sjis;
public import sworks.base.strutil;
debug import std.stdio : writeln;
// 文字列を SHIFT-JIS文字列に.
jstring toMBS(U : T[], T)(U msg, int codePage = 0)
{
import std.conv : to;
import std.ascii : isASCII;
import std.exception : enforce;
import std.traits : Unqual, isSomeChar;
import core.sys.windows.windows : WideCharToMultiByte;
static if (is(Unqual!T == jchar)) return msg.j;
else static if (isSomeChar!T)
{
bool ASCIIOnly = true;
for (size_t i = 0 ; i < msg.length && ASCIIOnly ; ++i)
ASCIIOnly = msg[i].isASCII;
if (ASCIIOnly) return msg.to!string.j;
auto str16 = msg.to!wstring;
auto result = new char[
WideCharToMultiByte(codePage, 0, str16.ptr, cast(int)str16.length,
null, 0, null, null)];
enforce(0 < result.length &&
result.length == WideCharToMultiByte(
codePage, 0, str16.ptr, cast(int)str16.length, result.ptr,
cast(int)result.length, null, null));
return result.j;
}
else return msg.to!string.toMBS;
}
/// ditto
jstring toMBS(T)(T msg, int codePage = 0)
{
import std.conv : to;
return msg.to!string.toMBS(codePage);
}
// 文字列をSHIFT-JISのNull終端文字列に。
jstringz toMBSz(U : T[], T)(U[] msg, int codePage = 0)
{
import std.conv : to;
import std.utf : toUTFz;
alias toUTF8z = toUTFz!(immutable(char)*);
import std.ascii : isASCII;
import std.exception : enforce;
import std.traits : Unqual, isSomeChar;
import core.sys.windows.windows : WideCharToMultiByte;
static if (is(Unqual!T == jchar)) return (msg ~ '\0').jz;
else static if (isSomeChar!T)
{
bool ASCIIOnly = true;
for (size_t i = 0 ; i < msg.length && ASCIIOnly ; ++i)
ASCIIOnly = msg[i].isASCII;
if (ASCIIOnly) return msg.toUTF8z.jz;
auto str16 = msg.to!wstring;
auto result = new char[
WideCharToMultiByte(codePage, 0, str16.ptr, cast(int)str16.length,
null, 0, null, null) + 1];
enforce(1 < result.length &&
result.length == WideCharToMultiByte(
codePage, 0, str16.ptr, cast(int)str16.length, result.ptr,
cast(int)result.length, null, null) + 1);
return result.ptr.jz;
}
else msg.to!string.toMBSz;
}
/// ditto
jstring toMBSz(T)(T msg, int codePage = 0)
{
import std.conv : to;
return msg.to!string.toMBSz(codePage);
}
// SHIFT-JIS文字列をUTF文字列に
immutable(CHAR)[] fromMBS(CHAR)(const(jchar)[] msg, int codePage = 0)
if (is(CHAR == char) || is(CHAR == wchar) || is(CHAR == dchar) ||
is(CHAR == jchar))
{
import std.conv : to;
import std.ascii : isASCII;
import std.exception: enforce;
import core.sys.windows.windows : MultiByteToWideChar;
static if (is(CHAR == jchar)) return msg;
bool ASCIIOnly = true;
for (size_t i = 0 ; i < msg.length && ASCIIOnly ; ++i)
ASCIIOnly = msg[i].isASCII;
if (ASCIIOnly) return msg.c.to!(immutable(CHAR)[]);
auto result = new wchar[
MultiByteToWideChar(codePage, 0, cast(const(CHAR)*)msg.ptr,
cast(int)msg.length, null, 0)];
enforce(0 < result.length &&
result.length ==MultiByteToWideChar(
codePage, 0, cast(const(CHAR)*)msg.ptr, msg.length, result.ptr,
result.length));
return result.to!(immutable(CHAR)[]);
}
// Null終端SHIFT-JIS文字列をUTF文字列に。
immutable(CHAR)[] fromMBSz(CHAR)(const(jchar)* msg, int codePage = 0)
if (is(T == char) || is(T == wchar) || is(T == dchar) || is(T == jchar))
{
size_t i = 0;
static if (is(CHAR == jchar))
{
for (; msg[i] != 0 ; ++i){}
return msg[0 .. i].j;
}
bool ASCIIOnly = true;
for (; msg[i] != 0 && ASCIIOnly ; ++i) ASCIIOnly = msg[i].isASCII;
if (ASCIIOnly) return msg[0 .. i].c.to!(immutable(CHAR)[]);
auto result = new wchar[
MultiByteToWideChar(codePage, 0, msg, -1, null, 0)];
enforce(0 < result.length &&
result.length == MultiByteToWideChar(
codePage, 0, msg.ptr, cast(int)msg.length, result.ptr,
cast(int)result.length));
return result.to!(immutable(CHAR)[]);
}
debug(sjis):
import std.stdio;
void main()
{
writeln("日本語".toMBS.c);
}
| D |
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module dwt.custom.ExtendedModifyEvent;
import dwt.dwthelper.utils;
import dwt.custom.StyledTextEvent;
import dwt.events.TypedEvent;
import dwt.widgets.Event;
/**
* This event is sent after a text change occurs.
*
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*/
public final class ExtendedModifyEvent : TypedEvent {
/** start offset of the new text */
public int start;
/** length of the new text */
public int length;
/** replaced text or empty string if no text was replaced */
public String replacedText;
static final long serialVersionUID = 3258696507027830832L;
/**
* Constructs a new instance of this class based on the
* information in the given event.
*
* @param e the event containing the information
*/
public this(StyledTextEvent e) {
super(cast(Event)e);
start = e.start;
length = e.end - e.start;
replacedText = e.text;
}
}
| D |
/Users/apple/Desktop/save/HW9.01/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/ResponseSerialization.o : /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/AFError.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Alamofire.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/MultipartFormData.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Notifications.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/ParameterEncoding.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Request.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Response.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/ResponseSerialization.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Result.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/SessionDelegate.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/SessionManager.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/TaskDelegate.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Timeline.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/apple/Desktop/save/HW9.01/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/apple/Desktop/save/HW9.01/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/apple/Desktop/save/HW9.01/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/ResponseSerialization~partial.swiftmodule : /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/AFError.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Alamofire.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/MultipartFormData.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Notifications.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/ParameterEncoding.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Request.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Response.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/ResponseSerialization.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Result.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/SessionDelegate.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/SessionManager.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/TaskDelegate.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Timeline.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/apple/Desktop/save/HW9.01/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/apple/Desktop/save/HW9.01/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/apple/Desktop/save/HW9.01/build/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/ResponseSerialization~partial.swiftdoc : /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/AFError.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Alamofire.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/MultipartFormData.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Notifications.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/ParameterEncoding.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Request.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Response.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/ResponseSerialization.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Result.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/SessionDelegate.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/SessionManager.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/TaskDelegate.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Timeline.swift /Users/apple/Desktop/save/HW9.01/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/apple/Desktop/save/HW9.01/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/apple/Desktop/save/HW9.01/build/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
| D |
/Users/taharahiroki/secret_account_test/target/debug/deps/bitflags-8f5bff499c42b43b.rmeta: /Users/taharahiroki/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.2.1/src/lib.rs
/Users/taharahiroki/secret_account_test/target/debug/deps/libbitflags-8f5bff499c42b43b.rlib: /Users/taharahiroki/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.2.1/src/lib.rs
/Users/taharahiroki/secret_account_test/target/debug/deps/bitflags-8f5bff499c42b43b.d: /Users/taharahiroki/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.2.1/src/lib.rs
/Users/taharahiroki/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.2.1/src/lib.rs:
| D |
// Written in the D programming language.
/**
A one-stop shop for converting values from one type to another.
Copyright: Copyright Digital Mars 2007-.
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(WEB digitalmars.com, Walter Bright),
$(WEB erdani.org, Andrei Alexandrescu),
Shin Fujishiro,
Adam D. Ruppe,
Kenji Hara
Source: $(PHOBOSSRC std/_conv.d)
*/
module std.conv;
import core.stdc.math : ldexpl;
import core.stdc.string;
import std.algorithm, std.array, std.ascii, std.exception, std.math, std.range,
std.string, std.traits, std.typecons, std.typetuple, std.uni,
std.utf;
import std.format;
import std.metastrings;
//debug=conv; // uncomment to turn on debugging printf's
/* ************* Exceptions *************** */
/**
* Thrown on conversion errors.
*/
class ConvException : Exception
{
this(string s, string fn = __FILE__, size_t ln = __LINE__)
{
super(s, fn, ln);
}
}
private string convError_unexpected(S)(S source) {
return source.empty ? "end of input" : text("'", source.front, "'");
}
private void convError(S, T)(S source, string fn = __FILE__, size_t ln = __LINE__)
{
throw new ConvException(
text("Unexpected ", convError_unexpected(source),
" when converting from type "~S.stringof~" to type "~T.stringof),
fn, ln);
}
private void convError(S, T)(S source, int radix, string fn = __FILE__, size_t ln = __LINE__)
{
throw new ConvException(
text("Unexpected ", convError_unexpected(source),
" when converting from type "~S.stringof~" base ", radix,
" to type "~T.stringof),
fn, ln);
}
private void parseError(lazy string msg, string fn = __FILE__, size_t ln = __LINE__)
{
throw new ConvException(text("Can't parse string: ", msg), fn, ln);
}
private void parseCheck(alias source)(dchar c, string fn = __FILE__, size_t ln = __LINE__)
{
if (source.front != c)
parseError(text("\"", c, "\" is missing"), fn, ln);
source.popFront();
}
private
{
template isImaginary(T)
{
enum bool isImaginary = staticIndexOf!(Unqual!(T),
ifloat, idouble, ireal) >= 0;
}
template isComplex(T)
{
enum bool isComplex = staticIndexOf!(Unqual!(T),
cfloat, cdouble, creal) >= 0;
}
template isNarrowInteger(T)
{
enum bool isNarrowInteger = staticIndexOf!(Unqual!(T),
byte, ubyte, short, ushort) >= 0;
}
T toStr(T, S)(S src)
if (isSomeString!T)
{
auto w = appender!T();
FormatSpec!(ElementEncodingType!T) f;
formatValue(w, src, f);
return w.data;
}
template isEnumStrToStr(S, T)
{
enum isEnumStrToStr = isImplicitlyConvertible!(S, T) &&
is(S == enum) && isSomeString!T;
}
template isNullToStr(S, T)
{
enum isNullToStr = isImplicitlyConvertible!(S, T) &&
is(S == typeof(null)) && isSomeString!T;
}
template isRawStaticArray(T, A...)
{
enum isRawStaticArray =
A.length == 0 &&
isStaticArray!T &&
!is(T == class) &&
!is(T == interface) &&
!is(T == struct) &&
!is(T == union);
}
}
/**
* Thrown on conversion overflow errors.
*/
class ConvOverflowException : ConvException
{
this(string s, string fn = __FILE__, size_t ln = __LINE__)
{
super(s, fn, ln);
}
}
/* **************************************************************
The $(D_PARAM to) family of functions converts a value from type
$(D_PARAM Source) to type $(D_PARAM Target). The source type is
deduced and the target type must be specified, for example the
expression $(D_PARAM to!int(42.0)) converts the number 42 from
$(D_PARAM double) to $(D_PARAM int). The conversion is "safe", i.e.,
it checks for overflow; $(D_PARAM to!int(4.2e10)) would throw the
$(D_PARAM ConvOverflowException) exception. Overflow checks are only
inserted when necessary, e.g., $(D_PARAM to!double(42)) does not do
any checking because any int fits in a double.
Converting a value to its own type (useful mostly for generic code)
simply returns its argument.
Example:
-------------------------
int a = 42;
auto b = to!int(a); // b is int with value 42
auto c = to!double(3.14); // c is double with value 3.14
-------------------------
Converting among numeric types is a safe way to cast them around.
Conversions from floating-point types to integral types allow loss of
precision (the fractional part of a floating-point number). The
conversion is truncating towards zero, the same way a cast would
truncate. (To round a floating point value when casting to an
integral, use $(D_PARAM roundTo).)
Examples:
-------------------------
int a = 420;
auto b = to!long(a); // same as long b = a;
auto c = to!byte(a / 10); // fine, c = 42
auto d = to!byte(a); // throw ConvOverflowException
double e = 4.2e6;
auto f = to!int(e); // f == 4200000
e = -3.14;
auto g = to!uint(e); // fails: floating-to-integral negative overflow
e = 3.14;
auto h = to!uint(e); // h = 3
e = 3.99;
h = to!uint(a); // h = 3
e = -3.99;
f = to!int(a); // f = -3
-------------------------
Conversions from integral types to floating-point types always
succeed, but might lose accuracy. The largest integers with a
predecessor representable in floating-point format are 2^24-1 for
float, 2^53-1 for double, and 2^64-1 for $(D_PARAM real) (when
$(D_PARAM real) is 80-bit, e.g. on Intel machines).
Example:
-------------------------
int a = 16_777_215; // 2^24 - 1, largest proper integer representable as float
assert(to!int(to!float(a)) == a);
assert(to!int(to!float(-a)) == -a);
a += 2;
assert(to!int(to!float(a)) == a); // fails!
-------------------------
Conversions from string to numeric types differ from the C equivalents
$(D_PARAM atoi()) and $(D_PARAM atol()) by checking for overflow and
not allowing whitespace.
For conversion of strings to signed types, the grammar recognized is:
<pre>
$(I Integer): $(I Sign UnsignedInteger)
$(I UnsignedInteger)
$(I Sign):
$(B +)
$(B -)
</pre>
For conversion to unsigned types, the grammar recognized is:
<pre>
$(I UnsignedInteger):
$(I DecimalDigit)
$(I DecimalDigit) $(I UnsignedInteger)
</pre>
Converting an array to another array type works by converting each
element in turn. Associative arrays can be converted to associative
arrays as long as keys and values can in turn be converted.
Example:
-------------------------
int[] a = ([1, 2, 3]).dup;
auto b = to!(float[])(a);
assert(b == [1.0f, 2, 3]);
string str = "1 2 3 4 5 6";
auto numbers = to!(double[])(split(str));
assert(numbers == [1.0, 2, 3, 4, 5, 6]);
int[string] c;
c["a"] = 1;
c["b"] = 2;
auto d = to!(double[wstring])(c);
assert(d["a"w] == 1 && d["b"w] == 2);
-------------------------
Conversions operate transitively, meaning that they work on arrays and
associative arrays of any complexity:
-------------------------
int[string][double[int[]]] a;
...
auto b = to!(short[wstring][string[double[]]])(a);
-------------------------
This conversion works because $(D_PARAM to!short) applies to an
$(D_PARAM int), $(D_PARAM to!wstring) applies to a $(D_PARAM
string), $(D_PARAM to!string) applies to a $(D_PARAM double), and
$(D_PARAM to!(double[])) applies to an $(D_PARAM int[]). The
conversion might throw an exception because $(D_PARAM to!short)
might fail the range check.
Macros: WIKI=Phobos/StdConv
*/
/**
Entry point that dispatches to the appropriate conversion
primitive. Client code normally calls $(D _to!TargetType(value))
(and not some variant of $(D toImpl)).
*/
template to(T)
{
T to(A...)(A args)
if (!isRawStaticArray!A)
{
return toImpl!T(args);
}
// Fix issue 6175
T to(S)(ref S arg)
if (isRawStaticArray!S)
{
return toImpl!T(arg);
}
}
// Tests for issue 6175
unittest
{
char[9] sarr = "blablabla";
auto darr = to!(char[])(sarr);
assert(sarr.ptr == darr.ptr);
assert(sarr.length == darr.length);
}
// Tests for issue 7348
unittest
{
assert(to!string(null) == "null");
assert(text(null) == "null");
}
/**
If the source type is implicitly convertible to the target type, $(D
to) simply performs the implicit conversion.
*/
T toImpl(T, S)(S value)
if (isImplicitlyConvertible!(S, T) &&
!isEnumStrToStr!(S, T) && !isNullToStr!(S, T))
{
alias isUnsigned isUnsignedInt;
// Conversion from integer to integer, and changing its sign
static if (isUnsignedInt!S && isSignedInt!T && S.sizeof == T.sizeof)
{ // unsigned to signed & same size
enforce(value <= cast(S)T.max,
new ConvOverflowException("Conversion positive overflow"));
}
else static if (isSignedInt!S && isUnsignedInt!T)
{ // signed to unsigned
enforce(0 <= value,
new ConvOverflowException("Conversion negative overflow"));
}
return value;
}
private template isSignedInt(T)
{
enum isSignedInt = isIntegral!T && isSigned!T;
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
int a = 42;
auto b = to!long(a);
assert(a == b);
}
// Tests for issue 6377
unittest
{
// Conversion between same size
foreach (S; TypeTuple!(byte, short, int, long))
{
alias Unsigned!S U;
foreach (Sint; TypeTuple!(S, const(S), immutable(S)))
foreach (Uint; TypeTuple!(U, const(U), immutable(U)))
{
// positive overflow
Uint un = Uint.max;
assertThrown!ConvOverflowException(to!Sint(un), text(
Sint.stringof, ' ', Uint.stringof, ' ', un));
// negative overflow
Sint sn = -1;
assertThrown!ConvOverflowException(to!Uint(sn), text(
Sint.stringof, ' ', Uint.stringof, ' ', un));
}
}
// Conversion between different size
foreach (i, S1; TypeTuple!(byte, short, int, long))
foreach ( S2; TypeTuple!(byte, short, int, long)[i+1..$])
{
alias Unsigned!S1 U1;
alias Unsigned!S2 U2;
static assert(U1.sizeof < S2.sizeof);
// small unsigned to big signed
foreach (Uint; TypeTuple!(U1, const(U1), immutable(U1)))
foreach (Sint; TypeTuple!(S2, const(S2), immutable(S2)))
{
Uint un = Uint.max;
assertNotThrown(to!Sint(un));
assert(to!Sint(un) == un);
}
// big unsigned to small signed
foreach (Uint; TypeTuple!(U2, const(U2), immutable(U2)))
foreach (Sint; TypeTuple!(S1, const(S1), immutable(S1)))
{
Uint un = Uint.max;
assertThrown(to!Sint(un));
}
static assert(S1.sizeof < U2.sizeof);
// small signed to big unsigned
foreach (Sint; TypeTuple!(S1, const(S1), immutable(S1)))
foreach (Uint; TypeTuple!(U2, const(U2), immutable(U2)))
{
Sint sn = -1;
assertThrown!ConvOverflowException(to!Uint(sn));
}
// big signed to small unsigned
foreach (Sint; TypeTuple!(S2, const(S2), immutable(S2)))
foreach (Uint; TypeTuple!(U1, const(U1), immutable(U1)))
{
Sint sn = -1;
assertThrown!ConvOverflowException(to!Uint(sn));
}
}
}
/*
Converting static arrays forwards to their dynamic counterparts.
*/
T toImpl(T, S)(ref S s)
if (isRawStaticArray!S)
{
return toImpl!(T, typeof(s[0])[])(s);
}
unittest
{
char[4] test = ['a', 'b', 'c', 'd'];
static assert(!isInputRange!(Unqual!(char[4])));
assert(to!string(test) == test);
}
/**
$(RED Deprecated. It will be removed in August 2012. Please define $(D opCast)
for user-defined types instead of a $(D to) function.
$(LREF to) will now use $(D opCast).)
Object-_to-non-object conversions look for a method "to" of the source
object.
Example:
----
class Date
{
T to(T)() if(is(T == long))
{
return timestamp;
}
...
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
auto d = new Date;
auto ts = to!long(d); // same as d.to!long()
}
----
*/
deprecated T toImpl(T, S)(S value)
if (is(S : Object) && !is(T : Object) && !isSomeString!T &&
hasMember!(S, "to") && is(typeof(S.init.to!T()) : T))
{
return value.to!T();
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
class B
{
T to(T)() { return 43; }
}
auto b = new B;
assert(to!int(b) == 43);
}
/**
When source type supports member template function opCast, is is used.
*/
T toImpl(T, S)(S value)
if (is(typeof(S.init.opCast!T()) : T) &&
!isSomeString!T)
{
return value.opCast!T();
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
class B
{
T opCast(T)() { return 43; }
}
auto b = new B;
assert(to!int(b) == 43);
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
struct S
{
T opCast(T)() { return 43; }
}
auto s = S();
assert(to!int(s) == 43);
}
/**
When target type supports 'converting construction', it is used.
$(UL $(LI If target type is struct, $(D T(value)) is used.)
$(LI If target type is class, $(D new T(value)) is used.))
*/
T toImpl(T, S)(S value)
if (!isImplicitlyConvertible!(S, T) &&
is(T == struct) && is(typeof(T(value))))
{
return T(value);
}
// Bugzilla 3961
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
struct Int
{
int x;
}
Int i = to!Int(1);
static struct Int2
{
int x;
this(int x) { this.x = x; }
}
Int2 i2 = to!Int2(1);
static struct Int3
{
int x;
static Int3 opCall(int x)
{
Int3 i;
i.x = x;
return i;
}
}
Int3 i3 = to!Int3(1);
}
// Bugzilla 6808
unittest
{
static struct FakeBigInt
{
this(string s){}
}
string s = "101";
auto i3 = to!FakeBigInt(s);
}
/// ditto
T toImpl(T, S)(S value)
if (!isImplicitlyConvertible!(S, T) &&
is(T == class) && is(typeof(new T(value))))
{
return new T(value);
}
unittest
{
static struct S
{
int x;
}
static class C
{
int x;
this(int x) { this.x = x; }
}
static class B
{
int value;
this(S src) { value = src.x; }
this(C src) { value = src.x; }
}
S s = S(1);
auto b1 = to!B(s); // == new B(s)
assert(b1.value == 1);
C c = new C(2);
auto b2 = to!B(c); // == new B(c)
assert(b2.value == 2);
auto c2 = to!C(3); // == new C(3)
assert(c2.x == 3);
}
version (unittest)
{
class A
{
this(B b) {}
}
class B : A
{
this() { super(this); }
}
}
unittest
{
B b = new B();
A a = to!A(b); // == cast(A)b
// (do not run construction conversion like new A(b))
assert(b is a);
static class C : Object
{
this() {}
this(Object o) {}
}
Object oc = new C();
C a2 = to!C(oc); // == new C(a)
// Construction conversion overrides down-casting conversion
assert(a2 != a); //
}
/**
Object-to-object conversions by dynamic casting throw exception when the source is
non-null and the target is null.
*/
T toImpl(T, S)(S value)
if (!isImplicitlyConvertible!(S, T) &&
(is(S == class) || is(S == interface)) && !is(typeof(value.opCast!T()) : T) &&
(is(T == class) || is(T == interface)) && !is(typeof(new T(value))))
{
static if (is(T == immutable))
{
// immutable <- immutable
enum isModConvertible = is(S == immutable);
}
else static if (is(T == const))
{
static if (is(T == shared))
{
// shared const <- shared
// shared const <- shared const
// shared const <- immutable
enum isModConvertible = is(S == shared) || is(S == immutable);
}
else
{
// const <- mutable
// const <- immutable
enum isModConvertible = !is(S == shared);
}
}
else
{
static if (is(T == shared))
{
// shared <- shared mutable
enum isModConvertible = is(S == shared) && !is(S == const);
}
else
{
// (mutable) <- (mutable)
enum isModConvertible = is(Unqual!S == S);
}
}
static assert(isModConvertible, "Bad modifier conversion: "~S.stringof~" to "~T.stringof);
auto result = cast(T) value;
if (!result && value)
{
throw new ConvException("Cannot convert object of static type "
~S.classinfo.name~" and dynamic type "~value.classinfo.name
~" to type "~T.classinfo.name);
}
return result;
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
// Testing object conversions
class A {}
class B : A {}
class C : A {}
A a1 = new A, a2 = new B, a3 = new C;
assert(to!B(a2) is a2);
assert(to!C(a3) is a3);
assertThrown!ConvException(to!B(a3));
}
// Unittest for 6288
version (unittest)
{
private template Identity(T) { alias T Identity; }
private template toConst(T) { alias const(T) toConst; }
private template toShared(T) { alias shared(T) toShared; }
private template toSharedConst(T) { alias shared(const(T)) toSharedConst; }
private template toImmutable(T) { alias immutable(T) toImmutable; }
private template AddModifier(int n) if (0 <= n && n < 5)
{
static if (n == 0) alias Identity AddModifier;
else static if (n == 1) alias toConst AddModifier;
else static if (n == 2) alias toShared AddModifier;
else static if (n == 3) alias toSharedConst AddModifier;
else static if (n == 4) alias toImmutable AddModifier;
}
}
unittest
{
interface I {}
interface J {}
class A {}
class B : A {}
class C : B, I, J {}
class D : I {}
foreach (m1; TypeTuple!(0,1,2,3,4)) // enumerate modifiers
foreach (m2; TypeTuple!(0,1,2,3,4)) // ditto
{
alias AddModifier!m1 srcmod;
alias AddModifier!m2 tgtmod;
//pragma(msg, srcmod!Object, " -> ", tgtmod!Object, ", convertible = ",
// isImplicitlyConvertible!(srcmod!Object, tgtmod!Object));
// Compile time convertible equals to modifier convertible.
static if (isImplicitlyConvertible!(srcmod!Object, tgtmod!Object))
{
// Test runtime conversions: class to class, class to interface,
// interface to class, and interface to interface
// Check that the runtime conversion to succeed
srcmod!A ac = new srcmod!C();
srcmod!I ic = new srcmod!C();
assert(to!(tgtmod!C)(ac) !is null); // A(c) to C
assert(to!(tgtmod!I)(ac) !is null); // A(c) to I
assert(to!(tgtmod!C)(ic) !is null); // I(c) to C
assert(to!(tgtmod!J)(ic) !is null); // I(c) to J
// Check that the runtime conversion fails
srcmod!A ab = new srcmod!B();
srcmod!I id = new srcmod!D();
assertThrown(to!(tgtmod!C)(ab)); // A(b) to C
assertThrown(to!(tgtmod!I)(ab)); // A(b) to I
assertThrown(to!(tgtmod!C)(id)); // I(d) to C
assertThrown(to!(tgtmod!J)(id)); // I(d) to J
}
else
{
// Check that the conversion is rejected statically
static assert(!is(typeof(to!(tgtmod!C)(srcmod!A.init)))); // A to C
static assert(!is(typeof(to!(tgtmod!I)(srcmod!A.init)))); // A to I
static assert(!is(typeof(to!(tgtmod!C)(srcmod!I.init)))); // I to C
static assert(!is(typeof(to!(tgtmod!J)(srcmod!I.init)))); // I to J
}
}
}
/**
Stringnize conversion from all types is supported.
$(UL
$(LI String _to string conversion works for any two string types having
($(D char), $(D wchar), $(D dchar)) character widths and any
combination of qualifiers (mutable, $(D const), or $(D immutable)).)
$(LI Converts array (other than strings) to string.
Each element is converted by calling $(D to!T).)
$(LI Associative array to string conversion.
Each element is printed by calling $(D to!T).)
$(LI Object to string conversion calls $(D toString) against the object or
returns $(D "null") if the object is null.)
$(LI Struct to string conversion calls $(D toString) against the struct if
it is defined.)
$(LI For structs that do not define $(D toString), the conversion to string
produces the list of fields.)
$(LI Enumerated types are converted to strings as their symbolic names.)
$(LI Boolean values are printed as $(D "true") or $(D "false").)
$(LI $(D char), $(D wchar), $(D dchar) to a string type.)
$(LI Unsigned or signed integers to strings.
$(DL $(DT [special case])
$(DD Convert integral value to string in $(D_PARAM radix) radix.
radix must be a value from 2 to 36.
value is treated as a signed value only if radix is 10.
The characters A through Z are used to represent values 10 through 36.)))
$(LI All floating point types to all string types.)
$(LI Pointer to string conversions prints the pointer as a $(D size_t) value.
If pointer is $(D char*), treat it as C-style strings.))
*/
T toImpl(T, S)(S value)
if (!(isImplicitlyConvertible!(S, T) &&
!isEnumStrToStr!(S, T) && !isNullToStr!(S, T)) &&
isSomeString!T && !isAggregateType!T)
{
static if (isSomeString!S && value[0].sizeof == ElementEncodingType!T.sizeof)
{
// string-to-string with incompatible qualifier conversion
static if (is(ElementEncodingType!T == immutable))
{
// conversion (mutable|const) -> immutable
return value.idup;
}
else
{
// conversion (immutable|const) -> mutable
return value.dup;
}
}
else static if (isSomeString!S)
{
// other string-to-string conversions always run decode/encode
return toStr!T(value);
}
else static if (is(S == void[]) || is(S == const(void)[]) || is(S == immutable(void)[]))
{
// Converting void array to string
alias Unqual!(ElementEncodingType!T) Char;
auto raw = cast(const(ubyte)[]) value;
enforce(raw.length % Char.sizeof == 0,
new ConvException("Alignment mismatch in converting a "
~ S.stringof ~ " to a "
~ T.stringof));
auto result = new Char[raw.length / Char.sizeof];
memcpy(result.ptr, value.ptr, value.length);
return cast(T) result;
}
else static if (isPointer!S && is(S : const(char)*))
{
return value ? cast(T) value[0 .. strlen(value)].dup : cast(string)null;
}
else
{
// other non-string values runs formatting
return toStr!T(value);
}
}
unittest
{
// string to string conversion
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
alias TypeTuple!(char, wchar, dchar) Chars;
foreach (LhsC; Chars)
{
alias TypeTuple!(LhsC[], const(LhsC)[], immutable(LhsC)[]) LhStrings;
foreach (Lhs; LhStrings)
{
foreach (RhsC; Chars)
{
alias TypeTuple!(RhsC[], const(RhsC)[], immutable(RhsC)[])
RhStrings;
foreach (Rhs; RhStrings)
{
Lhs s1 = to!Lhs("wyda");
Rhs s2 = to!Rhs(s1);
//writeln(Lhs.stringof, " -> ", Rhs.stringof);
assert(s1 == to!Lhs(s2));
}
}
}
}
foreach (T; Chars)
{
foreach (U; Chars)
{
T[] s1 = to!(T[])("Hello, world!");
auto s2 = to!(U[])(s1);
assert(s1 == to!(T[])(s2));
auto s3 = to!(const(U)[])(s1);
assert(s1 == to!(T[])(s3));
auto s4 = to!(immutable(U)[])(s1);
assert(s1 == to!(T[])(s4));
}
}
}
unittest
{
// Conversion reinterpreting void array to string
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
auto a = "abcx"w;
const(void)[] b = a;
assert(b.length == 8);
auto c = to!(wchar[])(b);
assert(c == "abcx");
}
unittest
{
// char* to string conversion
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
debug(conv) printf("string.to!string(char*).unittest\n");
assert(to!string(cast(char*) null) == "");
assert(to!string("foo\0".ptr) == "foo");
}
unittest
{
// Conversion representing bool value with string
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
bool b;
assert(to!string(b) == "false");
b = true;
assert(to!string(b) == "true");
}
unittest
{
// Conversion representing character value with string
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
alias TypeTuple!(
char, wchar, dchar,
const(char), const(wchar), const(dchar),
immutable(char), immutable(wchar), immutable(dchar)) AllChars;
foreach (Char1; AllChars)
{
foreach (Char2; AllChars)
{
Char1 c = 'a';
assert(to!(Char2[])(c)[0] == c);
}
uint x = 4;
assert(to!(Char1[])(x) == "4");
}
string s = "foo";
string s2;
foreach (char c; s)
{
s2 ~= to!string(c);
}
//printf("%.*s", s2);
assert(s2 == "foo");
}
unittest
{
// Conversion representing integer values with string
foreach (Int; TypeTuple!(ubyte, ushort, uint, ulong))
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
debug(conv) printf("string.to!string(%.*s).unittest\n", Int.stringof.length, Int.stringof.ptr);
assert(to!string(to!Int(0)) == "0");
assert(to!string(to!Int(9)) == "9");
assert(to!string(to!Int(123)) == "123");
}
foreach (Int; TypeTuple!(byte, short, int, long))
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
debug(conv) printf("string.to!string(%.*s).unittest\n", Int.stringof.length, Int.stringof.ptr);
assert(to!string(to!Int(0)) == "0");
assert(to!string(to!Int(9)) == "9");
assert(to!string(to!Int(123)) == "123");
assert(to!string(to!Int(-0)) == "0");
assert(to!string(to!Int(-9)) == "-9");
assert(to!string(to!Int(-123)) == "-123");
assert(to!string(to!(const Int)(6)) == "6");
}
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
assert(wtext(int.max) == "2147483647"w);
assert(wtext(int.min) == "-2147483648"w);
assert(to!string(0L) == "0");
}
unittest
{
// Conversion representing dynamic/static array with string
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
long[] b = [ 1, 3, 5 ];
auto s = to!string(b);
assert(to!string(b) == "[1, 3, 5]", s);
double[2] a = [ 1.5, 2.5 ];
assert(to!string(a) == "[1.5, 2.5]");
}
unittest
{
// Conversion representing associative array with string
int[string] a = ["0":1, "1":2];
assert(to!string(a) == `["0":1, "1":2]`);
}
unittest
{
// Conversion representing class object with string
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
class A
{
override string toString() const { return "an A"; }
}
A a;
assert(to!string(a) == "null");
a = new A;
assert(to!string(a) == "an A");
// Bug 7660
class C { override string toString() const { return "C"; } }
struct S { C c; alias c this; }
S s; s.c = new C();
assert(to!string(s) == "C");
}
unittest
{
// Conversion representing struct object with string
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
struct S1
{
string toString() { return "wyda"; }
}
assert(to!string(S1()) == "wyda");
struct S2
{
int a = 42;
float b = 43.5;
}
S2 s2;
assert(to!string(s2) == "S2(42, 43.5)");
// Test for issue 8080
struct S8080
{
short[4] data;
alias data this;
string toString() { return "<S>"; }
}
S8080 s8080;
assert(to!string(s8080) == "<S>");
}
unittest
{
// Conversion representing enum value with string
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
enum EB : bool { a = true }
enum EU : uint { a = 0, b = 1, c = 2 } // base type is unsigned
enum EI : int { a = -1, b = 0, c = 1 } // base type is signed (bug 7909)
enum EF : real { a = 1.414, b = 1.732, c = 2.236 }
enum EC : char { a = 'a', b = 'b' }
enum ES : string { a = "aaa", b = "bbb" }
foreach (E; TypeTuple!(EB, EU, EI, EF, EC, ES))
{
assert(to! string(E.a) == "a"c);
assert(to!wstring(E.a) == "a"w);
assert(to!dstring(E.a) == "a"d);
}
// Test an value not corresponding to an enum member.
auto o = cast(EU)5;
assert(to! string(o) == "cast(EU)5"c);
assert(to!wstring(o) == "cast(EU)5"w);
assert(to!dstring(o) == "cast(EU)5"d);
}
/// ditto
T toImpl(T, S)(S value, uint radix)
if (isIntegral!S &&
isSomeString!T)
in
{
assert(radix >= 2 && radix <= 36);
}
body
{
static if (!is(IntegralTypeOf!S == ulong))
{
enforce(radix >= 2 && radix <= 36, new ConvException("Radix error"));
if (radix == 10)
return to!string(value); // handle signed cases only for radix 10
return to!string(cast(ulong) value, radix);
}
else
{
char[value.sizeof * 8] buffer;
uint i = buffer.length;
if (value < radix && value < hexDigits.length)
return hexDigits[cast(size_t)value .. cast(size_t)value + 1];
do
{
ubyte c;
c = cast(ubyte)(value % radix);
value = value / radix;
i--;
buffer[i] = cast(char)((c < 10) ? c + '0' : c + 'A' - 10);
} while (value);
return to!T(buffer[i .. $].dup);
}
}
unittest
{
foreach (Int; TypeTuple!(uint, ulong))
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
debug(conv) printf("string.to!string(%.*s, uint).unittest\n", Int.stringof.length, Int.stringof.ptr);
assert(to!string(to!Int(16), 16) == "10");
assert(to!string(to!Int(15), 2u) == "1111");
assert(to!string(to!Int(1), 2u) == "1");
assert(to!string(to!Int(0x1234AF), 16u) == "1234AF");
}
foreach (Int; TypeTuple!(int, long))
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
debug(conv) printf("string.to!string(%.*s, uint).unittest\n", Int.stringof.length, Int.stringof.ptr);
assert(to!string(to!Int(-10), 10u) == "-10");
}
}
/**
$(RED Deprecated. It will be removed in January 2013.
Please use $(XREF format, formattedWrite) instead.)
Conversions to string with optional configures.
*/
deprecated T toImpl(T, S)(S s, in T leftBracket, in T separator = ", ", in T rightBracket = "]")
if (!isSomeChar!(ElementType!S) && (isInputRange!S || isInputRange!(Unqual!S)) &&
isSomeString!T)
{
pragma(msg, hardDeprec!("2.060", "January 2013", "std.conv.toImpl with extra parameters",
"std.format.formattedWrite"));
static if (!isInputRange!S)
{
alias toImpl!(T, Unqual!S) ti;
return ti(s, leftBracket, separator, rightBracket);
}
else
{
alias Unqual!(ElementEncodingType!T) Char;
// array-to-string conversion
auto result = appender!(Char[])();
result.put(leftBracket);
bool first = true;
for (; !s.empty; s.popFront())
{
if (!first)
{
result.put(separator);
}
else
{
first = false;
}
result.put(to!T(s.front));
}
result.put(rightBracket);
return cast(T) result.data;
}
}
/// ditto
deprecated T toImpl(T, S)(ref S s, in T leftBracket, in T separator = " ", in T rightBracket = "]")
if ((is(S == void[]) || is(S == const(void)[]) || is(S == immutable(void)[])) &&
isSomeString!T)
{
pragma(msg, hardDeprec!("2.060", "January 2013", "std.conv.toImpl with extra parameters",
"std.format.formattedWrite"));
return toImpl(s);
}
/// ditto
deprecated T toImpl(T, S)(S s, in T leftBracket, in T keyval = ":", in T separator = ", ", in T rightBracket = "]")
if (isAssociativeArray!S &&
isSomeString!T)
{
pragma(msg, hardDeprec!("2.060", "January 2013", "std.conv.toImpl with extra parameters",
"std.format.formattedWrite"));
alias Unqual!(ElementEncodingType!T) Char;
auto result = appender!(Char[])();
// hash-to-string conversion
result.put(leftBracket);
bool first = true;
foreach (k, v; s)
{
if (!first)
result.put(separator);
else first = false;
result.put(to!T(k));
result.put(keyval);
result.put(to!T(v));
}
result.put(rightBracket);
return cast(T) result.data;
}
/// ditto
deprecated T toImpl(T, S)(S s, in T nullstr)
if (is(S : Object) &&
isSomeString!T)
{
pragma(msg, hardDeprec!("2.060", "January 2013", "std.conv.toImpl with extra parameters",
"std.format.formattedWrite"));
if (!s)
return nullstr;
return to!T(s.toString());
}
/// ditto
deprecated T toImpl(T, S)(S s, in T left, in T separator = ", ", in T right = ")")
if (is(S == struct) && !is(typeof(&S.init.toString)) && !isInputRange!S &&
isSomeString!T)
{
pragma(msg, hardDeprec!("2.060", "January 2013", "std.conv.toImpl with extra parameters",
"std.format.formattedWrite"));
Tuple!(FieldTypeTuple!S) * t = void;
static if ((*t).sizeof == S.sizeof)
{
// ok, attempt to forge the tuple
t = cast(typeof(t)) &s;
alias Unqual!(ElementEncodingType!T) Char;
auto app = appender!(Char[])();
app.put(left);
foreach (i, e; t.field)
{
if (i > 0)
app.put(to!T(separator));
app.put(to!T(e));
}
app.put(right);
return cast(T) app.data;
}
else
{
// struct with weird alignment
return to!T(S.stringof);
}
}
/*
$(LI A $(D typedef Type Symbol) is converted to string as $(D "Type(value)").)
*/
deprecated T toImpl(T, S)(S s, in T left = to!T(S.stringof~"("), in T right = ")")
if (is(S == typedef) &&
isSomeString!T)
{
static if (is(S Original == typedef))
{
// typedef
return left ~ to!T(cast(Original) s) ~ right;
}
}
/**
Narrowing numeric-numeric conversions throw when the value does not
fit in the narrower type.
*/
T toImpl(T, S)(S value)
if (!isImplicitlyConvertible!(S, T) &&
(isNumeric!S || isSomeChar!S) &&
(isNumeric!T || isSomeChar!T))
{
enum sSmallest = mostNegative!S;
enum tSmallest = mostNegative!T;
static if (sSmallest < 0)
{
// possible underflow converting from a signed
static if (tSmallest == 0)
{
immutable good = value >= 0;
}
else
{
static assert(tSmallest < 0);
immutable good = value >= tSmallest;
}
if (!good)
throw new ConvOverflowException("Conversion negative overflow");
}
static if (S.max > T.max)
{
// possible overflow
if (value > T.max)
throw new ConvOverflowException("Conversion positive overflow");
}
return cast(T) value;
}
unittest
{
dchar a = ' ';
assert(to!char(a) == ' ');
a = 300;
assert(collectException(to!char(a)));
dchar from0 = 'A';
char to0 = to!char(from0);
wchar from1 = 'A';
char to1 = to!char(from1);
char from2 = 'A';
char to2 = to!char(from2);
char from3 = 'A';
wchar to3 = to!wchar(from3);
char from4 = 'A';
dchar to4 = to!dchar(from4);
}
/**
Array-to-array conversion (except when target is a string type)
converts each element in turn by using $(D to).
*/
T toImpl(T, S)(S value)
if (!isImplicitlyConvertible!(S, T) &&
!isSomeString!S && isDynamicArray!S &&
!isSomeString!T && isArray!T)
{
alias typeof(T.init[0]) E;
auto result = new E[value.length];
foreach (i, e; value)
{
/* Temporarily cast to mutable type, so we can get it initialized,
* this is ok because there are no other references to result[]
*/
cast()(result[i]) = to!E(e);
}
return result;
}
unittest
{
// array to array conversions
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
uint[] a = ([ 1u, 2, 3 ]).dup;
auto b = to!(float[])(a);
assert(b == [ 1.0f, 2, 3 ]);
auto c = to!(string[])(b);
assert(c[0] == "1" && c[1] == "2" && c[2] == "3");
immutable(int)[3] d = [ 1, 2, 3 ];
b = to!(float[])(d);
assert(b == [ 1.0f, 2, 3 ]);
uint[][] e = [ a, a ];
auto f = to!(float[][])(e);
assert(f[0] == b && f[1] == b);
// Test for bug 8264
struct Wrap
{
string wrap;
alias wrap this;
}
Wrap[] warr = to!(Wrap[])(["foo", "bar"]); // should work
}
/**
Associative array to associative array conversion converts each key
and each value in turn.
*/
T toImpl(T, S)(S value)
if (isAssociativeArray!S &&
isAssociativeArray!T)
{
alias typeof(T.keys[0]) K2;
alias typeof(T.values[0]) V2;
T result;
foreach (k1, v1; value)
{
result[to!K2(k1)] = to!V2(v1);
}
return result;
}
unittest
{
// hash to hash conversions
int[string] a;
a["0"] = 1;
a["1"] = 2;
auto b = to!(double[dstring])(a);
assert(b["0"d] == 1 && b["1"d] == 2);
}
private void testIntegralToFloating(Integral, Floating)()
{
Integral a = 42;
auto b = to!Floating(a);
assert(a == b);
assert(a == to!Integral(b));
}
private void testFloatingToIntegral(Floating, Integral)()
{
bool convFails(Source, Target, E)(Source src)
{
try
auto t = to!Target(src);
catch (E)
return true;
return false;
}
// convert some value
Floating a = 4.2e1;
auto b = to!Integral(a);
assert(is(typeof(b) == Integral) && b == 42);
// convert some negative value (if applicable)
a = -4.2e1;
static if (Integral.min < 0)
{
b = to!Integral(a);
assert(is(typeof(b) == Integral) && b == -42);
}
else
{
// no go for unsigned types
assert(convFails!(Floating, Integral, ConvOverflowException)(a));
}
// convert to the smallest integral value
a = 0.0 + Integral.min;
static if (Integral.min < 0)
{
a = -a; // -Integral.min not representable as an Integral
assert(convFails!(Floating, Integral, ConvOverflowException)(a)
|| Floating.sizeof <= Integral.sizeof);
}
a = 0.0 + Integral.min;
assert(to!Integral(a) == Integral.min);
--a; // no more representable as an Integral
assert(convFails!(Floating, Integral, ConvOverflowException)(a)
|| Floating.sizeof <= Integral.sizeof);
a = 0.0 + Integral.max;
assert(to!Integral(a) == Integral.max || Floating.sizeof <= Integral.sizeof);
++a; // no more representable as an Integral
assert(convFails!(Floating, Integral, ConvOverflowException)(a)
|| Floating.sizeof <= Integral.sizeof);
// convert a value with a fractional part
a = 3.14;
assert(to!Integral(a) == 3);
a = 3.99;
assert(to!Integral(a) == 3);
static if (Integral.min < 0)
{
a = -3.14;
assert(to!Integral(a) == -3);
a = -3.99;
assert(to!Integral(a) == -3);
}
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
alias TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)
AllInts;
alias TypeTuple!(float, double, real) AllFloats;
alias TypeTuple!(AllInts, AllFloats) AllNumerics;
// test with same type
{
foreach (T; AllNumerics)
{
T a = 42;
auto b = to!T(a);
assert(is(typeof(a) == typeof(b)) && a == b);
}
}
// test that floating-point numbers convert properly to largest ints
// see http://oregonstate.edu/~peterseb/mth351/docs/351s2001_fp80x87.html
// look for "largest fp integer with a predecessor"
{
// float
int a = 16_777_215; // 2^24 - 1
assert(to!int(to!float(a)) == a);
assert(to!int(to!float(-a)) == -a);
// double
long b = 9_007_199_254_740_991; // 2^53 - 1
assert(to!long(to!double(b)) == b);
assert(to!long(to!double(-b)) == -b);
// real
// @@@ BUG IN COMPILER @@@
// ulong c = 18_446_744_073_709_551_615UL; // 2^64 - 1
// assert(to!ulong(to!real(c)) == c);
// assert(to!ulong(-to!real(c)) == c);
}
// test conversions floating => integral
{
// AllInts[0 .. $ - 1] should be AllInts
// @@@ BUG IN COMPILER @@@
foreach (Integral; AllInts[0 .. $ - 1])
{
foreach (Floating; AllFloats)
{
testFloatingToIntegral!(Floating, Integral)();
}
}
}
// test conversion integral => floating
{
foreach (Integral; AllInts[0 .. $ - 1])
{
foreach (Floating; AllFloats)
{
testIntegralToFloating!(Integral, Floating)();
}
}
}
// test parsing
{
foreach (T; AllNumerics)
{
// from type immutable(char)[2]
auto a = to!T("42");
assert(a == 42);
// from type char[]
char[] s1 = "42".dup;
a = to!T(s1);
assert(a == 42);
// from type char[2]
char[2] s2;
s2[] = "42";
a = to!T(s2);
assert(a == 42);
// from type immutable(wchar)[2]
a = to!T("42"w);
assert(a == 42);
}
}
// test conversions to string
{
foreach (T; AllNumerics)
{
T a = 42;
assert(to!string(a) == "42");
//assert(to!wstring(a) == "42"w);
//assert(to!dstring(a) == "42"d);
// array test
// T[] b = new T[2];
// b[0] = 42;
// b[1] = 33;
// assert(to!string(b) == "[42,33]");
}
}
// test array to string conversion
foreach (T ; AllNumerics)
{
auto a = [to!T(1), 2, 3];
assert(to!string(a) == "[1, 2, 3]");
}
// test enum to int conversion
// enum Testing { Test1, Test2 };
// Testing t;
// auto a = to!string(t);
// assert(a == "0");
}
/**
String to non-string conversion runs parsing.
$(UL
$(LI When the source is a wide string, it is first converted to a narrow
string and then parsed.)
$(LI When the source is a narrow string, normal text parsing occurs.))
*/
T toImpl(T, S)(S value)
if (isDynamicArray!S && isSomeString!S &&
!isSomeString!T && is(typeof(parse!T(value))))
{
scope(exit)
{
if (value.length)
{
convError!(S, T)(value);
}
}
return parse!T(value);
}
/// ditto
T toImpl(T, S)(S value, uint radix)
if (isDynamicArray!S && isSomeString!S &&
!isSomeString!T && is(typeof(parse!T(value, radix))))
{
scope(exit)
{
if (value.length)
{
convError!(S, T)(value);
}
}
return parse!T(value, radix);
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
foreach (Char; TypeTuple!(char, wchar, dchar))
{
auto a = to!(Char[])("123");
assert(to!int(a) == 123);
assert(to!double(a) == 123);
}
// 6255
auto n = to!int("FF", 16);
assert(n == 255);
}
/***************************************************************
Rounded conversion from floating point to integral.
Example:
---------------
assert(roundTo!int(3.14) == 3);
assert(roundTo!int(3.49) == 3);
assert(roundTo!int(3.5) == 4);
assert(roundTo!int(3.999) == 4);
assert(roundTo!int(-3.14) == -3);
assert(roundTo!int(-3.49) == -3);
assert(roundTo!int(-3.5) == -4);
assert(roundTo!int(-3.999) == -4);
---------------
Rounded conversions do not work with non-integral target types.
*/
template roundTo(Target)
{
Target roundTo(Source)(Source value)
{
static assert(isFloatingPoint!Source);
static assert(isIntegral!Target);
return to!Target(trunc(value + (value < 0 ? -0.5L : 0.5L)));
}
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
assert(roundTo!int(3.14) == 3);
assert(roundTo!int(3.49) == 3);
assert(roundTo!int(3.5) == 4);
assert(roundTo!int(3.999) == 4);
assert(roundTo!int(-3.14) == -3);
assert(roundTo!int(-3.49) == -3);
assert(roundTo!int(-3.5) == -4);
assert(roundTo!int(-3.999) == -4);
assert(roundTo!(const int)(to!(const double)(-3.999)) == -4);
// boundary values
foreach (Int; TypeTuple!(byte, ubyte, short, ushort, int, uint))
{
assert(roundTo!Int(Int.min - 0.4L) == Int.min);
assert(roundTo!Int(Int.max + 0.4L) == Int.max);
assertThrown!ConvOverflowException(roundTo!Int(Int.min - 0.5L));
assertThrown!ConvOverflowException(roundTo!Int(Int.max + 0.5L));
}
}
/***************************************************************
* The $(D_PARAM parse) family of functions works quite like the
* $(D_PARAM to) family, except that (1) it only works with character ranges
* as input, (2) takes the input by reference and advances it to
* the position following the conversion, and (3) does not throw if it
* could not convert the entire input. It still throws if an overflow
* occurred during conversion or if no character of the input
* was meaningfully converted.
*
* Example:
--------------
string test = "123 \t 76.14";
auto a = parse!uint(test);
assert(a == 123);
assert(test == " \t 76.14"); // parse bumps string
munch(test, " \t\n\r"); // skip ws
assert(test == "76.14");
auto b = parse!double(test);
assert(b == 76.14);
assert(test == "");
--------------
*/
Target parse(Target, Source)(ref Source s)
if (isSomeChar!(ElementType!Source) &&
isIntegral!Target)
{
static if (Target.sizeof < int.sizeof)
{
// smaller types are handled like integers
auto v = .parse!(Select!(Target.min < 0, int, uint))(s);
auto result = cast(Target) v;
if (result != v)
goto Loverflow;
return result;
}
else
{
// Larger than int types
if (s.empty)
goto Lerr;
static if (Target.min < 0)
int sign = 0;
else
enum int sign = 0;
Target v = 0;
size_t i = 0;
enum char maxLastDigit = Target.min < 0 ? '7' : '5';
for (; !s.empty; ++i)
{
immutable c = s.front;
if (c >= '0' && c <= '9')
{
if (v >= Target.max/10 &&
(v != Target.max/10|| c + sign > maxLastDigit))
goto Loverflow;
v = cast(Target) (v * 10 + (c - '0'));
s.popFront();
}
else static if (Target.min < 0)
{
if (c == '-' && i == 0)
{
s.popFront();
if (s.empty)
goto Lerr;
sign = -1;
}
else if (c == '+' && i == 0)
{
s.popFront();
if (s.empty)
goto Lerr;
}
else
break;
}
else
break;
}
if (i == 0)
goto Lerr;
static if (Target.min < 0)
{
if (sign == -1)
{
v = -v;
}
}
return v;
}
Loverflow:
throw new ConvOverflowException("Overflow in integral conversion");
Lerr:
convError!(Source, Target)(s);
assert(0);
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
string s = "123";
auto a = parse!int(s);
}
unittest
{
foreach (Int; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong))
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
debug(conv) printf("conv.to!%.*s.unittest\n", Int.stringof.length, Int.stringof.ptr);
{
assert(to!Int("0") == 0);
static if (isSigned!Int)
{
assert(to!Int("+0") == 0);
assert(to!Int("-0") == 0);
}
}
static if (Int.sizeof >= byte.sizeof)
{
assert(to!Int("6") == 6);
assert(to!Int("23") == 23);
assert(to!Int("68") == 68);
assert(to!Int("127") == 0x7F);
static if (isUnsigned!Int)
{
assert(to!Int("255") == 0xFF);
}
static if (isSigned!Int)
{
assert(to!Int("+6") == 6);
assert(to!Int("+23") == 23);
assert(to!Int("+68") == 68);
assert(to!Int("+127") == 0x7F);
assert(to!Int("-6") == -6);
assert(to!Int("-23") == -23);
assert(to!Int("-68") == -68);
assert(to!Int("-128") == -128);
}
}
static if (Int.sizeof >= short.sizeof)
{
assert(to!Int("468") == 468);
assert(to!Int("32767") == 0x7FFF);
static if (isUnsigned!Int)
{
assert(to!Int("65535") == 0xFFFF);
}
static if (isSigned!Int)
{
assert(to!Int("+468") == 468);
assert(to!Int("+32767") == 0x7FFF);
assert(to!Int("-468") == -468);
assert(to!Int("-32768") == -32768);
}
}
static if (Int.sizeof >= int.sizeof)
{
assert(to!Int("2147483647") == 0x7FFFFFFF);
static if (isUnsigned!Int)
{
assert(to!Int("4294967295") == 0xFFFFFFFF);
}
static if (isSigned!Int)
{
assert(to!Int("+2147483647") == 0x7FFFFFFF);
assert(to!Int("-2147483648") == -2147483648);
}
}
static if (Int.sizeof >= long.sizeof)
{
assert(to!Int("9223372036854775807") == 0x7FFFFFFFFFFFFFFF);
static if (isUnsigned!Int)
{
assert(to!Int("18446744073709551615") == 0xFFFFFFFFFFFFFFFF);
}
static if (isSigned!Int)
{
assert(to!Int("+9223372036854775807") == 0x7FFFFFFFFFFFFFFF);
assert(to!Int("-9223372036854775808") == 0x8000000000000000);
}
}
}
}
unittest
{
// parsing error check
foreach (Int; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong))
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
debug(conv) printf("conv.to!%.*s.unittest (error)\n", Int.stringof.length, Int.stringof.ptr);
{
immutable string[] errors1 =
[
"",
"-",
"+",
"-+",
" ",
" 0",
"0 ",
"- 0",
"1-",
"xx",
"123h",
];
foreach (j, s; errors1)
assertThrown!ConvException(to!Int(s));
}
// parse!SomeUnsigned cannot parse head sign.
static if (isUnsigned!Int)
{
immutable string[] errors2 =
[
"+5",
"-78",
];
foreach (j, s; errors2)
assertThrown!ConvException(to!Int(s));
}
}
// positive overflow check
foreach (i, Int; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong))
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
debug(conv) printf("conv.to!%.*s.unittest (pos overflow)\n", Int.stringof.length, Int.stringof.ptr);
immutable string[] errors =
[
"128", // > byte.max
"256", // > ubyte.max
"32768", // > short.max
"65536", // > ushort.max
"2147483648", // > int.max
"4294967296", // > uint.max
"9223372036854775808", // > long.max
"18446744073709551616", // > ulong.max
];
foreach (j, s; errors[i..$])
assertThrown!ConvOverflowException(to!Int(s));
}
// negative overflow check
foreach (i, Int; TypeTuple!(byte, short, int, long))
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
debug(conv) printf("conv.to!%.*s.unittest (neg overflow)\n", Int.stringof.length, Int.stringof.ptr);
immutable string[] errors =
[
"-129", // < byte.min
"-32769", // < short.min
"-2147483649", // < int.min
"-9223372036854775809", // < long.min
];
foreach (j, s; errors[i..$])
assertThrown!ConvOverflowException(to!Int(s));
}
}
/// ditto
Target parse(Target, Source)(ref Source s, uint radix)
if (isSomeChar!(ElementType!Source) &&
isIntegral!Target)
in
{
assert(radix >= 2 && radix <= 36);
}
body
{
if (radix == 10)
return parse!Target(s);
immutable uint beyond = (radix < 10 ? '0' : 'a'-10) + radix;
Target v = 0;
size_t i = 0;
for (; !s.empty; s.popFront(), ++i)
{
uint c = s.front;
if (c < '0')
break;
if (radix < 10)
{
if (c >= beyond)
break;
}
else
{
if (c > '9')
{
c |= 0x20;//poorman's tolower
if (c < 'a' || c >= beyond)
break;
c -= 'a'-10-'0';
}
}
auto blah = cast(Target) (v * radix + c - '0');
if (blah < v)
goto Loverflow;
v = blah;
}
if (!i)
goto Lerr;
return v;
Loverflow:
throw new ConvOverflowException("Overflow in integral conversion");
Lerr:
convError!(Source, Target)(s, radix);
assert(0);
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
// @@@BUG@@@ the size of China
// foreach (i; 2..37)
// {
// assert(parse!int("0",i) == 0);
// assert(parse!int("1",i) == 1);
// assert(parse!byte("10",i) == i);
// }
foreach (i; 2..37)
{
string s = "0";
assert(parse!int(s,i) == 0);
s = "1";
assert(parse!int(s,i) == 1);
s = "10";
assert(parse!byte(s,i) == i);
}
// Same @@@BUG@@@ as above
//assert(parse!int("0011001101101", 2) == 0b0011001101101);
// assert(parse!int("765",8) == 0765);
// assert(parse!int("fCDe",16) == 0xfcde);
auto s = "0011001101101";
assert(parse!int(s, 2) == 0b0011001101101);
s = "765";
assert(parse!int(s, 8) == octal!765);
s = "fCDe";
assert(parse!int(s, 16) == 0xfcde);
// 6609
s = "-42";
assert(parse!int(s, 10) == -42);
}
unittest // bugzilla 7302
{
auto r = cycle("2A!");
auto u = parse!uint(r, 16);
assert(u == 42);
assert(r.front == '!');
}
Target parse(Target, Source)(ref Source s)
if (isSomeString!Source &&
is(Target == enum))
{
Target result;
size_t longest_match = 0;
foreach (i, e; EnumMembers!Target)
{
auto ident = __traits(allMembers, Target)[i];
if (longest_match < ident.length && s.startsWith(ident))
{
result = e;
longest_match = ident.length ;
}
}
if( longest_match > 0 )
{
s = s[longest_match..$];
return result ;
}
throw new ConvException(
Target.stringof ~ " does not have a member named '"
~ to!string(s) ~ "'");
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
enum EB : bool { a = true, b = false, c = a }
enum EU { a, b, c }
enum EI { a = -1, b = 0, c = 1 }
enum EF : real { a = 1.414, b = 1.732, c = 2.236 }
enum EC : char { a = 'a', b = 'b', c = 'c' }
enum ES : string { a = "aaa", b = "bbb", c = "ccc" }
foreach (E; TypeTuple!(EB, EU, EI, EF, EC, ES))
{
assert(to!E("a"c) == E.a);
assert(to!E("b"w) == E.b);
assert(to!E("c"d) == E.c);
assertThrown!ConvException(to!E("d"));
}
}
unittest // bugzilla 4744
{
enum A { member1, member11, member111 }
assert(to!A("member1" ) == A.member1 );
assert(to!A("member11" ) == A.member11 );
assert(to!A("member111") == A.member111);
auto s = "member1111";
assert(parse!A(s) == A.member111 && s == "1");
}
Target parse(Target, Source)(ref Source p)
if (isInputRange!Source && isSomeChar!(ElementType!Source) &&
isFloatingPoint!Target)
{
static immutable real negtab[14] =
[ 1e-4096L,1e-2048L,1e-1024L,1e-512L,1e-256L,1e-128L,1e-64L,1e-32L,
1e-16L,1e-8L,1e-4L,1e-2L,1e-1L,1.0L ];
static immutable real postab[13] =
[ 1e+4096L,1e+2048L,1e+1024L,1e+512L,1e+256L,1e+128L,1e+64L,1e+32L,
1e+16L,1e+8L,1e+4L,1e+2L,1e+1L ];
// static immutable string infinity = "infinity";
// static immutable string nans = "nans";
ConvException bailOut(string msg = null, string fn = __FILE__, size_t ln = __LINE__)
{
if (!msg)
msg = "Floating point conversion error";
return new ConvException(text(msg, " for input \"", p, "\"."), fn, ln);
}
for (;;)
{
enforce(!p.empty, bailOut());
if (!std.uni.isWhite(p.front))
break;
p.popFront();
}
char sign = 0; /* indicating + */
switch (p.front)
{
case '-':
sign++;
p.popFront();
enforce(!p.empty, bailOut());
if (std.ascii.toLower(p.front) == 'i')
goto case 'i';
enforce(!p.empty, bailOut());
break;
case '+':
p.popFront();
enforce(!p.empty, bailOut());
break;
case 'i': case 'I':
p.popFront();
enforce(!p.empty, bailOut());
if (std.ascii.toLower(p.front) == 'n' &&
(p.popFront(), enforce(!p.empty, bailOut()), std.ascii.toLower(p.front) == 'f'))
{
// 'inf'
p.popFront();
return sign ? -Target.infinity : Target.infinity;
}
goto default;
default: {}
}
bool isHex = false;
bool startsWithZero = p.front == '0';
if(startsWithZero)
{
p.popFront();
if(p.empty)
{
return (sign) ? -0.0 : 0.0;
}
isHex = p.front == 'x' || p.front == 'X';
}
real ldval = 0.0;
char dot = 0; /* if decimal point has been seen */
int exp = 0;
long msdec = 0, lsdec = 0;
ulong msscale = 1;
if (isHex)
{
int guard = 0;
int anydigits = 0;
uint ndigits = 0;
p.popFront();
while (!p.empty)
{
int i = p.front;
while (isHexDigit(i))
{
anydigits = 1;
i = std.ascii.isAlpha(i) ? ((i & ~0x20) - ('A' - 10)) : i - '0';
if (ndigits < 16)
{
msdec = msdec * 16 + i;
if (msdec)
ndigits++;
}
else if (ndigits == 16)
{
while (msdec >= 0)
{
exp--;
msdec <<= 1;
i <<= 1;
if (i & 0x10)
msdec |= 1;
}
guard = i << 4;
ndigits++;
exp += 4;
}
else
{
guard |= i;
exp += 4;
}
exp -= dot;
p.popFront();
if (p.empty)
break;
i = p.front;
if (i == '_')
{
p.popFront();
if (p.empty)
break;
i = p.front;
}
}
if (i == '.' && !dot)
{ p.popFront();
dot = 4;
}
else
break;
}
// Round up if (guard && (sticky || odd))
if (guard & 0x80 && (guard & 0x7F || msdec & 1))
{
msdec++;
if (msdec == 0) // overflow
{ msdec = 0x8000000000000000L;
exp++;
}
}
enforce(anydigits, bailOut());
enforce(!p.empty && (p.front == 'p' || p.front == 'P'),
bailOut("Floating point parsing: exponent is required"));
char sexp;
int e;
sexp = 0;
p.popFront();
if (!p.empty)
{
switch (p.front)
{ case '-': sexp++;
goto case;
case '+': p.popFront(); enforce(!p.empty,
new ConvException("Error converting input"
" to floating point"));
break;
default: {}
}
}
ndigits = 0;
e = 0;
while (!p.empty && isDigit(p.front))
{
if (e < 0x7FFFFFFF / 10 - 10) // prevent integer overflow
{
e = e * 10 + p.front - '0';
}
p.popFront();
ndigits = 1;
}
exp += (sexp) ? -e : e;
enforce(ndigits, new ConvException("Error converting input"
" to floating point"));
if (msdec)
{
int e2 = 0x3FFF + 63;
// left justify mantissa
while (msdec >= 0)
{ msdec <<= 1;
e2--;
}
// Stuff mantissa directly into real
*cast(long *)&ldval = msdec;
(cast(ushort *)&ldval)[4] = cast(ushort) e2;
// Exponent is power of 2, not power of 10
ldval = ldexpl(ldval,exp);
}
goto L6;
}
else // not hex
{
if (std.ascii.toUpper(p.front) == 'N' && !startsWithZero)
{
// nan
enforce((p.popFront(), !p.empty && std.ascii.toUpper(p.front) == 'A')
&& (p.popFront(), !p.empty && std.ascii.toUpper(p.front) == 'N'),
new ConvException("error converting input to floating point"));
// skip past the last 'n'
p.popFront();
return typeof(return).nan;
}
bool sawDigits = startsWithZero;
while (!p.empty)
{
int i = p.front;
while (isDigit(i))
{
sawDigits = true; /* must have at least 1 digit */
if (msdec < (0x7FFFFFFFFFFFL-10)/10)
msdec = msdec * 10 + (i - '0');
else if (msscale < (0xFFFFFFFF-10)/10)
{ lsdec = lsdec * 10 + (i - '0');
msscale *= 10;
}
else
{
exp++;
}
exp -= dot;
p.popFront();
if (p.empty)
break;
i = p.front;
if (i == '_')
{
p.popFront();
if (p.empty)
break;
i = p.front;
}
}
if (i == '.' && !dot)
{
p.popFront();
dot++;
}
else
{
break;
}
}
enforce(sawDigits, new ConvException("no digits seen"));
}
if (!p.empty && (p.front == 'e' || p.front == 'E'))
{
char sexp;
int e;
sexp = 0;
p.popFront();
enforce(!p.empty, new ConvException("Unexpected end of input"));
switch (p.front)
{ case '-': sexp++;
goto case;
case '+': p.popFront();
break;
default: {}
}
bool sawDigits = 0;
e = 0;
while (!p.empty && isDigit(p.front))
{
if (e < 0x7FFFFFFF / 10 - 10) // prevent integer overflow
{
e = e * 10 + p.front - '0';
}
p.popFront();
sawDigits = 1;
}
exp += (sexp) ? -e : e;
enforce(sawDigits, new ConvException("No digits seen."));
}
ldval = msdec;
if (msscale != 1) /* if stuff was accumulated in lsdec */
ldval = ldval * msscale + lsdec;
if (ldval)
{
uint u = 0;
int pow = 4096;
while (exp > 0)
{
while (exp >= pow)
{
ldval *= postab[u];
exp -= pow;
}
pow >>= 1;
u++;
}
while (exp < 0)
{
while (exp <= -pow)
{
ldval *= negtab[u];
enforce(ldval != 0, new ConvException("Range error"));
exp += pow;
}
pow >>= 1;
u++;
}
}
L6: // if overflow occurred
enforce(ldval != core.stdc.math.HUGE_VAL, new ConvException("Range error"));
L1:
return (sign) ? -ldval : ldval;
}
unittest
{
// Compare reals with given precision
bool feq(in real rx, in real ry, in real precision = 0.000001L)
{
if (rx == ry)
return 1;
if (isnan(rx))
return cast(bool)isnan(ry);
if (isnan(ry))
return 0;
return cast(bool)(fabs(rx - ry) <= precision);
}
// Make given typed literal
F Literal(F)(F f)
{
return f;
}
foreach (Float; TypeTuple!(float, double, real))
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
debug(conv) printf("conv.to!%.*s.unittest\n", Float.stringof.length, Float.stringof.ptr);
assert(to!Float("123") == Literal!Float(123));
assert(to!Float("+123") == Literal!Float(+123));
assert(to!Float("-123") == Literal!Float(-123));
assert(to!Float("123e2") == Literal!Float(123e2));
assert(to!Float("123e+2") == Literal!Float(123e+2));
assert(to!Float("123e-2") == Literal!Float(123e-2));
assert(to!Float("123.") == Literal!Float(123.));
assert(to!Float(".456") == Literal!Float(.456));
assert(to!Float("1.23456E+2") == Literal!Float(1.23456E+2));
assert(to!Float("0") is 0.0);
assert(to!Float("-0") is -0.0);
assert(isnan(to!Float("nan")));
assertThrown!ConvException(to!Float("\x00"));
}
// min and max
float f = to!float("1.17549e-38");
assert(feq(cast(real)f, cast(real)1.17549e-38));
assert(feq(cast(real)f, cast(real)float.min_normal));
f = to!float("3.40282e+38");
assert(to!string(f) == to!string(3.40282e+38));
// min and max
double d = to!double("2.22508e-308");
assert(feq(cast(real)d, cast(real)2.22508e-308));
assert(feq(cast(real)d, cast(real)double.min_normal));
d = to!double("1.79769e+308");
assert(to!string(d) == to!string(1.79769e+308));
assert(to!string(d) == to!string(double.max));
assert(to!string(to!real(to!string(real.max / 2L))) == to!string(real.max / 2L));
// min and max
real r = to!real(to!string(real.min_normal));
assert(to!string(r) == to!string(real.min_normal));
r = to!real(to!string(real.max));
assert(to!string(r) == to!string(real.max));
}
unittest
{
import core.stdc.errno;
import core.stdc.stdlib;
errno = 0; // In case it was set by another unittest in a different module.
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
struct longdouble
{
ushort value[5];
}
real ld;
longdouble x;
real ld1;
longdouble x1;
int i;
string s = "0x1.FFFFFFFFFFFFFFFEp-16382";
ld = parse!real(s);
assert(s.empty);
x = *cast(longdouble *)&ld;
ld1 = strtold("0x1.FFFFFFFFFFFFFFFEp-16382", null);
x1 = *cast(longdouble *)&ld1;
assert(x1 == x && ld1 == ld);
// for (i = 4; i >= 0; i--)
// {
// printf("%04x ", x.value[i]);
// }
// printf("\n");
assert(!errno);
s = "1.0e5";
ld = parse!real(s);
assert(s.empty);
x = *cast(longdouble *)&ld;
ld1 = strtold("1.0e5", null);
x1 = *cast(longdouble *)&ld1;
// for (i = 4; i >= 0; i--)
// {
// printf("%04x ", x.value[i]);
// }
// printf("\n");
}
// Unittest for bug 4959
unittest
{
auto s = "0 ";
auto x = parse!double(s);
assert(s == " ");
assert(x == 0.0);
}
// Unittest for bug 3369
unittest
{
assert(to!float("inf") == float.infinity);
assert(to!float("-inf") == -float.infinity);
}
// Unittest for bug 6160
unittest
{
assert(1000_000_000e50L == to!real("1000_000_000_e50")); // 1e59
assert(0x1000_000_000_p10 == to!real("0x1000_000_000_p10")); // 7.03687e+13
}
// Unittest for bug 6258
unittest
{
assertThrown!ConvException(to!real("-"));
assertThrown!ConvException(to!real("in"));
}
// Unittest for bug 7055
unittest
{
assertThrown!ConvException(to!float("INF2"));
}
/**
Parsing one character off a string returns the character and bumps the
string up one position.
*/
Target parse(Target, Source)(ref Source s)
if (isSomeString!Source &&
staticIndexOf!(Unqual!Target, dchar, Unqual!(ElementEncodingType!Source)) >= 0)
{
static if (is(Unqual!Target == dchar))
{
Target result = s.front;
s.popFront();
return result;
}
else
{
// Special case: okay so parse a Char off a Char[]
Target result = s[0];
s = s[1 .. $];
return result;
}
}
unittest
{
foreach (Str; TypeTuple!(string, wstring, dstring))
{
foreach (Char; TypeTuple!(char, wchar, dchar))
{
static if (is(Unqual!Char == dchar) ||
Char.sizeof == ElementEncodingType!Str.sizeof)
{
Str s = "aaa";
assert(parse!Char(s) == 'a');
assert(s == "aa");
}
}
}
}
Target parse(Target, Source)(ref Source s)
if (!isSomeString!Source && isInputRange!Source && isSomeChar!(ElementType!Source) &&
isSomeChar!Target && Target.sizeof >= ElementType!Source.sizeof)
{
Target result = s.front;
s.popFront();
return result;
}
// string to bool conversions
Target parse(Target, Source)(ref Source s)
if (isSomeString!Source &&
is(Unqual!Target == bool))
{
if (s.length >= 4 && icmp(s[0 .. 4], "true")==0)
{
s = s[4 .. $];
return true;
}
if (s.length >= 5 && icmp(s[0 .. 5], "false")==0)
{
s = s[5 .. $];
return false;
}
parseError("bool should be case-insensive 'true' or 'false'");
assert(0);
}
/*
Tests for to!bool and parse!bool
*/
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
debug(conv) printf("conv.to!bool.unittest\n");
assert (to!bool("TruE") == true);
assert (to!bool("faLse"d) == false);
assertThrown!ConvException(to!bool("maybe"));
auto t = "TrueType";
assert (parse!bool(t) == true);
assert (t == "Type");
auto f = "False killer whale"d;
assert (parse!bool(f) == false);
assert (f == " killer whale"d);
auto m = "maybe";
assertThrown!ConvException(parse!bool(m));
assert (m == "maybe"); // m shouldn't change on failure
auto s = "true";
auto b = parse!(const(bool))(s);
assert(b == true);
}
// string to null literal conversions
Target parse(Target, Source)(ref Source s)
if (isSomeString!Source &&
is(Unqual!Target == typeof(null)))
{
if (s.length >= 4 && icmp(s[0 .. 4], "null")==0)
{
s = s[4 .. $];
return null;
}
parseError("null should be case-insensive 'null'");
assert(0);
}
unittest
{
alias typeof(null) NullType;
auto s1 = "null";
assert(parse!NullType(s1) is null);
assert(s1 == "");
auto s2 = "NUll"d;
assert(parse!NullType(s2) is null);
assert(s2 == "");
auto m = "maybe";
assertThrown!ConvException(parse!NullType(m));
assert(m == "maybe"); // m shouldn't change on failure
auto s = "NULL";
assert(parse!(const(NullType))(s) is null);
}
private void skipWS(R)(ref R r)
{
skipAll(r, ' ', '\n', '\t', '\r');
}
/**
* Parses an array from a string given the left bracket (default $(D
* '[')), right bracket (default $(D ']')), and element seprator (by
* default $(D ',')).
*/
Target parse(Target, Source)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar comma = ',')
if (isSomeString!Source &&
isDynamicArray!Target)
{
Target result;
parseCheck!s(lbracket);
skipWS(s);
if (s.front == rbracket)
{
s.popFront();
return result;
}
for (;; s.popFront(), skipWS(s))
{
result ~= parseElement!(ElementType!Target)(s);
skipWS(s);
if (s.front != comma)
break;
}
parseCheck!s(rbracket);
return result;
}
unittest
{
int[] a = [1, 2, 3, 4, 5];
auto s = to!string(a);
assert(to!(int[])(s) == a);
}
unittest
{
int[][] a = [ [1, 2] , [3], [4, 5] ];
auto s = to!string(a);
assert(to!(int[][])(s) == a);
}
unittest
{
int[][][] ia = [ [[1,2],[3,4],[5]] , [[6],[],[7,8,9]] , [[]] ];
char[] s = to!(char[])(ia);
int[][][] ia2;
ia2 = to!(typeof(ia2))(s);
assert( ia == ia2);
}
unittest
{
auto s1 = `[['h', 'e', 'l', 'l', 'o'], "world"]`;
auto a1 = parse!(string[])(s1);
assert(a1 == ["hello", "world"]);
auto s2 = `["aaa", "bbb", "ccc"]`;
auto a2 = parse!(string[])(s2);
assert(a2 == ["aaa", "bbb", "ccc"]);
}
/// ditto
Target parse(Target, Source)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar comma = ',')
if (isSomeString!Source &&
isStaticArray!Target)
{
Target result = void;
parseCheck!s(lbracket);
skipWS(s);
if (s.front == rbracket)
{
static if (result.length != 0)
goto Lmanyerr;
else
{
s.popFront();
return result;
}
}
for (size_t i = 0; ; s.popFront(), skipWS(s))
{
if (i == result.length)
goto Lmanyerr;
result[i++] = parseElement!(ElementType!Target)(s);
skipWS(s);
if (s.front != comma)
{
if (i != result.length)
goto Lfewerr;
break;
}
}
parseCheck!s(rbracket);
return result;
Lmanyerr:
parseError(text("Too many elements in input, ", result.length, " elements expected."));
assert(0);
Lfewerr:
parseError(text("Too few elements in input, ", result.length, " elements expected."));
assert(0);
}
unittest
{
auto s1 = "[1,2,3,4]";
auto sa1 = parse!(int[4])(s1);
assert(sa1 == [1,2,3,4]);
auto s2 = "[[1],[2,3],[4]]";
auto sa2 = parse!(int[][3])(s2);
assert(sa2 == [[1],[2,3],[4]]);
auto s3 = "[1,2,3]";
assertThrown!ConvException(parse!(int[4])(s3));
auto s4 = "[1,2,3,4,5]";
assertThrown!ConvException(parse!(int[4])(s4));
}
/**
* Parses an associative array from a string given the left bracket (default $(D
* '[')), right bracket (default $(D ']')), key-value separator (default $(D
* ':')), and element seprator (by default $(D ',')).
*/
Target parse(Target, Source)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar keyval = ':', dchar comma = ',')
if (isSomeString!Source &&
isAssociativeArray!Target)
{
alias typeof(Target.keys[0]) KeyType;
alias typeof(Target.values[0]) ValueType;
Target result;
parseCheck!s(lbracket);
skipWS(s);
if (s.front == rbracket)
{
s.popFront();
return result;
}
for (;; s.popFront(), skipWS(s))
{
auto key = parseElement!KeyType(s);
skipWS(s);
parseCheck!s(keyval);
skipWS(s);
auto val = parseElement!ValueType(s);
skipWS(s);
result[key] = val;
if (s.front != comma) break;
}
parseCheck!s(rbracket);
return result;
}
unittest
{
auto s1 = "[1:10, 2:20, 3:30]";
auto aa1 = parse!(int[int])(s1);
assert(aa1 == [1:10, 2:20, 3:30]);
auto s2 = `["aaa":10, "bbb":20, "ccc":30]`;
auto aa2 = parse!(int[string])(s2);
assert(aa2 == ["aaa":10, "bbb":20, "ccc":30]);
auto s3 = `["aaa":[1], "bbb":[2,3], "ccc":[4,5,6]]`;
auto aa3 = parse!(int[][string])(s3);
assert(aa3 == ["aaa":[1], "bbb":[2,3], "ccc":[4,5,6]]);
}
private dchar parseEscape(Source)(ref Source s)
if (isInputRange!Source && isSomeChar!(ElementType!Source))
{
parseCheck!s('\\');
dchar getHexDigit()
{
s.popFront();
if (s.empty)
parseError("Unterminated escape sequence");
dchar c = s.front;
if (!isHexDigit(c))
parseError("Hex digit is missing");
return std.ascii.isAlpha(c) ? ((c & ~0x20) - ('A' - 10)) : c - '0';
}
dchar result;
switch (s.front)
{
case 'a': result = '\a'; break;
case 'b': result = '\b'; break;
case 'f': result = '\f'; break;
case 'n': result = '\n'; break;
case 'r': result = '\r'; break;
case 't': result = '\t'; break;
case 'v': result = '\v'; break;
case 'x':
result = getHexDigit() << 4;
result |= getHexDigit();
break;
case 'u':
result = getHexDigit() << 12;
result |= getHexDigit() << 8;
result |= getHexDigit() << 4;
result |= getHexDigit();
break;
case 'U':
result = getHexDigit() << 28;
result |= getHexDigit() << 24;
result |= getHexDigit() << 20;
result |= getHexDigit() << 16;
result |= getHexDigit() << 12;
result |= getHexDigit() << 8;
result |= getHexDigit() << 4;
result |= getHexDigit();
break;
default:
parseError("Unknown escape character " ~ to!string(s.front));
break;
}
s.popFront();
return result;
}
// Undocumented
Target parseElement(Target, Source)(ref Source s)
if (isInputRange!Source && isSomeChar!(ElementType!Source) &&
isSomeString!Target)
{
auto result = appender!Target();
// parse array of chars
if (s.front == '[')
return parse!Target(s);
parseCheck!s('\"');
if (s.front == '\"')
{
s.popFront();
return result.data;
}
while (true)
{
if (s.empty)
parseError("Unterminated quoted string");
switch (s.front)
{
case '\"':
s.popFront();
return result.data;
case '\\':
result.put(parseEscape(s));
break;
default:
result.put(s.front());
s.popFront();
break;
}
}
assert(0);
}
// ditto
Target parseElement(Target, Source)(ref Source s)
if (isInputRange!Source && isSomeChar!(ElementType!Source) &&
isSomeChar!Target)
{
Target c;
parseCheck!s('\'');
if (s.front != '\\')
{
c = s.front;
s.popFront();
}
else
c = parseEscape(s);
parseCheck!s('\'');
return c;
}
// ditto
Target parseElement(Target, Source)(ref Source s)
if (isInputRange!Source && isSomeChar!(ElementType!Source) &&
!isSomeString!Target && !isSomeChar!Target)
{
return parse!Target(s);
}
/***************************************************************
Convenience functions for converting any number and types of
arguments into _text (the three character widths).
Example:
----
assert(text(42, ' ', 1.5, ": xyz") == "42 1.5: xyz");
assert(wtext(42, ' ', 1.5, ": xyz") == "42 1.5: xyz"w);
assert(dtext(42, ' ', 1.5, ": xyz") == "42 1.5: xyz"d);
----
*/
string text(T...)(T args)
{
return textImpl!string(args);
}
///ditto
wstring wtext(T...)(T args)
{
return textImpl!wstring(args);
}
///ditto
dstring dtext(T...)(T args)
{
return textImpl!dstring(args);
}
private S textImpl(S, U...)(U args)
{
S result;
foreach (i, arg; args)
{
result ~= to!S(args[i]);
}
return result;
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
assert(text(42, ' ', 1.5, ": xyz") == "42 1.5: xyz");
assert(wtext(42, ' ', 1.5, ": xyz") == "42 1.5: xyz"w);
assert(dtext(42, ' ', 1.5, ": xyz") == "42 1.5: xyz"d);
}
/***************************************************************
The $(D octal) facility is intended as an experimental facility to
replace _octal literals starting with $(D '0'), which many find
confusing. Using $(D octal!177) or $(D octal!"177") instead of $(D
0177) as an _octal literal makes code clearer and the intent more
visible. If use of this facility becomes preponderent, a future
version of the language may deem old-style _octal literals deprecated.
The rules for strings are the usual for literals: If it can fit in an
$(D int), it is an $(D int). Otherwise, it is a $(D long). But, if the
user specifically asks for a $(D long) with the $(D L) suffix, always
give the $(D long). Give an unsigned iff it is asked for with the $(D
U) or $(D u) suffix. _Octals created from integers preserve the type
of the passed-in integral.
Example:
----
// same as 0177
auto x = octal!177;
// octal is a compile-time device
enum y = octal!160;
// Create an unsigned octal
auto z = octal!"1_000_000u";
----
*/
@property int octal(string num)()
if((octalFitsInInt!(num) && !literalIsLong!(num)) && !literalIsUnsigned!(num))
{
return octal!(int, num);
}
/// Ditto
@property long octal(string num)()
if((!octalFitsInInt!(num) || literalIsLong!(num)) && !literalIsUnsigned!(num))
{
return octal!(long, num);
}
/// Ditto
@property uint octal(string num)()
if((octalFitsInInt!(num) && !literalIsLong!(num)) && literalIsUnsigned!(num))
{
return octal!(int, num);
}
/// Ditto
@property ulong octal(string num)()
if((!octalFitsInInt!(num) || literalIsLong!(num)) && literalIsUnsigned!(num))
{
return octal!(long, num);
}
/// Ditto
template octal(alias s)
if (isIntegral!(typeof(s)))
{
enum auto octal = octal!(typeof(s), toStringNow!(s));
}
/*
Takes a string, num, which is an octal literal, and returns its
value, in the type T specified.
So:
int a = octal!(int, "10");
assert(a == 8);
*/
@property T octal(T, string num)()
if (isOctalLiteral!num)
{
ulong pow = 1;
T value = 0;
for (int pos = num.length - 1; pos >= 0; pos--)
{
char s = num[pos];
if (s < '0' || s > '7') // we only care about digits; skip the rest
// safe to skip - this is checked out in the assert so these
// are just suffixes
continue;
value += pow * (s - '0');
pow *= 8;
}
return value;
}
/*
Take a look at int.max and int.max+1 in octal and the logic for this
function follows directly.
*/
template octalFitsInInt(string octalNum)
{
// note it is important to strip the literal of all
// non-numbers. kill the suffix and underscores lest they mess up
// the number of digits here that we depend on.
enum bool octalFitsInInt = strippedOctalLiteral(octalNum).length < 11 ||
strippedOctalLiteral(octalNum).length == 11 &&
strippedOctalLiteral(octalNum)[0] == '1';
}
string strippedOctalLiteral(string original)
{
string stripped = "";
foreach (c; original)
if (c >= '0' && c <= '7')
stripped ~= c;
return stripped;
}
template literalIsLong(string num)
{
static if (num.length > 1)
// can be xxL or xxLu according to spec
enum literalIsLong = (num[$-1] == 'L' || num[$-2] == 'L');
else
enum literalIsLong = false;
}
template literalIsUnsigned(string num)
{
static if (num.length > 1)
// can be xxU or xxUL according to spec
enum literalIsUnsigned = (num[$-1] == 'u' || num[$-2] == 'u')
// both cases are allowed too
|| (num[$-1] == 'U' || num[$-2] == 'U');
else
enum literalIsUnsigned = false;
}
/*
Returns if the given string is a correctly formatted octal literal.
The format is specified in lex.html. The leading zero is allowed, but
not required.
*/
bool isOctalLiteralString(string num)
{
if (num.length == 0)
return false;
// Must start with a number. To avoid confusion, literals that
// start with a '0' are not allowed
if (num[0] == '0' && num.length > 1)
return false;
if (num[0] < '0' || num[0] > '7')
return false;
foreach (i, c; num)
{
if ((c < '0' || c > '7') && c != '_') // not a legal character
{
if (i < num.length - 2)
return false;
else // gotta check for those suffixes
{
if (c != 'U' && c != 'u' && c != 'L')
return false;
if (i != num.length - 1)
{
// if we're not the last one, the next one must
// also be a suffix to be valid
char c2 = num[$-1];
if (c2 != 'U' && c2 != 'u' && c2 != 'L')
return false; // spam at the end of the string
if (c2 == c)
return false; // repeats are disallowed
}
}
}
}
return true;
}
/*
Returns true if the given compile time string is an octal literal.
*/
template isOctalLiteral(string num)
{
enum bool isOctalLiteral = isOctalLiteralString(num);
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
// ensure that you get the right types, even with embedded underscores
auto w = octal!"100_000_000_000";
static assert(!is(typeof(w) == int));
auto w2 = octal!"1_000_000_000";
static assert(is(typeof(w2) == int));
static assert(octal!"45" == 37);
static assert(octal!"0" == 0);
static assert(octal!"7" == 7);
static assert(octal!"10" == 8);
static assert(octal!"666" == 438);
static assert(octal!45 == 37);
static assert(octal!0 == 0);
static assert(octal!7 == 7);
static assert(octal!10 == 8);
static assert(octal!666 == 438);
static assert(octal!"66_6" == 438);
static assert(octal!2520046213 == 356535435);
static assert(octal!"2520046213" == 356535435);
static assert(octal!17777777777 == int.max);
static assert(!__traits(compiles, octal!823));
static assert(!__traits(compiles, octal!"823"));
static assert(!__traits(compiles, octal!"_823"));
static assert(!__traits(compiles, octal!"spam"));
static assert(!__traits(compiles, octal!"77%"));
int a;
long b;
// biggest value that should fit in an it
static assert(__traits(compiles, a = octal!"17777777777"));
// should not fit in the int
static assert(!__traits(compiles, a = octal!"20000000000"));
// ... but should fit in a long
static assert(__traits(compiles, b = octal!"20000000000"));
static assert(!__traits(compiles, a = octal!"1L"));
// this should pass, but it doesn't, since the int converter
// doesn't pass along its suffix to helper templates
//static assert(!__traits(compiles, a = octal!1L));
static assert(__traits(compiles, b = octal!"1L"));
static assert(__traits(compiles, b = octal!1L));
}
// emplace
/**
Given a pointer $(D chunk) to uninitialized memory (but already typed
as $(D T)), constructs an object of non-$(D class) type $(D T) at that
address.
This function can be $(D @trusted) if the corresponding constructor of
$(D T) is $(D @safe).
Returns: A pointer to the newly constructed object (which is the same
as $(D chunk)).
*/
T* emplace(T)(T* chunk)
if (!is(T == class))
{
auto result = cast(typeof(return)) chunk;
static T i;
memcpy(result, &i, T.sizeof);
return result;
}
///ditto
T* emplace(T)(T* chunk)
if (is(T == class))
{
*chunk = null;
return chunk;
}
/**
Given a pointer $(D chunk) to uninitialized memory (but already typed
as a non-class type $(D T)), constructs an object of type $(D T) at
that address from arguments $(D args).
This function can be $(D @trusted) if the corresponding constructor of
$(D T) is $(D @safe).
Returns: A pointer to the newly constructed object (which is the same
as $(D chunk)).
*/
T* emplace(T, Args...)(T* chunk, Args args)
if (!is(T == struct) && Args.length == 1)
{
*chunk = args[0];
return chunk;
}
// Specialization for struct
T* emplace(T, Args...)(T* chunk, Args args)
if (is(T == struct))
{
auto result = cast(typeof(return)) chunk;
void initialize()
{
static T i;
memcpy(chunk, &i, T.sizeof);
}
static if (is(typeof(result.__ctor(args))))
{
// T defines a genuine constructor accepting args
// Go the classic route: write .init first, then call ctor
initialize();
result.__ctor(args);
}
else static if (is(typeof(T(args))))
{
// Struct without constructor that has one matching field for
// each argument
*result = T(args);
}
else //static if (Args.length == 1 && is(Args[0] : T))
{
static assert(Args.length == 1);
//static assert(0, T.stringof ~ " " ~ Args.stringof);
// initialize();
*result = args[0];
}
return result;
}
/**
Given a raw memory area $(D chunk), constructs an object of $(D class)
type $(D T) at that address. The constructor is passed the arguments
$(D Args). The $(D chunk) must be as least as large as $(D T) needs
and should have an alignment multiple of $(D T)'s alignment. (The size
of a $(D class) instance is obtained by using $(D
__traits(classInstanceSize, T))).
This function can be $(D @trusted) if the corresponding constructor of
$(D T) is $(D @safe).
Returns: A pointer to the newly constructed object.
*/
T emplace(T, Args...)(void[] chunk, Args args) if (is(T == class))
{
enum classSize = __traits(classInstanceSize, T);
enforce(chunk.length >= classSize,
new ConvException("emplace: chunk size too small"));
auto a = cast(size_t) chunk.ptr;
enforce(a % T.alignof == 0, text(a, " vs. ", T.alignof));
auto result = cast(typeof(return)) chunk.ptr;
// Initialize the object in its pre-ctor state
(cast(byte[]) chunk)[0 .. classSize] = typeid(T).init[];
// Call the ctor if any
static if (is(typeof(result.__ctor(args))))
{
// T defines a genuine constructor accepting args
// Go the classic route: write .init first, then call ctor
result.__ctor(args);
}
else
{
static assert(args.length == 0 && !is(typeof(&T.__ctor)),
"Don't know how to initialize an object of type "
~ T.stringof ~ " with arguments " ~ Args.stringof);
}
return result;
}
/**
Given a raw memory area $(D chunk), constructs an object of non-$(D
class) type $(D T) at that address. The constructor is passed the
arguments $(D args), if any. The $(D chunk) must be as least as large
as $(D T) needs and should have an alignment multiple of $(D T)'s
alignment.
This function can be $(D @trusted) if the corresponding constructor of
$(D T) is $(D @safe).
Returns: A pointer to the newly constructed object.
*/
T* emplace(T, Args...)(void[] chunk, Args args)
if (!is(T == class))
{
enforce(chunk.length >= T.sizeof,
new ConvException("emplace: chunk size too small"));
auto a = cast(size_t) chunk.ptr;
enforce(a % T.alignof == 0, text(a, " vs. ", T.alignof));
auto result = cast(typeof(return)) chunk.ptr;
return emplace(result, args);
}
unittest
{
struct S
{
int a, b;
}
auto p = new void[S.sizeof];
S s;
s.a = 42;
s.b = 43;
auto s1 = emplace!S(p, s);
assert(s1.a == 42 && s1.b == 43);
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
int a;
int b = 42;
assert(*emplace!int(&a, b) == 42);
struct S
{
double x = 5, y = 6;
this(int a, int b)
{
assert(x == 5 && y == 6);
x = a;
y = b;
}
}
auto s1 = new void[S.sizeof];
auto s2 = S(42, 43);
assert(*emplace!S(cast(S*) s1.ptr, s2) == s2);
assert(*emplace!S(cast(S*) s1, 44, 45) == S(44, 45));
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
class A
{
int x = 5;
int y = 42;
this(int z)
{
assert(x == 5 && y == 42);
x = y = z;
}
}
void[] buf;
static byte[__traits(classInstanceSize, A)] sbuf;
buf = sbuf[];
auto a = emplace!A(buf, 55);
assert(a.x == 55 && a.y == 55);
// emplace in bigger buffer
buf = new byte[](__traits(classInstanceSize, A) + 10);
a = emplace!A(buf, 55);
assert(a.x == 55 && a.y == 55);
// need ctor args
static assert(!is(typeof(emplace!A(buf))));
}
unittest
{
debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded.");
// Check fix for http://d.puremagic.com/issues/show_bug.cgi?id=2971
assert(equal(map!(to!int)(["42", "34", "345"]), [42, 34, 345]));
}
unittest
{
struct Foo
{
uint num;
}
Foo foo;
emplace!Foo(&foo, 2U);
assert(foo.num == 2);
}
unittest
{
interface I {}
class K : I {}
K k = void;
emplace!K(&k);
assert(k is null);
K k2 = new K;
assert(k2 !is null);
emplace!K(&k, k2);
assert(k is k2);
I i = void;
emplace!I(&i);
assert(i is null);
emplace!I(&i, k);
assert(i is k);
}
// Undocumented for the time being
void toTextRange(T, W)(T value, W writer)
if (isIntegral!T && isOutputRange!(W, char))
{
Unqual!(Unsigned!T) v = void;
if (value < 0)
{
put(writer, '-');
v = -value;
}
else
{
v = value;
}
if (v < 10 && v < hexDigits.length)
{
put(writer, hexDigits[cast(size_t) v]);
return;
}
char[v.sizeof * 4] buffer = void;
auto i = buffer.length;
do
{
auto c = cast(ubyte) (v % 10);
v = v / 10;
i--;
buffer[i] = cast(char) (c + '0');
} while (v);
put(writer, buffer[i .. $]);
}
template hardDeprec(string vers, string date, string oldFunc, string newFunc)
{
enum hardDeprec = Format!("Notice: As of Phobos %s, %s has been deprecated. " ~
"It will be removed in %s. Please use %s instead.",
vers, oldFunc, date, newFunc);
}
| D |
/Users/Bamz/Developer/Calculator/Build/Intermediates/Calculator.build/Debug-iphonesimulator/Calculator.build/Objects-normal/x86_64/CalcBrain.o : /Users/Bamz/Developer/Calculator/Calculator/AppDelegate.swift /Users/Bamz/Developer/Calculator/Calculator/CalcBrain.swift /Users/Bamz/Developer/Calculator/Calculator/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/Bamz/Developer/Calculator/Build/Intermediates/Calculator.build/Debug-iphonesimulator/Calculator.build/Objects-normal/x86_64/CalcBrain~partial.swiftmodule : /Users/Bamz/Developer/Calculator/Calculator/AppDelegate.swift /Users/Bamz/Developer/Calculator/Calculator/CalcBrain.swift /Users/Bamz/Developer/Calculator/Calculator/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/Bamz/Developer/Calculator/Build/Intermediates/Calculator.build/Debug-iphonesimulator/Calculator.build/Objects-normal/x86_64/CalcBrain~partial.swiftdoc : /Users/Bamz/Developer/Calculator/Calculator/AppDelegate.swift /Users/Bamz/Developer/Calculator/Calculator/CalcBrain.swift /Users/Bamz/Developer/Calculator/Calculator/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
| D |
func void zs_smalltalk()
{
printdebugnpc(PD_TA_FRAME,"ZS_Smalltalk");
//b_setperception(self);
Npc_PercEnable(self,PERC_ASSESSENEMY,b_assessenemy);
Npc_PercEnable(self,PERC_ASSESSFIGHTER,b_assessfighter);
Npc_PercEnable(self,PERC_ASSESSPLAYER,b_assesssc);
Npc_PercEnable(self,PERC_ASSESSDAMAGE,zs_reacttodamage);
Npc_PercEnable(self,PERC_ASSESSMAGIC,b_assessmagic);
Npc_PercEnable(self,PERC_ASSESSCASTER,b_assesscaster);
Npc_PercEnable(self,PERC_ASSESSTHREAT,b_assessfighter);
Npc_PercEnable(self,PERC_ASSESSWARN,b_assesswarn);
Npc_PercEnable(self,PERC_ASSESSMURDER,zs_assessmurder);
Npc_PercEnable(self,PERC_ASSESSDEFEAT,zs_assessdefeat);
Npc_PercEnable(self,PERC_DRAWWEAPON,b_assessfighter);
Npc_PercEnable(self,PERC_ASSESSFIGHTSOUND,b_assessfightsound);
//Npc_PercEnable(self,PERC_ASSESSQUIETSOUND,b_assessquietsound);
Npc_PercEnable(self,PERC_CATCHTHIEF,zs_catchthief);
Npc_PercEnable(self,PERC_ASSESSTHEFT,b_assesstheft);
Npc_PercEnable(self,PERC_ASSESSSURPRISE,zs_assesssurprise);
Npc_PercEnable(self,PERC_OBSERVESUSPECT,b_observesuspect);
Npc_PercEnable(self,PERC_OBSERVEINTRUDER,b_observeintruder);
Npc_PercEnable(self,PERC_ASSESSTALK,b_assesstalk);
Npc_PercEnable(self,PERC_ASSESSCALL,zs_reacttocall);
Npc_PercEnable(self,PERC_ASSESSUSEMOB,b_assessusemob);
Npc_PercEnable(self,PERC_ASSESSENTERROOM,b_assessenterroom);
Npc_PercEnable(self,PERC_MOVEMOB,b_movemob);
Npc_PercEnable(self,PERC_MOVENPC,b_movenpc);
Npc_SetPercTime(self,1);
AI_SetWalkMode(self,NPC_WALK);
if(!Npc_IsOnFP(self,"SMALLTALK"))
{
printdebugnpc(PD_TA_CHECK,"...nicht auf FP!");
AI_GotoWP(self,self.wp);
};
AI_RemoveWeapon(self);
AI_GotoFP(self,"SMALLTALK");
AI_AlignToFP(self);
};
func void zs_smalltalk_loop()
{
var int talktime;
printdebugnpc(PD_TA_LOOP,"ZS_Smalltalk_Loop");
Npc_PerceiveAll(self);
Wld_DetectNpc(self,-1,zs_smalltalk,-1);
printglobals(PD_TA_CHECK);
if(Wld_DetectNpc(self,-1,zs_smalltalk,-1) && (Npc_GetDistToNpc(self,other) < 250))
{
AI_TurnToNPC(self,other);
talktime = Hlp_Random(200);
if(talktime < 5)
{
b_say(self,NULL,"$SMALLTALK01");
}
else if(talktime < 10)
{
b_say(self,NULL,"$SMALLTALK02");
}
else if(talktime < 15)
{
b_say(self,NULL,"$SMALLTALK03");
}
else if(talktime < 20)
{
b_say(self,NULL,"$SMALLTALK04");
}
else if(talktime < 25)
{
b_say(self,NULL,"$SMALLTALK05");
}
else if(talktime < 30)
{
b_say(self,NULL,"$SMALLTALK06");
}
else if(talktime < 35)
{
b_say(self,NULL,"$SMALLTALK07");
}
else if(talktime < 40)
{
b_say(self,NULL,"$SMALLTALK08");
}
else if(talktime < 45)
{
b_say(self,NULL,"$SMALLTALK09");
}
else if(talktime < 50)
{
b_say(self,NULL,"$SMALLTALK10");
}
else if(talktime < 55)
{
b_say(self,NULL,"$SMALLTALK11");
}
else if(talktime < 60)
{
b_say(self,NULL,"$SMALLTALK12");
}
else if(talktime < 65)
{
b_say(self,NULL,"$SMALLTALK13");
}
else if(talktime < 70)
{
b_say(self,NULL,"$SMALLTALK14");
}
else if(talktime < 75)
{
b_say(self,NULL,"$SMALLTALK15");
}
else if(talktime < 80)
{
b_say(self,NULL,"$SMALLTALK16");
}
else if(talktime < 85)
{
b_say(self,NULL,"$SMALLTALK17");
}
else if(talktime < 90)
{
b_say(self,NULL,"$SMALLTALK18");
}
else if(talktime < 95)
{
b_say(self,NULL,"$SMALLTALK19");
}
else if(talktime < 100)
{
b_say(self,NULL,"$SMALLTALK20");
}
else if(talktime < 105)
{
b_say(self,NULL,"$SMALLTALK21");
}
else if(talktime < 110)
{
b_say(self,NULL,"$SMALLTALK22");
}
else if(talktime < 115)
{
b_say(self,NULL,"$SMALLTALK23");
}
else if(talktime < 120)
{
b_say(self,NULL,"$SMALLTALK24");
};
AI_Wait(self,3);
Npc_SetStateTime(self,0);
}
else if(Npc_GetStateTime(self) >= 5)
{
printdebugnpc(PD_TA_CHECK,"... kein Gesprächspartner gefunden!");
//AI_StartState(self,zs_stand,1,"");
};
AI_Wait(self,1);
};
func void zs_smalltalk_end()
{
printdebugnpc(PD_TA_FRAME,"ZS_Smalltalk_End");
};
| D |
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/OperationQueue+Alamofire.o : /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/MultipartFormData.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/MultipartUpload.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AlamofireExtended.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Protected.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/HTTPMethod.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Combine.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Result+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Response.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/SessionDelegate.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ParameterEncoding.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Session.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Validation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ResponseSerialization.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RequestTaskMap.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ParameterEncoder.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RedirectHandler.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AFError.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/EventMonitor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RequestInterceptor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Notifications.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/HTTPHeaders.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Request.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/OperationQueue+Alamofire~partial.swiftmodule : /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/MultipartFormData.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/MultipartUpload.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AlamofireExtended.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Protected.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/HTTPMethod.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Combine.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Result+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Response.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/SessionDelegate.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ParameterEncoding.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Session.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Validation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ResponseSerialization.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RequestTaskMap.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ParameterEncoder.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RedirectHandler.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AFError.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/EventMonitor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RequestInterceptor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Notifications.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/HTTPHeaders.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Request.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/OperationQueue+Alamofire~partial.swiftdoc : /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/MultipartFormData.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/MultipartUpload.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AlamofireExtended.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Protected.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/HTTPMethod.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Combine.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Result+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Response.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/SessionDelegate.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ParameterEncoding.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Session.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Validation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ResponseSerialization.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RequestTaskMap.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ParameterEncoder.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RedirectHandler.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AFError.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/EventMonitor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RequestInterceptor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Notifications.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/HTTPHeaders.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Request.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/OperationQueue+Alamofire~partial.swiftsourceinfo : /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/MultipartFormData.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/MultipartUpload.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AlamofireExtended.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Protected.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/HTTPMethod.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Combine.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Result+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Alamofire.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Response.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/SessionDelegate.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ParameterEncoding.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Session.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Validation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ResponseSerialization.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RequestTaskMap.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/ParameterEncoder.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RedirectHandler.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AFError.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/EventMonitor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RequestInterceptor.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Notifications.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/HTTPHeaders.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/Request.swift /Users/sapientisat/Projects/Supplements/Supplements/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/sapientisat/Projects/Supplements/Supplements/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/sapientisat/Projects/Supplements/Supplements/XcodeBuild/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
| D |
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module org.eclipse.swt.dnd.ByteArrayTransfer;
import org.eclipse.swt.internal.ole.win32.COM;
import org.eclipse.swt.internal.ole.win32.OBJIDL;
import org.eclipse.swt.internal.win32.OS;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.dnd.TransferData;
import java.lang.all;
/**
* The class <code>ByteArrayTransfer</code> provides a platform specific
* mechanism for converting a java <code>byte[]</code> to a platform
* specific representation of the byte array and vice versa.
*
* <p><code>ByteArrayTransfer</code> is never used directly but is sub-classed
* by transfer agents that convert between data in a java format such as a
* <code>String</code> and a platform specific byte array.
*
* <p>If the data you are converting <b>does not</b> map to a
* <code>byte[]</code>, you should sub-class <code>Transfer</code> directly
* and do your own mapping to a platform data type.</p>
*
* <p>The following snippet shows a subclass of ByteArrayTransfer that transfers
* data defined by the class <code>MyType</code>.</p>
*
* <pre><code>
* public class MyType {
* public String fileName;
* public long fileLength;
* public long lastModified;
* }
* </code></pre>
*
* <pre><code>
* public class MyTypeTransfer extends ByteArrayTransfer {
*
* private static final String MYTYPENAME = "my_type_name";
* private static final int MYTYPEID = registerType(MYTYPENAME);
* private static MyTypeTransfer _instance = new MyTypeTransfer();
*
* private MyTypeTransfer() {}
*
* public static MyTypeTransfer getInstance () {
* return _instance;
* }
* public void javaToNative (Object object, TransferData transferData) {
* if (object is null || !(object instanceof MyType[])) return;
*
* if (isSupportedType(transferData)) {
* MyType[] myTypes = (MyType[]) object;
* try {
* // write data to a byte array and then ask super to convert to pMedium
* ByteArrayOutputStream out = new ByteArrayOutputStream();
* DataOutputStream writeOut = new DataOutputStream(out);
* for (int i = 0, length = myTypes.length; i < length; i++){
* byte[] buffer = myTypes[i].fileName.getBytes();
* writeOut.writeInt(buffer.length);
* writeOut.write(buffer);
* writeOut.writeLong(myTypes[i].fileLength);
* writeOut.writeLong(myTypes[i].lastModified);
* }
* byte[] buffer = out.toByteArray();
* writeOut.close();
*
* super.javaToNative(buffer, transferData);
*
* } catch (IOException e) {
* }
* }
* }
* public Object nativeToJava(TransferData transferData){
*
* if (isSupportedType(transferData)) {
*
* byte[] buffer = (byte[])super.nativeToJava(transferData);
* if (buffer is null) return null;
*
* MyType[] myData = new MyType[0];
* try {
* ByteArrayInputStream in = new ByteArrayInputStream(buffer);
* DataInputStream readIn = new DataInputStream(in);
* while(readIn.available() > 20) {
* MyType datum = new MyType();
* int size = readIn.readInt();
* byte[] name = new byte[size];
* readIn.read(name);
* datum.fileName = new String(name);
* datum.fileLength = readIn.readLong();
* datum.lastModified = readIn.readLong();
* MyType[] newMyData = new MyType[myData.length + 1];
* System.arraycopy(myData, 0, newMyData, 0, myData.length);
* newMyData[myData.length] = datum;
* myData = newMyData;
* }
* readIn.close();
* } catch (IOException ex) {
* return null;
* }
* return myData;
* }
*
* return null;
* }
* protected String[] getTypeNames(){
* return new String[]{MYTYPENAME};
* }
* protected int[] getTypeIds(){
* return new int[] {MYTYPEID};
* }
* }
* </code></pre>
*
* @see Transfer
*/
public abstract class ByteArrayTransfer : Transfer {
override
public TransferData[] getSupportedTypes() {
int[] types = getTypeIds();
TransferData[] data = new TransferData[types.length];
for (int i = 0; i < types.length; i++) {
data[i] = new TransferData();
data[i].type = types[i];
data[i].formatetc = new FORMATETC();
data[i].formatetc.cfFormat = cast(ushort) types[i];
data[i].formatetc.dwAspect = COM.DVASPECT_CONTENT;
data[i].formatetc.lindex = -1;
data[i].formatetc.tymed = COM.TYMED_HGLOBAL;
}
return data;
}
override
public bool isSupportedType(TransferData transferData){
if (transferData is null) return false;
int[] types = getTypeIds();
for (int i = 0; i < types.length; i++) {
FORMATETC* format = transferData.formatetc;
if (format.cfFormat is types[i] &&
(format.dwAspect & COM.DVASPECT_CONTENT) is COM.DVASPECT_CONTENT &&
(format.tymed & COM.TYMED_HGLOBAL) is COM.TYMED_HGLOBAL )
return true;
}
return false;
}
/**
* This implementation of <code>javaToNative</code> converts a java
* <code>byte[]</code> to a platform specific representation.
*
* @param object a java <code>byte[]</code> containing the data to be converted
* @param transferData an empty <code>TransferData</code> object that will
* be filled in on return with the platform specific format of the data
*
* @see Transfer#nativeToJava
*/
override
protected void javaToNative (Object object, TransferData transferData) {
if (!checkByteArray(object) || !isSupportedType(transferData)) {
DND.error(DND.ERROR_INVALID_DATA);
}
// Allocate the memory because the caller (DropTarget) has not handed it in
// The caller of this method must release the data when it is done with it.
byte[] data = (cast(ArrayWrapperByte)object).array;
int size = data.length;
auto newPtr = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT, size);
OS.MoveMemory(newPtr, data.ptr, size);
transferData.stgmedium = new STGMEDIUM();
transferData.stgmedium.tymed = COM.TYMED_HGLOBAL;
transferData.stgmedium.unionField = newPtr;
transferData.stgmedium.pUnkForRelease = null;
transferData.result = COM.S_OK;
}
/**
* This implementation of <code>nativeToJava</code> converts a platform specific
* representation of a byte array to a java <code>byte[]</code>.
*
* @param transferData the platform specific representation of the data to be converted
* @return a java <code>byte[]</code> containing the converted data if the conversion was
* successful; otherwise null
*
* @see Transfer#javaToNative
*/
override
protected Object nativeToJava(TransferData transferData) {
if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
IDataObject data = transferData.pIDataObject;
data.AddRef();
FORMATETC* formatetc = transferData.formatetc;
STGMEDIUM* stgmedium = new STGMEDIUM();
stgmedium.tymed = COM.TYMED_HGLOBAL;
transferData.result = getData(data, formatetc, stgmedium);
data.Release();
if (transferData.result !is COM.S_OK) return null;
auto hMem = stgmedium.unionField;
int size = OS.GlobalSize(hMem);
byte[] buffer = new byte[size];
auto ptr = OS.GlobalLock(hMem);
OS.MoveMemory(buffer.ptr, ptr, size);
OS.GlobalUnlock(hMem);
OS.GlobalFree(hMem);
return new ArrayWrapperByte(buffer);
}
bool checkByteArray(Object object) {
return (object !is null && ( null !is cast(ArrayWrapperByte)object) && (cast(ArrayWrapperByte)object).array.length > 0);
}
}
| D |
a German art song of the 19th century for voice and piano
be located or situated somewhere
be lying, be prostrate
originate (in
be and remain in a particular state or condition
tell an untruth
have a place in relation to something else
assume a reclining position
| D |
/*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module dwt.events.MenuDetectListener;
public import dwt.internal.DWTEventListener;
public import dwt.events.MenuDetectEvent;
/**
* Classes which implement this interface provide methods
* that deal with the events that are generated when the
* platform-specific trigger for showing a context menu is
* detected.
* <p>
* After creating an instance of a class that :
* this interface it can be added to a control or TrayItem
* using the <code>addMenuDetectListener</code> method and
* removed using the <code>removeMenuDetectListener</code> method.
* When the context menu trigger occurs, the
* <code>menuDetected</code> method will be invoked.
* </p>
*
* @see MenuDetectEvent
*
* @since 3.3
*/
public interface MenuDetectListener :
DWTEventListener
{
/**
* Sent when the platform-dependent trigger for showing a menu item is detected.
*
* @param e an event containing information about the menu detect
*/
public void menuDetected (MenuDetectEvent e);
}
| D |
/home/spyro/Documents/github/GameEngine/game_engine/target/debug/build/parking_lot_core-8c60b6ae9e3f9263/build_script_build-8c60b6ae9e3f9263: /home/spyro/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.4.0/build.rs
/home/spyro/Documents/github/GameEngine/game_engine/target/debug/build/parking_lot_core-8c60b6ae9e3f9263/build_script_build-8c60b6ae9e3f9263.d: /home/spyro/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.4.0/build.rs
/home/spyro/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.4.0/build.rs:
| D |
a policy of nonparticipation in international economic and political relations
| D |
module dman.direction;
enum Direction
{
UP,
RIGHT,
DOWN,
LEFT
}
| D |
/**
* D header file for DragonFlyBSD
*
* Authors: Martin Nowak,Diederik de Groot(port:DragonFlyBSD)
* Copied: From core/sys/freebsd/sys
*/
module core.sys.dragonflybsd.pthread_np;
version (DragonFlyBSD):
extern (C) nothrow @nogc @system:
public import core.sys.posix.sys.types;
// TODO: add full core.sys.dragonflybsd.sys.cpuset;
public import core.sys.dragonflybsd.sys._cpuset;
public import core.sys.posix.time;
alias pthread_switch_routine_t = void function(pthread_t, pthread_t);
int pthread_attr_get_np(pthread_t, pthread_attr_t *);
int pthread_attr_getaffinity_np(const(pthread_attr_t)*, size_t, cpuset_t *);
int pthread_attr_setaffinity_np(pthread_attr_t *, size_t, const(cpuset_t)*);
int pthread_attr_setcreatesuspend_np(pthread_attr_t *);
int pthread_getaffinity_np(pthread_t, size_t, cpuset_t *);
int pthread_main_np();
int pthread_multi_np();
int pthread_mutexattr_getkind_np(pthread_mutexattr_t);
int pthread_mutexattr_setkind_np(pthread_mutexattr_t *, int);
void pthread_resume_all_np();
int pthread_resume_np(pthread_t);
void pthread_set_name_np(pthread_t, const(char)*);
int pthread_setaffinity_np(pthread_t, size_t, const(cpuset_t)*);
int pthread_single_np();
void pthread_suspend_all_np();
int pthread_suspend_np(pthread_t);
int pthread_switch_add_np(pthread_switch_routine_t);
int pthread_switch_delete_np(pthread_switch_routine_t);
int pthread_timedjoin_np(pthread_t, void **, const(timespec)*);
//int pthread_getthreadid_np();
//int pthread_mutex_getspinloops_np(pthread_mutex_t *mutex, int *count);
//int pthread_mutex_setspinloops_np(pthread_mutex_t *mutex, int count);
//int pthread_mutex_getyieldloops_np(pthread_mutex_t *mutex, int *count);
//int pthread_mutex_setyieldloops_np(pthread_mutex_t *mutex, int count);
//int pthread_mutex_isowned_np(pthread_mutex_t *mutex);
| D |
//https://rosettacode.org/wiki/Continued_fraction/Arithmetic/Construct_from_rational_number
import std.concurrency;
import std.stdio;
struct Pair {
int first, second;
}
auto r2cf(Pair frac) {
return new Generator!int({
auto num = frac.first;
auto den = frac.second;
while (den != 0) {
auto div = num / den;
auto rem = num % den;
num = den;
den = rem;
div.yield();
}
});
}
void iterate(Generator!int seq) {
foreach(i; seq) {
write(i, " ");
}
writeln();
}
void main() {
auto fracs = [
Pair( 1, 2),
Pair( 3, 1),
Pair( 23, 8),
Pair( 13, 11),
Pair( 22, 7),
Pair(-151, 77),
];
foreach(frac; fracs) {
writef("%4d / %-2d = ", frac.first, frac.second);
frac.r2cf.iterate;
}
writeln;
auto root2 = [
Pair( 14_142, 10_000),
Pair( 141_421, 100_000),
Pair( 1_414_214, 1_000_000),
Pair(14_142_136, 10_000_000),
];
writeln("Sqrt(2) ->");
foreach(frac; root2) {
writef("%8d / %-8d = ", frac.first, frac.second);
frac.r2cf.iterate;
}
writeln;
auto pi = [
Pair( 31, 10),
Pair( 314, 100),
Pair( 3_142, 1_000),
Pair( 31_428, 10_000),
Pair( 314_285, 100_000),
Pair( 3_142_857, 1_000_000),
Pair( 31_428_571, 10_000_000),
Pair(314_285_714, 100_000_000),
];
writeln("Pi ->");
foreach(frac; pi) {
writef("%9d / %-9d = ", frac.first, frac.second);
frac.r2cf.iterate;
}
}
| D |
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
module vtkViewTheme;
static import vtkd_im;
static import core.stdc.config;
static import std.conv;
static import std.string;
static import std.conv;
static import std.string;
static import vtkObjectBase;
static import SWIGTYPE_p_double;
static import vtkScalarsToColors;
static import vtkTextProperty;
static import vtkObject;
class vtkViewTheme : vtkObject.vtkObject {
private void* swigCPtr;
public this(void* cObject, bool ownCObject) {
super(vtkd_im.vtkViewTheme_Upcast(cObject), ownCObject);
swigCPtr = cObject;
}
public static void* swigGetCPtr(vtkViewTheme obj) {
return (obj is null) ? null : obj.swigCPtr;
}
mixin vtkd_im.SwigOperatorDefinitions;
public override void dispose() {
synchronized(this) {
if (swigCPtr !is null) {
if (swigCMemOwn) {
swigCMemOwn = false;
throw new object.Exception("C++ destructor does not have public access");
}
swigCPtr = null;
super.dispose();
}
}
}
public static vtkViewTheme New() {
void* cPtr = vtkd_im.vtkViewTheme_New();
vtkViewTheme ret = (cPtr is null) ? null : new vtkViewTheme(cPtr, false);
return ret;
}
public static int IsTypeOf(string type) {
auto ret = vtkd_im.vtkViewTheme_IsTypeOf((type ? std.string.toStringz(type) : null));
return ret;
}
public static vtkViewTheme SafeDownCast(vtkObjectBase.vtkObjectBase o) {
void* cPtr = vtkd_im.vtkViewTheme_SafeDownCast(vtkObjectBase.vtkObjectBase.swigGetCPtr(o));
vtkViewTheme ret = (cPtr is null) ? null : new vtkViewTheme(cPtr, false);
return ret;
}
public vtkViewTheme NewInstance() const {
void* cPtr = vtkd_im.vtkViewTheme_NewInstance(cast(void*)swigCPtr);
vtkViewTheme ret = (cPtr is null) ? null : new vtkViewTheme(cPtr, false);
return ret;
}
alias vtkObject.vtkObject.NewInstance NewInstance;
public void SetPointSize(double _arg) {
vtkd_im.vtkViewTheme_SetPointSize(cast(void*)swigCPtr, _arg);
}
public double GetPointSize() {
auto ret = vtkd_im.vtkViewTheme_GetPointSize(cast(void*)swigCPtr);
return ret;
}
public void SetLineWidth(double _arg) {
vtkd_im.vtkViewTheme_SetLineWidth(cast(void*)swigCPtr, _arg);
}
public double GetLineWidth() {
auto ret = vtkd_im.vtkViewTheme_GetLineWidth(cast(void*)swigCPtr);
return ret;
}
public void SetPointColor(double _arg1, double _arg2, double _arg3) {
vtkd_im.vtkViewTheme_SetPointColor__SWIG_0(cast(void*)swigCPtr, _arg1, _arg2, _arg3);
}
public void SetPointColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_SetPointColor__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public double* GetPointColor() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetPointColor__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetPointColor(double* _arg1, double* _arg2, double* _arg3) {
vtkd_im.vtkViewTheme_GetPointColor__SWIG_1(cast(void*)swigCPtr, cast(void*)_arg1, cast(void*)_arg2, cast(void*)_arg3);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetPointColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_GetPointColor__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public void SetPointOpacity(double _arg) {
vtkd_im.vtkViewTheme_SetPointOpacity(cast(void*)swigCPtr, _arg);
}
public double GetPointOpacity() {
auto ret = vtkd_im.vtkViewTheme_GetPointOpacity(cast(void*)swigCPtr);
return ret;
}
public void SetPointHueRange(double mn, double mx) {
vtkd_im.vtkViewTheme_SetPointHueRange__SWIG_0(cast(void*)swigCPtr, mn, mx);
}
public void SetPointHueRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_SetPointHueRange__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public double* GetPointHueRange() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetPointHueRange__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetPointHueRange(double* mn, double* mx) {
vtkd_im.vtkViewTheme_GetPointHueRange__SWIG_1(cast(void*)swigCPtr, cast(void*)mn, cast(void*)mx);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetPointHueRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_GetPointHueRange__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public void SetPointSaturationRange(double mn, double mx) {
vtkd_im.vtkViewTheme_SetPointSaturationRange__SWIG_0(cast(void*)swigCPtr, mn, mx);
}
public void SetPointSaturationRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_SetPointSaturationRange__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public double* GetPointSaturationRange() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetPointSaturationRange__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetPointSaturationRange(double* mn, double* mx) {
vtkd_im.vtkViewTheme_GetPointSaturationRange__SWIG_1(cast(void*)swigCPtr, cast(void*)mn, cast(void*)mx);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetPointSaturationRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_GetPointSaturationRange__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public void SetPointValueRange(double mn, double mx) {
vtkd_im.vtkViewTheme_SetPointValueRange__SWIG_0(cast(void*)swigCPtr, mn, mx);
}
public void SetPointValueRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_SetPointValueRange__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public double* GetPointValueRange() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetPointValueRange__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetPointValueRange(double* mn, double* mx) {
vtkd_im.vtkViewTheme_GetPointValueRange__SWIG_1(cast(void*)swigCPtr, cast(void*)mn, cast(void*)mx);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetPointValueRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_GetPointValueRange__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public void SetPointAlphaRange(double mn, double mx) {
vtkd_im.vtkViewTheme_SetPointAlphaRange__SWIG_0(cast(void*)swigCPtr, mn, mx);
}
public void SetPointAlphaRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_SetPointAlphaRange__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public double* GetPointAlphaRange() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetPointAlphaRange__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetPointAlphaRange(double* mn, double* mx) {
vtkd_im.vtkViewTheme_GetPointAlphaRange__SWIG_1(cast(void*)swigCPtr, cast(void*)mn, cast(void*)mx);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetPointAlphaRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_GetPointAlphaRange__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public vtkScalarsToColors.vtkScalarsToColors GetPointLookupTable() {
void* cPtr = vtkd_im.vtkViewTheme_GetPointLookupTable(cast(void*)swigCPtr);
vtkScalarsToColors.vtkScalarsToColors ret = (cPtr is null) ? null : new vtkScalarsToColors.vtkScalarsToColors(cPtr, false);
return ret;
}
public void SetPointLookupTable(vtkScalarsToColors.vtkScalarsToColors lut) {
vtkd_im.vtkViewTheme_SetPointLookupTable(cast(void*)swigCPtr, vtkScalarsToColors.vtkScalarsToColors.swigGetCPtr(lut));
}
public void SetScalePointLookupTable(bool _arg) {
vtkd_im.vtkViewTheme_SetScalePointLookupTable(cast(void*)swigCPtr, _arg);
}
public bool GetScalePointLookupTable() {
bool ret = vtkd_im.vtkViewTheme_GetScalePointLookupTable(cast(void*)swigCPtr) ? true : false;
return ret;
}
public void ScalePointLookupTableOn() {
vtkd_im.vtkViewTheme_ScalePointLookupTableOn(cast(void*)swigCPtr);
}
public void ScalePointLookupTableOff() {
vtkd_im.vtkViewTheme_ScalePointLookupTableOff(cast(void*)swigCPtr);
}
public void SetCellColor(double _arg1, double _arg2, double _arg3) {
vtkd_im.vtkViewTheme_SetCellColor__SWIG_0(cast(void*)swigCPtr, _arg1, _arg2, _arg3);
}
public void SetCellColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_SetCellColor__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public double* GetCellColor() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetCellColor__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetCellColor(double* _arg1, double* _arg2, double* _arg3) {
vtkd_im.vtkViewTheme_GetCellColor__SWIG_1(cast(void*)swigCPtr, cast(void*)_arg1, cast(void*)_arg2, cast(void*)_arg3);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetCellColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_GetCellColor__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public void SetCellOpacity(double _arg) {
vtkd_im.vtkViewTheme_SetCellOpacity(cast(void*)swigCPtr, _arg);
}
public double GetCellOpacity() {
auto ret = vtkd_im.vtkViewTheme_GetCellOpacity(cast(void*)swigCPtr);
return ret;
}
public void SetCellHueRange(double mn, double mx) {
vtkd_im.vtkViewTheme_SetCellHueRange__SWIG_0(cast(void*)swigCPtr, mn, mx);
}
public void SetCellHueRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_SetCellHueRange__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public double* GetCellHueRange() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetCellHueRange__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetCellHueRange(double* mn, double* mx) {
vtkd_im.vtkViewTheme_GetCellHueRange__SWIG_1(cast(void*)swigCPtr, cast(void*)mn, cast(void*)mx);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetCellHueRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_GetCellHueRange__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public void SetCellSaturationRange(double mn, double mx) {
vtkd_im.vtkViewTheme_SetCellSaturationRange__SWIG_0(cast(void*)swigCPtr, mn, mx);
}
public void SetCellSaturationRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_SetCellSaturationRange__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public double* GetCellSaturationRange() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetCellSaturationRange__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetCellSaturationRange(double* mn, double* mx) {
vtkd_im.vtkViewTheme_GetCellSaturationRange__SWIG_1(cast(void*)swigCPtr, cast(void*)mn, cast(void*)mx);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetCellSaturationRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_GetCellSaturationRange__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public void SetCellValueRange(double mn, double mx) {
vtkd_im.vtkViewTheme_SetCellValueRange__SWIG_0(cast(void*)swigCPtr, mn, mx);
}
public void SetCellValueRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_SetCellValueRange__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public double* GetCellValueRange() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetCellValueRange__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetCellValueRange(double* mn, double* mx) {
vtkd_im.vtkViewTheme_GetCellValueRange__SWIG_1(cast(void*)swigCPtr, cast(void*)mn, cast(void*)mx);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetCellValueRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_GetCellValueRange__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public void SetCellAlphaRange(double mn, double mx) {
vtkd_im.vtkViewTheme_SetCellAlphaRange__SWIG_0(cast(void*)swigCPtr, mn, mx);
}
public void SetCellAlphaRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_SetCellAlphaRange__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public double* GetCellAlphaRange() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetCellAlphaRange__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetCellAlphaRange(double* mn, double* mx) {
vtkd_im.vtkViewTheme_GetCellAlphaRange__SWIG_1(cast(void*)swigCPtr, cast(void*)mn, cast(void*)mx);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetCellAlphaRange(SWIGTYPE_p_double.SWIGTYPE_p_double rng) {
vtkd_im.vtkViewTheme_GetCellAlphaRange__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(rng));
}
public vtkScalarsToColors.vtkScalarsToColors GetCellLookupTable() {
void* cPtr = vtkd_im.vtkViewTheme_GetCellLookupTable(cast(void*)swigCPtr);
vtkScalarsToColors.vtkScalarsToColors ret = (cPtr is null) ? null : new vtkScalarsToColors.vtkScalarsToColors(cPtr, false);
return ret;
}
public void SetCellLookupTable(vtkScalarsToColors.vtkScalarsToColors lut) {
vtkd_im.vtkViewTheme_SetCellLookupTable(cast(void*)swigCPtr, vtkScalarsToColors.vtkScalarsToColors.swigGetCPtr(lut));
}
public void SetScaleCellLookupTable(bool _arg) {
vtkd_im.vtkViewTheme_SetScaleCellLookupTable(cast(void*)swigCPtr, _arg);
}
public bool GetScaleCellLookupTable() {
bool ret = vtkd_im.vtkViewTheme_GetScaleCellLookupTable(cast(void*)swigCPtr) ? true : false;
return ret;
}
public void ScaleCellLookupTableOn() {
vtkd_im.vtkViewTheme_ScaleCellLookupTableOn(cast(void*)swigCPtr);
}
public void ScaleCellLookupTableOff() {
vtkd_im.vtkViewTheme_ScaleCellLookupTableOff(cast(void*)swigCPtr);
}
public void SetOutlineColor(double _arg1, double _arg2, double _arg3) {
vtkd_im.vtkViewTheme_SetOutlineColor__SWIG_0(cast(void*)swigCPtr, _arg1, _arg2, _arg3);
}
public void SetOutlineColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_SetOutlineColor__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public double* GetOutlineColor() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetOutlineColor__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetOutlineColor(double* _arg1, double* _arg2, double* _arg3) {
vtkd_im.vtkViewTheme_GetOutlineColor__SWIG_1(cast(void*)swigCPtr, cast(void*)_arg1, cast(void*)_arg2, cast(void*)_arg3);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetOutlineColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_GetOutlineColor__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public void SetSelectedPointColor(double _arg1, double _arg2, double _arg3) {
vtkd_im.vtkViewTheme_SetSelectedPointColor__SWIG_0(cast(void*)swigCPtr, _arg1, _arg2, _arg3);
}
public void SetSelectedPointColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_SetSelectedPointColor__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public double* GetSelectedPointColor() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetSelectedPointColor__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetSelectedPointColor(double* _arg1, double* _arg2, double* _arg3) {
vtkd_im.vtkViewTheme_GetSelectedPointColor__SWIG_1(cast(void*)swigCPtr, cast(void*)_arg1, cast(void*)_arg2, cast(void*)_arg3);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetSelectedPointColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_GetSelectedPointColor__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public void SetSelectedPointOpacity(double _arg) {
vtkd_im.vtkViewTheme_SetSelectedPointOpacity(cast(void*)swigCPtr, _arg);
}
public double GetSelectedPointOpacity() {
auto ret = vtkd_im.vtkViewTheme_GetSelectedPointOpacity(cast(void*)swigCPtr);
return ret;
}
public void SetSelectedCellColor(double _arg1, double _arg2, double _arg3) {
vtkd_im.vtkViewTheme_SetSelectedCellColor__SWIG_0(cast(void*)swigCPtr, _arg1, _arg2, _arg3);
}
public void SetSelectedCellColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_SetSelectedCellColor__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public double* GetSelectedCellColor() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetSelectedCellColor__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetSelectedCellColor(double* _arg1, double* _arg2, double* _arg3) {
vtkd_im.vtkViewTheme_GetSelectedCellColor__SWIG_1(cast(void*)swigCPtr, cast(void*)_arg1, cast(void*)_arg2, cast(void*)_arg3);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetSelectedCellColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_GetSelectedCellColor__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public void SetSelectedCellOpacity(double _arg) {
vtkd_im.vtkViewTheme_SetSelectedCellOpacity(cast(void*)swigCPtr, _arg);
}
public double GetSelectedCellOpacity() {
auto ret = vtkd_im.vtkViewTheme_GetSelectedCellOpacity(cast(void*)swigCPtr);
return ret;
}
public void SetBackgroundColor(double _arg1, double _arg2, double _arg3) {
vtkd_im.vtkViewTheme_SetBackgroundColor__SWIG_0(cast(void*)swigCPtr, _arg1, _arg2, _arg3);
}
public void SetBackgroundColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_SetBackgroundColor__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public double* GetBackgroundColor() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetBackgroundColor__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetBackgroundColor(double* _arg1, double* _arg2, double* _arg3) {
vtkd_im.vtkViewTheme_GetBackgroundColor__SWIG_1(cast(void*)swigCPtr, cast(void*)_arg1, cast(void*)_arg2, cast(void*)_arg3);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetBackgroundColor(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_GetBackgroundColor__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public void SetBackgroundColor2(double _arg1, double _arg2, double _arg3) {
vtkd_im.vtkViewTheme_SetBackgroundColor2__SWIG_0(cast(void*)swigCPtr, _arg1, _arg2, _arg3);
}
public void SetBackgroundColor2(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_SetBackgroundColor2__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public double* GetBackgroundColor2() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetBackgroundColor2__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetBackgroundColor2(double* _arg1, double* _arg2, double* _arg3) {
vtkd_im.vtkViewTheme_GetBackgroundColor2__SWIG_1(cast(void*)swigCPtr, cast(void*)_arg1, cast(void*)_arg2, cast(void*)_arg3);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetBackgroundColor2(SWIGTYPE_p_double.SWIGTYPE_p_double _arg) {
vtkd_im.vtkViewTheme_GetBackgroundColor2__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(_arg));
}
public void SetPointTextProperty(vtkTextProperty.vtkTextProperty tprop) {
vtkd_im.vtkViewTheme_SetPointTextProperty(cast(void*)swigCPtr, vtkTextProperty.vtkTextProperty.swigGetCPtr(tprop));
}
public vtkTextProperty.vtkTextProperty GetPointTextProperty() {
void* cPtr = vtkd_im.vtkViewTheme_GetPointTextProperty(cast(void*)swigCPtr);
vtkTextProperty.vtkTextProperty ret = (cPtr is null) ? null : new vtkTextProperty.vtkTextProperty(cPtr, false);
return ret;
}
public void SetCellTextProperty(vtkTextProperty.vtkTextProperty tprop) {
vtkd_im.vtkViewTheme_SetCellTextProperty(cast(void*)swigCPtr, vtkTextProperty.vtkTextProperty.swigGetCPtr(tprop));
}
public vtkTextProperty.vtkTextProperty GetCellTextProperty() {
void* cPtr = vtkd_im.vtkViewTheme_GetCellTextProperty(cast(void*)swigCPtr);
vtkTextProperty.vtkTextProperty ret = (cPtr is null) ? null : new vtkTextProperty.vtkTextProperty(cPtr, false);
return ret;
}
public void SetVertexLabelColor(double r, double g, double b) {
vtkd_im.vtkViewTheme_SetVertexLabelColor__SWIG_0(cast(void*)swigCPtr, r, g, b);
}
public void SetVertexLabelColor(SWIGTYPE_p_double.SWIGTYPE_p_double c) {
vtkd_im.vtkViewTheme_SetVertexLabelColor__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(c));
}
public double* GetVertexLabelColor() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetVertexLabelColor__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetVertexLabelColor(double* r, double* g, double* b) {
vtkd_im.vtkViewTheme_GetVertexLabelColor__SWIG_1(cast(void*)swigCPtr, cast(void*)r, cast(void*)g, cast(void*)b);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetVertexLabelColor(SWIGTYPE_p_double.SWIGTYPE_p_double c) {
vtkd_im.vtkViewTheme_GetVertexLabelColor__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(c));
}
public void SetEdgeLabelColor(double r, double g, double b) {
vtkd_im.vtkViewTheme_SetEdgeLabelColor__SWIG_0(cast(void*)swigCPtr, r, g, b);
}
public void SetEdgeLabelColor(SWIGTYPE_p_double.SWIGTYPE_p_double c) {
vtkd_im.vtkViewTheme_SetEdgeLabelColor__SWIG_1(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(c));
}
public double* GetEdgeLabelColor() {
auto ret = cast(double*)vtkd_im.vtkViewTheme_GetEdgeLabelColor__SWIG_0(cast(void*)swigCPtr);
return ret;
}
public void GetEdgeLabelColor(double* r, double* g, double* b) {
vtkd_im.vtkViewTheme_GetEdgeLabelColor__SWIG_1(cast(void*)swigCPtr, cast(void*)r, cast(void*)g, cast(void*)b);
if (vtkd_im.SwigPendingException.isPending) throw vtkd_im.SwigPendingException.retrieve();
}
public void GetEdgeLabelColor(SWIGTYPE_p_double.SWIGTYPE_p_double c) {
vtkd_im.vtkViewTheme_GetEdgeLabelColor__SWIG_2(cast(void*)swigCPtr, SWIGTYPE_p_double.SWIGTYPE_p_double.swigGetCPtr(c));
}
public static vtkViewTheme CreateOceanTheme() {
void* cPtr = vtkd_im.vtkViewTheme_CreateOceanTheme();
vtkViewTheme ret = (cPtr is null) ? null : new vtkViewTheme(cPtr, false);
return ret;
}
public static vtkViewTheme CreateMellowTheme() {
void* cPtr = vtkd_im.vtkViewTheme_CreateMellowTheme();
vtkViewTheme ret = (cPtr is null) ? null : new vtkViewTheme(cPtr, false);
return ret;
}
public static vtkViewTheme CreateNeonTheme() {
void* cPtr = vtkd_im.vtkViewTheme_CreateNeonTheme();
vtkViewTheme ret = (cPtr is null) ? null : new vtkViewTheme(cPtr, false);
return ret;
}
public bool LookupMatchesPointTheme(vtkScalarsToColors.vtkScalarsToColors s2c) {
bool ret = vtkd_im.vtkViewTheme_LookupMatchesPointTheme(cast(void*)swigCPtr, vtkScalarsToColors.vtkScalarsToColors.swigGetCPtr(s2c)) ? true : false;
return ret;
}
public bool LookupMatchesCellTheme(vtkScalarsToColors.vtkScalarsToColors s2c) {
bool ret = vtkd_im.vtkViewTheme_LookupMatchesCellTheme(cast(void*)swigCPtr, vtkScalarsToColors.vtkScalarsToColors.swigGetCPtr(s2c)) ? true : false;
return ret;
}
}
| D |
/*
* Copyright (C) 2017 Julien Viet
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
module test.pgclient.PgConnectionTestBase;
import test.pgclient.PgClientTestBase;
import hunt.database.base;
import hunt.database.driver.postgresql;
// import java.util.ArrayList;
// import java.util.List;
// import java.util.concurrent.CompletableFuture;
// import java.util.concurrent.Executor;
// import java.util.concurrent.atomic.AtomicInteger;
// import java.util.concurrent.atomic.AtomicReference;
import hunt.Assert;
import hunt.Exceptions;
import hunt.logging.ConsoleLogger;
import hunt.util.Common;
import hunt.util.UnitTest;
import hunt.collection;
/**
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a>
*/
abstract class PgConnectionTestBase : PgClientTestBase!(SqlConnection) {
// @Test
// void testDisconnectAbruptly() {
// Async async = ctx.async();
// ProxyServer proxy = ProxyServer.create(vertx, options.getPort(), options.getHost());
// proxy.proxyHandler(conn -> {
// vertx.setTimer(200, id -> {
// conn.close();
// });
// conn.connect();
// });
// proxy.listen(8080, "localhost", ctx.asyncAssertSuccess(v1 -> {
// options.setPort(8080).setHost("localhost");
// connector.accept(ctx.asyncAssertSuccess(conn -> {
// conn.closeHandler(v2 -> {
// async.complete();
// });
// }));
// }));
// }
// @Test
// void testProtocolError() {
// Async async = ctx.async();
// ProxyServer proxy = ProxyServer.create(vertx, options.getPort(), options.getHost());
// CompletableFuture!(Void) connected = new CompletableFuture<>();
// proxy.proxyHandler(conn -> {
// connected.thenAccept(v -> {
// System.out.println("send bogus");
// Buffer bogusMsg = Buffer.buffer();
// bogusMsg.appendByte((byte) 'R'); // Authentication
// bogusMsg.appendInt(0);
// bogusMsg.appendInt(1);
// bogusMsg.setInt(1, bogusMsg.length() - 1);
// conn.clientSocket().write(bogusMsg);
// });
// conn.connect();
// });
// proxy.listen(8080, "localhost", ctx.asyncAssertSuccess(v1 -> {
// options.setPort(8080).setHost("localhost");
// connector.accept(ctx.asyncAssertSuccess(conn -> {
// AtomicInteger count = new AtomicInteger();
// conn.exceptionHandler(err -> {
// ctx.assertEquals(err.getClass(), UnsupportedOperationException.class);
// count.incrementAndGet();
// });
// conn.closeHandler(v -> {
// ctx.assertEquals(1, count.get());
// async.complete();
// });
// connected.complete(null);
// }));
// }));
// }
// @Test
// void testTx() {
// connector((SqlConnection conn) {
// conn.query("BEGIN", (AsyncResult!RowSet ar) {
// if(ar.succeeded()) {
// RowSet result1 = ar.result();
// assert(0 == result1.size());
// assert(result1.iterator() !is null);
// conn.query("COMMIT", (AsyncResult!RowSet ar) {
// if(ar.succeeded()) {
// RowSet result2 = ar.result();
// assert(0 == result2.size());
// } else {
// warning(ar.cause().msg);
// }
// conn.close();
// });
// } else {
// warning(ar.cause().msg);
// }
// });
// });
// }
// /*
// @Test
// void testSQLConnection() {
// connector((SqlConnection conn) {
// conn.query("SELECT 1", (AsyncResult!RowSet ar) {
// if(ar.succeeded()) {
// RowSet result = ar.result();
// assert(1 == result.rowCount());
// } else {
// warning(ar.cause().msg);
// }
// conn.close();
// });
// });
// }
@Test
void testSelectForQueryWithParams() {
connector((SqlConnection conn) {
trace("testing preparedQuery...");
conn.preparedQuery("SELECT * FROM Fortune WHERE id=$1", Tuple.of(12), (AsyncResult!RowSet ar) {
if(ar.succeeded()) {
RowSet result = ar.result();
assert(1 == result.rowCount());
Row r = result.iterator.front();
tracef("id: %d, message: %s", r.getValue("id").get!int(), r.getValue("message"));
} else {
warning(ar.cause().msg);
}
// conn.close();
});
});
}
// @Test
// void testUpdateError() {
// Async async = ctx.async();
// connector.accept(ctx.asyncAssertSuccess(conn -> {
// conn.query("INSERT INTO Fortune (id, message) VALUES (1, 'Duplicate')", ctx.asyncAssertFailure(err -> {
// ctx.assertEquals("23505", ((PgException) err).getCode());
// conn.query("SELECT 1000", ctx.asyncAssertSuccess(result -> {
// ctx.assertEquals(1, result.size());
// ctx.assertEquals(1000, result.iterator().next().getInteger(0));
// async.complete();
// }));
// }));
// }));
// }
// @Test
// void testBatchInsertError() {
// Async async = ctx.async();
// connector.accept(ctx.asyncAssertSuccess(conn -> {
// int id = randomWorld();
// List!(Tuple) batch = new ArrayList<>();
// batch.add(Tuple.of(id, 3));
// conn.preparedBatch("INSERT INTO World (id, randomnumber) VALUES ($1, $2)", batch, ctx.asyncAssertFailure(err -> {
// ctx.assertEquals("23505", ((PgException) err).getCode());
// conn.query("SELECT 1000", ctx.asyncAssertSuccess(result -> {
// ctx.assertEquals(1, result.size());
// ctx.assertEquals(1000, result.iterator().next().getInteger(0));
// async.complete();
// }));
// }));
// }));
// }
// @Test
// void testCloseOnUndeploy() {
// Async done = ctx.async();
// vertx.deployVerticle(new AbstractVerticle() {
// override
// void start(Promise!(Void) startPromise) {
// connector.accept(ctx.asyncAssertSuccess(conn -> {
// conn.closeHandler(v -> {
// done.complete();
// });
// startPromise.complete();
// }));
// }
// }, ctx.asyncAssertSuccess(id -> {
// vertx.undeploy(id);
// }));
// }
// @Test
// void testTransactionCommit() {
// testTransactionCommit(ctx, Runnable::run);
// }
// @Test
// void testTransactionCommitFromAnotherThread() {
// testTransactionCommit(ctx, t -> new Thread(t).start());
// }
// private void testTransactionCommit(, Executor exec) {
// Async done = ctx.async();
// connector.accept(ctx.asyncAssertSuccess(conn -> {
// deleteFromTestTable(ctx, conn, () -> {
// exec.execute(() -> {
// Transaction tx = conn.begin();
// AtomicInteger u1 = new AtomicInteger();
// AtomicInteger u2 = new AtomicInteger();
// conn.query("INSERT INTO Test (id, val) VALUES (1, 'val-1')", ctx.asyncAssertSuccess(res1 -> {
// u1.addAndGet(res1.rowCount());
// exec.execute(() -> {
// conn.query("INSERT INTO Test (id, val) VALUES (2, 'val-2')", ctx.asyncAssertSuccess(res2 -> {
// u2.addAndGet(res2.rowCount());
// exec.execute(() -> {
// tx.commit(ctx.asyncAssertSuccess(v -> {
// ctx.assertEquals(1, u1.get());
// ctx.assertEquals(1, u2.get());
// conn.query("SELECT id FROM Test WHERE id=1 OR id=2", ctx.asyncAssertSuccess(result -> {
// ctx.assertEquals(2, result.size());
// done.complete();
// }));
// }));
// });
// }));
// });
// }));
// });
// });
// }));
// }
// @Test
// void testTransactionRollback() {
// testTransactionRollback(ctx, Runnable::run);
// }
// @Test
// void testTransactionRollbackFromAnotherThread() {
// testTransactionRollback(ctx, t -> new Thread(t).start());
// }
// private void testTransactionRollback(, Executor exec) {
// Async done = ctx.async();
// connector.accept(ctx.asyncAssertSuccess(conn -> {
// deleteFromTestTable(ctx, conn, () -> {
// exec.execute(() -> {
// Transaction tx = conn.begin();
// AtomicInteger u1 = new AtomicInteger();
// AtomicInteger u2 = new AtomicInteger();
// conn.query("INSERT INTO Test (id, val) VALUES (1, 'val-1')", ctx.asyncAssertSuccess(res1 -> {
// u1.addAndGet(res1.rowCount());
// exec.execute(() -> {
// });
// conn.query("INSERT INTO Test (id, val) VALUES (2, 'val-2')", ctx.asyncAssertSuccess(res2 -> {
// u2.addAndGet(res2.rowCount());
// exec.execute(() -> {
// tx.rollback(ctx.asyncAssertSuccess(v -> {
// ctx.assertEquals(1, u1.get());
// ctx.assertEquals(1, u2.get());
// conn.query("SELECT id FROM Test WHERE id=1 OR id=2", ctx.asyncAssertSuccess(result -> {
// ctx.assertEquals(0, result.size());
// done.complete();
// }));
// }));
// });
// }));
// }));
// });
// });
// }));
// }
// @Test
// void testTransactionAbort() {
// Async done = ctx.async();
// connector.accept(ctx.asyncAssertSuccess(conn -> {
// deleteFromTestTable(ctx, conn, () -> {
// Transaction tx = conn.begin();
// AtomicInteger failures = new AtomicInteger();
// tx.abortHandler(v -> ctx.assertEquals(0, failures.getAndIncrement()));
// AtomicReference!(AsyncResult!(RowSet)) queryAfterFailed = new AtomicReference<>();
// AtomicReference!(AsyncResult!(Void)) commit = new AtomicReference<>();
// conn.query("INSERT INTO Test (id, val) VALUES (1, 'val-1')", ar1 -> { });
// conn.query("INSERT INTO Test (id, val) VALUES (1, 'val-2')", ar2 -> {
// ctx.assertNotNull(queryAfterFailed.get());
// ctx.assertTrue(queryAfterFailed.get().failed());
// ctx.assertNotNull(commit.get());
// ctx.assertTrue(commit.get().failed());
// ctx.assertTrue(ar2.failed());
// ctx.assertEquals(1, failures.get());
// // This query won't be made in the same TX
// conn.query("SELECT id FROM Test WHERE id=1", ctx.asyncAssertSuccess(result -> {
// ctx.assertEquals(0, result.size());
// done.complete();
// }));
// });
// conn.query("SELECT id FROM Test", queryAfterFailed::set);
// tx.commit(commit::set);
// });
// }));
// }
}
| D |
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Console.build/Terminal/ConsoleColor+Terminal.swift.o : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Swift3.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/String+ANSI.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Utilities/Bool+Polymorphic.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/Terminal+Command.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Command.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Runnable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Style/Console+ConsoleStyle.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Style/ConsoleStyle.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Value.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Ask.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/ConsoleColor+Terminal.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/Terminal.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Ephemeral.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/ConsoleProtocol.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Stream/FileHandle+Stream.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Stream/Pipe+Stream.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Stream/Stream.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Utilities/String+Trim.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Confirm.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Option.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Run.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Group.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Bar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Loading/Console+LoadingBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Loading/LoadingBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Progress/Console+ProgressBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Progress/ProgressBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Clear/ConsoleClear.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Center.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Color/ConsoleColor.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/ConsoleError.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Options.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Argument.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Command+Print.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Print.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Console.build/ConsoleColor+Terminal~partial.swiftmodule : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Swift3.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/String+ANSI.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Utilities/Bool+Polymorphic.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/Terminal+Command.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Command.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Runnable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Style/Console+ConsoleStyle.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Style/ConsoleStyle.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Value.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Ask.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/ConsoleColor+Terminal.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/Terminal.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Ephemeral.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/ConsoleProtocol.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Stream/FileHandle+Stream.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Stream/Pipe+Stream.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Stream/Stream.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Utilities/String+Trim.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Confirm.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Option.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Run.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Group.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Bar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Loading/Console+LoadingBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Loading/LoadingBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Progress/Console+ProgressBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Progress/ProgressBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Clear/ConsoleClear.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Center.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Color/ConsoleColor.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/ConsoleError.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Options.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Argument.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Command+Print.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Print.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Console.build/ConsoleColor+Terminal~partial.swiftdoc : /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Swift3.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/String+ANSI.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Utilities/Bool+Polymorphic.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/Terminal+Command.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Command.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Runnable.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Style/Console+ConsoleStyle.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Style/ConsoleStyle.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Value.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Ask.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/ConsoleColor+Terminal.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Terminal/Terminal.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Ephemeral.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/ConsoleProtocol.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Stream/FileHandle+Stream.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Stream/Pipe+Stream.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Stream/Stream.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Utilities/String+Trim.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Confirm.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Option.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Run.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Group.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Bar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Loading/Console+LoadingBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Loading/LoadingBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Progress/Console+ProgressBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Bar/Progress/ProgressBar.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Clear/ConsoleClear.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Center.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Color/ConsoleColor.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/ConsoleError.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Options.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Argument.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Command/Command+Print.swift /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/checkouts/console.git--2431895819212044213/Sources/Console/Console/Console+Print.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/AleixDiaz/Desktop/VaporProject/LaSalleChat/.build/x86_64-apple-macosx10.10/debug/CSQLite.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
| D |
// Written in the D programming language.
/**
$(RED Warning: This module is considered out-dated and not up to Phobos'
current standards. It will remain until we have a suitable replacement,
but be aware that it will not remain long term.)
Classes and functions for creating and parsing XML
The basic architecture of this module is that there are standalone functions,
classes for constructing an XML document from scratch (Tag, Element and
Document), and also classes for parsing a pre-existing XML file (ElementParser
and DocumentParser). The parsing classes <i>may</i> be used to build a
Document, but that is not their primary purpose. The handling capabilities of
DocumentParser and ElementParser are sufficiently customizable that you can
make them do pretty much whatever you want.
Example: This example creates a DOM (Document Object Model) tree
from an XML file.
------------------------------------------------------------------------------
import std.xml;
import std.stdio;
import std.string;
import std.file;
// books.xml is used in various samples throughout the Microsoft XML Core
// Services (MSXML) SDK.
//
// See http://msdn2.microsoft.com/en-us/library/ms762271(VS.85).aspx
void main()
{
string s = cast(string)std.file.read("books.xml");
// Check for well-formedness
check(s);
// Make a DOM tree
auto doc = new Document(s);
// Plain-print it
writeln(doc);
}
------------------------------------------------------------------------------
Example: This example does much the same thing, except that the file is
deconstructed and reconstructed by hand. This is more work, but the
techniques involved offer vastly more power.
------------------------------------------------------------------------------
import std.xml;
import std.stdio;
import std.string;
struct Book
{
string id;
string author;
string title;
string genre;
string price;
string pubDate;
string description;
}
void main()
{
string s = cast(string)std.file.read("books.xml");
// Check for well-formedness
check(s);
// Take it apart
Book[] books;
auto xml = new DocumentParser(s);
xml.onStartTag["book"] = (ElementParser xml)
{
Book book;
book.id = xml.tag.attr["id"];
xml.onEndTag["author"] = (in Element e) { book.author = e.text(); };
xml.onEndTag["title"] = (in Element e) { book.title = e.text(); };
xml.onEndTag["genre"] = (in Element e) { book.genre = e.text(); };
xml.onEndTag["price"] = (in Element e) { book.price = e.text(); };
xml.onEndTag["publish-date"] = (in Element e) { book.pubDate = e.text(); };
xml.onEndTag["description"] = (in Element e) { book.description = e.text(); };
xml.parse();
books ~= book;
};
xml.parse();
// Put it back together again;
auto doc = new Document(new Tag("catalog"));
foreach (book;books)
{
auto element = new Element("book");
element.tag.attr["id"] = book.id;
element ~= new Element("author", book.author);
element ~= new Element("title", book.title);
element ~= new Element("genre", book.genre);
element ~= new Element("price", book.price);
element ~= new Element("publish-date",book.pubDate);
element ~= new Element("description", book.description);
doc ~= element;
}
// Pretty-print it
writefln(join(doc.pretty(3),"\n"));
}
-------------------------------------------------------------------------------
Macros:
WIKI=Phobos/StdXml
Copyright: Copyright Janice Caron 2008 - 2009.
License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Janice Caron
Source: $(PHOBOSSRC std/_xml.d)
*/
/*
Copyright Janice Caron 2008 - 2009.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
module std.xml;
import std.algorithm : count, startsWith;
import std.array;
import std.ascii;
import std.string;
import std.encoding;
enum cdata = "<![CDATA[";
/**
* Returns true if the character is a character according to the XML standard
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Params:
* c = the character to be tested
*/
bool isChar(dchar c) // rule 2
{
if (c <= 0xD7FF)
{
if (c >= 0x20)
return true;
switch (c)
{
case 0xA:
case 0x9:
case 0xD:
return true;
default:
return false;
}
}
else if (0xE000 <= c && c <= 0x10FFFF)
{
if ((c & 0x1FFFFE) != 0xFFFE) // U+FFFE and U+FFFF
return true;
}
return false;
}
unittest
{
// const CharTable=[0x9,0x9,0xA,0xA,0xD,0xD,0x20,0xD7FF,0xE000,0xFFFD,
// 0x10000,0x10FFFF];
assert(!isChar(cast(dchar)0x8));
assert( isChar(cast(dchar)0x9));
assert( isChar(cast(dchar)0xA));
assert(!isChar(cast(dchar)0xB));
assert(!isChar(cast(dchar)0xC));
assert( isChar(cast(dchar)0xD));
assert(!isChar(cast(dchar)0xE));
assert(!isChar(cast(dchar)0x1F));
assert( isChar(cast(dchar)0x20));
assert( isChar('J'));
assert( isChar(cast(dchar)0xD7FF));
assert(!isChar(cast(dchar)0xD800));
assert(!isChar(cast(dchar)0xDFFF));
assert( isChar(cast(dchar)0xE000));
assert( isChar(cast(dchar)0xFFFD));
assert(!isChar(cast(dchar)0xFFFE));
assert(!isChar(cast(dchar)0xFFFF));
assert( isChar(cast(dchar)0x10000));
assert( isChar(cast(dchar)0x10FFFF));
assert(!isChar(cast(dchar)0x110000));
debug (stdxml_TestHardcodedChecks)
{
foreach (c; 0 .. dchar.max + 1)
assert(isChar(c) == lookup(CharTable, c));
}
}
/**
* Returns true if the character is whitespace according to the XML standard
*
* Only the following characters are considered whitespace in XML - space, tab,
* carriage return and linefeed
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Params:
* c = the character to be tested
*/
bool isSpace(dchar c)
{
return c == '\u0020' || c == '\u0009' || c == '\u000A' || c == '\u000D';
}
/**
* Returns true if the character is a digit according to the XML standard
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Params:
* c = the character to be tested
*/
bool isDigit(dchar c)
{
if (c <= 0x0039 && c >= 0x0030)
return true;
else
return lookup(DigitTable,c);
}
unittest
{
debug (stdxml_TestHardcodedChecks)
{
foreach (c; 0 .. dchar.max + 1)
assert(isDigit(c) == lookup(DigitTable, c));
}
}
/**
* Returns true if the character is a letter according to the XML standard
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Params:
* c = the character to be tested
*/
bool isLetter(dchar c) // rule 84
{
return isIdeographic(c) || isBaseChar(c);
}
/**
* Returns true if the character is an ideographic character according to the
* XML standard
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Params:
* c = the character to be tested
*/
bool isIdeographic(dchar c)
{
if (c == 0x3007)
return true;
if (c <= 0x3029 && c >= 0x3021 )
return true;
if (c <= 0x9FA5 && c >= 0x4E00)
return true;
return false;
}
unittest
{
assert(isIdeographic('\u4E00'));
assert(isIdeographic('\u9FA5'));
assert(isIdeographic('\u3007'));
assert(isIdeographic('\u3021'));
assert(isIdeographic('\u3029'));
debug (stdxml_TestHardcodedChecks)
{
foreach (c; 0 .. dchar.max + 1)
assert(isIdeographic(c) == lookup(IdeographicTable, c));
}
}
/**
* Returns true if the character is a base character according to the XML
* standard
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Params:
* c = the character to be tested
*/
bool isBaseChar(dchar c)
{
return lookup(BaseCharTable,c);
}
/**
* Returns true if the character is a combining character according to the
* XML standard
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Params:
* c = the character to be tested
*/
bool isCombiningChar(dchar c)
{
return lookup(CombiningCharTable,c);
}
/**
* Returns true if the character is an extender according to the XML standard
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Params:
* c = the character to be tested
*/
bool isExtender(dchar c)
{
return lookup(ExtenderTable,c);
}
/**
* Encodes a string by replacing all characters which need to be escaped with
* appropriate predefined XML entities.
*
* encode() escapes certain characters (ampersand, quote, apostrophe, less-than
* and greater-than), and similarly, decode() unescapes them. These functions
* are provided for convenience only. You do not need to use them when using
* the std.xml classes, because then all the encoding and decoding will be done
* for you automatically.
*
* If the string is not modified, the original will be returned.
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Params:
* s = The string to be encoded
*
* Returns: The encoded string
*
* Example:
* --------------
* writefln(encode("a > b")); // writes "a > b"
* --------------
*/
S encode(S)(S s)
{
string r;
size_t lastI;
auto result = appender!S();
foreach (i, c; s)
{
switch (c)
{
case '&': r = "&"; break;
case '"': r = """; break;
case '\'': r = "'"; break;
case '<': r = "<"; break;
case '>': r = ">"; break;
default: continue;
}
// Replace with r
result.put(s[lastI .. i]);
result.put(r);
lastI = i + 1;
}
if (!result.data.ptr) return s;
result.put(s[lastI .. $]);
return result.data;
}
unittest
{
auto s = "hello";
assert(encode(s) is s);
assert(encode("a > b") == "a > b", encode("a > b"));
assert(encode("a < b") == "a < b");
assert(encode("don't") == "don't");
assert(encode("\"hi\"") == ""hi"", encode("\"hi\""));
assert(encode("cat & dog") == "cat & dog");
}
/**
* Mode to use for decoding.
*
* $(DDOC_ENUM_MEMBERS NONE) Do not decode
* $(DDOC_ENUM_MEMBERS LOOSE) Decode, but ignore errors
* $(DDOC_ENUM_MEMBERS STRICT) Decode, and throw exception on error
*/
enum DecodeMode
{
NONE, LOOSE, STRICT
}
/**
* Decodes a string by unescaping all predefined XML entities.
*
* encode() escapes certain characters (ampersand, quote, apostrophe, less-than
* and greater-than), and similarly, decode() unescapes them. These functions
* are provided for convenience only. You do not need to use them when using
* the std.xml classes, because then all the encoding and decoding will be done
* for you automatically.
*
* This function decodes the entities &amp;, &quot;, &apos;,
* &lt; and &gt,
* as well as decimal and hexadecimal entities such as &#x20AC;
*
* If the string does not contain an ampersand, the original will be returned.
*
* Note that the "mode" parameter can be one of DecodeMode.NONE (do not
* decode), DecodeMode.LOOSE (decode, but ignore errors), or DecodeMode.STRICT
* (decode, and throw a DecodeException in the event of an error).
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Params:
* s = The string to be decoded
* mode = (optional) Mode to use for decoding. (Defaults to LOOSE).
*
* Throws: DecodeException if mode == DecodeMode.STRICT and decode fails
*
* Returns: The decoded string
*
* Example:
* --------------
* writefln(decode("a > b")); // writes "a > b"
* --------------
*/
string decode(string s, DecodeMode mode=DecodeMode.LOOSE)
{
if (mode == DecodeMode.NONE) return s;
char[] buffer;
foreach (ref i; 0 .. s.length)
{
char c = s[i];
if (c != '&')
{
if (buffer.length != 0) buffer ~= c;
}
else
{
if (buffer.length == 0)
{
buffer = s[0 .. i].dup;
}
if (startsWith(s[i..$],"&#"))
{
try
{
dchar d;
string t = s[i..$];
checkCharRef(t, d);
char[4] temp;
import std.utf : encode;
buffer ~= temp[0 .. encode(temp, d)];
i = s.length - t.length - 1;
}
catch(Err e)
{
if (mode == DecodeMode.STRICT)
throw new DecodeException("Unescaped &");
buffer ~= '&';
}
}
else if (startsWith(s[i..$],"&" )) { buffer ~= '&'; i += 4; }
else if (startsWith(s[i..$],""")) { buffer ~= '"'; i += 5; }
else if (startsWith(s[i..$],"'")) { buffer ~= '\''; i += 5; }
else if (startsWith(s[i..$],"<" )) { buffer ~= '<'; i += 3; }
else if (startsWith(s[i..$],">" )) { buffer ~= '>'; i += 3; }
else
{
if (mode == DecodeMode.STRICT)
throw new DecodeException("Unescaped &");
buffer ~= '&';
}
}
}
return (buffer.length == 0) ? s : cast(string)buffer;
}
unittest
{
void assertNot(string s)
{
bool b = false;
try { decode(s,DecodeMode.STRICT); }
catch (DecodeException e) { b = true; }
assert(b,s);
}
// Assert that things that should work, do
auto s = "hello";
assert(decode(s, DecodeMode.STRICT) is s);
assert(decode("a > b", DecodeMode.STRICT) == "a > b");
assert(decode("a < b", DecodeMode.STRICT) == "a < b");
assert(decode("don't", DecodeMode.STRICT) == "don't");
assert(decode(""hi"", DecodeMode.STRICT) == "\"hi\"");
assert(decode("cat & dog", DecodeMode.STRICT) == "cat & dog");
assert(decode("*", DecodeMode.STRICT) == "*");
assert(decode("*", DecodeMode.STRICT) == "*");
assert(decode("cat & dog", DecodeMode.LOOSE) == "cat & dog");
assert(decode("a > b", DecodeMode.LOOSE) == "a > b");
assert(decode("&#;", DecodeMode.LOOSE) == "&#;");
assert(decode("&#x;", DecodeMode.LOOSE) == "&#x;");
assert(decode("G;", DecodeMode.LOOSE) == "G;");
assert(decode("G;", DecodeMode.LOOSE) == "G;");
// Assert that things that shouldn't work, don't
assertNot("cat & dog");
assertNot("a > b");
assertNot("&#;");
assertNot("&#x;");
assertNot("G;");
assertNot("G;");
}
/**
* Class representing an XML document.
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
*/
class Document : Element
{
/**
* Contains all text which occurs before the root element.
* Defaults to <?xml version="1.0"?>
*/
string prolog = "<?xml version=\"1.0\"?>";
/**
* Contains all text which occurs after the root element.
* Defaults to the empty string
*/
string epilog;
/**
* Constructs a Document by parsing XML text.
*
* This function creates a complete DOM (Document Object Model) tree.
*
* The input to this function MUST be valid XML.
* This is enforced by DocumentParser's in contract.
*
* Params:
* s = the complete XML text.
*/
this(string s)
in
{
assert(s.length != 0);
}
body
{
auto xml = new DocumentParser(s);
string tagString = xml.tag.tagString;
this(xml.tag);
prolog = s[0 .. tagString.ptr - s.ptr];
parse(xml);
epilog = *xml.s;
}
/**
* Constructs a Document from a Tag.
*
* Params:
* tag = the start tag of the document.
*/
this(const(Tag) tag)
{
super(tag);
}
const
{
/**
* Compares two Documents for equality
*
* Example:
* --------------
* Document d1,d2;
* if (d1 == d2) { }
* --------------
*/
override bool opEquals(Object o)
{
const doc = toType!(const Document)(o);
return prolog == doc.prolog
&& (cast()this).Element.opEquals(cast()doc)
&& epilog == doc.epilog;
}
/**
* Compares two Documents
*
* You should rarely need to call this function. It exists so that
* Documents can be used as associative array keys.
*
* Example:
* --------------
* Document d1,d2;
* if (d1 < d2) { }
* --------------
*/
override int opCmp(Object o)
{
const doc = toType!(const Document)(o);
if (prolog != doc.prolog)
return prolog < doc.prolog ? -1 : 1;
if (int cmp = (cast()this).Element.opCmp(cast()doc))
return cmp;
if (epilog != doc.epilog)
return epilog < doc.epilog ? -1 : 1;
return 0;
}
/**
* Returns the hash of a Document
*
* You should rarely need to call this function. It exists so that
* Documents can be used as associative array keys.
*/
override size_t toHash() @trusted
{
return hash(prolog, hash(epilog, (cast()this).Element.toHash()));
}
/**
* Returns the string representation of a Document. (That is, the
* complete XML of a document).
*/
override string toString()
{
return prolog ~ super.toString() ~ epilog;
}
}
}
unittest
{
// https://issues.dlang.org/show_bug.cgi?id=14966
auto xml = `<?xml version="1.0" encoding="UTF-8"?><foo></foo>`;
auto a = new Document(xml);
auto b = new Document(xml);
assert(a == b);
assert(!(a < b));
int[Document] aa;
aa[a] = 1;
assert(aa[b] == 1);
b ~= new Element("b");
assert(a < b);
assert(b > a);
}
/**
* Class representing an XML element.
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*/
class Element : Item
{
Tag tag; /// The start tag of the element
Item[] items; /// The element's items
Text[] texts; /// The element's text items
CData[] cdatas; /// The element's CData items
Comment[] comments; /// The element's comments
ProcessingInstruction[] pis; /// The element's processing instructions
Element[] elements; /// The element's child elements
/**
* Constructs an Element given a name and a string to be used as a Text
* interior.
*
* Params:
* name = the name of the element.
* interior = (optional) the string interior.
*
* Example:
* -------------------------------------------------------
* auto element = new Element("title","Serenity")
* // constructs the element <title>Serenity</title>
* -------------------------------------------------------
*/
this(string name, string interior=null)
{
this(new Tag(name));
if (interior.length != 0) opCatAssign(new Text(interior));
}
/**
* Constructs an Element from a Tag.
*
* Params:
* tag_ = the start or empty tag of the element.
*/
this(const(Tag) tag_)
{
this.tag = new Tag(tag_.name);
tag.type = TagType.EMPTY;
foreach (k,v;tag_.attr) tag.attr[k] = v;
tag.tagString = tag_.tagString;
}
/**
* Append a text item to the interior of this element
*
* Params:
* item = the item you wish to append.
*
* Example:
* --------------
* Element element;
* element ~= new Text("hello");
* --------------
*/
void opCatAssign(Text item)
{
texts ~= item;
appendItem(item);
}
/**
* Append a CData item to the interior of this element
*
* Params:
* item = the item you wish to append.
*
* Example:
* --------------
* Element element;
* element ~= new CData("hello");
* --------------
*/
void opCatAssign(CData item)
{
cdatas ~= item;
appendItem(item);
}
/**
* Append a comment to the interior of this element
*
* Params:
* item = the item you wish to append.
*
* Example:
* --------------
* Element element;
* element ~= new Comment("hello");
* --------------
*/
void opCatAssign(Comment item)
{
comments ~= item;
appendItem(item);
}
/**
* Append a processing instruction to the interior of this element
*
* Params:
* item = the item you wish to append.
*
* Example:
* --------------
* Element element;
* element ~= new ProcessingInstruction("hello");
* --------------
*/
void opCatAssign(ProcessingInstruction item)
{
pis ~= item;
appendItem(item);
}
/**
* Append a complete element to the interior of this element
*
* Params:
* item = the item you wish to append.
*
* Example:
* --------------
* Element element;
* Element other = new Element("br");
* element ~= other;
* // appends element representing <br />
* --------------
*/
void opCatAssign(Element item)
{
elements ~= item;
appendItem(item);
}
private void appendItem(Item item)
{
items ~= item;
if (tag.type == TagType.EMPTY && !item.isEmptyXML)
tag.type = TagType.START;
}
private void parse(ElementParser xml)
{
xml.onText = (string s) { opCatAssign(new Text(s)); };
xml.onCData = (string s) { opCatAssign(new CData(s)); };
xml.onComment = (string s) { opCatAssign(new Comment(s)); };
xml.onPI = (string s) { opCatAssign(new ProcessingInstruction(s)); };
xml.onStartTag[null] = (ElementParser xml)
{
auto e = new Element(xml.tag);
e.parse(xml);
opCatAssign(e);
};
xml.parse();
}
/**
* Compares two Elements for equality
*
* Example:
* --------------
* Element e1,e2;
* if (e1 == e2) { }
* --------------
*/
override bool opEquals(Object o)
{
const element = toType!(const Element)(o);
auto len = items.length;
if (len != element.items.length) return false;
foreach (i; 0 .. len)
{
if (!items[i].opEquals(cast()element.items[i])) return false;
}
return true;
}
/**
* Compares two Elements
*
* You should rarely need to call this function. It exists so that Elements
* can be used as associative array keys.
*
* Example:
* --------------
* Element e1,e2;
* if (e1 < e2) { }
* --------------
*/
override int opCmp(Object o)
{
const element = toType!(const Element)(o);
for (uint i=0; ; ++i)
{
if (i == items.length && i == element.items.length) return 0;
if (i == items.length) return -1;
if (i == element.items.length) return 1;
if (items[i] != element.items[i])
return items[i].opCmp(cast()element.items[i]);
}
}
/**
* Returns the hash of an Element
*
* You should rarely need to call this function. It exists so that Elements
* can be used as associative array keys.
*/
override size_t toHash() const
{
size_t hash = tag.toHash();
foreach (item;items) hash += item.toHash();
return hash;
}
const
{
/**
* Returns the decoded interior of an element.
*
* The element is assumed to contain text <i>only</i>. So, for
* example, given XML such as "<title>Good &amp;
* Bad</title>", will return "Good & Bad".
*
* Params:
* mode = (optional) Mode to use for decoding. (Defaults to LOOSE).
*
* Throws: DecodeException if decode fails
*/
string text(DecodeMode mode=DecodeMode.LOOSE)
{
string buffer;
foreach (item;items)
{
Text t = cast(Text)item;
if (t is null) throw new DecodeException(item.toString());
buffer ~= decode(t.toString(),mode);
}
return buffer;
}
/**
* Returns an indented string representation of this item
*
* Params:
* indent = (optional) number of spaces by which to indent this
* element. Defaults to 2.
*/
override string[] pretty(uint indent=2)
{
if (isEmptyXML) return [ tag.toEmptyString() ];
if (items.length == 1)
{
Text t = cast(Text)(items[0]);
if (t !is null)
{
return [tag.toStartString() ~ t.toString() ~ tag.toEndString()];
}
}
string[] a = [ tag.toStartString() ];
foreach (item;items)
{
string[] b = item.pretty(indent);
foreach (s;b)
{
a ~= rightJustify(s,count(s) + indent);
}
}
a ~= tag.toEndString();
return a;
}
/**
* Returns the string representation of an Element
*
* Example:
* --------------
* auto element = new Element("br");
* writefln(element.toString()); // writes "<br />"
* --------------
*/
override string toString()
{
if (isEmptyXML) return tag.toEmptyString();
string buffer = tag.toStartString();
foreach (item;items) { buffer ~= item.toString(); }
buffer ~= tag.toEndString();
return buffer;
}
override @property bool isEmptyXML() { return items.length == 0; }
}
}
/**
* Tag types.
*
* $(DDOC_ENUM_MEMBERS START) Used for start tags
* $(DDOC_ENUM_MEMBERS END) Used for end tags
* $(DDOC_ENUM_MEMBERS EMPTY) Used for empty tags
*
*/
enum TagType { START, END, EMPTY }
/**
* Class representing an XML tag.
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* The class invariant guarantees
* <ul>
* <li> that $(B type) is a valid enum TagType value</li>
* <li> that $(B name) consists of valid characters</li>
* <li> that each attribute name consists of valid characters</li>
* </ul>
*/
class Tag
{
TagType type = TagType.START; /// Type of tag
string name; /// Tag name
string[string] attr; /// Associative array of attributes
private string tagString;
invariant()
{
string s;
string t;
assert(type == TagType.START
|| type == TagType.END
|| type == TagType.EMPTY);
s = name;
try { checkName(s,t); }
catch(Err e) { assert(false,"Invalid tag name:" ~ e.toString()); }
foreach (k,v;attr)
{
s = k;
try { checkName(s,t); }
catch(Err e)
{ assert(false,"Invalid atrribute name:" ~ e.toString()); }
}
}
/**
* Constructs an instance of Tag with a specified name and type
*
* The constructor does not initialize the attributes. To initialize the
* attributes, you access the $(B attr) member variable.
*
* Params:
* name = the Tag's name
* type = (optional) the Tag's type. If omitted, defaults to
* TagType.START.
*
* Example:
* --------------
* auto tag = new Tag("img",Tag.EMPTY);
* tag.attr["src"] = "http://example.com/example.jpg";
* --------------
*/
this(string name, TagType type=TagType.START)
{
this.name = name;
this.type = type;
}
/* Private constructor (so don't ddoc this!)
*
* Constructs a Tag by parsing the string representation, e.g. "<html>".
*
* The string is passed by reference, and is advanced over all characters
* consumed.
*
* The second parameter is a dummy parameter only, required solely to
* distinguish this constructor from the public one.
*/
private this(ref string s, bool dummy)
{
tagString = s;
try
{
reqc(s,'<');
if (optc(s,'/')) type = TagType.END;
name = munch(s,"^/>"~whitespace);
munch(s,whitespace);
while (s.length > 0 && s[0] != '>' && s[0] != '/')
{
string key = munch(s,"^="~whitespace);
munch(s,whitespace);
reqc(s,'=');
munch(s,whitespace);
reqc(s,'"');
string val = decode(munch(s,"^\""), DecodeMode.LOOSE);
reqc(s,'"');
munch(s,whitespace);
attr[key] = val;
}
if (optc(s,'/'))
{
if (type == TagType.END) throw new TagException("");
type = TagType.EMPTY;
}
reqc(s,'>');
tagString.length = (s.ptr - tagString.ptr);
}
catch(XMLException e)
{
tagString.length = (s.ptr - tagString.ptr);
throw new TagException(tagString);
}
}
const
{
/**
* Compares two Tags for equality
*
* You should rarely need to call this function. It exists so that Tags
* can be used as associative array keys.
*
* Example:
* --------------
* Tag tag1,tag2
* if (tag1 == tag2) { }
* --------------
*/
override bool opEquals(Object o)
{
const tag = toType!(const Tag)(o);
return
(name != tag.name) ? false : (
(attr != tag.attr) ? false : (
(type != tag.type) ? false : (
true )));
}
/**
* Compares two Tags
*
* Example:
* --------------
* Tag tag1,tag2
* if (tag1 < tag2) { }
* --------------
*/
override int opCmp(Object o)
{
const tag = toType!(const Tag)(o);
// Note that attr is an AA, so the comparison is nonsensical (bug 10381)
return
((name != tag.name) ? ( name < tag.name ? -1 : 1 ) :
((attr != tag.attr) ? ( cast(void *)attr < cast(void*)tag.attr ? -1 : 1 ) :
((type != tag.type) ? ( type < tag.type ? -1 : 1 ) :
0 )));
}
/**
* Returns the hash of a Tag
*
* You should rarely need to call this function. It exists so that Tags
* can be used as associative array keys.
*/
override size_t toHash()
{
return typeid(name).getHash(&name);
}
/**
* Returns the string representation of a Tag
*
* Example:
* --------------
* auto tag = new Tag("book",TagType.START);
* writefln(tag.toString()); // writes "<book>"
* --------------
*/
override string toString()
{
if (isEmpty) return toEmptyString();
return (isEnd) ? toEndString() : toStartString();
}
private
{
string toNonEndString()
{
string s = "<" ~ name;
foreach (key,val;attr)
s ~= format(" %s=\"%s\"",key,encode(val));
return s;
}
string toStartString() { return toNonEndString() ~ ">"; }
string toEndString() { return "</" ~ name ~ ">"; }
string toEmptyString() { return toNonEndString() ~ " />"; }
}
/**
* Returns true if the Tag is a start tag
*
* Example:
* --------------
* if (tag.isStart) { }
* --------------
*/
@property bool isStart() { return type == TagType.START; }
/**
* Returns true if the Tag is an end tag
*
* Example:
* --------------
* if (tag.isEnd) { }
* --------------
*/
@property bool isEnd() { return type == TagType.END; }
/**
* Returns true if the Tag is an empty tag
*
* Example:
* --------------
* if (tag.isEmpty) { }
* --------------
*/
@property bool isEmpty() { return type == TagType.EMPTY; }
}
}
/**
* Class representing a comment
*/
class Comment : Item
{
private string content;
/**
* Construct a comment
*
* Params:
* content = the body of the comment
*
* Throws: CommentException if the comment body is illegal (contains "--"
* or exactly equals "-")
*
* Example:
* --------------
* auto item = new Comment("This is a comment");
* // constructs <!--This is a comment-->
* --------------
*/
this(string content)
{
if (content == "-" || content.indexOf("==") != -1)
throw new CommentException(content);
this.content = content;
}
/**
* Compares two comments for equality
*
* Example:
* --------------
* Comment item1,item2;
* if (item1 == item2) { }
* --------------
*/
override bool opEquals(Object o)
{
const item = toType!(const Item)(o);
const t = cast(Comment)item;
return t !is null && content == t.content;
}
/**
* Compares two comments
*
* You should rarely need to call this function. It exists so that Comments
* can be used as associative array keys.
*
* Example:
* --------------
* Comment item1,item2;
* if (item1 < item2) { }
* --------------
*/
override int opCmp(Object o)
{
const item = toType!(const Item)(o);
const t = cast(Comment)item;
return t !is null && (content != t.content
? (content < t.content ? -1 : 1 ) : 0 );
}
/**
* Returns the hash of a Comment
*
* You should rarely need to call this function. It exists so that Comments
* can be used as associative array keys.
*/
override size_t toHash() const { return hash(content); }
/**
* Returns a string representation of this comment
*/
override string toString() const { return "<!--" ~ content ~ "-->"; }
override @property bool isEmptyXML() const { return false; } /// Returns false always
}
/**
* Class representing a Character Data section
*/
class CData : Item
{
private string content;
/**
* Construct a character data section
*
* Params:
* content = the body of the character data segment
*
* Throws: CDataException if the segment body is illegal (contains "]]>")
*
* Example:
* --------------
* auto item = new CData("<b>hello</b>");
* // constructs <![CDATA[<b>hello</b>]]>
* --------------
*/
this(string content)
{
if (content.indexOf("]]>") != -1) throw new CDataException(content);
this.content = content;
}
/**
* Compares two CDatas for equality
*
* Example:
* --------------
* CData item1,item2;
* if (item1 == item2) { }
* --------------
*/
override bool opEquals(Object o)
{
const item = toType!(const Item)(o);
const t = cast(CData)item;
return t !is null && content == t.content;
}
/**
* Compares two CDatas
*
* You should rarely need to call this function. It exists so that CDatas
* can be used as associative array keys.
*
* Example:
* --------------
* CData item1,item2;
* if (item1 < item2) { }
* --------------
*/
override int opCmp(Object o)
{
const item = toType!(const Item)(o);
const t = cast(CData)item;
return t !is null && (content != t.content
? (content < t.content ? -1 : 1 ) : 0 );
}
/**
* Returns the hash of a CData
*
* You should rarely need to call this function. It exists so that CDatas
* can be used as associative array keys.
*/
override size_t toHash() const { return hash(content); }
/**
* Returns a string representation of this CData section
*/
override string toString() const { return cdata ~ content ~ "]]>"; }
override @property bool isEmptyXML() const { return false; } /// Returns false always
}
/**
* Class representing a text (aka Parsed Character Data) section
*/
class Text : Item
{
private string content;
/**
* Construct a text (aka PCData) section
*
* Params:
* content = the text. This function encodes the text before
* insertion, so it is safe to insert any text
*
* Example:
* --------------
* auto Text = new CData("a < b");
* // constructs a < b
* --------------
*/
this(string content)
{
this.content = encode(content);
}
/**
* Compares two text sections for equality
*
* Example:
* --------------
* Text item1,item2;
* if (item1 == item2) { }
* --------------
*/
override bool opEquals(Object o)
{
const item = toType!(const Item)(o);
const t = cast(Text)item;
return t !is null && content == t.content;
}
/**
* Compares two text sections
*
* You should rarely need to call this function. It exists so that Texts
* can be used as associative array keys.
*
* Example:
* --------------
* Text item1,item2;
* if (item1 < item2) { }
* --------------
*/
override int opCmp(Object o)
{
const item = toType!(const Item)(o);
const t = cast(Text)item;
return t !is null
&& (content != t.content ? (content < t.content ? -1 : 1 ) : 0 );
}
/**
* Returns the hash of a text section
*
* You should rarely need to call this function. It exists so that Texts
* can be used as associative array keys.
*/
override size_t toHash() const { return hash(content); }
/**
* Returns a string representation of this Text section
*/
override string toString() const { return content; }
/**
* Returns true if the content is the empty string
*/
override @property bool isEmptyXML() const { return content.length == 0; }
}
/**
* Class representing an XML Instruction section
*/
class XMLInstruction : Item
{
private string content;
/**
* Construct an XML Instruction section
*
* Params:
* content = the body of the instruction segment
*
* Throws: XIException if the segment body is illegal (contains ">")
*
* Example:
* --------------
* auto item = new XMLInstruction("ATTLIST");
* // constructs <!ATTLIST>
* --------------
*/
this(string content)
{
if (content.indexOf(">") != -1) throw new XIException(content);
this.content = content;
}
/**
* Compares two XML instructions for equality
*
* Example:
* --------------
* XMLInstruction item1,item2;
* if (item1 == item2) { }
* --------------
*/
override bool opEquals(Object o)
{
const item = toType!(const Item)(o);
const t = cast(XMLInstruction)item;
return t !is null && content == t.content;
}
/**
* Compares two XML instructions
*
* You should rarely need to call this function. It exists so that
* XmlInstructions can be used as associative array keys.
*
* Example:
* --------------
* XMLInstruction item1,item2;
* if (item1 < item2) { }
* --------------
*/
override int opCmp(Object o)
{
const item = toType!(const Item)(o);
const t = cast(XMLInstruction)item;
return t !is null
&& (content != t.content ? (content < t.content ? -1 : 1 ) : 0 );
}
/**
* Returns the hash of an XMLInstruction
*
* You should rarely need to call this function. It exists so that
* XmlInstructions can be used as associative array keys.
*/
override size_t toHash() const { return hash(content); }
/**
* Returns a string representation of this XmlInstruction
*/
override string toString() const { return "<!" ~ content ~ ">"; }
override @property bool isEmptyXML() const { return false; } /// Returns false always
}
/**
* Class representing a Processing Instruction section
*/
class ProcessingInstruction : Item
{
private string content;
/**
* Construct a Processing Instruction section
*
* Params:
* content = the body of the instruction segment
*
* Throws: PIException if the segment body is illegal (contains "?>")
*
* Example:
* --------------
* auto item = new ProcessingInstruction("php");
* // constructs <?php?>
* --------------
*/
this(string content)
{
if (content.indexOf("?>") != -1) throw new PIException(content);
this.content = content;
}
/**
* Compares two processing instructions for equality
*
* Example:
* --------------
* ProcessingInstruction item1,item2;
* if (item1 == item2) { }
* --------------
*/
override bool opEquals(Object o)
{
const item = toType!(const Item)(o);
const t = cast(ProcessingInstruction)item;
return t !is null && content == t.content;
}
/**
* Compares two processing instructions
*
* You should rarely need to call this function. It exists so that
* ProcessingInstructions can be used as associative array keys.
*
* Example:
* --------------
* ProcessingInstruction item1,item2;
* if (item1 < item2) { }
* --------------
*/
override int opCmp(Object o)
{
const item = toType!(const Item)(o);
const t = cast(ProcessingInstruction)item;
return t !is null
&& (content != t.content ? (content < t.content ? -1 : 1 ) : 0 );
}
/**
* Returns the hash of a ProcessingInstruction
*
* You should rarely need to call this function. It exists so that
* ProcessingInstructions can be used as associative array keys.
*/
override size_t toHash() const { return hash(content); }
/**
* Returns a string representation of this ProcessingInstruction
*/
override string toString() const { return "<?" ~ content ~ "?>"; }
override @property bool isEmptyXML() const { return false; } /// Returns false always
}
/**
* Abstract base class for XML items
*/
abstract class Item
{
/// Compares with another Item of same type for equality
abstract override bool opEquals(Object o);
/// Compares with another Item of same type
abstract override int opCmp(Object o);
/// Returns the hash of this item
abstract override size_t toHash() const;
/// Returns a string representation of this item
abstract override string toString() const;
/**
* Returns an indented string representation of this item
*
* Params:
* indent = number of spaces by which to indent child elements
*/
string[] pretty(uint indent) const
{
string s = strip(toString());
return s.length == 0 ? [] : [ s ];
}
/// Returns true if the item represents empty XML text
abstract @property bool isEmptyXML() const;
}
/**
* Class for parsing an XML Document.
*
* This is a subclass of ElementParser. Most of the useful functions are
* documented there.
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Bugs:
* Currently only supports UTF documents.
*
* If there is an encoding attribute in the prolog, it is ignored.
*
*/
class DocumentParser : ElementParser
{
string xmlText;
/**
* Constructs a DocumentParser.
*
* The input to this function MUST be valid XML.
* This is enforced by the function's in contract.
*
* Params:
* xmlText_ = the entire XML document as text
*
*/
this(string xmlText_)
in
{
assert(xmlText_.length != 0);
try
{
// Confirm that the input is valid XML
check(xmlText_);
}
catch (CheckException e)
{
// And if it's not, tell the user why not
assert(false, "\n" ~ e.toString());
}
}
body
{
xmlText = xmlText_;
s = &xmlText;
super(); // Initialize everything
parse(); // Parse through the root tag (but not beyond)
}
}
/**
* Class for parsing an XML element.
*
* Standards: $(LINK2 http://www.w3.org/TR/1998/REC-xml-19980210, XML 1.0)
*
* Note that you cannot construct instances of this class directly. You can
* construct a DocumentParser (which is a subclass of ElementParser), but
* otherwise, Instances of ElementParser will be created for you by the
* library, and passed your way via onStartTag handlers.
*
*/
class ElementParser
{
alias Handler = void delegate(string);
alias ElementHandler = void delegate(in Element element);
alias ParserHandler = void delegate(ElementParser parser);
private
{
Tag tag_;
string elementStart;
string* s;
Handler commentHandler = null;
Handler cdataHandler = null;
Handler xiHandler = null;
Handler piHandler = null;
Handler rawTextHandler = null;
Handler textHandler = null;
// Private constructor for start tags
this(ElementParser parent)
{
s = parent.s;
this();
tag_ = parent.tag_;
}
// Private constructor for empty tags
this(Tag tag, string* t)
{
s = t;
this();
tag_ = tag;
}
}
/**
* The Tag at the start of the element being parsed. You can read this to
* determine the tag's name and attributes.
*/
@property const(Tag) tag() const { return tag_; }
/**
* Register a handler which will be called whenever a start tag is
* encountered which matches the specified name. You can also pass null as
* the name, in which case the handler will be called for any unmatched
* start tag.
*
* Example:
* --------------
* // Call this function whenever a <podcast> start tag is encountered
* onStartTag["podcast"] = (ElementParser xml)
* {
* // Your code here
* //
* // This is a a closure, so code here may reference
* // variables which are outside of this scope
* };
*
* // call myEpisodeStartHandler (defined elsewhere) whenever an <episode>
* // start tag is encountered
* onStartTag["episode"] = &myEpisodeStartHandler;
*
* // call delegate dg for all other start tags
* onStartTag[null] = dg;
* --------------
*
* This library will supply your function with a new instance of
* ElementHandler, which may be used to parse inside the element whose
* start tag was just found, or to identify the tag attributes of the
* element, etc.
*
* Note that your function will be called for both start tags and empty
* tags. That is, we make no distinction between <br></br>
* and <br/>.
*/
ParserHandler[string] onStartTag;
/**
* Register a handler which will be called whenever an end tag is
* encountered which matches the specified name. You can also pass null as
* the name, in which case the handler will be called for any unmatched
* end tag.
*
* Example:
* --------------
* // Call this function whenever a </podcast> end tag is encountered
* onEndTag["podcast"] = (in Element e)
* {
* // Your code here
* //
* // This is a a closure, so code here may reference
* // variables which are outside of this scope
* };
*
* // call myEpisodeEndHandler (defined elsewhere) whenever an </episode>
* // end tag is encountered
* onEndTag["episode"] = &myEpisodeEndHandler;
*
* // call delegate dg for all other end tags
* onEndTag[null] = dg;
* --------------
*
* Note that your function will be called for both start tags and empty
* tags. That is, we make no distinction between <br></br>
* and <br/>.
*/
ElementHandler[string] onEndTag;
protected this()
{
elementStart = *s;
}
/**
* Register a handler which will be called whenever text is encountered.
*
* Example:
* --------------
* // Call this function whenever text is encountered
* onText = (string s)
* {
* // Your code here
*
* // The passed parameter s will have been decoded by the time you see
* // it, and so may contain any character.
* //
* // This is a a closure, so code here may reference
* // variables which are outside of this scope
* };
* --------------
*/
@property void onText(Handler handler) { textHandler = handler; }
/**
* Register an alternative handler which will be called whenever text
* is encountered. This differs from onText in that onText will decode
* the text, whereas onTextRaw will not. This allows you to make design
* choices, since onText will be more accurate, but slower, while
* onTextRaw will be faster, but less accurate. Of course, you can
* still call decode() within your handler, if you want, but you'd
* probably want to use onTextRaw only in circumstances where you
* know that decoding is unnecessary.
*
* Example:
* --------------
* // Call this function whenever text is encountered
* onText = (string s)
* {
* // Your code here
*
* // The passed parameter s will NOT have been decoded.
* //
* // This is a a closure, so code here may reference
* // variables which are outside of this scope
* };
* --------------
*/
void onTextRaw(Handler handler) { rawTextHandler = handler; }
/**
* Register a handler which will be called whenever a character data
* segment is encountered.
*
* Example:
* --------------
* // Call this function whenever a CData section is encountered
* onCData = (string s)
* {
* // Your code here
*
* // The passed parameter s does not include the opening <![CDATA[
* // nor closing ]]>
* //
* // This is a a closure, so code here may reference
* // variables which are outside of this scope
* };
* --------------
*/
@property void onCData(Handler handler) { cdataHandler = handler; }
/**
* Register a handler which will be called whenever a comment is
* encountered.
*
* Example:
* --------------
* // Call this function whenever a comment is encountered
* onComment = (string s)
* {
* // Your code here
*
* // The passed parameter s does not include the opening <!-- nor
* // closing -->
* //
* // This is a a closure, so code here may reference
* // variables which are outside of this scope
* };
* --------------
*/
@property void onComment(Handler handler) { commentHandler = handler; }
/**
* Register a handler which will be called whenever a processing
* instruction is encountered.
*
* Example:
* --------------
* // Call this function whenever a processing instruction is encountered
* onPI = (string s)
* {
* // Your code here
*
* // The passed parameter s does not include the opening <? nor
* // closing ?>
* //
* // This is a a closure, so code here may reference
* // variables which are outside of this scope
* };
* --------------
*/
@property void onPI(Handler handler) { piHandler = handler; }
/**
* Register a handler which will be called whenever an XML instruction is
* encountered.
*
* Example:
* --------------
* // Call this function whenever an XML instruction is encountered
* // (Note: XML instructions may only occur preceding the root tag of a
* // document).
* onPI = (string s)
* {
* // Your code here
*
* // The passed parameter s does not include the opening <! nor
* // closing >
* //
* // This is a a closure, so code here may reference
* // variables which are outside of this scope
* };
* --------------
*/
@property void onXI(Handler handler) { xiHandler = handler; }
/**
* Parse an XML element.
*
* Parsing will continue until the end of the current element. Any items
* encountered for which a handler has been registered will invoke that
* handler.
*
* Throws: various kinds of XMLException
*/
void parse()
{
string t;
Tag root = tag_;
Tag[string] startTags;
if (tag_ !is null) startTags[tag_.name] = tag_;
while (s.length != 0)
{
if (startsWith(*s,"<!--"))
{
chop(*s,4);
t = chop(*s,indexOf(*s,"-->"));
if (commentHandler.funcptr !is null) commentHandler(t);
chop(*s,3);
}
else if (startsWith(*s,"<![CDATA["))
{
chop(*s,9);
t = chop(*s,indexOf(*s,"]]>"));
if (cdataHandler.funcptr !is null) cdataHandler(t);
chop(*s,3);
}
else if (startsWith(*s,"<!"))
{
chop(*s,2);
t = chop(*s,indexOf(*s,">"));
if (xiHandler.funcptr !is null) xiHandler(t);
chop(*s,1);
}
else if (startsWith(*s,"<?"))
{
chop(*s,2);
t = chop(*s,indexOf(*s,"?>"));
if (piHandler.funcptr !is null) piHandler(t);
chop(*s,2);
}
else if (startsWith(*s,"<"))
{
tag_ = new Tag(*s,true);
if (root is null)
return; // Return to constructor of derived class
if (tag_.isStart)
{
startTags[tag_.name] = tag_;
auto parser = new ElementParser(this);
auto handler = tag_.name in onStartTag;
if (handler !is null) (*handler)(parser);
else
{
handler = null in onStartTag;
if (handler !is null) (*handler)(parser);
}
}
else if (tag_.isEnd)
{
auto startTag = startTags[tag_.name];
string text;
immutable(char)* p = startTag.tagString.ptr
+ startTag.tagString.length;
immutable(char)* q = tag_.tagString.ptr;
text = decode(p[0..(q-p)], DecodeMode.LOOSE);
auto element = new Element(startTag);
if (text.length != 0) element ~= new Text(text);
auto handler = tag_.name in onEndTag;
if (handler !is null) (*handler)(element);
else
{
handler = null in onEndTag;
if (handler !is null) (*handler)(element);
}
if (tag_.name == root.name) return;
}
else if (tag_.isEmpty)
{
Tag startTag = new Tag(tag_.name);
// FIX by hed010gy, for bug 2979
// http://d.puremagic.com/issues/show_bug.cgi?id=2979
if (tag_.attr.length > 0)
foreach (tn,tv; tag_.attr) startTag.attr[tn]=tv;
// END FIX
// Handle the pretend start tag
string s2;
auto parser = new ElementParser(startTag,&s2);
auto handler1 = startTag.name in onStartTag;
if (handler1 !is null) (*handler1)(parser);
else
{
handler1 = null in onStartTag;
if (handler1 !is null) (*handler1)(parser);
}
// Handle the pretend end tag
auto element = new Element(startTag);
auto handler2 = tag_.name in onEndTag;
if (handler2 !is null) (*handler2)(element);
else
{
handler2 = null in onEndTag;
if (handler2 !is null) (*handler2)(element);
}
}
}
else
{
t = chop(*s,indexOf(*s,"<"));
if (rawTextHandler.funcptr !is null)
rawTextHandler(t);
else if (textHandler.funcptr !is null)
textHandler(decode(t,DecodeMode.LOOSE));
}
}
}
/**
* Returns that part of the element which has already been parsed
*/
override string toString() const
{
assert(elementStart.length >= s.length);
return elementStart[0 .. elementStart.length - s.length];
}
}
private
{
template Check(string msg)
{
string old = s;
void fail()
{
s = old;
throw new Err(s,msg);
}
void fail(Err e)
{
s = old;
throw new Err(s,msg,e);
}
void fail(string msg2)
{
fail(new Err(s,msg2));
}
}
void checkMisc(ref string s) // rule 27
{
mixin Check!("Misc");
try
{
if (s.startsWith("<!--")) { checkComment(s); }
else if (s.startsWith("<?")) { checkPI(s); }
else { checkSpace(s); }
}
catch(Err e) { fail(e); }
}
void checkDocument(ref string s) // rule 1
{
mixin Check!("Document");
try
{
checkProlog(s);
checkElement(s);
star!(checkMisc)(s);
}
catch(Err e) { fail(e); }
}
void checkChars(ref string s) // rule 2
{
// TO DO - Fix std.utf stride and decode functions, then use those
// instead
mixin Check!("Chars");
dchar c;
int n = -1;
foreach (int i,dchar d; s)
{
if (!isChar(d))
{
c = d;
n = i;
break;
}
}
if (n != -1)
{
s = s[n..$];
fail(format("invalid character: U+%04X",c));
}
}
void checkSpace(ref string s) // rule 3
{
mixin Check!("Whitespace");
munch(s,"\u0020\u0009\u000A\u000D");
if (s is old) fail();
}
void checkName(ref string s, out string name) // rule 5
{
mixin Check!("Name");
if (s.length == 0) fail();
int n;
foreach (int i,dchar c;s)
{
if (c == '_' || c == ':' || isLetter(c)) continue;
if (i == 0) fail();
if (c == '-' || c == '.' || isDigit(c)
|| isCombiningChar(c) || isExtender(c)) continue;
n = i;
break;
}
name = s[0..n];
s = s[n..$];
}
void checkAttValue(ref string s) // rule 10
{
mixin Check!("AttValue");
if (s.length == 0) fail();
char c = s[0];
if (c != '\u0022' && c != '\u0027')
fail("attribute value requires quotes");
s = s[1..$];
for (;;)
{
munch(s,"^<&"~c);
if (s.length == 0) fail("unterminated attribute value");
if (s[0] == '<') fail("< found in attribute value");
if (s[0] == c) break;
try { checkReference(s); } catch(Err e) { fail(e); }
}
s = s[1..$];
}
void checkCharData(ref string s) // rule 14
{
mixin Check!("CharData");
while (s.length != 0)
{
if (s.startsWith("&")) break;
if (s.startsWith("<")) break;
if (s.startsWith("]]>")) fail("]]> found within char data");
s = s[1..$];
}
}
void checkComment(ref string s) // rule 15
{
mixin Check!("Comment");
try { checkLiteral("<!--",s); } catch(Err e) { fail(e); }
ptrdiff_t n = s.indexOf("--");
if (n == -1) fail("unterminated comment");
s = s[n..$];
try { checkLiteral("-->",s); } catch(Err e) { fail(e); }
}
void checkPI(ref string s) // rule 16
{
mixin Check!("PI");
try
{
checkLiteral("<?",s);
checkEnd("?>",s);
}
catch(Err e) { fail(e); }
}
void checkCDSect(ref string s) // rule 18
{
mixin Check!("CDSect");
try
{
checkLiteral(cdata,s);
checkEnd("]]>",s);
}
catch(Err e) { fail(e); }
}
void checkProlog(ref string s) // rule 22
{
mixin Check!("Prolog");
try
{
/* The XML declaration is optional
* http://www.w3.org/TR/2008/REC-xml-20081126/#NT-prolog
*/
opt!(checkXMLDecl)(s);
star!(checkMisc)(s);
opt!(seq!(checkDocTypeDecl,star!(checkMisc)))(s);
}
catch(Err e) { fail(e); }
}
void checkXMLDecl(ref string s) // rule 23
{
mixin Check!("XMLDecl");
try
{
checkLiteral("<?xml",s);
checkVersionInfo(s);
opt!(checkEncodingDecl)(s);
opt!(checkSDDecl)(s);
opt!(checkSpace)(s);
checkLiteral("?>",s);
}
catch(Err e) { fail(e); }
}
void checkVersionInfo(ref string s) // rule 24
{
mixin Check!("VersionInfo");
try
{
checkSpace(s);
checkLiteral("version",s);
checkEq(s);
quoted!(checkVersionNum)(s);
}
catch(Err e) { fail(e); }
}
void checkEq(ref string s) // rule 25
{
mixin Check!("Eq");
try
{
opt!(checkSpace)(s);
checkLiteral("=",s);
opt!(checkSpace)(s);
}
catch(Err e) { fail(e); }
}
void checkVersionNum(ref string s) // rule 26
{
mixin Check!("VersionNum");
munch(s,"a-zA-Z0-9_.:-");
if (s is old) fail();
}
void checkDocTypeDecl(ref string s) // rule 28
{
mixin Check!("DocTypeDecl");
try
{
checkLiteral("<!DOCTYPE",s);
//
// TO DO -- ensure DOCTYPE is well formed
// (But not yet. That's one of our "future directions")
//
checkEnd(">",s);
}
catch(Err e) { fail(e); }
}
void checkSDDecl(ref string s) // rule 32
{
mixin Check!("SDDecl");
try
{
checkSpace(s);
checkLiteral("standalone",s);
checkEq(s);
}
catch(Err e) { fail(e); }
int n = 0;
if (s.startsWith("'yes'") || s.startsWith("\"yes\"")) n = 5;
else if (s.startsWith("'no'" ) || s.startsWith("\"no\"" )) n = 4;
else fail("standalone attribute value must be 'yes', \"yes\","~
" 'no' or \"no\"");
s = s[n..$];
}
void checkElement(ref string s) // rule 39
{
mixin Check!("Element");
string sname,ename,t;
try { checkTag(s,t,sname); } catch(Err e) { fail(e); }
if (t == "STag")
{
try
{
checkContent(s);
t = s;
checkETag(s,ename);
}
catch(Err e) { fail(e); }
if (sname != ename)
{
s = t;
fail("end tag name \"" ~ ename
~ "\" differs from start tag name \""~sname~"\"");
}
}
}
// rules 40 and 44
void checkTag(ref string s, out string type, out string name)
{
mixin Check!("Tag");
try
{
type = "STag";
checkLiteral("<",s);
checkName(s,name);
star!(seq!(checkSpace,checkAttribute))(s);
opt!(checkSpace)(s);
if (s.length != 0 && s[0] == '/')
{
s = s[1..$];
type = "ETag";
}
checkLiteral(">",s);
}
catch(Err e) { fail(e); }
}
void checkAttribute(ref string s) // rule 41
{
mixin Check!("Attribute");
try
{
string name;
checkName(s,name);
checkEq(s);
checkAttValue(s);
}
catch(Err e) { fail(e); }
}
void checkETag(ref string s, out string name) // rule 42
{
mixin Check!("ETag");
try
{
checkLiteral("</",s);
checkName(s,name);
opt!(checkSpace)(s);
checkLiteral(">",s);
}
catch(Err e) { fail(e); }
}
void checkContent(ref string s) // rule 43
{
mixin Check!("Content");
try
{
while (s.length != 0)
{
old = s;
if (s.startsWith("&")) { checkReference(s); }
else if (s.startsWith("<!--")) { checkComment(s); }
else if (s.startsWith("<?")) { checkPI(s); }
else if (s.startsWith(cdata)) { checkCDSect(s); }
else if (s.startsWith("</")) { break; }
else if (s.startsWith("<")) { checkElement(s); }
else { checkCharData(s); }
}
}
catch(Err e) { fail(e); }
}
void checkCharRef(ref string s, out dchar c) // rule 66
{
mixin Check!("CharRef");
c = 0;
try { checkLiteral("&#",s); } catch(Err e) { fail(e); }
int radix = 10;
if (s.length != 0 && s[0] == 'x')
{
s = s[1..$];
radix = 16;
}
if (s.length == 0) fail("unterminated character reference");
if (s[0] == ';')
fail("character reference must have at least one digit");
while (s.length != 0)
{
char d = s[0];
int n = 0;
switch (d)
{
case 'F','f': ++n; goto case;
case 'E','e': ++n; goto case;
case 'D','d': ++n; goto case;
case 'C','c': ++n; goto case;
case 'B','b': ++n; goto case;
case 'A','a': ++n; goto case;
case '9': ++n; goto case;
case '8': ++n; goto case;
case '7': ++n; goto case;
case '6': ++n; goto case;
case '5': ++n; goto case;
case '4': ++n; goto case;
case '3': ++n; goto case;
case '2': ++n; goto case;
case '1': ++n; goto case;
case '0': break;
default: n = 100; break;
}
if (n >= radix) break;
c *= radix;
c += n;
s = s[1..$];
}
if (!isChar(c)) fail(format("U+%04X is not a legal character",c));
if (s.length == 0 || s[0] != ';') fail("expected ;");
else s = s[1..$];
}
void checkReference(ref string s) // rule 67
{
mixin Check!("Reference");
try
{
dchar c;
if (s.startsWith("&#")) checkCharRef(s,c);
else checkEntityRef(s);
}
catch(Err e) { fail(e); }
}
void checkEntityRef(ref string s) // rule 68
{
mixin Check!("EntityRef");
try
{
string name;
checkLiteral("&",s);
checkName(s,name);
checkLiteral(";",s);
}
catch(Err e) { fail(e); }
}
void checkEncName(ref string s) // rule 81
{
mixin Check!("EncName");
munch(s,"a-zA-Z");
if (s is old) fail();
munch(s,"a-zA-Z0-9_.-");
}
void checkEncodingDecl(ref string s) // rule 80
{
mixin Check!("EncodingDecl");
try
{
checkSpace(s);
checkLiteral("encoding",s);
checkEq(s);
quoted!(checkEncName)(s);
}
catch(Err e) { fail(e); }
}
// Helper functions
void checkLiteral(string literal,ref string s)
{
mixin Check!("Literal");
if (!s.startsWith(literal)) fail("Expected literal \""~literal~"\"");
s = s[literal.length..$];
}
void checkEnd(string end,ref string s)
{
// Deliberately no mixin Check here.
auto n = s.indexOf(end);
if (n == -1) throw new Err(s,"Unable to find terminating \""~end~"\"");
s = s[n..$];
checkLiteral(end,s);
}
// Metafunctions -- none of these use mixin Check
void opt(alias f)(ref string s)
{
try { f(s); } catch(Err e) {}
}
void plus(alias f)(ref string s)
{
f(s);
star!(f)(s);
}
void star(alias f)(ref string s)
{
while (s.length != 0)
{
try { f(s); }
catch(Err e) { return; }
}
}
void quoted(alias f)(ref string s)
{
if (s.startsWith("'"))
{
checkLiteral("'",s);
f(s);
checkLiteral("'",s);
}
else
{
checkLiteral("\"",s);
f(s);
checkLiteral("\"",s);
}
}
void seq(alias f,alias g)(ref string s)
{
f(s);
g(s);
}
}
/**
* Check an entire XML document for well-formedness
*
* Params:
* s = the document to be checked, passed as a string
*
* Throws: CheckException if the document is not well formed
*
* CheckException's toString() method will yield the complete hierarchy of
* parse failure (the XML equivalent of a stack trace), giving the line and
* column number of every failure at every level.
*/
void check(string s)
{
try
{
checkChars(s);
checkDocument(s);
if (s.length != 0) throw new Err(s,"Junk found after document");
}
catch(Err e)
{
e.complete(s);
throw e;
}
}
unittest
{
version (none) // WHY ARE WE NOT RUNNING THIS UNIT TEST?
{
try
{
check(q"[<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genres>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
<book id="bk103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-11-17</publish_date>
<description>After the collapse of a nanotechnology
society in England, the young survivors lay the
foundation for a new society.</description>
</book>
</catalog>
]");
assert(false);
}
catch(CheckException e)
{
int n = e.toString().indexOf("end tag name \"genres\" differs"~
" from start tag name \"genre\"");
assert(n != -1);
}
}
}
unittest
{
string s = q"EOS
<?xml version="1.0"?>
<set>
<one>A</one>
<!-- comment -->
<two>B</two>
</set>
EOS";
try
{
check(s);
}
catch (CheckException e)
{
assert(0, e.toString());
}
}
unittest
{
string s = q"EOS
<?xml version="1.0" encoding="utf-8"?> <Tests>
<Test thing="What & Up">What & Up Second</Test>
</Tests>
EOS";
auto xml = new DocumentParser(s);
xml.onStartTag["Test"] = (ElementParser xml) {
assert(xml.tag.attr["thing"] == "What & Up");
};
xml.onEndTag["Test"] = (in Element e) {
assert(e.text() == "What & Up Second");
};
xml.parse();
}
unittest
{
string s = `<tag attr=""value>" />`;
auto doc = new Document(s);
assert(doc.toString() == s);
}
/** The base class for exceptions thrown by this module */
class XMLException : Exception { this(string msg) { super(msg); } }
// Other exceptions
/// Thrown during Comment constructor
class CommentException : XMLException
{ private this(string msg) { super(msg); } }
/// Thrown during CData constructor
class CDataException : XMLException
{ private this(string msg) { super(msg); } }
/// Thrown during XMLInstruction constructor
class XIException : XMLException
{ private this(string msg) { super(msg); } }
/// Thrown during ProcessingInstruction constructor
class PIException : XMLException
{ private this(string msg) { super(msg); } }
/// Thrown during Text constructor
class TextException : XMLException
{ private this(string msg) { super(msg); } }
/// Thrown during decode()
class DecodeException : XMLException
{ private this(string msg) { super(msg); } }
/// Thrown if comparing with wrong type
class InvalidTypeException : XMLException
{ private this(string msg) { super(msg); } }
/// Thrown when parsing for Tags
class TagException : XMLException
{ private this(string msg) { super(msg); } }
/**
* Thrown during check()
*/
class CheckException : XMLException
{
CheckException err; /// Parent in hierarchy
private string tail;
/**
* Name of production rule which failed to parse,
* or specific error message
*/
string msg;
size_t line = 0; /// Line number at which parse failure occurred
size_t column = 0; /// Column number at which parse failure occurred
private this(string tail,string msg,Err err=null)
{
super(null);
this.tail = tail;
this.msg = msg;
this.err = err;
}
private void complete(string entire)
{
string head = entire[0..$-tail.length];
ptrdiff_t n = head.lastIndexOf('\n') + 1;
line = head.count("\n") + 1;
dstring t;
transcode(head[n..$],t);
column = t.length + 1;
if (err !is null) err.complete(entire);
}
override string toString() const
{
string s;
if (line != 0) s = format("Line %d, column %d: ",line,column);
s ~= msg;
s ~= '\n';
if (err !is null) s = err.toString() ~ s;
return s;
}
}
private alias Err = CheckException;
// Private helper functions
private
{
T toType(T)(Object o)
{
T t = cast(T)(o);
if (t is null)
{
throw new InvalidTypeException("Attempt to compare a "
~ T.stringof ~ " with an instance of another type");
}
return t;
}
string chop(ref string s, size_t n)
{
if (n == -1) n = s.length;
string t = s[0..n];
s = s[n..$];
return t;
}
bool optc(ref string s, char c)
{
bool b = s.length != 0 && s[0] == c;
if (b) s = s[1..$];
return b;
}
void reqc(ref string s, char c)
{
if (s.length == 0 || s[0] != c) throw new TagException("");
s = s[1..$];
}
size_t hash(string s,size_t h=0) @trusted nothrow
{
return typeid(s).getHash(&s) + h;
}
// Definitions from the XML specification
immutable CharTable=[0x9,0x9,0xA,0xA,0xD,0xD,0x20,0xD7FF,0xE000,0xFFFD,
0x10000,0x10FFFF];
immutable BaseCharTable=[0x0041,0x005A,0x0061,0x007A,0x00C0,0x00D6,0x00D8,
0x00F6,0x00F8,0x00FF,0x0100,0x0131,0x0134,0x013E,0x0141,0x0148,0x014A,
0x017E,0x0180,0x01C3,0x01CD,0x01F0,0x01F4,0x01F5,0x01FA,0x0217,0x0250,
0x02A8,0x02BB,0x02C1,0x0386,0x0386,0x0388,0x038A,0x038C,0x038C,0x038E,
0x03A1,0x03A3,0x03CE,0x03D0,0x03D6,0x03DA,0x03DA,0x03DC,0x03DC,0x03DE,
0x03DE,0x03E0,0x03E0,0x03E2,0x03F3,0x0401,0x040C,0x040E,0x044F,0x0451,
0x045C,0x045E,0x0481,0x0490,0x04C4,0x04C7,0x04C8,0x04CB,0x04CC,0x04D0,
0x04EB,0x04EE,0x04F5,0x04F8,0x04F9,0x0531,0x0556,0x0559,0x0559,0x0561,
0x0586,0x05D0,0x05EA,0x05F0,0x05F2,0x0621,0x063A,0x0641,0x064A,0x0671,
0x06B7,0x06BA,0x06BE,0x06C0,0x06CE,0x06D0,0x06D3,0x06D5,0x06D5,0x06E5,
0x06E6,0x0905,0x0939,0x093D,0x093D,0x0958,0x0961,0x0985,0x098C,0x098F,
0x0990,0x0993,0x09A8,0x09AA,0x09B0,0x09B2,0x09B2,0x09B6,0x09B9,0x09DC,
0x09DD,0x09DF,0x09E1,0x09F0,0x09F1,0x0A05,0x0A0A,0x0A0F,0x0A10,0x0A13,
0x0A28,0x0A2A,0x0A30,0x0A32,0x0A33,0x0A35,0x0A36,0x0A38,0x0A39,0x0A59,
0x0A5C,0x0A5E,0x0A5E,0x0A72,0x0A74,0x0A85,0x0A8B,0x0A8D,0x0A8D,0x0A8F,
0x0A91,0x0A93,0x0AA8,0x0AAA,0x0AB0,0x0AB2,0x0AB3,0x0AB5,0x0AB9,0x0ABD,
0x0ABD,0x0AE0,0x0AE0,0x0B05,0x0B0C,0x0B0F,0x0B10,0x0B13,0x0B28,0x0B2A,
0x0B30,0x0B32,0x0B33,0x0B36,0x0B39,0x0B3D,0x0B3D,0x0B5C,0x0B5D,0x0B5F,
0x0B61,0x0B85,0x0B8A,0x0B8E,0x0B90,0x0B92,0x0B95,0x0B99,0x0B9A,0x0B9C,
0x0B9C,0x0B9E,0x0B9F,0x0BA3,0x0BA4,0x0BA8,0x0BAA,0x0BAE,0x0BB5,0x0BB7,
0x0BB9,0x0C05,0x0C0C,0x0C0E,0x0C10,0x0C12,0x0C28,0x0C2A,0x0C33,0x0C35,
0x0C39,0x0C60,0x0C61,0x0C85,0x0C8C,0x0C8E,0x0C90,0x0C92,0x0CA8,0x0CAA,
0x0CB3,0x0CB5,0x0CB9,0x0CDE,0x0CDE,0x0CE0,0x0CE1,0x0D05,0x0D0C,0x0D0E,
0x0D10,0x0D12,0x0D28,0x0D2A,0x0D39,0x0D60,0x0D61,0x0E01,0x0E2E,0x0E30,
0x0E30,0x0E32,0x0E33,0x0E40,0x0E45,0x0E81,0x0E82,0x0E84,0x0E84,0x0E87,
0x0E88,0x0E8A,0x0E8A,0x0E8D,0x0E8D,0x0E94,0x0E97,0x0E99,0x0E9F,0x0EA1,
0x0EA3,0x0EA5,0x0EA5,0x0EA7,0x0EA7,0x0EAA,0x0EAB,0x0EAD,0x0EAE,0x0EB0,
0x0EB0,0x0EB2,0x0EB3,0x0EBD,0x0EBD,0x0EC0,0x0EC4,0x0F40,0x0F47,0x0F49,
0x0F69,0x10A0,0x10C5,0x10D0,0x10F6,0x1100,0x1100,0x1102,0x1103,0x1105,
0x1107,0x1109,0x1109,0x110B,0x110C,0x110E,0x1112,0x113C,0x113C,0x113E,
0x113E,0x1140,0x1140,0x114C,0x114C,0x114E,0x114E,0x1150,0x1150,0x1154,
0x1155,0x1159,0x1159,0x115F,0x1161,0x1163,0x1163,0x1165,0x1165,0x1167,
0x1167,0x1169,0x1169,0x116D,0x116E,0x1172,0x1173,0x1175,0x1175,0x119E,
0x119E,0x11A8,0x11A8,0x11AB,0x11AB,0x11AE,0x11AF,0x11B7,0x11B8,0x11BA,
0x11BA,0x11BC,0x11C2,0x11EB,0x11EB,0x11F0,0x11F0,0x11F9,0x11F9,0x1E00,
0x1E9B,0x1EA0,0x1EF9,0x1F00,0x1F15,0x1F18,0x1F1D,0x1F20,0x1F45,0x1F48,
0x1F4D,0x1F50,0x1F57,0x1F59,0x1F59,0x1F5B,0x1F5B,0x1F5D,0x1F5D,0x1F5F,
0x1F7D,0x1F80,0x1FB4,0x1FB6,0x1FBC,0x1FBE,0x1FBE,0x1FC2,0x1FC4,0x1FC6,
0x1FCC,0x1FD0,0x1FD3,0x1FD6,0x1FDB,0x1FE0,0x1FEC,0x1FF2,0x1FF4,0x1FF6,
0x1FFC,0x2126,0x2126,0x212A,0x212B,0x212E,0x212E,0x2180,0x2182,0x3041,
0x3094,0x30A1,0x30FA,0x3105,0x312C,0xAC00,0xD7A3];
immutable IdeographicTable=[0x3007,0x3007,0x3021,0x3029,0x4E00,0x9FA5];
immutable CombiningCharTable=[0x0300,0x0345,0x0360,0x0361,0x0483,0x0486,
0x0591,0x05A1,0x05A3,0x05B9,0x05BB,0x05BD,0x05BF,0x05BF,0x05C1,0x05C2,
0x05C4,0x05C4,0x064B,0x0652,0x0670,0x0670,0x06D6,0x06DC,0x06DD,0x06DF,
0x06E0,0x06E4,0x06E7,0x06E8,0x06EA,0x06ED,0x0901,0x0903,0x093C,0x093C,
0x093E,0x094C,0x094D,0x094D,0x0951,0x0954,0x0962,0x0963,0x0981,0x0983,
0x09BC,0x09BC,0x09BE,0x09BE,0x09BF,0x09BF,0x09C0,0x09C4,0x09C7,0x09C8,
0x09CB,0x09CD,0x09D7,0x09D7,0x09E2,0x09E3,0x0A02,0x0A02,0x0A3C,0x0A3C,
0x0A3E,0x0A3E,0x0A3F,0x0A3F,0x0A40,0x0A42,0x0A47,0x0A48,0x0A4B,0x0A4D,
0x0A70,0x0A71,0x0A81,0x0A83,0x0ABC,0x0ABC,0x0ABE,0x0AC5,0x0AC7,0x0AC9,
0x0ACB,0x0ACD,0x0B01,0x0B03,0x0B3C,0x0B3C,0x0B3E,0x0B43,0x0B47,0x0B48,
0x0B4B,0x0B4D,0x0B56,0x0B57,0x0B82,0x0B83,0x0BBE,0x0BC2,0x0BC6,0x0BC8,
0x0BCA,0x0BCD,0x0BD7,0x0BD7,0x0C01,0x0C03,0x0C3E,0x0C44,0x0C46,0x0C48,
0x0C4A,0x0C4D,0x0C55,0x0C56,0x0C82,0x0C83,0x0CBE,0x0CC4,0x0CC6,0x0CC8,
0x0CCA,0x0CCD,0x0CD5,0x0CD6,0x0D02,0x0D03,0x0D3E,0x0D43,0x0D46,0x0D48,
0x0D4A,0x0D4D,0x0D57,0x0D57,0x0E31,0x0E31,0x0E34,0x0E3A,0x0E47,0x0E4E,
0x0EB1,0x0EB1,0x0EB4,0x0EB9,0x0EBB,0x0EBC,0x0EC8,0x0ECD,0x0F18,0x0F19,
0x0F35,0x0F35,0x0F37,0x0F37,0x0F39,0x0F39,0x0F3E,0x0F3E,0x0F3F,0x0F3F,
0x0F71,0x0F84,0x0F86,0x0F8B,0x0F90,0x0F95,0x0F97,0x0F97,0x0F99,0x0FAD,
0x0FB1,0x0FB7,0x0FB9,0x0FB9,0x20D0,0x20DC,0x20E1,0x20E1,0x302A,0x302F,
0x3099,0x3099,0x309A,0x309A];
immutable DigitTable=[0x0030,0x0039,0x0660,0x0669,0x06F0,0x06F9,0x0966,
0x096F,0x09E6,0x09EF,0x0A66,0x0A6F,0x0AE6,0x0AEF,0x0B66,0x0B6F,0x0BE7,
0x0BEF,0x0C66,0x0C6F,0x0CE6,0x0CEF,0x0D66,0x0D6F,0x0E50,0x0E59,0x0ED0,
0x0ED9,0x0F20,0x0F29];
immutable ExtenderTable=[0x00B7,0x00B7,0x02D0,0x02D0,0x02D1,0x02D1,0x0387,
0x0387,0x0640,0x0640,0x0E46,0x0E46,0x0EC6,0x0EC6,0x3005,0x3005,0x3031,
0x3035,0x309D,0x309E,0x30FC,0x30FE];
bool lookup(const(int)[] table, int c)
{
while (table.length != 0)
{
auto m = (table.length >> 1) & ~1;
if (c < table[m])
{
table = table[0..m];
}
else if (c > table[m+1])
{
table = table[m+2..$];
}
else return true;
}
return false;
}
string startOf(string s)
{
string r;
foreach (char c;s)
{
r ~= (c < 0x20 || c > 0x7F) ? '.' : c;
if (r.length >= 40) { r ~= "___"; break; }
}
return r;
}
void exit(string s=null)
{
throw new XMLException(s);
}
}
| D |
/**
* Performs inlining, which is an optimization pass enabled with the `-inline` flag.
*
* The AST is traversed, and every function call is considered for inlining using `inlinecost.d`.
* The function call is then inlined if this cost is below a threshold.
*
* Copyright: Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/inline.d, _inline.d)
* Documentation: https://dlang.org/phobos/dmd_inline.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/inline.d
*/
module dmd.inline;
import core.stdc.stdio;
import core.stdc.string;
import dmd.aggregate;
import dmd.apply;
import dmd.arraytypes;
import dmd.astenums;
import dmd.attrib;
import dmd.declaration;
import dmd.dmodule;
import dmd.dscope;
import dmd.dstruct;
import dmd.dsymbol;
import dmd.dtemplate;
import dmd.expression;
import dmd.errors;
import dmd.func;
import dmd.globals;
import dmd.id;
import dmd.identifier;
import dmd.init;
import dmd.initsem;
import dmd.mtype;
import dmd.opover;
import dmd.statement;
import dmd.tokens;
import dmd.visitor;
import dmd.inlinecost;
/***********************************************************
* Scan function implementations in Module m looking for functions that can be inlined,
* and inline them in situ.
*
* Params:
* m = module to scan
*/
public void inlineScanModule(Module m)
{
if (m.semanticRun != PASS.semantic3done)
return;
m.semanticRun = PASS.inline;
// Note that modules get their own scope, from scratch.
// This is so regardless of where in the syntax a module
// gets imported, it is unaffected by context.
//printf("Module = %p\n", m.sc.scopesym);
foreach (i; 0 .. m.members.dim)
{
Dsymbol s = (*m.members)[i];
//if (global.params.verbose)
// message("inline scan symbol %s", s.toChars());
scope InlineScanVisitor v = new InlineScanVisitor();
s.accept(v);
}
m.semanticRun = PASS.inlinedone;
}
/***********************************************************
* Perform the "inline copying" of a default argument for a function parameter.
*
* Todo:
* The hack for bugzilla 4820 case is still questionable. Perhaps would have to
* handle a delegate expression with 'null' context properly in front-end.
*/
public Expression inlineCopy(Expression e, Scope* sc)
{
/* See https://issues.dlang.org/show_bug.cgi?id=2935
* for explanation of why just a copy() is broken
*/
//return e.copy();
if (auto de = e.isDelegateExp())
{
if (de.func.isNested())
{
/* https://issues.dlang.org/show_bug.cgi?id=4820
* Defer checking until later if we actually need the 'this' pointer
*/
return de.copy();
}
}
int cost = inlineCostExpression(e);
if (cost >= COST_MAX)
{
e.error("cannot inline default argument `%s`", e.toChars());
return ErrorExp.get();
}
scope ids = new InlineDoState(sc.parent, null);
return doInlineAs!Expression(e, ids);
}
private:
enum LOG = false;
enum CANINLINE_LOG = false;
enum EXPANDINLINE_LOG = false;
/***********************************************************
* Represent a context to inline statements and expressions.
*
* Todo:
* It would be better to make foundReturn an instance field of DoInlineAs visitor class,
* like as DoInlineAs!Result.result field, because it's one another result of inlining.
* The best would be to return a pair of result Expression and a bool value as foundReturn
* from doInlineAs function.
*/
private final class InlineDoState
{
// inline context
VarDeclaration vthis;
Dsymbols from; // old Dsymbols
Dsymbols to; // parallel array of new Dsymbols
Dsymbol parent; // new parent
FuncDeclaration fd; // function being inlined (old parent)
// inline result
bool foundReturn;
this(Dsymbol parent, FuncDeclaration fd)
{
this.parent = parent;
this.fd = fd;
}
}
/***********************************************************
* Perform the inlining from (Statement or Expression) to (Statement or Expression).
*
* Inlining is done by:
* - Converting to an Expression
* - Copying the trees of the function to be inlined
* - Renaming the variables
*/
private extern (C++) final class DoInlineAs(Result) : Visitor
if (is(Result == Statement) || is(Result == Expression))
{
alias visit = Visitor.visit;
public:
InlineDoState ids;
Result result;
enum asStatements = is(Result == Statement);
extern (D) this(InlineDoState ids)
{
this.ids = ids;
}
// Statement -> (Statement | Expression)
override void visit(Statement s)
{
printf("Statement.doInlineAs!%s()\n%s\n", Result.stringof.ptr, s.toChars());
fflush(stdout);
assert(0); // default is we can't inline it
}
override void visit(ExpStatement s)
{
static if (LOG)
{
if (s.exp)
printf("ExpStatement.doInlineAs!%s() '%s'\n", Result.stringof.ptr, s.exp.toChars());
}
auto exp = doInlineAs!Expression(s.exp, ids);
static if (asStatements)
result = new ExpStatement(s.loc, exp);
else
result = exp;
}
override void visit(CompoundStatement s)
{
//printf("CompoundStatement.doInlineAs!%s() %d\n", Result.stringof.ptr, s.statements.dim);
static if (asStatements)
{
auto as = new Statements();
as.reserve(s.statements.dim);
}
foreach (i, sx; *s.statements)
{
if (!sx)
continue;
static if (asStatements)
{
as.push(doInlineAs!Statement(sx, ids));
}
else
{
/* Specifically allow:
* if (condition)
* return exp1;
* return exp2;
*/
IfStatement ifs;
Statement s3;
if ((ifs = sx.isIfStatement()) !is null &&
ifs.ifbody &&
ifs.ifbody.endsWithReturnStatement() &&
!ifs.elsebody &&
i + 1 < s.statements.dim &&
(s3 = (*s.statements)[i + 1]) !is null &&
s3.endsWithReturnStatement()
)
{
/* Rewrite as ?:
*/
auto econd = doInlineAs!Expression(ifs.condition, ids);
assert(econd);
auto e1 = doInlineAs!Expression(ifs.ifbody, ids);
assert(ids.foundReturn);
auto e2 = doInlineAs!Expression(s3, ids);
Expression e = new CondExp(econd.loc, econd, e1, e2);
e.type = e1.type;
if (e.type.ty == Ttuple)
{
e1.type = Type.tvoid;
e2.type = Type.tvoid;
e.type = Type.tvoid;
}
result = Expression.combine(result, e);
}
else
{
auto e = doInlineAs!Expression(sx, ids);
result = Expression.combine(result, e);
}
}
if (ids.foundReturn)
break;
}
static if (asStatements)
result = new CompoundStatement(s.loc, as);
}
override void visit(UnrolledLoopStatement s)
{
//printf("UnrolledLoopStatement.doInlineAs!%s() %d\n", Result.stringof.ptr, s.statements.dim);
static if (asStatements)
{
auto as = new Statements();
as.reserve(s.statements.dim);
}
foreach (sx; *s.statements)
{
if (!sx)
continue;
auto r = doInlineAs!Result(sx, ids);
static if (asStatements)
as.push(r);
else
result = Expression.combine(result, r);
if (ids.foundReturn)
break;
}
static if (asStatements)
result = new UnrolledLoopStatement(s.loc, as);
}
override void visit(ScopeStatement s)
{
//printf("ScopeStatement.doInlineAs!%s() %d\n", Result.stringof.ptr, s.statement.dim);
auto r = doInlineAs!Result(s.statement, ids);
static if (asStatements)
result = new ScopeStatement(s.loc, r, s.endloc);
else
result = r;
}
override void visit(IfStatement s)
{
assert(!s.prm);
auto econd = doInlineAs!Expression(s.condition, ids);
assert(econd);
auto ifbody = doInlineAs!Result(s.ifbody, ids);
bool bodyReturn = ids.foundReturn;
ids.foundReturn = false;
auto elsebody = doInlineAs!Result(s.elsebody, ids);
static if (asStatements)
{
result = new IfStatement(s.loc, s.prm, econd, ifbody, elsebody, s.endloc);
}
else
{
alias e1 = ifbody;
alias e2 = elsebody;
if (e1 && e2)
{
result = new CondExp(econd.loc, econd, e1, e2);
result.type = e1.type;
if (result.type.ty == Ttuple)
{
e1.type = Type.tvoid;
e2.type = Type.tvoid;
result.type = Type.tvoid;
}
}
else if (e1)
{
result = new LogicalExp(econd.loc, EXP.andAnd, econd, e1);
result.type = Type.tvoid;
}
else if (e2)
{
result = new LogicalExp(econd.loc, EXP.orOr, econd, e2);
result.type = Type.tvoid;
}
else
{
result = econd;
}
}
ids.foundReturn = ids.foundReturn && bodyReturn;
}
override void visit(ReturnStatement s)
{
//printf("ReturnStatement.doInlineAs!%s() '%s'\n", Result.stringof.ptr, s.exp ? s.exp.toChars() : "");
ids.foundReturn = true;
auto exp = doInlineAs!Expression(s.exp, ids);
if (!exp) // https://issues.dlang.org/show_bug.cgi?id=14560
// 'return' must not leave in the expand result
return;
static if (asStatements)
{
/* Any return statement should be the last statement in the function being
* inlined, otherwise things shouldn't have gotten this far. Since the
* return value is being ignored (otherwise it wouldn't be inlined as a statement)
* we only need to evaluate `exp` for side effects.
* Already disallowed this if `exp` produces an object that needs destruction -
* an enhancement would be to do the destruction here.
*/
result = new ExpStatement(s.loc, exp);
}
else
result = exp;
}
override void visit(ImportStatement s)
{
}
override void visit(ForStatement s)
{
//printf("ForStatement.doInlineAs!%s()\n", Result.stringof.ptr);
static if (asStatements)
{
auto sinit = doInlineAs!Statement(s._init, ids);
auto scond = doInlineAs!Expression(s.condition, ids);
auto sincr = doInlineAs!Expression(s.increment, ids);
auto sbody = doInlineAs!Statement(s._body, ids);
result = new ForStatement(s.loc, sinit, scond, sincr, sbody, s.endloc);
}
else
result = null; // cannot be inlined as an Expression
}
override void visit(ThrowStatement s)
{
//printf("ThrowStatement.doInlineAs!%s() '%s'\n", Result.stringof.ptr, s.exp.toChars());
static if (asStatements)
result = new ThrowStatement(s.loc, doInlineAs!Expression(s.exp, ids));
else
result = null; // cannot be inlined as an Expression
}
// Expression -> (Statement | Expression)
static if (asStatements)
{
override void visit(Expression e)
{
result = new ExpStatement(e.loc, doInlineAs!Expression(e, ids));
}
}
else
{
/******************************
* Perform doInlineAs() on an array of Expressions.
*/
Expressions* arrayExpressionDoInline(Expressions* a)
{
if (!a)
return null;
auto newa = new Expressions(a.dim);
foreach (i; 0 .. a.dim)
{
(*newa)[i] = doInlineAs!Expression((*a)[i], ids);
}
return newa;
}
override void visit(Expression e)
{
//printf("Expression.doInlineAs!%s(%s): %s\n", Result.stringof.ptr, EXPtoString(e.op).ptr, e.toChars());
result = e.copy();
}
override void visit(SymOffExp e)
{
//printf("SymOffExp.doInlineAs!%s(%s)\n", Result.stringof.ptr, e.toChars());
foreach (i; 0 .. ids.from.dim)
{
if (e.var != ids.from[i])
continue;
auto se = e.copy().isSymOffExp();
se.var = ids.to[i].isDeclaration();
result = se;
return;
}
result = e;
}
override void visit(VarExp e)
{
//printf("VarExp.doInlineAs!%s(%s)\n", Result.stringof.ptr, e.toChars());
foreach (i; 0 .. ids.from.dim)
{
if (e.var != ids.from[i])
continue;
auto ve = e.copy().isVarExp();
ve.var = ids.to[i].isDeclaration();
result = ve;
return;
}
if (ids.fd && e.var == ids.fd.vthis)
{
result = new VarExp(e.loc, ids.vthis);
if (ids.fd.isThis2)
result = new AddrExp(e.loc, result);
result.type = e.type;
return;
}
/* Inlining context pointer access for nested referenced variables.
* For example:
* auto fun() {
* int i = 40;
* auto foo() {
* int g = 2;
* struct Result {
* auto bar() { return i + g; }
* }
* return Result();
* }
* return foo();
* }
* auto t = fun();
* 'i' and 'g' are nested referenced variables in Result.bar(), so:
* auto x = t.bar();
* should be inlined to:
* auto x = *(t.vthis.vthis + i.voffset) + *(t.vthis + g.voffset)
*/
auto v = e.var.isVarDeclaration();
if (v && v.nestedrefs.dim && ids.vthis)
{
Dsymbol s = ids.fd;
auto fdv = v.toParent().isFuncDeclaration();
assert(fdv);
result = new VarExp(e.loc, ids.vthis);
result.type = ids.vthis.type;
if (ids.fd.isThis2)
{
// &__this
result = new AddrExp(e.loc, result);
result.type = ids.vthis.type.pointerTo();
}
while (s != fdv)
{
auto f = s.isFuncDeclaration();
AggregateDeclaration ad;
if (f && f.isThis2)
{
if (f.hasNestedFrameRefs())
{
result = new DotVarExp(e.loc, result, f.vthis);
result.type = f.vthis.type;
}
// (*__this)[i]
uint i = f.followInstantiationContext(fdv);
if (i == 1 && f == ids.fd)
{
auto ve = e.copy().isVarExp();
ve.originalScope = ids.fd;
result = ve;
return;
}
result = new PtrExp(e.loc, result);
result.type = Type.tvoidptr.sarrayOf(2);
auto ie = new IndexExp(e.loc, result, new IntegerExp(i));
ie.indexIsInBounds = true; // no runtime bounds checking
result = ie;
result.type = Type.tvoidptr;
s = f.toParentP(fdv);
ad = s.isAggregateDeclaration();
if (ad)
goto Lad;
continue;
}
else if ((ad = s.isThis()) !is null)
{
Lad:
while (ad)
{
assert(ad.vthis);
bool i = ad.followInstantiationContext(fdv);
auto vthis = i ? ad.vthis2 : ad.vthis;
result = new DotVarExp(e.loc, result, vthis);
result.type = vthis.type;
s = ad.toParentP(fdv);
ad = s.isAggregateDeclaration();
}
}
else if (f && f.isNested())
{
assert(f.vthis);
if (f.hasNestedFrameRefs())
{
result = new DotVarExp(e.loc, result, f.vthis);
result.type = f.vthis.type;
}
s = f.toParent2();
}
else
assert(0);
assert(s);
}
result = new DotVarExp(e.loc, result, v);
result.type = v.type;
//printf("\t==> result = %s, type = %s\n", result.toChars(), result.type.toChars());
return;
}
else if (v && v.nestedrefs.dim)
{
auto ve = e.copy().isVarExp();
ve.originalScope = ids.fd;
result = ve;
return;
}
result = e;
}
override void visit(ThisExp e)
{
//if (!ids.vthis)
// e.error("no `this` when inlining `%s`", ids.parent.toChars());
if (!ids.vthis)
{
result = e;
return;
}
result = new VarExp(e.loc, ids.vthis);
if (ids.fd.isThis2)
{
// __this[0]
result.type = ids.vthis.type;
auto ie = new IndexExp(e.loc, result, IntegerExp.literal!0);
ie.indexIsInBounds = true; // no runtime bounds checking
result = ie;
if (e.type.ty == Tstruct)
{
result.type = e.type.pointerTo();
result = new PtrExp(e.loc, result);
}
}
result.type = e.type;
}
override void visit(SuperExp e)
{
assert(ids.vthis);
result = new VarExp(e.loc, ids.vthis);
if (ids.fd.isThis2)
{
// __this[0]
result.type = ids.vthis.type;
auto ie = new IndexExp(e.loc, result, IntegerExp.literal!0);
ie.indexIsInBounds = true; // no runtime bounds checking
result = ie;
}
result.type = e.type;
}
override void visit(DeclarationExp e)
{
//printf("DeclarationExp.doInlineAs!%s(%s)\n", Result.stringof.ptr, e.toChars());
if (auto vd = e.declaration.isVarDeclaration())
{
version (none)
{
// Need to figure this out before inlining can work for tuples
if (auto tup = vd.toAlias().isTupleDeclaration())
{
foreach (i; 0 .. tup.objects.dim)
{
DsymbolExp se = (*tup.objects)[i];
assert(se.op == EXP.dSymbol);
se.s;
}
result = st.objects.dim;
return;
}
}
if (vd.isStatic())
return;
if (ids.fd && vd == ids.fd.nrvo_var)
{
foreach (i; 0 .. ids.from.dim)
{
if (vd != ids.from[i])
continue;
if (vd._init && !vd._init.isVoidInitializer())
{
result = vd._init.initializerToExpression();
assert(result);
result = doInlineAs!Expression(result, ids);
}
else
result = IntegerExp.literal!0;
return;
}
}
auto vto = new VarDeclaration(vd.loc, vd.type, vd.ident, vd._init);
memcpy(cast(void*)vto, cast(void*)vd, __traits(classInstanceSize, VarDeclaration));
vto.parent = ids.parent;
vto.csym = null;
vto.isym = null;
ids.from.push(vd);
ids.to.push(vto);
if (vd._init)
{
if (vd._init.isVoidInitializer())
{
vto._init = new VoidInitializer(vd._init.loc);
}
else
{
auto ei = vd._init.initializerToExpression();
assert(ei);
vto._init = new ExpInitializer(ei.loc, doInlineAs!Expression(ei, ids));
}
}
if (vd.edtor)
{
vto.edtor = doInlineAs!Expression(vd.edtor, ids);
}
auto de = e.copy().isDeclarationExp();
de.declaration = vto;
result = de;
return;
}
// Prevent the copy of the aggregates allowed in inlineable funcs
if (isInlinableNestedAggregate(e))
return;
/* This needs work, like DeclarationExp.toElem(), if we are
* to handle TemplateMixin's. For now, we just don't inline them.
*/
visit(cast(Expression)e);
}
override void visit(TypeidExp e)
{
//printf("TypeidExp.doInlineAs!%s(): %s\n", Result.stringof.ptr, e.toChars());
auto te = e.copy().isTypeidExp();
if (auto ex = isExpression(te.obj))
{
te.obj = doInlineAs!Expression(ex, ids);
}
else
assert(isType(te.obj));
result = te;
}
override void visit(NewExp e)
{
//printf("NewExp.doInlineAs!%s(): %s\n", Result.stringof.ptr, e.toChars());
auto ne = e.copy().isNewExp();
ne.thisexp = doInlineAs!Expression(e.thisexp, ids);
ne.argprefix = doInlineAs!Expression(e.argprefix, ids);
ne.newargs = arrayExpressionDoInline(e.newargs);
ne.arguments = arrayExpressionDoInline(e.arguments);
result = ne;
semanticTypeInfo(null, e.type);
}
override void visit(DeleteExp e)
{
visit(cast(UnaExp)e);
Type tb = e.e1.type.toBasetype();
if (tb.ty == Tarray)
{
Type tv = tb.nextOf().baseElemOf();
if (auto ts = tv.isTypeStruct())
{
auto sd = ts.sym;
if (sd.dtor)
semanticTypeInfo(null, ts);
}
}
}
override void visit(UnaExp e)
{
auto ue = cast(UnaExp)e.copy();
ue.e1 = doInlineAs!Expression(e.e1, ids);
result = ue;
}
override void visit(AssertExp e)
{
auto ae = e.copy().isAssertExp();
ae.e1 = doInlineAs!Expression(e.e1, ids);
ae.msg = doInlineAs!Expression(e.msg, ids);
result = ae;
}
override void visit(BinExp e)
{
auto be = cast(BinExp)e.copy();
be.e1 = doInlineAs!Expression(e.e1, ids);
be.e2 = doInlineAs!Expression(e.e2, ids);
result = be;
}
override void visit(CallExp e)
{
auto ce = e.copy().isCallExp();
ce.e1 = doInlineAs!Expression(e.e1, ids);
ce.arguments = arrayExpressionDoInline(e.arguments);
result = ce;
}
override void visit(AssignExp e)
{
visit(cast(BinExp)e);
if (auto ale = e.e1.isArrayLengthExp())
{
Type tn = ale.e1.type.toBasetype().nextOf();
semanticTypeInfo(null, tn);
}
}
override void visit(EqualExp e)
{
visit(cast(BinExp)e);
Type t1 = e.e1.type.toBasetype();
if (t1.ty == Tarray || t1.ty == Tsarray)
{
Type t = t1.nextOf().toBasetype();
while (t.toBasetype().nextOf())
t = t.nextOf().toBasetype();
if (t.ty == Tstruct)
semanticTypeInfo(null, t);
}
else if (t1.ty == Taarray)
{
semanticTypeInfo(null, t1);
}
}
override void visit(IndexExp e)
{
auto are = e.copy().isIndexExp();
are.e1 = doInlineAs!Expression(e.e1, ids);
if (e.lengthVar)
{
//printf("lengthVar\n");
auto vd = e.lengthVar;
auto vto = new VarDeclaration(vd.loc, vd.type, vd.ident, vd._init);
memcpy(cast(void*)vto, cast(void*)vd, __traits(classInstanceSize, VarDeclaration));
vto.parent = ids.parent;
vto.csym = null;
vto.isym = null;
ids.from.push(vd);
ids.to.push(vto);
if (vd._init && !vd._init.isVoidInitializer())
{
auto ie = vd._init.isExpInitializer();
assert(ie);
vto._init = new ExpInitializer(ie.loc, doInlineAs!Expression(ie.exp, ids));
}
are.lengthVar = vto;
}
are.e2 = doInlineAs!Expression(e.e2, ids);
result = are;
}
override void visit(SliceExp e)
{
auto are = e.copy().isSliceExp();
are.e1 = doInlineAs!Expression(e.e1, ids);
if (e.lengthVar)
{
//printf("lengthVar\n");
auto vd = e.lengthVar;
auto vto = new VarDeclaration(vd.loc, vd.type, vd.ident, vd._init);
memcpy(cast(void*)vto, cast(void*)vd, __traits(classInstanceSize, VarDeclaration));
vto.parent = ids.parent;
vto.csym = null;
vto.isym = null;
ids.from.push(vd);
ids.to.push(vto);
if (vd._init && !vd._init.isVoidInitializer())
{
auto ie = vd._init.isExpInitializer();
assert(ie);
vto._init = new ExpInitializer(ie.loc, doInlineAs!Expression(ie.exp, ids));
}
are.lengthVar = vto;
}
are.lwr = doInlineAs!Expression(e.lwr, ids);
are.upr = doInlineAs!Expression(e.upr, ids);
result = are;
}
override void visit(TupleExp e)
{
auto ce = e.copy().isTupleExp();
ce.e0 = doInlineAs!Expression(e.e0, ids);
ce.exps = arrayExpressionDoInline(e.exps);
result = ce;
}
override void visit(ArrayLiteralExp e)
{
auto ce = e.copy().isArrayLiteralExp();
ce.basis = doInlineAs!Expression(e.basis, ids);
ce.elements = arrayExpressionDoInline(e.elements);
result = ce;
semanticTypeInfo(null, e.type);
}
override void visit(AssocArrayLiteralExp e)
{
auto ce = e.copy().isAssocArrayLiteralExp();
ce.keys = arrayExpressionDoInline(e.keys);
ce.values = arrayExpressionDoInline(e.values);
result = ce;
semanticTypeInfo(null, e.type);
}
override void visit(StructLiteralExp e)
{
if (e.inlinecopy)
{
result = e.inlinecopy;
return;
}
auto ce = e.copy().isStructLiteralExp();
e.inlinecopy = ce;
ce.elements = arrayExpressionDoInline(e.elements);
e.inlinecopy = null;
result = ce;
}
override void visit(ArrayExp e)
{
assert(0); // this should have been lowered to something else
}
override void visit(CondExp e)
{
auto ce = e.copy().isCondExp();
ce.econd = doInlineAs!Expression(e.econd, ids);
ce.e1 = doInlineAs!Expression(e.e1, ids);
ce.e2 = doInlineAs!Expression(e.e2, ids);
result = ce;
}
}
}
/// ditto
private Result doInlineAs(Result)(Statement s, InlineDoState ids)
{
if (!s)
return null;
scope DoInlineAs!Result v = new DoInlineAs!Result(ids);
s.accept(v);
return v.result;
}
/// ditto
private Result doInlineAs(Result)(Expression e, InlineDoState ids)
{
if (!e)
return null;
scope DoInlineAs!Result v = new DoInlineAs!Result(ids);
e.accept(v);
return v.result;
}
/***********************************************************
* Walk the trees, looking for functions to inline.
* Inline any that can be.
*/
private extern (C++) final class InlineScanVisitor : Visitor
{
alias visit = Visitor.visit;
public:
FuncDeclaration parent; // function being scanned
// As the visit method cannot return a value, these variables
// are used to pass the result from 'visit' back to 'inlineScan'
Statement sresult;
Expression eresult;
bool again;
extern (D) this()
{
}
override void visit(Statement s)
{
}
override void visit(ExpStatement s)
{
static if (LOG)
{
printf("ExpStatement.inlineScan(%s)\n", s.toChars());
}
if (!s.exp)
return;
Statement inlineScanExpAsStatement(ref Expression exp)
{
/* If there's a EXP.call at the top, then it may fail to inline
* as an Expression. Try to inline as a Statement instead.
*/
if (auto ce = exp.isCallExp())
{
visitCallExp(ce, null, true);
if (eresult)
exp = eresult;
auto s = sresult;
sresult = null;
eresult = null;
return s;
}
/* If there's a CondExp or CommaExp at the top, then its
* sub-expressions may be inlined as statements.
*/
if (auto e = exp.isCondExp())
{
inlineScan(e.econd);
auto s1 = inlineScanExpAsStatement(e.e1);
auto s2 = inlineScanExpAsStatement(e.e2);
if (!s1 && !s2)
return null;
auto ifbody = !s1 ? new ExpStatement(e.e1.loc, e.e1) : s1;
auto elsebody = !s2 ? new ExpStatement(e.e2.loc, e.e2) : s2;
return new IfStatement(exp.loc, null, e.econd, ifbody, elsebody, exp.loc);
}
if (auto e = exp.isCommaExp())
{
/* If expression declares temporaries which have to be destructed
* at the end of the scope then it is better handled as an expression.
*/
if (expNeedsDtor(e.e1))
{
inlineScan(exp);
return null;
}
auto s1 = inlineScanExpAsStatement(e.e1);
auto s2 = inlineScanExpAsStatement(e.e2);
if (!s1 && !s2)
return null;
auto a = new Statements();
a.push(!s1 ? new ExpStatement(e.e1.loc, e.e1) : s1);
a.push(!s2 ? new ExpStatement(e.e2.loc, e.e2) : s2);
return new CompoundStatement(exp.loc, a);
}
// inline as an expression
inlineScan(exp);
return null;
}
sresult = inlineScanExpAsStatement(s.exp);
}
override void visit(CompoundStatement s)
{
foreach (i; 0 .. s.statements.dim)
{
inlineScan((*s.statements)[i]);
}
}
override void visit(UnrolledLoopStatement s)
{
foreach (i; 0 .. s.statements.dim)
{
inlineScan((*s.statements)[i]);
}
}
override void visit(ScopeStatement s)
{
inlineScan(s.statement);
}
override void visit(WhileStatement s)
{
inlineScan(s.condition);
inlineScan(s._body);
}
override void visit(DoStatement s)
{
inlineScan(s._body);
inlineScan(s.condition);
}
override void visit(ForStatement s)
{
inlineScan(s._init);
inlineScan(s.condition);
inlineScan(s.increment);
inlineScan(s._body);
}
override void visit(ForeachStatement s)
{
inlineScan(s.aggr);
inlineScan(s._body);
}
override void visit(ForeachRangeStatement s)
{
inlineScan(s.lwr);
inlineScan(s.upr);
inlineScan(s._body);
}
override void visit(IfStatement s)
{
inlineScan(s.condition);
inlineScan(s.ifbody);
inlineScan(s.elsebody);
}
override void visit(SwitchStatement s)
{
//printf("SwitchStatement.inlineScan()\n");
inlineScan(s.condition);
inlineScan(s._body);
Statement sdefault = s.sdefault;
inlineScan(sdefault);
s.sdefault = cast(DefaultStatement)sdefault;
if (s.cases)
{
foreach (i; 0 .. s.cases.dim)
{
Statement scase = (*s.cases)[i];
inlineScan(scase);
(*s.cases)[i] = cast(CaseStatement)scase;
}
}
}
override void visit(CaseStatement s)
{
//printf("CaseStatement.inlineScan()\n");
inlineScan(s.exp);
inlineScan(s.statement);
}
override void visit(DefaultStatement s)
{
inlineScan(s.statement);
}
override void visit(ReturnStatement s)
{
//printf("ReturnStatement.inlineScan()\n");
inlineScan(s.exp);
}
override void visit(SynchronizedStatement s)
{
inlineScan(s.exp);
inlineScan(s._body);
}
override void visit(WithStatement s)
{
inlineScan(s.exp);
inlineScan(s._body);
}
override void visit(TryCatchStatement s)
{
inlineScan(s._body);
if (s.catches)
{
foreach (c; *s.catches)
{
inlineScan(c.handler);
}
}
}
override void visit(TryFinallyStatement s)
{
inlineScan(s._body);
inlineScan(s.finalbody);
}
override void visit(ThrowStatement s)
{
inlineScan(s.exp);
}
override void visit(LabelStatement s)
{
inlineScan(s.statement);
}
/********************************
* Scan Statement s for inlining opportunities,
* and if found replace s with an inlined one.
* Params:
* s = Statement to be scanned and updated
*/
void inlineScan(ref Statement s)
{
if (!s)
return;
assert(sresult is null);
s.accept(this);
if (sresult)
{
s = sresult;
sresult = null;
}
}
/* -------------------------- */
void arrayInlineScan(Expressions* arguments)
{
if (arguments)
{
foreach (i; 0 .. arguments.dim)
{
inlineScan((*arguments)[i]);
}
}
}
override void visit(Expression e)
{
}
void scanVar(Dsymbol s)
{
//printf("scanVar(%s %s)\n", s.kind(), s.toPrettyChars());
VarDeclaration vd = s.isVarDeclaration();
if (vd)
{
TupleDeclaration td = vd.toAlias().isTupleDeclaration();
if (td)
{
foreach (i; 0 .. td.objects.dim)
{
DsymbolExp se = cast(DsymbolExp)(*td.objects)[i];
assert(se.op == EXP.dSymbol);
scanVar(se.s); // TODO
}
}
else if (vd._init)
{
if (ExpInitializer ie = vd._init.isExpInitializer())
{
inlineScan(ie.exp);
}
}
}
else
{
s.accept(this);
}
}
override void visit(DeclarationExp e)
{
//printf("DeclarationExp.inlineScan() %s\n", e.toChars());
scanVar(e.declaration);
}
override void visit(UnaExp e)
{
inlineScan(e.e1);
}
override void visit(AssertExp e)
{
inlineScan(e.e1);
inlineScan(e.msg);
}
override void visit(BinExp e)
{
inlineScan(e.e1);
inlineScan(e.e2);
}
override void visit(AssignExp e)
{
// Look for NRVO, as inlining NRVO function returns require special handling
if (e.op == EXP.construct && e.e2.op == EXP.call)
{
auto ce = e.e2.isCallExp();
if (ce.f && ce.f.nrvo_can && ce.f.nrvo_var) // NRVO
{
if (auto ve = e.e1.isVarExp())
{
/* Inlining:
* S s = foo(); // initializing by rvalue
* S s = S(1); // constructor call
*/
Declaration d = ve.var;
if (d.storage_class & (STC.out_ | STC.ref_)) // refinit
goto L1;
}
else
{
/* Inlining:
* this.field = foo(); // inside constructor
*/
inlineScan(e.e1);
}
visitCallExp(ce, e.e1, false);
if (eresult)
{
//printf("call with nrvo: %s ==> %s\n", e.toChars(), eresult.toChars());
return;
}
}
}
L1:
visit(cast(BinExp)e);
}
override void visit(CallExp e)
{
//printf("CallExp.inlineScan() %s\n", e.toChars());
visitCallExp(e, null, false);
}
/**************************************
* Check function call to see if can be inlined,
* and then inline it if it can.
* Params:
* e = the function call
* eret = if !null, then this is the lvalue of the nrvo function result
* asStatements = if inline as statements rather than as an Expression
* Returns:
* this.eresult if asStatements == false
* this.sresult if asStatements == true
*/
void visitCallExp(CallExp e, Expression eret, bool asStatements)
{
inlineScan(e.e1);
arrayInlineScan(e.arguments);
//printf("visitCallExp() %s\n", e.toChars());
FuncDeclaration fd;
void inlineFd()
{
if (!fd || fd == parent)
return;
/* If the arguments generate temporaries that need destruction, the destruction
* must be done after the function body is executed.
* The easiest way to accomplish that is to do the inlining as an Expression.
* https://issues.dlang.org/show_bug.cgi?id=16652
*/
bool asStates = asStatements;
if (asStates)
{
if (fd.inlineStatusExp == ILS.yes)
asStates = false; // inline as expressions
// so no need to recompute argumentsNeedDtors()
else if (argumentsNeedDtors(e.arguments))
asStates = false;
}
if (canInline(fd, false, false, asStates))
{
expandInline(e.loc, fd, parent, eret, null, e.arguments, asStates, e.vthis2, eresult, sresult, again);
if (asStatements && eresult)
{
sresult = new ExpStatement(eresult.loc, eresult);
eresult = null;
}
}
}
/* Pattern match various ASTs looking for indirect function calls, delegate calls,
* function literal calls, delegate literal calls, and dot member calls.
* If so, and that is only assigned its _init.
* If so, do 'copy propagation' of the _init value and try to inline it.
*/
if (auto ve = e.e1.isVarExp())
{
fd = ve.var.isFuncDeclaration();
if (fd)
// delegate call
inlineFd();
else
{
// delegate literal call
auto v = ve.var.isVarDeclaration();
if (v && v._init && v.type.ty == Tdelegate && onlyOneAssign(v, parent))
{
//printf("init: %s\n", v._init.toChars());
auto ei = v._init.isExpInitializer();
if (ei && ei.exp.op == EXP.blit)
{
Expression e2 = (cast(AssignExp)ei.exp).e2;
if (auto fe = e2.isFuncExp())
{
auto fld = fe.fd;
assert(fld.tok == TOK.delegate_);
fd = fld;
inlineFd();
}
else if (auto de = e2.isDelegateExp())
{
if (auto ve2 = de.e1.isVarExp())
{
fd = ve2.var.isFuncDeclaration();
inlineFd();
}
}
}
}
}
}
else if (auto dve = e.e1.isDotVarExp())
{
fd = dve.var.isFuncDeclaration();
if (fd && fd != parent && canInline(fd, true, false, asStatements))
{
if (dve.e1.op == EXP.call && dve.e1.type.toBasetype().ty == Tstruct)
{
/* To create ethis, we'll need to take the address
* of dve.e1, but this won't work if dve.e1 is
* a function call.
*/
}
else
{
expandInline(e.loc, fd, parent, eret, dve.e1, e.arguments, asStatements, e.vthis2, eresult, sresult, again);
}
}
}
else if (e.e1.op == EXP.star &&
(cast(PtrExp)e.e1).e1.op == EXP.variable)
{
auto ve = e.e1.isPtrExp().e1.isVarExp();
VarDeclaration v = ve.var.isVarDeclaration();
if (v && v._init && onlyOneAssign(v, parent))
{
//printf("init: %s\n", v._init.toChars());
auto ei = v._init.isExpInitializer();
if (ei && ei.exp.op == EXP.blit)
{
Expression e2 = (cast(AssignExp)ei.exp).e2;
// function pointer call
if (auto se = e2.isSymOffExp())
{
fd = se.var.isFuncDeclaration();
inlineFd();
}
// function literal call
else if (auto fe = e2.isFuncExp())
{
auto fld = fe.fd;
assert(fld.tok == TOK.function_);
fd = fld;
inlineFd();
}
}
}
}
else
return;
if (global.params.verbose && (eresult || sresult))
message("inlined %s =>\n %s", fd.toPrettyChars(), parent.toPrettyChars());
if (eresult && e.type.ty != Tvoid)
{
Expression ex = eresult;
while (ex.op == EXP.comma)
{
ex.type = e.type;
ex = ex.isCommaExp().e2;
}
ex.type = e.type;
}
}
override void visit(SliceExp e)
{
inlineScan(e.e1);
inlineScan(e.lwr);
inlineScan(e.upr);
}
override void visit(TupleExp e)
{
//printf("TupleExp.inlineScan()\n");
inlineScan(e.e0);
arrayInlineScan(e.exps);
}
override void visit(ArrayLiteralExp e)
{
//printf("ArrayLiteralExp.inlineScan()\n");
inlineScan(e.basis);
arrayInlineScan(e.elements);
}
override void visit(AssocArrayLiteralExp e)
{
//printf("AssocArrayLiteralExp.inlineScan()\n");
arrayInlineScan(e.keys);
arrayInlineScan(e.values);
}
override void visit(StructLiteralExp e)
{
//printf("StructLiteralExp.inlineScan()\n");
if (e.stageflags & stageInlineScan)
return;
int old = e.stageflags;
e.stageflags |= stageInlineScan;
arrayInlineScan(e.elements);
e.stageflags = old;
}
override void visit(ArrayExp e)
{
//printf("ArrayExp.inlineScan()\n");
inlineScan(e.e1);
arrayInlineScan(e.arguments);
}
override void visit(CondExp e)
{
inlineScan(e.econd);
inlineScan(e.e1);
inlineScan(e.e2);
}
/********************************
* Scan Expression e for inlining opportunities,
* and if found replace e with an inlined one.
* Params:
* e = Expression to be scanned and updated
*/
void inlineScan(ref Expression e)
{
if (!e)
return;
assert(eresult is null);
e.accept(this);
if (eresult)
{
e = eresult;
eresult = null;
}
}
/*************************************
* Look for function inlining possibilities.
*/
override void visit(Dsymbol d)
{
// Most Dsymbols aren't functions
}
override void visit(FuncDeclaration fd)
{
static if (LOG)
{
printf("FuncDeclaration.inlineScan('%s')\n", fd.toPrettyChars());
}
if (!(global.params.useInline || fd.hasAlwaysInlines))
return;
if (fd.isUnitTestDeclaration() && !global.params.useUnitTests ||
fd.flags & FUNCFLAG.inlineScanned)
return;
if (fd.fbody && !fd.naked)
{
auto againsave = again;
auto parentsave = parent;
parent = fd;
do
{
again = false;
fd.inlineNest++;
fd.flags |= FUNCFLAG.inlineScanned;
inlineScan(fd.fbody);
fd.inlineNest--;
}
while (again);
again = againsave;
parent = parentsave;
}
}
override void visit(AttribDeclaration d)
{
Dsymbols* decls = d.include(null);
if (decls)
{
foreach (i; 0 .. decls.dim)
{
Dsymbol s = (*decls)[i];
//printf("AttribDeclaration.inlineScan %s\n", s.toChars());
s.accept(this);
}
}
}
override void visit(AggregateDeclaration ad)
{
//printf("AggregateDeclaration.inlineScan(%s)\n", toChars());
if (ad.members)
{
foreach (i; 0 .. ad.members.dim)
{
Dsymbol s = (*ad.members)[i];
//printf("inline scan aggregate symbol '%s'\n", s.toChars());
s.accept(this);
}
}
}
override void visit(TemplateInstance ti)
{
static if (LOG)
{
printf("TemplateInstance.inlineScan('%s')\n", ti.toChars());
}
if (!ti.errors && ti.members)
{
foreach (i; 0 .. ti.members.dim)
{
Dsymbol s = (*ti.members)[i];
s.accept(this);
}
}
}
}
/***********************************************************
* Test that `fd` can be inlined.
*
* Params:
* hasthis = `true` if the function call has explicit 'this' expression.
* hdrscan = `true` if the inline scan is for 'D header' content.
* statementsToo = `true` if the function call is placed on ExpStatement.
* It means more code-block dependent statements in fd body - ForStatement,
* ThrowStatement, etc. can be inlined.
*
* Returns:
* true if the function body can be expanded.
*
* Todo:
* - Would be able to eliminate `hasthis` parameter, because semantic analysis
* no longer accepts calls of contextful function without valid 'this'.
* - Would be able to eliminate `hdrscan` parameter, because it's always false.
*/
private bool canInline(FuncDeclaration fd, bool hasthis, bool hdrscan, bool statementsToo)
{
int cost;
static if (CANINLINE_LOG)
{
printf("FuncDeclaration.canInline(hasthis = %d, statementsToo = %d, '%s')\n",
hasthis, statementsToo, fd.toPrettyChars());
}
if (fd.needThis() && !hasthis)
return false;
if (fd.inlineNest)
{
static if (CANINLINE_LOG)
{
printf("\t1: no, inlineNest = %d, semanticRun = %d\n", fd.inlineNest, fd.semanticRun);
}
return false;
}
if (fd.semanticRun < PASS.semantic3 && !hdrscan)
{
if (!fd.fbody)
return false;
if (!fd.functionSemantic3())
return false;
Module.runDeferredSemantic3();
if (global.errors)
return false;
assert(fd.semanticRun >= PASS.semantic3done);
}
final switch (statementsToo ? fd.inlineStatusStmt : fd.inlineStatusExp)
{
case ILS.yes:
static if (CANINLINE_LOG)
{
printf("\t1: yes %s\n", fd.toChars());
}
return true;
case ILS.no:
static if (CANINLINE_LOG)
{
printf("\t1: no %s\n", fd.toChars());
}
return false;
case ILS.uninitialized:
break;
}
final switch (fd.inlining)
{
case PINLINE.default_:
if (!global.params.useInline)
return false;
break;
case PINLINE.always:
break;
case PINLINE.never:
return false;
}
if (fd.type)
{
TypeFunction tf = fd.type.isTypeFunction();
// no variadic parameter lists
if (tf.parameterList.varargs == VarArg.variadic)
goto Lno;
/* No lazy parameters when inlining by statement, as the inliner tries to
* operate on the created delegate itself rather than the return value.
* Discussion: https://github.com/dlang/dmd/pull/6815
*/
if (statementsToo && fd.parameters)
{
foreach (param; *fd.parameters)
{
if (param.storage_class & STC.lazy_)
goto Lno;
}
}
static bool hasDtor(Type t)
{
auto tv = t.baseElemOf();
return tv.ty == Tstruct || tv.ty == Tclass; // for now assume these might have a destructor
}
/* Don't inline a function that returns non-void, but has
* no or multiple return expression.
* When inlining as a statement:
* 1. don't inline array operations, because the order the arguments
* get evaluated gets reversed. This is the same issue that e2ir.callfunc()
* has with them
* 2. don't inline when the return value has a destructor, as it doesn't
* get handled properly
*/
if (tf.next && tf.next.ty != Tvoid &&
(!(fd.hasReturnExp & 1) ||
statementsToo && hasDtor(tf.next)) &&
!hdrscan)
{
static if (CANINLINE_LOG)
{
printf("\t3: no %s\n", fd.toChars());
}
goto Lno;
}
/* https://issues.dlang.org/show_bug.cgi?id=14560
* If fd returns void, all explicit `return;`s
* must not appear in the expanded result.
* See also ReturnStatement.doInlineAs!Statement().
*/
}
// cannot inline constructor calls because we need to convert:
// return;
// to:
// return this;
// ensure() has magic properties the inliner loses
// require() has magic properties too
// see bug 7699
// no nested references to this frame
if (!fd.fbody ||
fd.ident == Id.ensure ||
(fd.ident == Id.require &&
fd.toParent().isFuncDeclaration() &&
fd.toParent().isFuncDeclaration().needThis()) ||
!hdrscan && (fd.isSynchronized() ||
fd.isImportedSymbol() ||
fd.hasNestedFrameRefs() ||
(fd.isVirtual() && !fd.isFinalFunc())))
{
static if (CANINLINE_LOG)
{
printf("\t4: no %s\n", fd.toChars());
}
goto Lno;
}
// cannot inline functions as statement if they have multiple
// return statements
if ((fd.hasReturnExp & 16) && statementsToo)
{
static if (CANINLINE_LOG)
{
printf("\t5: no %s\n", fd.toChars());
}
goto Lno;
}
{
cost = inlineCostFunction(fd, hasthis, hdrscan);
}
static if (CANINLINE_LOG)
{
printf("\tcost = %d for %s\n", cost, fd.toChars());
}
if (tooCostly(cost))
goto Lno;
if (!statementsToo && cost > COST_MAX)
goto Lno;
if (!hdrscan)
{
// Don't modify inlineStatus for header content scan
if (statementsToo)
fd.inlineStatusStmt = ILS.yes;
else
fd.inlineStatusExp = ILS.yes;
scope InlineScanVisitor v = new InlineScanVisitor();
fd.accept(v); // Don't scan recursively for header content scan
if (fd.inlineStatusExp == ILS.uninitialized)
{
// Need to redo cost computation, as some statements or expressions have been inlined
cost = inlineCostFunction(fd, hasthis, hdrscan);
static if (CANINLINE_LOG)
{
printf("recomputed cost = %d for %s\n", cost, fd.toChars());
}
if (tooCostly(cost))
goto Lno;
if (!statementsToo && cost > COST_MAX)
goto Lno;
if (statementsToo)
fd.inlineStatusStmt = ILS.yes;
else
fd.inlineStatusExp = ILS.yes;
}
}
static if (CANINLINE_LOG)
{
printf("\t2: yes %s\n", fd.toChars());
}
return true;
Lno:
if (fd.inlining == PINLINE.always && global.params.warnings == DiagnosticReporting.inform)
warning(fd.loc, "cannot inline function `%s`", fd.toPrettyChars());
if (!hdrscan) // Don't modify inlineStatus for header content scan
{
if (statementsToo)
fd.inlineStatusStmt = ILS.no;
else
fd.inlineStatusExp = ILS.no;
}
static if (CANINLINE_LOG)
{
printf("\t2: no %s\n", fd.toChars());
}
return false;
}
/***********************************************************
* Expand a function call inline,
* ethis.fd(arguments)
*
* Params:
* callLoc = location of CallExp
* fd = function to expand
* parent = function that the call to fd is being expanded into
* eret = if !null then the lvalue of where the nrvo return value goes
* ethis = 'this' reference
* arguments = arguments passed to fd
* asStatements = expand to Statements rather than Expressions
* eresult = if expanding to an expression, this is where the expression is written to
* sresult = if expanding to a statement, this is where the statement is written to
* again = if true, then fd can be inline scanned again because there may be
* more opportunities for inlining
*/
private void expandInline(Loc callLoc, FuncDeclaration fd, FuncDeclaration parent, Expression eret,
Expression ethis, Expressions* arguments, bool asStatements, VarDeclaration vthis2,
out Expression eresult, out Statement sresult, out bool again)
{
auto tf = fd.type.isTypeFunction();
static if (LOG || CANINLINE_LOG || EXPANDINLINE_LOG)
printf("FuncDeclaration.expandInline('%s', %d)\n", fd.toChars(), asStatements);
static if (EXPANDINLINE_LOG)
{
if (eret) printf("\teret = %s\n", eret.toChars());
if (ethis) printf("\tethis = %s\n", ethis.toChars());
}
scope ids = new InlineDoState(parent, fd);
if (fd.isNested())
{
if (!parent.inlinedNestedCallees)
parent.inlinedNestedCallees = new FuncDeclarations();
parent.inlinedNestedCallees.push(fd);
}
VarDeclaration vret; // will be set the function call result
if (eret)
{
if (auto ve = eret.isVarExp())
{
vret = ve.var.isVarDeclaration();
assert(!(vret.storage_class & (STC.out_ | STC.ref_)));
eret = null;
}
else
{
/* Inlining:
* this.field = foo(); // inside constructor
*/
auto ei = new ExpInitializer(callLoc, null);
auto tmp = Identifier.generateId("__retvar");
vret = new VarDeclaration(fd.loc, eret.type, tmp, ei);
vret.storage_class |= STC.temp | STC.ref_;
vret.linkage = LINK.d;
vret.parent = parent;
ei.exp = new ConstructExp(fd.loc, vret, eret);
ei.exp.type = vret.type;
auto de = new DeclarationExp(fd.loc, vret);
de.type = Type.tvoid;
eret = de;
}
if (!asStatements && fd.nrvo_var)
{
ids.from.push(fd.nrvo_var);
ids.to.push(vret);
}
}
else
{
if (!asStatements && fd.nrvo_var)
{
auto tmp = Identifier.generateId("__retvar");
vret = new VarDeclaration(fd.loc, fd.nrvo_var.type, tmp, new VoidInitializer(fd.loc));
assert(!tf.isref);
vret.storage_class = STC.temp | STC.rvalue;
vret.linkage = tf.linkage;
vret.parent = parent;
auto de = new DeclarationExp(fd.loc, vret);
de.type = Type.tvoid;
eret = de;
ids.from.push(fd.nrvo_var);
ids.to.push(vret);
}
}
// Set up vthis
VarDeclaration vthis;
if (ethis)
{
Expression e0;
ethis = Expression.extractLast(ethis, e0);
assert(vthis2 || !fd.isThis2);
if (vthis2)
{
// void*[2] __this = [ethis, this]
if (ethis.type.ty == Tstruct)
{
// ðis
Type t = ethis.type.pointerTo();
ethis = new AddrExp(ethis.loc, ethis);
ethis.type = t;
}
auto elements = new Expressions(2);
(*elements)[0] = ethis;
(*elements)[1] = new NullExp(Loc.initial, Type.tvoidptr);
Expression ae = new ArrayLiteralExp(vthis2.loc, vthis2.type, elements);
Expression ce = new ConstructExp(vthis2.loc, vthis2, ae);
ce.type = vthis2.type;
vthis2._init = new ExpInitializer(vthis2.loc, ce);
vthis = vthis2;
}
else if (auto ve = ethis.isVarExp())
{
vthis = ve.var.isVarDeclaration();
}
else
{
//assert(ethis.type.ty != Tpointer);
if (ethis.type.ty == Tpointer)
{
Type t = ethis.type.nextOf();
ethis = new PtrExp(ethis.loc, ethis);
ethis.type = t;
}
auto ei = new ExpInitializer(fd.loc, ethis);
vthis = new VarDeclaration(fd.loc, ethis.type, Id.This, ei);
if (ethis.type.ty != Tclass)
vthis.storage_class = STC.ref_;
else
vthis.storage_class = STC.in_;
vthis.linkage = LINK.d;
vthis.parent = parent;
ei.exp = new ConstructExp(fd.loc, vthis, ethis);
ei.exp.type = vthis.type;
auto de = new DeclarationExp(fd.loc, vthis);
de.type = Type.tvoid;
e0 = Expression.combine(e0, de);
}
ethis = e0;
ids.vthis = vthis;
}
// Set up parameters
Expression eparams;
if (arguments && arguments.dim)
{
assert(fd.parameters.dim == arguments.dim);
foreach (i; 0 .. arguments.dim)
{
auto vfrom = (*fd.parameters)[i];
auto arg = (*arguments)[i];
auto ei = new ExpInitializer(vfrom.loc, arg);
auto vto = new VarDeclaration(vfrom.loc, vfrom.type, vfrom.ident, ei);
vto.storage_class |= vfrom.storage_class & (STC.temp | STC.IOR | STC.lazy_ | STC.nodtor);
vto.linkage = vfrom.linkage;
vto.parent = parent;
//printf("vto = '%s', vto.storage_class = x%x\n", vto.toChars(), vto.storage_class);
//printf("vto.parent = '%s'\n", parent.toChars());
if (VarExp ve = arg.isVarExp())
{
VarDeclaration va = ve.var.isVarDeclaration();
if (va && va.isArgDtorVar)
{
assert(vto.storage_class & STC.nodtor);
// The destructor is called on va so take it by ref
vto.storage_class |= STC.ref_;
}
}
// Even if vto is STC.lazy_, `vto = arg` is handled correctly in glue layer.
ei.exp = new BlitExp(vto.loc, vto, arg);
ei.exp.type = vto.type;
ids.from.push(vfrom);
ids.to.push(vto);
auto de = new DeclarationExp(vto.loc, vto);
de.type = Type.tvoid;
eparams = Expression.combine(eparams, de);
/* If function pointer or delegate parameters are present,
* inline scan again because if they are initialized to a symbol,
* any calls to the fp or dg can be inlined.
*/
if (vfrom.type.ty == Tdelegate ||
vfrom.type.isPtrToFunction())
{
if (auto ve = arg.isVarExp())
{
if (ve.var.isFuncDeclaration())
again = true;
}
else if (auto se = arg.isSymOffExp())
{
if (se.var.isFuncDeclaration())
again = true;
}
else if (arg.op == EXP.function_ || arg.op == EXP.delegate_)
again = true;
}
}
}
if (asStatements)
{
/* Construct:
* { eret; ethis; eparams; fd.fbody; }
* or:
* { eret; ethis; try { eparams; fd.fbody; } finally { vthis.edtor; } }
*/
auto as = new Statements();
if (eret)
as.push(new ExpStatement(callLoc, eret));
if (ethis)
as.push(new ExpStatement(callLoc, ethis));
auto as2 = as;
if (vthis && !vthis.isDataseg())
{
if (vthis.needsScopeDtor())
{
// same with ExpStatement.scopeCode()
as2 = new Statements();
vthis.storage_class |= STC.nodtor;
}
}
if (eparams)
as2.push(new ExpStatement(callLoc, eparams));
fd.inlineNest++;
Statement s = doInlineAs!Statement(fd.fbody, ids);
fd.inlineNest--;
as2.push(s);
if (as2 != as)
{
as.push(new TryFinallyStatement(callLoc,
new CompoundStatement(callLoc, as2),
new DtorExpStatement(callLoc, vthis.edtor, vthis)));
}
sresult = new ScopeStatement(callLoc, new CompoundStatement(callLoc, as), callLoc);
static if (EXPANDINLINE_LOG)
printf("\n[%s] %s expandInline sresult =\n%s\n",
callLoc.toChars(), fd.toPrettyChars(), sresult.toChars());
}
else
{
/* Construct:
* (eret, ethis, eparams, fd.fbody)
*/
fd.inlineNest++;
auto e = doInlineAs!Expression(fd.fbody, ids);
fd.inlineNest--;
// https://issues.dlang.org/show_bug.cgi?id=11322
if (tf.isref)
e = e.toLvalue(null, null);
/* If the inlined function returns a copy of a struct,
* and then the return value is used subsequently as an
* lvalue, as in a struct return that is then used as a 'this'.
* Taking the address of the return value will be taking the address
* of the original, not the copy. Fix this by assigning the return value to
* a temporary, then returning the temporary. If the temporary is used as an
* lvalue, it will work.
* This only happens with struct returns.
* See https://issues.dlang.org/show_bug.cgi?id=2127 for an example.
*
* On constructor call making __inlineretval is merely redundant, because
* the returned reference is exactly same as vthis, and the 'this' variable
* already exists at the caller side.
*/
if (tf.next.ty == Tstruct && !fd.nrvo_var && !fd.isCtorDeclaration() &&
!isConstruction(e))
{
/* Generate a new variable to hold the result and initialize it with the
* inlined body of the function:
* tret __inlineretval = e;
*/
auto ei = new ExpInitializer(callLoc, e);
auto tmp = Identifier.generateId("__inlineretval");
auto vd = new VarDeclaration(callLoc, tf.next, tmp, ei);
vd.storage_class = STC.temp | (tf.isref ? STC.ref_ : STC.rvalue);
vd.linkage = tf.linkage;
vd.parent = parent;
ei.exp = new ConstructExp(callLoc, vd, e);
ei.exp.type = vd.type;
auto de = new DeclarationExp(callLoc, vd);
de.type = Type.tvoid;
// Chain the two together:
// ( typeof(return) __inlineretval = ( inlined body )) , __inlineretval
e = Expression.combine(de, new VarExp(callLoc, vd));
}
// https://issues.dlang.org/show_bug.cgi?id=15210
if (tf.next.ty == Tvoid && e && e.type.ty != Tvoid)
{
e = new CastExp(callLoc, e, Type.tvoid);
e.type = Type.tvoid;
}
eresult = Expression.combine(eresult, eret, ethis, eparams);
eresult = Expression.combine(eresult, e);
static if (EXPANDINLINE_LOG)
printf("\n[%s] %s expandInline eresult = %s\n",
callLoc.toChars(), fd.toPrettyChars(), eresult.toChars());
}
// Need to reevaluate whether parent can now be inlined
// in expressions, as we might have inlined statements
parent.inlineStatusExp = ILS.uninitialized;
}
/****************************************************
* Determine if the value of `e` is the result of construction.
*
* Params:
* e = expression to check
* Returns:
* true for value generated by a constructor or struct literal
*/
private bool isConstruction(Expression e)
{
e = lastComma(e);
if (e.op == EXP.structLiteral)
{
return true;
}
/* Detect:
* structliteral.ctor(args)
*/
else if (e.op == EXP.call)
{
auto ce = cast(CallExp)e;
if (ce.e1.op == EXP.dotVariable)
{
auto dve = cast(DotVarExp)ce.e1;
auto fd = dve.var.isFuncDeclaration();
if (fd && fd.isCtorDeclaration())
{
if (dve.e1.op == EXP.structLiteral)
{
return true;
}
}
}
}
return false;
}
/***********************************************************
* Determine if v is 'head const', meaning
* that once it is initialized it is not changed
* again.
*
* This is done using a primitive flow analysis.
*
* v is head const if v is const or immutable.
* Otherwise, v is assumed to be head const unless one of the
* following is true:
* 1. v is a `ref` or `out` variable
* 2. v is a parameter and fd is a variadic function
* 3. v is assigned to again
* 4. the address of v is taken
* 5. v is referred to by a function nested within fd
* 6. v is ever assigned to a `ref` or `out` variable
* 7. v is ever passed to another function as `ref` or `out`
*
* Params:
* v variable to check
* fd function that v is local to
* Returns:
* true if v's initializer is the only value assigned to v
*/
private bool onlyOneAssign(VarDeclaration v, FuncDeclaration fd)
{
if (!v.type.isMutable())
return true; // currently the only case handled atm
return false;
}
/************************************************************
* See if arguments to a function are creating temporaries that
* will need destruction after the function is executed.
* Params:
* arguments = arguments to function
* Returns:
* true if temporaries need destruction
*/
private bool argumentsNeedDtors(Expressions* arguments)
{
if (arguments)
{
foreach (arg; *arguments)
{
if (expNeedsDtor(arg))
return true;
}
}
return false;
}
/************************************************************
* See if expression is creating temporaries that
* will need destruction at the end of the scope.
* Params:
* exp = expression
* Returns:
* true if temporaries need destruction
*/
private bool expNeedsDtor(Expression exp)
{
extern (C++) final class NeedsDtor : StoppableVisitor
{
alias visit = typeof(super).visit;
Expression exp;
public:
extern (D) this(Expression exp)
{
this.exp = exp;
}
override void visit(Expression)
{
}
override void visit(DeclarationExp de)
{
Dsymbol_needsDtor(de.declaration);
}
void Dsymbol_needsDtor(Dsymbol s)
{
/* This mirrors logic of Dsymbol_toElem() in e2ir.d
* perhaps they can be combined.
*/
void symbolDg(Dsymbol s)
{
Dsymbol_needsDtor(s);
}
if (auto vd = s.isVarDeclaration())
{
s = s.toAlias();
if (s != vd)
return Dsymbol_needsDtor(s);
else if (vd.isStatic() || vd.storage_class & (STC.extern_ | STC.tls | STC.gshared | STC.manifest))
return;
if (vd.needsScopeDtor())
{
stop = true;
}
}
else if (auto tm = s.isTemplateMixin())
{
tm.members.foreachDsymbol(&symbolDg);
}
else if (auto ad = s.isAttribDeclaration())
{
ad.include(null).foreachDsymbol(&symbolDg);
}
else if (auto td = s.isTupleDeclaration())
{
foreach (o; *td.objects)
{
import dmd.root.rootobject;
if (o.dyncast() == DYNCAST.expression)
{
Expression eo = cast(Expression)o;
if (eo.op == EXP.dSymbol)
{
DsymbolExp se = cast(DsymbolExp)eo;
Dsymbol_needsDtor(se.s);
}
}
}
}
}
}
scope NeedsDtor ct = new NeedsDtor(exp);
return walkPostorder(exp, ct);
}
| D |
///////////////////////////////////////////////////////////////////////
// Info EXIT
///////////////////////////////////////////////////////////////////////
INSTANCE DIA_Addon_Sancho_EXIT (C_INFO)
{
npc = BDT_1073_Addon_Sancho;
nr = 999;
condition = DIA_Addon_Sancho_EXIT_Condition;
information = DIA_Addon_Sancho_EXIT_Info;
permanent = TRUE;
description = DIALOG_ENDE;
};
FUNC INT DIA_Addon_Sancho_EXIT_Condition()
{
return TRUE;
};
FUNC VOID DIA_Addon_Sancho_EXIT_Info()
{
AI_StopProcessInfos (self);
};
// ************************************************************
// PICK POCKET
// ************************************************************
INSTANCE DIA_Addon_Sancho_PICKPOCKET (C_INFO)
{
npc = BDT_1073_Addon_Sancho;
nr = 900;
condition = DIA_Addon_Sancho_PICKPOCKET_Condition;
information = DIA_Addon_Sancho_PICKPOCKET_Info;
permanent = TRUE;
description = Pickpocket_40;
};
FUNC INT DIA_Addon_Sancho_PICKPOCKET_Condition()
{
C_Beklauen (50, 40);
};
FUNC VOID DIA_Addon_Sancho_PICKPOCKET_Info()
{
Info_ClearChoices (DIA_Addon_Sancho_PICKPOCKET);
Info_AddChoice (DIA_Addon_Sancho_PICKPOCKET, DIALOG_BACK ,DIA_Addon_Sancho_PICKPOCKET_BACK);
Info_AddChoice (DIA_Addon_Sancho_PICKPOCKET, DIALOG_PICKPOCKET ,DIA_Addon_Sancho_PICKPOCKET_DoIt);
};
func void DIA_Addon_Sancho_PICKPOCKET_DoIt()
{
B_Beklauen ();
Info_ClearChoices (DIA_Addon_Sancho_PICKPOCKET);
};
func void DIA_Addon_Sancho_PICKPOCKET_BACK()
{
Info_ClearChoices (DIA_Addon_Sancho_PICKPOCKET);
};
//---------------------------------------------------------------------
// Info HI
//---------------------------------------------------------------------
INSTANCE DIA_Addon_Sancho_HI (C_INFO)
{
npc = BDT_1073_Addon_Sancho;
nr = 2;
condition = DIA_Addon_Sancho_HI_Condition;
information = DIA_Addon_Sancho_HI_Info;
permanent = FALSE;
important = TRUE;
};
FUNC INT DIA_Addon_Sancho_HI_Condition()
{
return TRUE;
};
FUNC VOID DIA_Addon_Sancho_HI_Info()
{
AI_Output (self,other,"DIA_Addon_Sancho_HI_06_00"); //Cholera, znowu ktoś nowy. Też chcesz złota, co?
AI_Output (other,self,"DIA_Addon_Sancho_HI_15_01"); //Złota?
AI_Output (self,other,"DIA_Addon_Sancho_HI_06_02"); //Nie próbuj się ze mną przekomarzać!
AI_Output (self,other,"DIA_Addon_Sancho_HI_06_03"); //Wszyscy nowi chcą wejść do kopalni.
AI_Output (self,other,"DIA_Addon_Sancho_HI_06_04"); //Nie oczekuj jednak, że będzie to łatwe!
if (SC_KnowsRavensGoldmine == FALSE)
{
B_LogEntry (TOPIC_Addon_RavenKDW, LogText_Addon_RavensGoldmine);
Log_AddEntry (TOPIC_Addon_Sklaven, LogText_Addon_RavensGoldmine);
B_LogEntry (TOPIC_Addon_ScoutBandits,Log_Text_Addon_ScoutBandits);
};
SC_KnowsRavensGoldmine = TRUE;
};
//---------------------------------------------------------------------
// Lager
//---------------------------------------------------------------------
INSTANCE DIA_Addon_Sancho_Lager (C_INFO)
{
npc = BDT_1073_Addon_Sancho;
nr = 2;
condition = DIA_Addon_Sancho_Lager_Condition;
information = DIA_Addon_Sancho_Lager_Info;
permanent = FALSE;
description = "Jak mogę się dostać do obozu?";
};
FUNC INT DIA_Addon_Sancho_Lager_Condition()
{
return TRUE;
};
FUNC VOID DIA_Addon_Sancho_Lager_Info()
{
AI_Output (other,self,"DIA_Addon_Sancho_Lager_15_00"); //Jak mogę się dostać do obozu?
AI_Output (self,other,"DIA_Addon_Sancho_Lager_06_01"); //Idź po prostu mostem!
if (!Npc_IsDead(Franco))
{
AI_Output (self,other,"DIA_Addon_Sancho_Lager_06_02"); //Jeśli jednak chcesz się dostać do kopalni, będziesz musiał przejść koło Franka.
AI_Output (self,other,"DIA_Addon_Sancho_Lager_06_03"); //On oczekuje od nowych, że przez jakiś czas będą pracować poza obozem.
};
Log_CreateTopic (Topic_Addon_Franco,LOG_MISSION);
Log_SetTopicStatus (Topic_Addon_Franco,LOG_RUNNING);
B_LogEntry (Topic_Addon_Franco,"Wszyscy nowoprzybyli muszą pracować na bagnie, zanim dostaną pozwolenie wejścia do kopalni.");
};
//---------------------------------------------------------------------
// Mine
//---------------------------------------------------------------------
INSTANCE DIA_Addon_Sancho_Mine (C_INFO)
{
npc = BDT_1073_Addon_Sancho;
nr = 3;
condition = DIA_Addon_Sancho_Mine_Condition;
information = DIA_Addon_Sancho_Mine_Info;
permanent = FALSE;
description = "Powiedz mi coś więcej o kopalni.";
};
FUNC INT DIA_Addon_Sancho_Mine_Condition()
{
if (!Npc_IsDead(Franco))
{
return TRUE;
};
};
FUNC VOID DIA_Addon_Sancho_Mine_Info()
{
AI_Output (other,self,"DIA_Addon_Sancho_Mine_15_00"); //Powiedz mi coś więcej o kopalni.
AI_Output (self,other,"DIA_Addon_Sancho_Mine_06_01"); //Chcesz dostać się do środka? Spróbuj zaprzyjaźnić się z Frankiem. On jest tu szefem.
AI_Output (self,other,"DIA_Addon_Sancho_Mine_06_02"); //To on decyduje, kto wejdzie do obozu.
AI_Output (self,other,"DIA_Addon_Sancho_Mine_06_03"); //Jak będziesz siedział na tyłku, to nie masz żadnych szans na wejście.
AI_Output (self,other,"DIA_Addon_Sancho_Mine_06_04"); //Porozmawiaj z nim, niech ci wyznaczy jakąś robotę.
B_LogEntry (Topic_Addon_Franco,"FRANKO decyduje o tym, kto może wejść do obozu. Rozdziela także pracę.");
};
//---------------------------------------------------------------------
// Wo Franco
//---------------------------------------------------------------------
INSTANCE DIA_Addon_Sancho_Franco (C_INFO)
{
npc = BDT_1073_Addon_Sancho;
nr = 4;
condition = DIA_Addon_Sancho_Franco_Condition;
information = DIA_Addon_Sancho_Franco_Info;
permanent = FALSE;
description = "Gdzie znajdę tego Franka?";
};
FUNC INT DIA_Addon_Sancho_Franco_Condition()
{
if (Npc_KnowsInfo (other, DIA_Addon_Sancho_Mine))
&& (!Npc_IsDead(Franco))
{
return TRUE;
};
};
FUNC VOID DIA_Addon_Sancho_Franco_Info()
{
AI_Output (other,self,"DIA_Addon_Sancho_Franco_15_00"); //Gdzie znajdę tego Franka?
AI_Output (self,other,"DIA_Addon_Sancho_Franco_06_01"); //Zwykle kręci się przed wejściem do obozu.
AI_Output (self,other,"DIA_Addon_Sancho_Franco_06_02"); //No i zachowuj się, bo inaczej dostaniesz taką gównianą robotę, jak ja.
B_LogEntry (Topic_Addon_Franco,"Franko kręci się przy wejściu do obozu.");
};
//---------------------------------------------------------------------
// Spitzel
//---------------------------------------------------------------------
INSTANCE DIA_Addon_Sancho_Spitzel (C_INFO)
{
npc = BDT_1073_Addon_Sancho;
nr = 5;
condition = DIA_Addon_Sancho_Spitzel_Condition;
information = DIA_Addon_Sancho_Spitzel_Info;
permanent = FALSE;
description = "Musisz tu siedzieć przez cały czas?";
};
FUNC INT DIA_Addon_Sancho_Spitzel_Condition()
{
if (Npc_KnowsInfo (other, DIA_Addon_Sancho_Franco))
|| (Npc_IsDead(Franco))
{
return TRUE;
};
};
FUNC VOID DIA_Addon_Sancho_Spitzel_Info()
{
AI_Output (other,self,"DIA_Addon_Sancho_Spitzel_15_00");//Musisz tu siedzieć przez cały czas?
AI_Output (self,other,"DIA_Addon_Sancho_Spitzel_06_01");//Mam sprawdzać, czy wśród nowych ludzi nie ma szpiegów.
AI_Output (self,other,"DIA_Addon_Sancho_Spitzel_06_02");//Jakby ktoś znał to zapomniane miejsce. To koniec świata - środek bagna.
AI_Output (self,other,"DIA_Addon_Sancho_Spitzel_06_03");//Nikt nie może nas tu znaleźć i nie znajdzie. Po co ktoś miałby przysyłać do nas szpiegów?
};
//---------------------------------------------------------------------
// Info Perm
//---------------------------------------------------------------------
INSTANCE DIA_Addon_Sancho_Perm (C_INFO)
{
npc = BDT_1073_Addon_Sancho;
nr = 99;
condition = DIA_Addon_Sancho_Perm_Condition;
information = DIA_Addon_Sancho_Perm_Info;
permanent = TRUE;
description = "Co nowego?";
};
FUNC INT DIA_Addon_Sancho_Perm_Condition()
{
if Npc_KnowsInfo (other, DIA_Addon_Sancho_Spitzel)
{
return TRUE;
};
};
var int Comment_Franco;
var int Comment_Esteban;
FUNC VOID DIA_Addon_Sancho_Perm_Info()
{
AI_Output (other,self,"DIA_Addon_Sancho_Perm_15_00");//Co nowego?
if Npc_IsDead (Franco)
&& (Comment_Franco == FALSE)
{
AI_Output (self,other,"DIA_Addon_Sancho_Perm_06_01");//Słyszałem, że wysłałeś Franka do piekła. Dobra robota...
if !Npc_IsDead (Carlos)
{
AI_Output (self,other,"DIA_Addon_Sancho_Perm_06_02");//...ale teraz szarogęsi się tutaj Carlos. A z nim nie ma żartów...
}
else
{
AI_Output (self,other,"DIA_Addon_Sancho_Perm_06_03");//Carlosa też wysłałeś na cmentarz? Chłopie, lepiej trzymaj się ode mnie z daleka.
};
Comment_Franco = TRUE;
}
else if Npc_IsDead (Esteban)
&& (Comment_Esteban == FALSE)
{
AI_Output (self,other,"DIA_Addon_Sancho_Perm_06_04");//Słyszałem, że ukatrupiłeś Estebana. Chłopie, do czego ty zmierzasz, co?
Comment_Esteban = TRUE;
}
else
{
AI_Output (self,other,"DIA_Addon_Sancho_Perm_06_05");//Nie, w tej chwili nic nowego.
};
};
| D |
/*******************************************************************************
* Copyright (c) 2000, 2003 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module org.eclipse.swt.events.MouseMoveListener;
public import org.eclipse.swt.internal.SWTEventListener;
public import org.eclipse.swt.events.MouseEvent;
/**
* Classes which implement this interface provide a method
* that deals with the events that are generated as the mouse
* pointer moves.
* <p>
* After creating an instance of a class that :
* this interface it can be added to a control using the
* <code>addMouseMoveListener</code> method and removed using
* the <code>removeMouseMoveListener</code> method. As the
* mouse moves, the mouseMove method will be invoked.
* </p>
*
* @see MouseEvent
*/
public interface MouseMoveListener : SWTEventListener {
/**
* Sent when the mouse moves.
*
* @param e an event containing information about the mouse move
*/
public void mouseMove(MouseEvent e);
}
| D |
/**
* The fiber module provides OS-indepedent lightweight threads aka fibers.
*
* Copyright: Copyright Sean Kelly 2005 - 2012.
* License: Distributed under the
* $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
* (See accompanying file LICENSE)
* Authors: Sean Kelly, Walter Bright, Alex Rønne Petersen, Martin Nowak
* Source: $(DRUNTIMESRC core/thread/fiber.d)
*/
/* NOTE: This file has been patched from the original DMD distribution to
* work with the GDC compiler.
*/
module core.thread.fiber;
import core.thread.osthread;
import core.thread.threadgroup;
import core.thread.types;
import core.thread.context;
///////////////////////////////////////////////////////////////////////////////
// Fiber Platform Detection
///////////////////////////////////////////////////////////////////////////////
version (GNU)
{
import gcc.builtins;
import gcc.config;
version (GNU_StackGrowsDown)
version = StackGrowsDown;
}
else
{
// this should be true for most architectures
version = StackGrowsDown;
}
version (Windows)
{
import core.stdc.stdlib : malloc, free;
import core.sys.windows.winbase;
import core.sys.windows.winnt;
}
private
{
version (D_InlineAsm_X86)
{
version (Windows)
version = AsmX86_Windows;
else version (Posix)
version = AsmX86_Posix;
version = AlignFiberStackTo16Byte;
}
else version (D_InlineAsm_X86_64)
{
version (Windows)
{
version = AsmX86_64_Windows;
version = AlignFiberStackTo16Byte;
}
else version (Posix)
{
version = AsmX86_64_Posix;
version = AlignFiberStackTo16Byte;
}
}
else version (X86)
{
version = AlignFiberStackTo16Byte;
version (CET)
{
// fiber_switchContext does not support shadow stack from
// Intel CET. So use ucontext implementation.
}
else
{
version = AsmExternal;
version (MinGW)
version = GNU_AsmX86_Windows;
else version (OSX)
version = AsmX86_Posix;
else version (Posix)
version = AsmX86_Posix;
}
}
else version (X86_64)
{
version = AlignFiberStackTo16Byte;
version (CET)
{
// fiber_switchContext does not support shadow stack from
// Intel CET. So use ucontext implementation.
}
else version (D_X32)
{
// let X32 be handled by ucontext swapcontext
}
else
{
version = AsmExternal;
version (MinGW)
version = GNU_AsmX86_64_Windows;
else version (OSX)
version = AsmX86_64_Posix;
else version (Posix)
version = AsmX86_64_Posix;
}
}
else version (PPC)
{
version (OSX)
{
version = AsmPPC_Darwin;
version = AsmExternal;
version = AlignFiberStackTo16Byte;
}
else version (Posix)
{
version = AsmPPC_Posix;
version = AsmExternal;
}
}
else version (PPC64)
{
version (OSX)
{
version = AsmPPC_Darwin;
version = AsmExternal;
version = AlignFiberStackTo16Byte;
}
else version (Posix)
{
version = AlignFiberStackTo16Byte;
}
}
else version (MIPS_O32)
{
version (Posix)
{
version = AsmMIPS_O32_Posix;
version = AsmExternal;
}
}
else version (AArch64)
{
version (Posix)
{
version = AsmAArch64_Posix;
version = AsmExternal;
version = AlignFiberStackTo16Byte;
}
}
else version (ARM)
{
version (Posix)
{
version = AsmARM_Posix;
version = AsmExternal;
}
}
else version (SPARC)
{
// NOTE: The SPARC ABI specifies only doubleword alignment.
version = AlignFiberStackTo16Byte;
}
else version (SPARC64)
{
version = AlignFiberStackTo16Byte;
}
version (Posix)
{
version (AsmX86_Windows) {} else
version (AsmX86_Posix) {} else
version (AsmX86_64_Windows) {} else
version (AsmX86_64_Posix) {} else
version (AsmExternal) {} else
{
// NOTE: The ucontext implementation requires architecture specific
// data definitions to operate so testing for it must be done
// by checking for the existence of ucontext_t rather than by
// a version identifier. Please note that this is considered
// an obsolescent feature according to the POSIX spec, so a
// custom solution is still preferred.
import core.sys.posix.ucontext;
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Fiber Entry Point and Context Switch
///////////////////////////////////////////////////////////////////////////////
private
{
import core.atomic : atomicStore, cas, MemoryOrder;
import core.exception : onOutOfMemoryError;
import core.stdc.stdlib : abort;
extern (C) void fiber_entryPoint() nothrow
{
Fiber obj = Fiber.getThis();
assert( obj );
assert( Thread.getThis().m_curr is obj.m_ctxt );
atomicStore!(MemoryOrder.raw)(*cast(shared)&Thread.getThis().m_lock, false);
obj.m_ctxt.tstack = obj.m_ctxt.bstack;
obj.m_state = Fiber.State.EXEC;
try
{
obj.run();
}
catch ( Throwable t )
{
obj.m_unhandled = t;
}
static if ( __traits( compiles, ucontext_t ) )
obj.m_ucur = &obj.m_utxt;
obj.m_state = Fiber.State.TERM;
obj.switchOut();
}
// Look above the definition of 'class Fiber' for some information about the implementation of this routine
version (AsmExternal)
{
extern (C) void fiber_switchContext( void** oldp, void* newp ) nothrow @nogc;
version (AArch64)
extern (C) void fiber_trampoline() nothrow;
}
else
extern (C) void fiber_switchContext( void** oldp, void* newp ) nothrow @nogc
{
// NOTE: The data pushed and popped in this routine must match the
// default stack created by Fiber.initStack or the initial
// switch into a new context will fail.
version (AsmX86_Windows)
{
asm pure nothrow @nogc
{
naked;
// save current stack state
push EBP;
mov EBP, ESP;
push EDI;
push ESI;
push EBX;
push dword ptr FS:[0];
push dword ptr FS:[4];
push dword ptr FS:[8];
push EAX;
// store oldp again with more accurate address
mov EAX, dword ptr 8[EBP];
mov [EAX], ESP;
// load newp to begin context switch
mov ESP, dword ptr 12[EBP];
// load saved state from new stack
pop EAX;
pop dword ptr FS:[8];
pop dword ptr FS:[4];
pop dword ptr FS:[0];
pop EBX;
pop ESI;
pop EDI;
pop EBP;
// 'return' to complete switch
pop ECX;
jmp ECX;
}
}
else version (AsmX86_64_Windows)
{
asm pure nothrow @nogc
{
naked;
// save current stack state
// NOTE: When changing the layout of registers on the stack,
// make sure that the XMM registers are still aligned.
// On function entry, the stack is guaranteed to not
// be aligned to 16 bytes because of the return address
// on the stack.
push RBP;
mov RBP, RSP;
push R12;
push R13;
push R14;
push R15;
push RDI;
push RSI;
// 7 registers = 56 bytes; stack is now aligned to 16 bytes
sub RSP, 160;
movdqa [RSP + 144], XMM6;
movdqa [RSP + 128], XMM7;
movdqa [RSP + 112], XMM8;
movdqa [RSP + 96], XMM9;
movdqa [RSP + 80], XMM10;
movdqa [RSP + 64], XMM11;
movdqa [RSP + 48], XMM12;
movdqa [RSP + 32], XMM13;
movdqa [RSP + 16], XMM14;
movdqa [RSP], XMM15;
push RBX;
xor RAX,RAX;
push qword ptr GS:[RAX];
push qword ptr GS:8[RAX];
push qword ptr GS:16[RAX];
// store oldp
mov [RCX], RSP;
// load newp to begin context switch
mov RSP, RDX;
// load saved state from new stack
pop qword ptr GS:16[RAX];
pop qword ptr GS:8[RAX];
pop qword ptr GS:[RAX];
pop RBX;
movdqa XMM15, [RSP];
movdqa XMM14, [RSP + 16];
movdqa XMM13, [RSP + 32];
movdqa XMM12, [RSP + 48];
movdqa XMM11, [RSP + 64];
movdqa XMM10, [RSP + 80];
movdqa XMM9, [RSP + 96];
movdqa XMM8, [RSP + 112];
movdqa XMM7, [RSP + 128];
movdqa XMM6, [RSP + 144];
add RSP, 160;
pop RSI;
pop RDI;
pop R15;
pop R14;
pop R13;
pop R12;
pop RBP;
// 'return' to complete switch
pop RCX;
jmp RCX;
}
}
else version (AsmX86_Posix)
{
asm pure nothrow @nogc
{
naked;
// save current stack state
push EBP;
mov EBP, ESP;
push EDI;
push ESI;
push EBX;
push EAX;
// store oldp again with more accurate address
mov EAX, dword ptr 8[EBP];
mov [EAX], ESP;
// load newp to begin context switch
mov ESP, dword ptr 12[EBP];
// load saved state from new stack
pop EAX;
pop EBX;
pop ESI;
pop EDI;
pop EBP;
// 'return' to complete switch
pop ECX;
jmp ECX;
}
}
else version (AsmX86_64_Posix)
{
asm pure nothrow @nogc
{
naked;
// save current stack state
push RBP;
mov RBP, RSP;
push RBX;
push R12;
push R13;
push R14;
push R15;
// store oldp
mov [RDI], RSP;
// load newp to begin context switch
mov RSP, RSI;
// load saved state from new stack
pop R15;
pop R14;
pop R13;
pop R12;
pop RBX;
pop RBP;
// 'return' to complete switch
pop RCX;
jmp RCX;
}
}
else static if ( __traits( compiles, ucontext_t ) )
{
Fiber cfib = Fiber.getThis();
void* ucur = cfib.m_ucur;
*oldp = &ucur;
swapcontext( **(cast(ucontext_t***) oldp),
*(cast(ucontext_t**) newp) );
}
else
static assert(0, "Not implemented");
}
}
///////////////////////////////////////////////////////////////////////////////
// Fiber
///////////////////////////////////////////////////////////////////////////////
/*
* Documentation of Fiber internals:
*
* The main routines to implement when porting Fibers to new architectures are
* fiber_switchContext and initStack. Some version constants have to be defined
* for the new platform as well, search for "Fiber Platform Detection and Memory Allocation".
*
* Fibers are based on a concept called 'Context'. A Context describes the execution
* state of a Fiber or main thread which is fully described by the stack, some
* registers and a return address at which the Fiber/Thread should continue executing.
* Please note that not only each Fiber has a Context, but each thread also has got a
* Context which describes the threads stack and state. If you call Fiber fib; fib.call
* the first time in a thread you switch from Threads Context into the Fibers Context.
* If you call fib.yield in that Fiber you switch out of the Fibers context and back
* into the Thread Context. (However, this is not always the case. You can call a Fiber
* from within another Fiber, then you switch Contexts between the Fibers and the Thread
* Context is not involved)
*
* In all current implementations the registers and the return address are actually
* saved on a Contexts stack.
*
* The fiber_switchContext routine has got two parameters:
* void** a: This is the _location_ where we have to store the current stack pointer,
* the stack pointer of the currently executing Context (Fiber or Thread).
* void* b: This is the pointer to the stack of the Context which we want to switch into.
* Note that we get the same pointer here as the one we stored into the void** a
* in a previous call to fiber_switchContext.
*
* In the simplest case, a fiber_switchContext rountine looks like this:
* fiber_switchContext:
* push {return Address}
* push {registers}
* copy {stack pointer} into {location pointed to by a}
* //We have now switch to the stack of a different Context!
* copy {b} into {stack pointer}
* pop {registers}
* pop {return Address}
* jump to {return Address}
*
* The GC uses the value returned in parameter a to scan the Fibers stack. It scans from
* the stack base to that value. As the GC dislikes false pointers we can actually optimize
* this a little: By storing registers which can not contain references to memory managed
* by the GC outside of the region marked by the stack base pointer and the stack pointer
* saved in fiber_switchContext we can prevent the GC from scanning them.
* Such registers are usually floating point registers and the return address. In order to
* implement this, we return a modified stack pointer from fiber_switchContext. However,
* we have to remember that when we restore the registers from the stack!
*
* --------------------------- <= Stack Base
* | Frame | <= Many other stack frames
* | Frame |
* |-------------------------| <= The last stack frame. This one is created by fiber_switchContext
* | registers with pointers |
* | | <= Stack pointer. GC stops scanning here
* | return address |
* |floating point registers |
* --------------------------- <= Real Stack End
*
* fiber_switchContext:
* push {registers with pointers}
* copy {stack pointer} into {location pointed to by a}
* push {return Address}
* push {Floating point registers}
* //We have now switch to the stack of a different Context!
* copy {b} into {stack pointer}
* //We now have to adjust the stack pointer to point to 'Real Stack End' so we can pop
* //the FP registers
* //+ or - depends on if your stack grows downwards or upwards
* {stack pointer} = {stack pointer} +- ({FPRegisters}.sizeof + {return address}.sizeof}
* pop {Floating point registers}
* pop {return Address}
* pop {registers with pointers}
* jump to {return Address}
*
* So the question now is which registers need to be saved? This depends on the specific
* architecture ABI of course, but here are some general guidelines:
* - If a register is callee-save (if the callee modifies the register it must saved and
* restored by the callee) it needs to be saved/restored in switchContext
* - If a register is caller-save it needn't be saved/restored. (Calling fiber_switchContext
* is a function call and the compiler therefore already must save these registers before
* calling fiber_switchContext)
* - Argument registers used for passing parameters to functions needn't be saved/restored
* - The return register needn't be saved/restored (fiber_switchContext hasn't got a return type)
* - All scratch registers needn't be saved/restored
* - The link register usually needn't be saved/restored (but sometimes it must be cleared -
* see below for details)
* - The frame pointer register - if it exists - is usually callee-save
* - All current implementations do not save control registers
*
* What happens on the first switch into a Fiber? We never saved a state for this fiber before,
* but the initial state is prepared in the initStack routine. (This routine will also be called
* when a Fiber is being resetted). initStack must produce exactly the same stack layout as the
* part of fiber_switchContext which saves the registers. Pay special attention to set the stack
* pointer correctly if you use the GC optimization mentioned before. the return Address saved in
* initStack must be the address of fiber_entrypoint.
*
* There's now a small but important difference between the first context switch into a fiber and
* further context switches. On the first switch, Fiber.call is used and the returnAddress in
* fiber_switchContext will point to fiber_entrypoint. The important thing here is that this jump
* is a _function call_, we call fiber_entrypoint by jumping before it's function prologue. On later
* calls, the user used yield() in a function, and therefore the return address points into a user
* function, after the yield call. So here the jump in fiber_switchContext is a _function return_,
* not a function call!
*
* The most important result of this is that on entering a function, i.e. fiber_entrypoint, we
* would have to provide a return address / set the link register once fiber_entrypoint
* returns. Now fiber_entrypoint does never return and therefore the actual value of the return
* address / link register is never read/used and therefore doesn't matter. When fiber_switchContext
* performs a _function return_ the value in the link register doesn't matter either.
* However, the link register will still be saved to the stack in fiber_entrypoint and some
* exception handling / stack unwinding code might read it from this stack location and crash.
* The exact solution depends on your architecture, but see the ARM implementation for a way
* to deal with this issue.
*
* The ARM implementation is meant to be used as a kind of documented example implementation.
* Look there for a concrete example.
*
* FIXME: fiber_entrypoint might benefit from a @noreturn attribute, but D doesn't have one.
*/
/**
* This class provides a cooperative concurrency mechanism integrated with the
* threading and garbage collection functionality. Calling a fiber may be
* considered a blocking operation that returns when the fiber yields (via
* Fiber.yield()). Execution occurs within the context of the calling thread
* so synchronization is not necessary to guarantee memory visibility so long
* as the same thread calls the fiber each time. Please note that there is no
* requirement that a fiber be bound to one specific thread. Rather, fibers
* may be freely passed between threads so long as they are not currently
* executing. Like threads, a new fiber thread may be created using either
* derivation or composition, as in the following example.
*
* Warning:
* Status registers are not saved by the current implementations. This means
* floating point exception status bits (overflow, divide by 0), rounding mode
* and similar stuff is set per-thread, not per Fiber!
*
* Warning:
* On ARM FPU registers are not saved if druntime was compiled as ARM_SoftFloat.
* If such a build is used on a ARM_SoftFP system which actually has got a FPU
* and other libraries are using the FPU registers (other code is compiled
* as ARM_SoftFP) this can cause problems. Druntime must be compiled as
* ARM_SoftFP in this case.
*
* Authors: Based on a design by Mikola Lysenko.
*/
class Fiber
{
///////////////////////////////////////////////////////////////////////////
// Initialization
///////////////////////////////////////////////////////////////////////////
version (Windows)
// exception handling walks the stack, invoking DbgHelp.dll which
// needs up to 16k of stack space depending on the version of DbgHelp.dll,
// the existence of debug symbols and other conditions. Avoid causing
// stack overflows by defaulting to a larger stack size
enum defaultStackPages = 8;
else version (OSX)
{
version (X86_64)
// libunwind on macOS 11 now requires more stack space than 16k, so
// default to a larger stack size. This is only applied to X86 as
// the PAGESIZE is still 4k, however on AArch64 it is 16k.
enum defaultStackPages = 8;
else
enum defaultStackPages = 4;
}
else
enum defaultStackPages = 4;
/**
* Initializes a fiber object which is associated with a static
* D function.
*
* Params:
* fn = The fiber function.
* sz = The stack size for this fiber.
* guardPageSize = size of the guard page to trap fiber's stack
* overflows. Beware that using this will increase
* the number of mmaped regions on platforms using mmap
* so an OS-imposed limit may be hit.
*
* In:
* fn must not be null.
*/
this( void function() fn, size_t sz = PAGESIZE * defaultStackPages,
size_t guardPageSize = PAGESIZE ) nothrow
in
{
assert( fn );
}
do
{
allocStack( sz, guardPageSize );
reset( fn );
}
/**
* Initializes a fiber object which is associated with a dynamic
* D function.
*
* Params:
* dg = The fiber function.
* sz = The stack size for this fiber.
* guardPageSize = size of the guard page to trap fiber's stack
* overflows. Beware that using this will increase
* the number of mmaped regions on platforms using mmap
* so an OS-imposed limit may be hit.
*
* In:
* dg must not be null.
*/
this( void delegate() dg, size_t sz = PAGESIZE * defaultStackPages,
size_t guardPageSize = PAGESIZE ) nothrow
in
{
assert( dg );
}
do
{
allocStack( sz, guardPageSize );
reset( dg );
}
/**
* Cleans up any remaining resources used by this object.
*/
~this() nothrow @nogc
{
// NOTE: A live reference to this object will exist on its associated
// stack from the first time its call() method has been called
// until its execution completes with State.TERM. Thus, the only
// times this dtor should be called are either if the fiber has
// terminated (and therefore has no active stack) or if the user
// explicitly deletes this object. The latter case is an error
// but is not easily tested for, since State.HOLD may imply that
// the fiber was just created but has never been run. There is
// not a compelling case to create a State.INIT just to offer a
// means of ensuring the user isn't violating this object's
// contract, so for now this requirement will be enforced by
// documentation only.
freeStack();
}
///////////////////////////////////////////////////////////////////////////
// General Actions
///////////////////////////////////////////////////////////////////////////
/**
* Transfers execution to this fiber object. The calling context will be
* suspended until the fiber calls Fiber.yield() or until it terminates
* via an unhandled exception.
*
* Params:
* rethrow = Rethrow any unhandled exception which may have caused this
* fiber to terminate.
*
* In:
* This fiber must be in state HOLD.
*
* Throws:
* Any exception not handled by the joined thread.
*
* Returns:
* Any exception not handled by this fiber if rethrow = false, null
* otherwise.
*/
// Not marked with any attributes, even though `nothrow @nogc` works
// because it calls arbitrary user code. Most of the implementation
// is already `@nogc nothrow`, but in order for `Fiber.call` to
// propagate the attributes of the user's function, the Fiber
// class needs to be templated.
final Throwable call( Rethrow rethrow = Rethrow.yes )
{
return rethrow ? call!(Rethrow.yes)() : call!(Rethrow.no);
}
/// ditto
final Throwable call( Rethrow rethrow )()
{
callImpl();
if ( m_unhandled )
{
Throwable t = m_unhandled;
m_unhandled = null;
static if ( rethrow )
throw t;
else
return t;
}
return null;
}
private void callImpl() nothrow @nogc
in
{
assert( m_state == State.HOLD );
}
do
{
Fiber cur = getThis();
static if ( __traits( compiles, ucontext_t ) )
m_ucur = cur ? &cur.m_utxt : &Fiber.sm_utxt;
setThis( this );
this.switchIn();
setThis( cur );
static if ( __traits( compiles, ucontext_t ) )
m_ucur = null;
// NOTE: If the fiber has terminated then the stack pointers must be
// reset. This ensures that the stack for this fiber is not
// scanned if the fiber has terminated. This is necessary to
// prevent any references lingering on the stack from delaying
// the collection of otherwise dead objects. The most notable
// being the current object, which is referenced at the top of
// fiber_entryPoint.
if ( m_state == State.TERM )
{
m_ctxt.tstack = m_ctxt.bstack;
}
}
/// Flag to control rethrow behavior of $(D $(LREF call))
enum Rethrow : bool { no, yes }
/**
* Resets this fiber so that it may be re-used, optionally with a
* new function/delegate. This routine should only be called for
* fibers that have terminated, as doing otherwise could result in
* scope-dependent functionality that is not executed.
* Stack-based classes, for example, may not be cleaned up
* properly if a fiber is reset before it has terminated.
*
* In:
* This fiber must be in state TERM or HOLD.
*/
final void reset() nothrow @nogc
in
{
assert( m_state == State.TERM || m_state == State.HOLD );
}
do
{
m_ctxt.tstack = m_ctxt.bstack;
m_state = State.HOLD;
initStack();
m_unhandled = null;
}
/// ditto
final void reset( void function() fn ) nothrow @nogc
{
reset();
m_call = fn;
}
/// ditto
final void reset( void delegate() dg ) nothrow @nogc
{
reset();
m_call = dg;
}
///////////////////////////////////////////////////////////////////////////
// General Properties
///////////////////////////////////////////////////////////////////////////
/// A fiber may occupy one of three states: HOLD, EXEC, and TERM.
enum State
{
/** The HOLD state applies to any fiber that is suspended and ready to
be called. */
HOLD,
/** The EXEC state will be set for any fiber that is currently
executing. */
EXEC,
/** The TERM state is set when a fiber terminates. Once a fiber
terminates, it must be reset before it may be called again. */
TERM
}
/**
* Gets the current state of this fiber.
*
* Returns:
* The state of this fiber as an enumerated value.
*/
final @property State state() const @safe pure nothrow @nogc
{
return m_state;
}
///////////////////////////////////////////////////////////////////////////
// Actions on Calling Fiber
///////////////////////////////////////////////////////////////////////////
/**
* Forces a context switch to occur away from the calling fiber.
*/
static void yield() nothrow @nogc
{
Fiber cur = getThis();
assert( cur, "Fiber.yield() called with no active fiber" );
assert( cur.m_state == State.EXEC );
static if ( __traits( compiles, ucontext_t ) )
cur.m_ucur = &cur.m_utxt;
cur.m_state = State.HOLD;
cur.switchOut();
cur.m_state = State.EXEC;
}
/**
* Forces a context switch to occur away from the calling fiber and then
* throws obj in the calling fiber.
*
* Params:
* t = The object to throw.
*
* In:
* t must not be null.
*/
static void yieldAndThrow( Throwable t ) nothrow @nogc
in
{
assert( t );
}
do
{
Fiber cur = getThis();
assert( cur, "Fiber.yield() called with no active fiber" );
assert( cur.m_state == State.EXEC );
static if ( __traits( compiles, ucontext_t ) )
cur.m_ucur = &cur.m_utxt;
cur.m_unhandled = t;
cur.m_state = State.HOLD;
cur.switchOut();
cur.m_state = State.EXEC;
}
///////////////////////////////////////////////////////////////////////////
// Fiber Accessors
///////////////////////////////////////////////////////////////////////////
/**
* Provides a reference to the calling fiber or null if no fiber is
* currently active.
*
* Returns:
* The fiber object representing the calling fiber or null if no fiber
* is currently active within this thread. The result of deleting this object is undefined.
*/
static Fiber getThis() @safe nothrow @nogc
{
version (GNU) pragma(inline, false);
return sm_this;
}
///////////////////////////////////////////////////////////////////////////
// Static Initialization
///////////////////////////////////////////////////////////////////////////
version (Posix)
{
static this()
{
static if ( __traits( compiles, ucontext_t ) )
{
int status = getcontext( &sm_utxt );
assert( status == 0 );
}
}
}
private:
//
// Fiber entry point. Invokes the function or delegate passed on
// construction (if any).
//
final void run()
{
m_call();
}
//
// Standard fiber data
//
Callable m_call;
bool m_isRunning;
Throwable m_unhandled;
State m_state;
private:
///////////////////////////////////////////////////////////////////////////
// Stack Management
///////////////////////////////////////////////////////////////////////////
//
// Allocate a new stack for this fiber.
//
final void allocStack( size_t sz, size_t guardPageSize ) nothrow
in
{
assert( !m_pmem && !m_ctxt );
}
do
{
// adjust alloc size to a multiple of PAGESIZE
sz += PAGESIZE - 1;
sz -= sz % PAGESIZE;
// NOTE: This instance of Thread.Context is dynamic so Fiber objects
// can be collected by the GC so long as no user level references
// to the object exist. If m_ctxt were not dynamic then its
// presence in the global context list would be enough to keep
// this object alive indefinitely. An alternative to allocating
// room for this struct explicitly would be to mash it into the
// base of the stack being allocated below. However, doing so
// requires too much special logic to be worthwhile.
m_ctxt = new StackContext;
version (Windows)
{
// reserve memory for stack
m_pmem = VirtualAlloc( null,
sz + guardPageSize,
MEM_RESERVE,
PAGE_NOACCESS );
if ( !m_pmem )
onOutOfMemoryError();
version (StackGrowsDown)
{
void* stack = m_pmem + guardPageSize;
void* guard = m_pmem;
void* pbase = stack + sz;
}
else
{
void* stack = m_pmem;
void* guard = m_pmem + sz;
void* pbase = stack;
}
// allocate reserved stack segment
stack = VirtualAlloc( stack,
sz,
MEM_COMMIT,
PAGE_READWRITE );
if ( !stack )
onOutOfMemoryError();
if (guardPageSize)
{
// allocate reserved guard page
guard = VirtualAlloc( guard,
guardPageSize,
MEM_COMMIT,
PAGE_READWRITE | PAGE_GUARD );
if ( !guard )
onOutOfMemoryError();
}
m_ctxt.bstack = pbase;
m_ctxt.tstack = pbase;
m_size = sz;
}
else
{
version (Posix) import core.sys.posix.sys.mman; // mmap, MAP_ANON
static if ( __traits( compiles, ucontext_t ) )
{
// Stack size must be at least the minimum allowable by the OS.
if (sz < MINSIGSTKSZ)
sz = MINSIGSTKSZ;
}
static if ( __traits( compiles, mmap ) )
{
// Allocate more for the memory guard
sz += guardPageSize;
int mmap_flags = MAP_PRIVATE | MAP_ANON;
version (OpenBSD)
mmap_flags |= MAP_STACK;
m_pmem = mmap( null,
sz,
PROT_READ | PROT_WRITE,
mmap_flags,
-1,
0 );
if ( m_pmem == MAP_FAILED )
m_pmem = null;
}
else static if ( __traits( compiles, valloc ) )
{
m_pmem = valloc( sz );
}
else static if ( __traits( compiles, malloc ) )
{
m_pmem = malloc( sz );
}
else
{
m_pmem = null;
}
if ( !m_pmem )
onOutOfMemoryError();
version (StackGrowsDown)
{
m_ctxt.bstack = m_pmem + sz;
m_ctxt.tstack = m_pmem + sz;
void* guard = m_pmem;
}
else
{
m_ctxt.bstack = m_pmem;
m_ctxt.tstack = m_pmem;
void* guard = m_pmem + sz - guardPageSize;
}
m_size = sz;
static if ( __traits( compiles, mmap ) )
{
if (guardPageSize)
{
// protect end of stack
if ( mprotect(guard, guardPageSize, PROT_NONE) == -1 )
abort();
}
}
else
{
// Supported only for mmap allocated memory - results are
// undefined if applied to memory not obtained by mmap
}
}
Thread.add( m_ctxt );
}
//
// Free this fiber's stack.
//
final void freeStack() nothrow @nogc
in
{
assert( m_pmem && m_ctxt );
}
do
{
// NOTE: m_ctxt is guaranteed to be alive because it is held in the
// global context list.
Thread.slock.lock_nothrow();
scope(exit) Thread.slock.unlock_nothrow();
Thread.remove( m_ctxt );
version (Windows)
{
VirtualFree( m_pmem, 0, MEM_RELEASE );
}
else
{
import core.sys.posix.sys.mman; // munmap
static if ( __traits( compiles, mmap ) )
{
munmap( m_pmem, m_size );
}
else static if ( __traits( compiles, valloc ) )
{
free( m_pmem );
}
else static if ( __traits( compiles, malloc ) )
{
free( m_pmem );
}
}
m_pmem = null;
m_ctxt = null;
}
//
// Initialize the allocated stack.
// Look above the definition of 'class Fiber' for some information about the implementation of this routine
//
final void initStack() nothrow @nogc
in
{
assert( m_ctxt.tstack && m_ctxt.tstack == m_ctxt.bstack );
assert( cast(size_t) m_ctxt.bstack % (void*).sizeof == 0 );
}
do
{
void* pstack = m_ctxt.tstack;
scope( exit ) m_ctxt.tstack = pstack;
void push( size_t val ) nothrow
{
version (StackGrowsDown)
{
pstack -= size_t.sizeof;
*(cast(size_t*) pstack) = val;
}
else
{
pstack += size_t.sizeof;
*(cast(size_t*) pstack) = val;
}
}
// NOTE: On OS X the stack must be 16-byte aligned according
// to the IA-32 call spec. For x86_64 the stack also needs to
// be aligned to 16-byte according to SysV AMD64 ABI.
version (AlignFiberStackTo16Byte)
{
version (StackGrowsDown)
{
pstack = cast(void*)(cast(size_t)(pstack) - (cast(size_t)(pstack) & 0x0F));
}
else
{
pstack = cast(void*)(cast(size_t)(pstack) + (cast(size_t)(pstack) & 0x0F));
}
}
version (AsmX86_Windows)
{
version (StackGrowsDown) {} else static assert( false );
// On Windows Server 2008 and 2008 R2, an exploit mitigation
// technique known as SEHOP is activated by default. To avoid
// hijacking of the exception handler chain, the presence of a
// Windows-internal handler (ntdll.dll!FinalExceptionHandler) at
// its end is tested by RaiseException. If it is not present, all
// handlers are disregarded, and the program is thus aborted
// (see http://blogs.technet.com/b/srd/archive/2009/02/02/
// preventing-the-exploitation-of-seh-overwrites-with-sehop.aspx).
// For new threads, this handler is installed by Windows immediately
// after creation. To make exception handling work in fibers, we
// have to insert it for our new stacks manually as well.
//
// To do this, we first determine the handler by traversing the SEH
// chain of the current thread until its end, and then construct a
// registration block for the last handler on the newly created
// thread. We then continue to push all the initial register values
// for the first context switch as for the other implementations.
//
// Note that this handler is never actually invoked, as we install
// our own one on top of it in the fiber entry point function.
// Thus, it should not have any effects on OSes not implementing
// exception chain verification.
alias fp_t = void function(); // Actual signature not relevant.
static struct EXCEPTION_REGISTRATION
{
EXCEPTION_REGISTRATION* next; // sehChainEnd if last one.
fp_t handler;
}
enum sehChainEnd = cast(EXCEPTION_REGISTRATION*) 0xFFFFFFFF;
__gshared static fp_t finalHandler = null;
if ( finalHandler is null )
{
static EXCEPTION_REGISTRATION* fs0() nothrow
{
asm pure nothrow @nogc
{
naked;
mov EAX, FS:[0];
ret;
}
}
auto reg = fs0();
while ( reg.next != sehChainEnd ) reg = reg.next;
// Benign races are okay here, just to avoid re-lookup on every
// fiber creation.
finalHandler = reg.handler;
}
// When linking with /safeseh (supported by LDC, but not DMD)
// the exception chain must not extend to the very top
// of the stack, otherwise the exception chain is also considered
// invalid. Reserving additional 4 bytes at the top of the stack will
// keep the EXCEPTION_REGISTRATION below that limit
size_t reserve = EXCEPTION_REGISTRATION.sizeof + 4;
pstack -= reserve;
*(cast(EXCEPTION_REGISTRATION*)pstack) =
EXCEPTION_REGISTRATION( sehChainEnd, finalHandler );
auto pChainEnd = pstack;
push( cast(size_t) &fiber_entryPoint ); // EIP
push( cast(size_t) m_ctxt.bstack - reserve ); // EBP
push( 0x00000000 ); // EDI
push( 0x00000000 ); // ESI
push( 0x00000000 ); // EBX
push( cast(size_t) pChainEnd ); // FS:[0]
push( cast(size_t) m_ctxt.bstack ); // FS:[4]
push( cast(size_t) m_ctxt.bstack - m_size ); // FS:[8]
push( 0x00000000 ); // EAX
}
else version (AsmX86_64_Windows)
{
// Using this trampoline instead of the raw fiber_entryPoint
// ensures that during context switches, source and destination
// stacks have the same alignment. Otherwise, the stack would need
// to be shifted by 8 bytes for the first call, as fiber_entryPoint
// is an actual function expecting a stack which is not aligned
// to 16 bytes.
static void trampoline()
{
asm pure nothrow @nogc
{
naked;
sub RSP, 32; // Shadow space (Win64 calling convention)
call fiber_entryPoint;
xor RCX, RCX; // This should never be reached, as
jmp RCX; // fiber_entryPoint must never return.
}
}
push( cast(size_t) &trampoline ); // RIP
push( 0x00000000_00000000 ); // RBP
push( 0x00000000_00000000 ); // R12
push( 0x00000000_00000000 ); // R13
push( 0x00000000_00000000 ); // R14
push( 0x00000000_00000000 ); // R15
push( 0x00000000_00000000 ); // RDI
push( 0x00000000_00000000 ); // RSI
push( 0x00000000_00000000 ); // XMM6 (high)
push( 0x00000000_00000000 ); // XMM6 (low)
push( 0x00000000_00000000 ); // XMM7 (high)
push( 0x00000000_00000000 ); // XMM7 (low)
push( 0x00000000_00000000 ); // XMM8 (high)
push( 0x00000000_00000000 ); // XMM8 (low)
push( 0x00000000_00000000 ); // XMM9 (high)
push( 0x00000000_00000000 ); // XMM9 (low)
push( 0x00000000_00000000 ); // XMM10 (high)
push( 0x00000000_00000000 ); // XMM10 (low)
push( 0x00000000_00000000 ); // XMM11 (high)
push( 0x00000000_00000000 ); // XMM11 (low)
push( 0x00000000_00000000 ); // XMM12 (high)
push( 0x00000000_00000000 ); // XMM12 (low)
push( 0x00000000_00000000 ); // XMM13 (high)
push( 0x00000000_00000000 ); // XMM13 (low)
push( 0x00000000_00000000 ); // XMM14 (high)
push( 0x00000000_00000000 ); // XMM14 (low)
push( 0x00000000_00000000 ); // XMM15 (high)
push( 0x00000000_00000000 ); // XMM15 (low)
push( 0x00000000_00000000 ); // RBX
push( 0xFFFFFFFF_FFFFFFFF ); // GS:[0]
version (StackGrowsDown)
{
push( cast(size_t) m_ctxt.bstack ); // GS:[8]
push( cast(size_t) m_ctxt.bstack - m_size ); // GS:[16]
}
else
{
push( cast(size_t) m_ctxt.bstack ); // GS:[8]
push( cast(size_t) m_ctxt.bstack + m_size ); // GS:[16]
}
}
else version (AsmX86_Posix)
{
push( 0x00000000 ); // Return address of fiber_entryPoint call
push( cast(size_t) &fiber_entryPoint ); // EIP
push( cast(size_t) m_ctxt.bstack ); // EBP
push( 0x00000000 ); // EDI
push( 0x00000000 ); // ESI
push( 0x00000000 ); // EBX
push( 0x00000000 ); // EAX
}
else version (AsmX86_64_Posix)
{
push( 0x00000000_00000000 ); // Return address of fiber_entryPoint call
push( cast(size_t) &fiber_entryPoint ); // RIP
push( cast(size_t) m_ctxt.bstack ); // RBP
push( 0x00000000_00000000 ); // RBX
push( 0x00000000_00000000 ); // R12
push( 0x00000000_00000000 ); // R13
push( 0x00000000_00000000 ); // R14
push( 0x00000000_00000000 ); // R15
}
else version (AsmPPC_Posix)
{
version (StackGrowsDown)
{
pstack -= int.sizeof * 5;
}
else
{
pstack += int.sizeof * 5;
}
push( cast(size_t) &fiber_entryPoint ); // link register
push( 0x00000000 ); // control register
push( 0x00000000 ); // old stack pointer
// GPR values
version (StackGrowsDown)
{
pstack -= int.sizeof * 20;
}
else
{
pstack += int.sizeof * 20;
}
assert( (cast(size_t) pstack & 0x0f) == 0 );
}
else version (AsmPPC_Darwin)
{
version (StackGrowsDown) {}
else static assert(false, "PowerPC Darwin only supports decrementing stacks");
uint wsize = size_t.sizeof;
// linkage + regs + FPRs + VRs
uint space = 8 * wsize + 20 * wsize + 18 * 8 + 12 * 16;
(cast(ubyte*)pstack - space)[0 .. space] = 0;
pstack -= wsize * 6;
*cast(size_t*)pstack = cast(size_t) &fiber_entryPoint; // LR
pstack -= wsize * 22;
// On Darwin PPC64 pthread self is in R13 (which is reserved).
// At present, it is not safe to migrate fibers between threads, but if that
// changes, then updating the value of R13 will also need to be handled.
version (PPC64)
*cast(size_t*)(pstack + wsize) = cast(size_t) Thread.getThis().m_addr;
assert( (cast(size_t) pstack & 0x0f) == 0 );
}
else version (AsmMIPS_O32_Posix)
{
version (StackGrowsDown) {}
else static assert(0);
/* We keep the FP registers and the return address below
* the stack pointer, so they don't get scanned by the
* GC. The last frame before swapping the stack pointer is
* organized like the following.
*
* |-----------|<= frame pointer
* | $gp |
* | $s0-8 |
* |-----------|<= stack pointer
* | $ra |
* | align(8) |
* | $f20-30 |
* |-----------|
*
*/
enum SZ_GP = 10 * size_t.sizeof; // $gp + $s0-8
enum SZ_RA = size_t.sizeof; // $ra
version (MIPS_HardFloat)
{
enum SZ_FP = 6 * 8; // $f20-30
enum ALIGN = -(SZ_FP + SZ_RA) & (8 - 1);
}
else
{
enum SZ_FP = 0;
enum ALIGN = 0;
}
enum BELOW = SZ_FP + ALIGN + SZ_RA;
enum ABOVE = SZ_GP;
enum SZ = BELOW + ABOVE;
(cast(ubyte*)pstack - SZ)[0 .. SZ] = 0;
pstack -= ABOVE;
*cast(size_t*)(pstack - SZ_RA) = cast(size_t)&fiber_entryPoint;
}
else version (AsmAArch64_Posix)
{
// Like others, FP registers and return address (lr) are kept
// below the saved stack top (tstack) to hide from GC scanning.
// fiber_switchContext expects newp sp to look like this:
// 19: x19
// ...
// 9: x29 (fp) <-- newp tstack
// 8: x30 (lr) [&fiber_entryPoint]
// 7: d8
// ...
// 0: d15
version (StackGrowsDown) {}
else
static assert(false, "Only full descending stacks supported on AArch64");
// Only need to set return address (lr). Everything else is fine
// zero initialized.
pstack -= size_t.sizeof * 11; // skip past x19-x29
push(cast(size_t) &fiber_trampoline); // see threadasm.S for docs
pstack += size_t.sizeof; // adjust sp (newp) above lr
}
else version (AsmARM_Posix)
{
/* We keep the FP registers and the return address below
* the stack pointer, so they don't get scanned by the
* GC. The last frame before swapping the stack pointer is
* organized like the following.
*
* | |-----------|<= 'frame starts here'
* | | fp | (the actual frame pointer, r11 isn't
* | | r10-r4 | updated and still points to the previous frame)
* | |-----------|<= stack pointer
* | | lr |
* | | 4byte pad |
* | | d15-d8 |(if FP supported)
* | |-----------|
* Y
* stack grows down: The pointer value here is smaller than some lines above
*/
// frame pointer can be zero, r10-r4 also zero initialized
version (StackGrowsDown)
pstack -= int.sizeof * 8;
else
static assert(false, "Only full descending stacks supported on ARM");
// link register
push( cast(size_t) &fiber_entryPoint );
/*
* We do not push padding and d15-d8 as those are zero initialized anyway
* Position the stack pointer above the lr register
*/
pstack += int.sizeof * 1;
}
else version (GNU_AsmX86_Windows)
{
version (StackGrowsDown) {} else static assert( false );
// Currently, MinGW doesn't utilize SEH exceptions.
// See DMD AsmX86_Windows If this code ever becomes fails and SEH is used.
push( 0x00000000 ); // Return address of fiber_entryPoint call
push( cast(size_t) &fiber_entryPoint ); // EIP
push( 0x00000000 ); // EBP
push( 0x00000000 ); // EDI
push( 0x00000000 ); // ESI
push( 0x00000000 ); // EBX
push( 0xFFFFFFFF ); // FS:[0] - Current SEH frame
push( cast(size_t) m_ctxt.bstack ); // FS:[4] - Top of stack
push( cast(size_t) m_ctxt.bstack - m_size ); // FS:[8] - Bottom of stack
push( 0x00000000 ); // EAX
}
else version (GNU_AsmX86_64_Windows)
{
push( 0x00000000_00000000 ); // Return address of fiber_entryPoint call
push( cast(size_t) &fiber_entryPoint ); // RIP
push( 0x00000000_00000000 ); // RBP
push( 0x00000000_00000000 ); // RBX
push( 0x00000000_00000000 ); // R12
push( 0x00000000_00000000 ); // R13
push( 0x00000000_00000000 ); // R14
push( 0x00000000_00000000 ); // R15
push( 0xFFFFFFFF_FFFFFFFF ); // GS:[0] - Current SEH frame
version (StackGrowsDown)
{
push( cast(size_t) m_ctxt.bstack ); // GS:[8] - Top of stack
push( cast(size_t) m_ctxt.bstack - m_size ); // GS:[16] - Bottom of stack
}
else
{
push( cast(size_t) m_ctxt.bstack ); // GS:[8] - Top of stack
push( cast(size_t) m_ctxt.bstack + m_size ); // GS:[16] - Bottom of stack
}
}
else static if ( __traits( compiles, ucontext_t ) )
{
getcontext( &m_utxt );
m_utxt.uc_stack.ss_sp = m_pmem;
m_utxt.uc_stack.ss_size = m_size;
makecontext( &m_utxt, &fiber_entryPoint, 0 );
// NOTE: If ucontext is being used then the top of the stack will
// be a pointer to the ucontext_t struct for that fiber.
push( cast(size_t) &m_utxt );
}
else
static assert(0, "Not implemented");
}
StackContext* m_ctxt;
size_t m_size;
void* m_pmem;
static if ( __traits( compiles, ucontext_t ) )
{
// NOTE: The static ucontext instance is used to represent the context
// of the executing thread.
static ucontext_t sm_utxt = void;
ucontext_t m_utxt = void;
ucontext_t* m_ucur = null;
}
else static if (GNU_Enable_CET)
{
// When libphobos was built with --enable-cet, these fields need to
// always be present in the Fiber class layout.
import core.sys.posix.ucontext;
static ucontext_t sm_utxt = void;
ucontext_t m_utxt = void;
ucontext_t* m_ucur = null;
}
private:
///////////////////////////////////////////////////////////////////////////
// Storage of Active Fiber
///////////////////////////////////////////////////////////////////////////
//
// Sets a thread-local reference to the current fiber object.
//
static void setThis( Fiber f ) nothrow @nogc
{
sm_this = f;
}
static Fiber sm_this;
private:
///////////////////////////////////////////////////////////////////////////
// Context Switching
///////////////////////////////////////////////////////////////////////////
//
// Switches into the stack held by this fiber.
//
final void switchIn() nothrow @nogc
{
Thread tobj = Thread.getThis();
void** oldp = &tobj.m_curr.tstack;
void* newp = m_ctxt.tstack;
// NOTE: The order of operations here is very important. The current
// stack top must be stored before m_lock is set, and pushContext
// must not be called until after m_lock is set. This process
// is intended to prevent a race condition with the suspend
// mechanism used for garbage collection. If it is not followed,
// a badly timed collection could cause the GC to scan from the
// bottom of one stack to the top of another, or to miss scanning
// a stack that still contains valid data. The old stack pointer
// oldp will be set again before the context switch to guarantee
// that it points to exactly the correct stack location so the
// successive pop operations will succeed.
*oldp = getStackTop();
atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, true);
tobj.pushContext( m_ctxt );
fiber_switchContext( oldp, newp );
// NOTE: As above, these operations must be performed in a strict order
// to prevent Bad Things from happening.
tobj.popContext();
atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, false);
tobj.m_curr.tstack = tobj.m_curr.bstack;
}
//
// Switches out of the current stack and into the enclosing stack.
//
final void switchOut() nothrow @nogc
{
Thread tobj = Thread.getThis();
void** oldp = &m_ctxt.tstack;
void* newp = tobj.m_curr.within.tstack;
// NOTE: The order of operations here is very important. The current
// stack top must be stored before m_lock is set, and pushContext
// must not be called until after m_lock is set. This process
// is intended to prevent a race condition with the suspend
// mechanism used for garbage collection. If it is not followed,
// a badly timed collection could cause the GC to scan from the
// bottom of one stack to the top of another, or to miss scanning
// a stack that still contains valid data. The old stack pointer
// oldp will be set again before the context switch to guarantee
// that it points to exactly the correct stack location so the
// successive pop operations will succeed.
*oldp = getStackTop();
atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, true);
fiber_switchContext( oldp, newp );
// NOTE: As above, these operations must be performed in a strict order
// to prevent Bad Things from happening.
// NOTE: If use of this fiber is multiplexed across threads, the thread
// executing here may be different from the one above, so get the
// current thread handle before unlocking, etc.
tobj = Thread.getThis();
atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, false);
tobj.m_curr.tstack = tobj.m_curr.bstack;
}
}
///
unittest {
int counter;
class DerivedFiber : Fiber
{
this()
{
super( &run );
}
private :
void run()
{
counter += 2;
}
}
void fiberFunc()
{
counter += 4;
Fiber.yield();
counter += 8;
}
// create instances of each type
Fiber derived = new DerivedFiber();
Fiber composed = new Fiber( &fiberFunc );
assert( counter == 0 );
derived.call();
assert( counter == 2, "Derived fiber increment." );
composed.call();
assert( counter == 6, "First composed fiber increment." );
counter += 16;
assert( counter == 22, "Calling context increment." );
composed.call();
assert( counter == 30, "Second composed fiber increment." );
// since each fiber has run to completion, each should have state TERM
assert( derived.state == Fiber.State.TERM );
assert( composed.state == Fiber.State.TERM );
}
version (CoreUnittest)
{
class TestFiber : Fiber
{
this()
{
super(&run);
}
void run()
{
foreach (i; 0 .. 1000)
{
sum += i;
Fiber.yield();
}
}
enum expSum = 1000 * 999 / 2;
size_t sum;
}
void runTen()
{
TestFiber[10] fibs;
foreach (ref fib; fibs)
fib = new TestFiber();
bool cont;
do {
cont = false;
foreach (fib; fibs) {
if (fib.state == Fiber.State.HOLD)
{
fib.call();
cont |= fib.state != Fiber.State.TERM;
}
}
} while (cont);
foreach (fib; fibs)
{
assert(fib.sum == TestFiber.expSum);
}
}
}
// Single thread running separate fibers
unittest
{
runTen();
}
// Multiple threads running separate fibers
unittest
{
auto group = new ThreadGroup();
foreach (_; 0 .. 4)
{
group.create(&runTen);
}
group.joinAll();
}
// Multiple threads running shared fibers
version (PPC) version = UnsafeFiberMigration;
version (PPC64) version = UnsafeFiberMigration;
version (OSX)
{
version (X86) version = UnsafeFiberMigration;
version (X86_64) version = UnsafeFiberMigration;
}
version (UnsafeFiberMigration)
{
// XBUG: core.thread fibers are supposed to be safe to migrate across
// threads, however, there is a problem: GCC always assumes that the
// address of thread-local variables don't change while on a given stack.
// In consequence, migrating fibers between threads currently is an unsafe
// thing to do, and will break on some targets (possibly PR26461).
}
else
{
version = FiberMigrationUnittest;
}
version (FiberMigrationUnittest)
unittest
{
shared bool[10] locks;
TestFiber[10] fibs;
void runShared()
{
bool cont;
do {
cont = false;
foreach (idx; 0 .. 10)
{
if (cas(&locks[idx], false, true))
{
if (fibs[idx].state == Fiber.State.HOLD)
{
fibs[idx].call();
cont |= fibs[idx].state != Fiber.State.TERM;
}
locks[idx] = false;
}
else
{
cont = true;
}
}
} while (cont);
}
foreach (ref fib; fibs)
{
fib = new TestFiber();
}
auto group = new ThreadGroup();
foreach (_; 0 .. 4)
{
group.create(&runShared);
}
group.joinAll();
foreach (fib; fibs)
{
assert(fib.sum == TestFiber.expSum);
}
}
// Test exception handling inside fibers.
unittest
{
enum MSG = "Test message.";
string caughtMsg;
(new Fiber({
try
{
throw new Exception(MSG);
}
catch (Exception e)
{
caughtMsg = e.msg;
}
})).call();
assert(caughtMsg == MSG);
}
unittest
{
int x = 0;
(new Fiber({
x++;
})).call();
assert( x == 1 );
}
nothrow unittest
{
new Fiber({}).call!(Fiber.Rethrow.no)();
}
unittest
{
new Fiber({}).call(Fiber.Rethrow.yes);
new Fiber({}).call(Fiber.Rethrow.no);
}
unittest
{
enum MSG = "Test message.";
try
{
(new Fiber(function() {
throw new Exception( MSG );
})).call();
assert( false, "Expected rethrown exception." );
}
catch ( Throwable t )
{
assert( t.msg == MSG );
}
}
// Test exception chaining when switching contexts in finally blocks.
unittest
{
static void throwAndYield(string msg) {
try {
throw new Exception(msg);
} finally {
Fiber.yield();
}
}
static void fiber(string name) {
try {
try {
throwAndYield(name ~ ".1");
} finally {
throwAndYield(name ~ ".2");
}
} catch (Exception e) {
assert(e.msg == name ~ ".1");
assert(e.next);
assert(e.next.msg == name ~ ".2");
assert(!e.next.next);
}
}
auto first = new Fiber(() => fiber("first"));
auto second = new Fiber(() => fiber("second"));
first.call();
second.call();
first.call();
second.call();
first.call();
second.call();
assert(first.state == Fiber.State.TERM);
assert(second.state == Fiber.State.TERM);
}
// Test Fiber resetting
unittest
{
static string method;
static void foo()
{
method = "foo";
}
void bar()
{
method = "bar";
}
static void expect(Fiber fib, string s)
{
assert(fib.state == Fiber.State.HOLD);
fib.call();
assert(fib.state == Fiber.State.TERM);
assert(method == s); method = null;
}
auto fib = new Fiber(&foo);
expect(fib, "foo");
fib.reset();
expect(fib, "foo");
fib.reset(&foo);
expect(fib, "foo");
fib.reset(&bar);
expect(fib, "bar");
fib.reset(function void(){method = "function";});
expect(fib, "function");
fib.reset(delegate void(){method = "delegate";});
expect(fib, "delegate");
}
// Test unsafe reset in hold state
unittest
{
auto fib = new Fiber(function {ubyte[2048] buf = void; Fiber.yield();}, 4096);
foreach (_; 0 .. 10)
{
fib.call();
assert(fib.state == Fiber.State.HOLD);
fib.reset();
}
}
// stress testing GC stack scanning
unittest
{
import core.memory;
import core.time : dur;
static void unreferencedThreadObject()
{
static void sleep() { Thread.sleep(dur!"msecs"(100)); }
auto thread = new Thread(&sleep).start();
}
unreferencedThreadObject();
GC.collect();
static class Foo
{
this(int value)
{
_value = value;
}
int bar()
{
return _value;
}
int _value;
}
static void collect()
{
auto foo = new Foo(2);
assert(foo.bar() == 2);
GC.collect();
Fiber.yield();
GC.collect();
assert(foo.bar() == 2);
}
auto fiber = new Fiber(&collect);
fiber.call();
GC.collect();
fiber.call();
// thread reference
auto foo = new Foo(2);
void collect2()
{
assert(foo.bar() == 2);
GC.collect();
Fiber.yield();
GC.collect();
assert(foo.bar() == 2);
}
fiber = new Fiber(&collect2);
fiber.call();
GC.collect();
fiber.call();
static void recurse(size_t cnt)
{
--cnt;
Fiber.yield();
if (cnt)
{
auto fib = new Fiber(() { recurse(cnt); });
fib.call();
GC.collect();
fib.call();
}
}
fiber = new Fiber(() { recurse(20); });
fiber.call();
}
version (AsmX86_64_Windows)
{
// Test Windows x64 calling convention
unittest
{
void testNonvolatileRegister(alias REG)()
{
auto zeroRegister = new Fiber(() {
mixin("asm pure nothrow @nogc { naked; xor "~REG~", "~REG~"; ret; }");
});
long after;
mixin("asm pure nothrow @nogc { mov "~REG~", 0xFFFFFFFFFFFFFFFF; }");
zeroRegister.call();
mixin("asm pure nothrow @nogc { mov after, "~REG~"; }");
assert(after == -1);
}
void testNonvolatileRegisterSSE(alias REG)()
{
auto zeroRegister = new Fiber(() {
mixin("asm pure nothrow @nogc { naked; xorpd "~REG~", "~REG~"; ret; }");
});
long[2] before = [0xFFFFFFFF_FFFFFFFF, 0xFFFFFFFF_FFFFFFFF], after;
mixin("asm pure nothrow @nogc { movdqu "~REG~", before; }");
zeroRegister.call();
mixin("asm pure nothrow @nogc { movdqu after, "~REG~"; }");
assert(before == after);
}
testNonvolatileRegister!("R12")();
testNonvolatileRegister!("R13")();
testNonvolatileRegister!("R14")();
testNonvolatileRegister!("R15")();
testNonvolatileRegister!("RDI")();
testNonvolatileRegister!("RSI")();
testNonvolatileRegister!("RBX")();
testNonvolatileRegisterSSE!("XMM6")();
testNonvolatileRegisterSSE!("XMM7")();
testNonvolatileRegisterSSE!("XMM8")();
testNonvolatileRegisterSSE!("XMM9")();
testNonvolatileRegisterSSE!("XMM10")();
testNonvolatileRegisterSSE!("XMM11")();
testNonvolatileRegisterSSE!("XMM12")();
testNonvolatileRegisterSSE!("XMM13")();
testNonvolatileRegisterSSE!("XMM14")();
testNonvolatileRegisterSSE!("XMM15")();
}
}
version (D_InlineAsm_X86_64)
{
unittest
{
void testStackAlignment()
{
void* pRSP;
asm pure nothrow @nogc
{
mov pRSP, RSP;
}
assert((cast(size_t)pRSP & 0xF) == 0);
}
auto fib = new Fiber(&testStackAlignment);
fib.call();
}
}
| D |
module android.java.org.xml.sax.DTDHandler;
public import android.java.org.xml.sax.DTDHandler_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!DTDHandler;
import import0 = android.java.java.lang.Class;
| D |
/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Copyright (c) 2010 by Álvaro Castro-Castilla, All Rights Reserved.
+ Licensed under the MIT/X11 license, see LICENSE file for full description
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/
module cyma.model.Node;
protected {
import cyma.engine.Element;
}
/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ A node of the model tree
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/
struct Node{
/++ Reference to the engine element +/
Element element;
}
| D |
module mod_inv;
// a^-1 (mod 2^64)
long modInv(long a)
in {
assert(a & 1, "modInv: a must be odd");
}
do {
long b = ((a << 1) + a) ^ 2;
b *= 2 - a * b;
b *= 2 - a * b;
b *= 2 - a * b;
b *= 2 - a * b;
return b;
}
// a^-1 (mod m)
long modInv(long a, long m)
in {
assert(m > 0, "modInv: m > 0 must hold");
}
do {
long b = m, x = 1, y = 0, t;
for (; ; ) {
t = a / b; a -= t * b;
if (a == 0) {
assert(b == 1 || b == -1, "modInv: gcd(a, m) != 1");
if (b == -1) y = -y;
return (y < 0) ? (y + m) : y;
}
x -= t * y;
t = b / a; b -= t * a;
if (b == 0) {
assert(a == 1 || a == -1, "modInv: gcd(a, m) != 1");
if (a == -1) x = -x;
return (x < 0) ? (x + m) : x;
}
y -= t * x;
}
}
| D |
/**
* Windows API header module
*
* Translated from MinGW Windows headers
*
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(DRUNTIMESRC core/sys/windows/_lmaudit.d)
*/
// COMMENT: This file may be deprecated.
module core.sys.windows.lmaudit;
version (Windows):
@system:
import core.sys.windows.lmcons, core.sys.windows.windef;
enum LOGFLAGS_FORWARD = 0;
enum LOGFLAGS_BACKWARD = 1;
enum LOGFLAGS_SEEK = 2;
enum ACTION_LOCKOUT = 0;
enum ACTION_ADMINUNLOCK = 1;
enum AE_GUEST=0;
enum AE_USER=1;
enum AE_ADMIN=2;
enum AE_NORMAL=0;
enum AE_USERLIMIT=0;
enum AE_GENERAL=0;
enum AE_ERROR=1;
enum AE_SESSDIS=1;
enum AE_BADPW=1;
enum AE_AUTODIS=2;
enum AE_UNSHARE=2;
enum AE_ADMINPRIVREQD=2;
enum AE_ADMINDIS=3;
enum AE_NOACCESSPERM=3;
enum AE_ACCRESTRICT=4;
enum AE_NORMAL_CLOSE=0;
enum AE_SES_CLOSE=1;
enum AE_ADMIN_CLOSE=2;
enum AE_LIM_UNKNOWN=0;
enum AE_LIM_LOGONHOURS=1;
enum AE_LIM_EXPIRED=2;
enum AE_LIM_INVAL_WKSTA=3;
enum AE_LIM_DISABLED=4;
enum AE_LIM_DELETED=5;
enum AE_MOD=0;
enum AE_DELETE=1;
enum AE_ADD=2;
enum AE_UAS_USER = 0;
enum AE_UAS_GROUP = 1;
enum AE_UAS_MODALS = 2;
enum SVAUD_SERVICE = 1;
enum SVAUD_GOODSESSLOGON = 6;
enum SVAUD_BADSESSLOGON = 24;
enum SVAUD_SESSLOGON = SVAUD_GOODSESSLOGON|SVAUD_BADSESSLOGON;
enum SVAUD_GOODNETLOGON = 96;
enum SVAUD_BADNETLOGON = 384;
enum SVAUD_NETLOGON = SVAUD_GOODNETLOGON|SVAUD_BADNETLOGON;
enum SVAUD_LOGON = SVAUD_NETLOGON|SVAUD_SESSLOGON;
enum SVAUD_GOODUSE = 0x600;
enum SVAUD_BADUSE = 0x1800;
enum SVAUD_USE = SVAUD_GOODUSE|SVAUD_BADUSE;
enum SVAUD_USERLIST = 8192;
enum SVAUD_PERMISSIONS = 16384;
enum SVAUD_RESOURCE = 32768;
enum SVAUD_LOGONLIM = 65536;
enum AA_AUDIT_ALL=1;
enum AA_A_OWNER=4;
enum AA_CLOSE=8;
enum AA_S_OPEN=16;
enum AA_S_WRITE=32;
enum AA_S_CREATE=32;
enum AA_S_DELETE=64;
enum AA_S_ACL=128;
enum AA_S_ALL=253;
enum AA_F_OPEN=256;
enum AA_F_WRITE=512;
enum AA_F_CREATE=512;
enum AA_F_DELETE=1024;
enum AA_F_ACL=2048;
enum AA_F_ALL = AA_F_OPEN|AA_F_WRITE|AA_F_DELETE|AA_F_ACL;
enum AA_A_OPEN=2048;
enum AA_A_WRITE=4096;
enum AA_A_CREATE=8192;
enum AA_A_DELETE=16384;
enum AA_A_ACL=32768;
enum AA_A_ALL = AA_F_OPEN|AA_F_WRITE|AA_F_DELETE|AA_F_ACL;
struct AUDIT_ENTRY{
DWORD ae_len;
DWORD ae_reserved;
DWORD ae_time;
DWORD ae_type;
DWORD ae_data_offset;
DWORD ae_data_size;
}
alias AUDIT_ENTRY* PAUDIT_ENTRY, LPAUDIT_ENTRY;
struct HLOG{
DWORD time;
DWORD last_flags;
DWORD offset;
DWORD rec_offset;
}
alias HLOG* PHLOG, LPHLOG;
struct AE_SRVSTATUS{
DWORD ae_sv_status;
}
alias AE_SRVSTATUS* PAE_SRVSTATUS, LPAE_SRVSTATUS;
struct AE_SESSLOGON{
DWORD ae_so_compname;
DWORD ae_so_username;
DWORD ae_so_privilege;
}
alias AE_SESSLOGON* PAE_SESSLOGON, LPAE_SESSLOGON;
struct AE_SESSLOGOFF{
DWORD ae_sf_compname;
DWORD ae_sf_username;
DWORD ae_sf_reason;
}
alias AE_SESSLOGOFF* PAE_SESSLOGOFF, LPAE_SESSLOGOFF;
struct AE_SESSPWERR{
DWORD ae_sp_compname;
DWORD ae_sp_username;
}
alias AE_SESSPWERR* PAE_SESSPWERR, LPAE_SESSPWERR;
struct AE_CONNSTART{
DWORD ae_ct_compname;
DWORD ae_ct_username;
DWORD ae_ct_netname;
DWORD ae_ct_connid;
}
alias AE_CONNSTART* PAE_CONNSTART, LPAE_CONNSTART;
struct AE_CONNSTOP{
DWORD ae_cp_compname;
DWORD ae_cp_username;
DWORD ae_cp_netname;
DWORD ae_cp_connid;
DWORD ae_cp_reason;
}
alias AE_CONNSTOP* PAE_CONNSTOP, LPAE_CONNSTOP;
struct AE_CONNREJ{
DWORD ae_cr_compname;
DWORD ae_cr_username;
DWORD ae_cr_netname;
DWORD ae_cr_reason;
}
alias AE_CONNREJ* PAE_CONNREJ, LPAE_CONNREJ;
struct AE_RESACCESS{
DWORD ae_ra_compname;
DWORD ae_ra_username;
DWORD ae_ra_resname;
DWORD ae_ra_operation;
DWORD ae_ra_returncode;
DWORD ae_ra_restype;
DWORD ae_ra_fileid;
}
alias AE_RESACCESS* PAE_RESACCESS, LPAE_RESACCESS;
struct AE_RESACCESSREJ{
DWORD ae_rr_compname;
DWORD ae_rr_username;
DWORD ae_rr_resname;
DWORD ae_rr_operation;
}
alias AE_RESACCESSREJ* PAE_RESACCESSREJ, LPAE_RESACCESSREJ;
struct AE_CLOSEFILE{
DWORD ae_cf_compname;
DWORD ae_cf_username;
DWORD ae_cf_resname;
DWORD ae_cf_fileid;
DWORD ae_cf_duration;
DWORD ae_cf_reason;
}
alias AE_CLOSEFILE* PAE_CLOSEFILE, LPAE_CLOSEFILE;
struct AE_SERVICESTAT{
DWORD ae_ss_compname;
DWORD ae_ss_username;
DWORD ae_ss_svcname;
DWORD ae_ss_status;
DWORD ae_ss_code;
DWORD ae_ss_text;
DWORD ae_ss_returnval;
}
alias AE_SERVICESTAT* PAE_SERVICESTAT, LPAE_SERVICESTAT;
struct AE_ACLMOD{
DWORD ae_am_compname;
DWORD ae_am_username;
DWORD ae_am_resname;
DWORD ae_am_action;
DWORD ae_am_datalen;
}
alias AE_ACLMOD* PAE_ACLMOD, LPAE_ACLMOD;
struct AE_UASMOD{
DWORD ae_um_compname;
DWORD ae_um_username;
DWORD ae_um_resname;
DWORD ae_um_rectype;
DWORD ae_um_action;
DWORD ae_um_datalen;
}
alias AE_UASMOD* PAE_UASMOD, LPAE_UASMOD;
struct AE_NETLOGON{
DWORD ae_no_compname;
DWORD ae_no_username;
DWORD ae_no_privilege;
DWORD ae_no_authflags;
}
alias AE_NETLOGON* PAE_NETLOGON, LPAE_NETLOGON;
struct AE_NETLOGOFF{
DWORD ae_nf_compname;
DWORD ae_nf_username;
DWORD ae_nf_reserved1;
DWORD ae_nf_reserved2;
}
alias AE_NETLOGOFF* PAE_NETLOGOFF, LPAE_NETLOGOFF;
struct AE_ACCLIM{
DWORD ae_al_compname;
DWORD ae_al_username;
DWORD ae_al_resname;
DWORD ae_al_limit;
}
alias AE_ACCLIM* PAE_ACCLIM, LPAE_ACCLIM;
struct AE_LOCKOUT{
DWORD ae_lk_compname;
DWORD ae_lk_username;
DWORD ae_lk_action;
DWORD ae_lk_bad_pw_count;
}
alias AE_LOCKOUT* PAE_LOCKOUT, LPAE_LOCKOUT;
struct AE_GENERIC{
DWORD ae_ge_msgfile;
DWORD ae_ge_msgnum;
DWORD ae_ge_params;
DWORD ae_ge_param1;
DWORD ae_ge_param2;
DWORD ae_ge_param3;
DWORD ae_ge_param4;
DWORD ae_ge_param5;
DWORD ae_ge_param6;
DWORD ae_ge_param7;
DWORD ae_ge_param8;
DWORD ae_ge_param9;
}
alias AE_GENERIC* PAE_GENERIC, LPAE_GENERIC;
extern (Windows) {
deprecated {
NET_API_STATUS NetAuditClear(LPCWSTR,LPCWSTR,LPCWSTR);
NET_API_STATUS NetAuditRead(LPTSTR,LPTSTR,LPHLOG,DWORD,PDWORD,DWORD,DWORD,PBYTE*,DWORD,PDWORD,PDWORD);
NET_API_STATUS NetAuditWrite(DWORD,PBYTE,DWORD,LPTSTR,PBYTE);
}
}
/+
/* MinGW: These conflict with struct typedefs, why? */
enum AE_SRVSTATUS=0;
enum AE_SESSLOGON=1;
enum AE_SESSLOGOFF=2;
enum AE_SESSPWERR=3;
enum AE_CONNSTART=4;
enum AE_CONNSTOP=5;
enum AE_CONNREJ=6;
enum AE_RESACCESS=7;
enum AE_RESACCESSREJ=8;
enum AE_CLOSEFILE=9;
enum AE_SERVICESTAT=11;
enum AE_ACLMOD=12;
enum AE_UASMOD=13;
enum AE_NETLOGON=14;
enum AE_NETLOGOFF=15;
enum AE_NETLOGDENIED=16;
enum AE_ACCLIMITEXCD=17;
enum AE_RESACCESS2=18;
enum AE_ACLMODFAIL=19;
enum AE_LOCKOUT=20;
enum AE_GENERIC_TYPE=21;
enum AE_SRVSTART=0;
enum AE_SRVPAUSED=1;
enum AE_SRVCONT=2;
enum AE_SRVSTOP=3;
+/
| D |
module ext.window.freeglut.api;
alias uint GLenum;
alias ubyte GLboolean;
alias uint GLbitfield;
alias byte GLbyte;
alias short GLshort;
alias int GLint;
alias int GLsizei;
alias ubyte GLubyte;
alias ushort GLushort;
alias uint GLuint;
alias ushort GLhalf;
alias float GLfloat;
alias float GLclampf;
alias double GLdouble;
alias double GLclampd;
alias void GLvoid;
nothrow extern (C):
// -----------------------------------------
// Standard GLUT
// Special key codes
enum {
GLUT_KEY_F1 = 0x0001,
GLUT_KEY_F2 = 0x0002,
GLUT_KEY_F3 = 0x0003,
GLUT_KEY_F4 = 0x0004,
GLUT_KEY_F5 = 0x0005,
GLUT_KEY_F6 = 0x0006,
GLUT_KEY_F7 = 0x0007,
GLUT_KEY_F8 = 0x0008,
GLUT_KEY_F9 = 0x0009,
GLUT_KEY_F10 = 0x000A,
GLUT_KEY_F11 = 0x000B,
GLUT_KEY_F12 = 0x000C,
GLUT_KEY_LEFT = 0x0064,
GLUT_KEY_UP = 0x0065,
GLUT_KEY_RIGHT = 0x0066,
GLUT_KEY_DOWN = 0x0067,
GLUT_KEY_PAGE_UP = 0x0068,
GLUT_KEY_PAGE_DOWN = 0x0069,
GLUT_KEY_HOME = 0x006A,
GLUT_KEY_END = 0x006B,
GLUT_KEY_INSERT = 0x006C,
}
// Mouse state definitions
enum {
GLUT_LEFT_BUTTON = 0x0000,
GLUT_MIDDLE_BUTTON = 0x0001,
GLUT_RIGHT_BUTTON = 0x0002,
GLUT_DOWN = 0x0000,
GLUT_UP = 0x0001,
GLUT_LEFT = 0x0000,
GLUT_ENTERED = 0x0001,
}
// Display mode definitions
enum {
GLUT_RGB = 0x0000,
GLUT_RGBA = 0x0000,
GLUT_INDEX = 0x0001,
GLUT_SINGLE = 0x0000,
GLUT_DOUBLE = 0x0002,
GLUT_ACCUM = 0x0004,
GLUT_ALPHA = 0x0008,
GLUT_DEPTH = 0x0010,
GLUT_STENCIL = 0x0020,
GLUT_MULTISAMPLE = 0x0080,
GLUT_STEREO = 0x0100,
GLUT_LUMINANCE = 0x0200,
}
// Windows and menu related definitions
enum {
GLUT_MENU_NOT_IN_USE = 0x0000,
GLUT_MENU_IN_USE = 0x0001,
GLUT_NOT_VISIBLE = 0x0000,
GLUT_VISIBLE = 0x0001,
GLUT_HIDDEN = 0x0000,
GLUT_FULLY_RETAINED = 0x0001,
GLUT_PARTIALLY_RETAINED = 0x0002,
GLUT_FULLY_COVERED = 0x0003,
}
// glutGet parameters
enum {
GLUT_WINDOW_X = 0x0064,
GLUT_WINDOW_Y = 0x0065,
GLUT_WINDOW_WIDTH = 0x0066,
GLUT_WINDOW_HEIGHT = 0x0067,
GLUT_WINDOW_BUFFER_SIZE = 0x0068,
GLUT_WINDOW_STENCIL_SIZE = 0x0069,
GLUT_WINDOW_DEPTH_SIZE = 0x006A,
GLUT_WINDOW_RED_SIZE = 0x006B,
GLUT_WINDOW_GREEN_SIZE = 0x006C,
GLUT_WINDOW_BLUE_SIZE = 0x006D,
GLUT_WINDOW_ALPHA_SIZE = 0x006E,
GLUT_WINDOW_ACCUM_RED_SIZE = 0x006F,
GLUT_WINDOW_ACCUM_GREEN_SIZE = 0x0070,
GLUT_WINDOW_ACCUM_BLUE_SIZE = 0x0071,
GLUT_WINDOW_ACCUM_ALPHA_SIZE = 0x0072,
GLUT_WINDOW_DOUBLEBUFFER = 0x0073,
GLUT_WINDOW_RGBA = 0x0074,
GLUT_WINDOW_PARENT = 0x0075,
GLUT_WINDOW_NUM_CHILDREN = 0x0076,
GLUT_WINDOW_COLORMAP_SIZE = 0x0077,
GLUT_WINDOW_NUM_SAMPLES = 0x0078,
GLUT_WINDOW_STEREO = 0x0079,
GLUT_WINDOW_CURSOR = 0x007A,
GLUT_SCREEN_WIDTH = 0x00C8,
GLUT_SCREEN_HEIGHT = 0x00C9,
GLUT_SCREEN_WIDTH_MM = 0x00CA,
GLUT_SCREEN_HEIGHT_MM = 0x00CB,
GLUT_MENU_NUM_ITEMS = 0x012C,
GLUT_DISPLAY_MODE_POSSIBLE = 0x0190,
GLUT_INIT_WINDOW_X = 0x01F4,
GLUT_INIT_WINDOW_Y = 0x01F5,
GLUT_INIT_WINDOW_WIDTH = 0x01F6,
GLUT_INIT_WINDOW_HEIGHT = 0x01F7,
GLUT_INIT_DISPLAY_MODE = 0x01F8,
GLUT_ELAPSED_TIME = 0x02BC,
GLUT_WINDOW_FORMAT_ID = 0x007B,
}
// glutDeviceGet parameters
enum {
GLUT_HAS_KEYBOARD = 0x0258,
GLUT_HAS_MOUSE = 0x0259,
GLUT_HAS_SPACEBALL = 0x025A,
GLUT_HAS_DIAL_AND_BUTTON_BOX = 0x025B,
GLUT_HAS_TABLET = 0x025C,
GLUT_NUM_MOUSE_BUTTONS = 0x025D,
GLUT_NUM_SPACEBALL_BUTTONS = 0x025E,
GLUT_NUM_BUTTON_BOX_BUTTONS = 0x025F,
GLUT_NUM_DIALS = 0x0260,
GLUT_NUM_TABLET_BUTTONS = 0x0261,
GLUT_DEVICE_IGNORE_KEY_REPEAT = 0x0262,
GLUT_DEVICE_KEY_REPEAT = 0x0263,
GLUT_HAS_JOYSTICK = 0x0264,
GLUT_OWNS_JOYSTICK = 0x0265,
GLUT_JOYSTICK_BUTTONS = 0x0266,
GLUT_JOYSTICK_AXES = 0x0267,
GLUT_JOYSTICK_POLL_RATE = 0x0268,
}
// glutLayerGet parameters
enum {
GLUT_OVERLAY_POSSIBLE = 0x0320,
GLUT_LAYER_IN_USE = 0x0321,
GLUT_HAS_OVERLAY = 0x0322,
GLUT_TRANSPARENT_INDEX = 0x0323,
GLUT_NORMAL_DAMAGED = 0x0324,
GLUT_OVERLAY_DAMAGED = 0x0325,
}
// glutVideoResizeGet parameters
enum {
GLUT_VIDEO_RESIZE_POSSIBLE = 0x0384,
GLUT_VIDEO_RESIZE_IN_USE = 0x0385,
GLUT_VIDEO_RESIZE_X_DELTA = 0x0386,
GLUT_VIDEO_RESIZE_Y_DELTA = 0x0387,
GLUT_VIDEO_RESIZE_WIDTH_DELTA = 0x0388,
GLUT_VIDEO_RESIZE_HEIGHT_DELTA = 0x0389,
GLUT_VIDEO_RESIZE_X = 0x038A,
GLUT_VIDEO_RESIZE_Y = 0x038B,
GLUT_VIDEO_RESIZE_WIDTH = 0x038C,
GLUT_VIDEO_RESIZE_HEIGHT = 0x038D,
}
// glutUseLayer parameters
enum {
GLUT_NORMAL = 0x0000,
GLUT_OVERLAY = 0x0001,
}
// glutGetModifiers parameters
enum {
GLUT_ACTIVE_SHIFT = 0x0001,
GLUT_ACTIVE_CTRL = 0x0002,
GLUT_ACTIVE_ALT = 0x0004,
}
// glutSetCursor parameters
enum {
GLUT_CURSOR_RIGHT_ARROW = 0x0000,
GLUT_CURSOR_LEFT_ARROW = 0x0001,
GLUT_CURSOR_INFO = 0x0002,
GLUT_CURSOR_DESTROY = 0x0003,
GLUT_CURSOR_HELP = 0x0004,
GLUT_CURSOR_CYCLE = 0x0005,
GLUT_CURSOR_SPRAY = 0x0006,
GLUT_CURSOR_WAIT = 0x0007,
GLUT_CURSOR_TEXT = 0x0008,
GLUT_CURSOR_CROSSHAIR = 0x0009,
GLUT_CURSOR_UP_DOWN = 0x000A,
GLUT_CURSOR_LEFT_RIGHT = 0x000B,
GLUT_CURSOR_TOP_SIDE = 0x000C,
GLUT_CURSOR_BOTTOM_SIDE = 0x000D,
GLUT_CURSOR_LEFT_SIDE = 0x000E,
GLUT_CURSOR_RIGHT_SIDE = 0x000F,
GLUT_CURSOR_TOP_LEFT_CORNER = 0x0010,
GLUT_CURSOR_TOP_RIGHT_CORNER = 0x0011,
GLUT_CURSOR_BOTTOM_RIGHT_CORNER = 0x0012,
GLUT_CURSOR_BOTTOM_LEFT_CORNER = 0x0013,
GLUT_CURSOR_INHERIT = 0x0064,
GLUT_CURSOR_NONE = 0x0065,
GLUT_CURSOR_FULL_CROSSHAIR = 0x0066,
}
// Additional keyboard and joystick definitions
enum {
GLUT_KEY_REPEAT_OFF = 0x0000,
GLUT_KEY_REPEAT_ON = 0x0001,
GLUT_KEY_REPEAT_DEFAULT = 0x0002,
GLUT_JOYSTICK_BUTTON_A = 0x0001,
GLUT_JOYSTICK_BUTTON_B = 0x0002,
GLUT_JOYSTICK_BUTTON_C = 0x0004,
GLUT_JOYSTICK_BUTTON_D = 0x0008,
}
// Game mode definitions
enum {
GLUT_GAME_MODE_ACTIVE = 0x0000,
GLUT_GAME_MODE_POSSIBLE = 0x0001,
GLUT_GAME_MODE_WIDTH = 0x0002,
GLUT_GAME_MODE_HEIGHT = 0x0003,
GLUT_GAME_MODE_PIXEL_DEPTH = 0x0004,
GLUT_GAME_MODE_REFRESH_RATE = 0x0005,
GLUT_GAME_MODE_DISPLAY_CHANGED = 0x0006,
}
// ---------------------------------------------------------
// Initialisation functions
void glutInit(int* pargc, char** argv);
void glutInitWindowPosition(int x, int y);
void glutInitWindowSize(int width, int height);
void glutInitDisplayMode(uint displayMode);
void glutInitDisplayString(const char* displayMode);
// Process loop functions
void glutMainLoop();
// Window management functions
int glutCreateWindow(const char* title);
int glutCreateSubWindow(int window, int x, int y, int width, int height);
void glutDestroyWindow(int window);
void glutSetWindow(int window);
int glutGetWindow();
void glutSetWindowTitle(const char* title);
void glutSetIconTitle(const char* title);
void glutReshapeWindow(int width, int height);
void glutPositionWindow(int x, int y);
void glutShowWindow();
void glutHideWindow();
void glutIconifyWindow();
void glutPushWindow();
void glutPopWindow();
void glutFullScreen();
// Display-connected functions
void glutPostWindowRedisplay(int window);
void glutPostRedisplay();
void glutSwapBuffers();
// Mouse cursor functions
void glutWarpPointer(int x, int y);
void glutSetCursor(int cursor);
// Overlay stuff
void glutEstablishOverlay();
void glutRemoveOverlay();
void glutUseLayer(GLenum layer);
void glutPostOverlayRedisplay();
void glutPostWindowOverlayRedisplay(int window);
void glutShowOverlay();
void glutHideOverlay();
// Menu stuff
int glutCreateMenu(void function(int menu));
void glutDestroyMenu(int menu);
int glutGetMenu();
void glutSetMenu(int menu);
void glutAddMenuEntry(const char* label, int value);
void glutAddSubMenu(const char* label, int subMenu);
void glutChangeToMenuEntry(int item, const char* label, int value);
void glutChangeToSubMenu(int item, const char* label, int value);
void glutRemoveMenuItem(int item);
void glutAttachMenu(int button);
void glutDetachMenu(int button);
// Global callback functions
void glutTimerFunc(uint time, void function(int), int value);
void glutIdleFunc(void function());
// Window-specific callback functions
void glutKeyboardFunc(void function(char, int, int));
void glutSpecialFunc(void function(int, int, int));
void glutReshapeFunc(void function(int, int));
void glutVisibilityFunc(void function(int));
void glutDisplayFunc(void function());
void glutMouseFunc(void function(int, int, int, int));
void glutMotionFunc(void function(int, int));
void glutPassiveMotionFunc(void function(int, int));
void glutEntryFunc(void function(int));
void glutKeyboardUpFunc(void function(char, int, int));
void glutSpecialUpFunc(void function(int, int, int));
void glutJoystickFunc(void function(uint, int, int, int), int pollInterval);
void glutMenuStateFunc(void function(int));
void glutMenuStatusFunc(void function(int, int, int));
void glutOverlayDisplayFunc(void function());
void glutWindowStatusFunc(void function(int));
void glutSpaceballMotionFunc(void function(int, int, int));
void glutSpaceballRotateFunc(void function(int, int, int));
void glutSpaceballButtonFunc(void function(int, int));
void glutButtonBoxFunc(void function(int, int));
void glutDialsFunc(void function(int, int));
void glutTabletMotionFunc(void function(int, int));
void glutTabletButtonFunc(void function(int, int, int, int));
// State setting and retrieval functions
int glutGet(GLenum query);
int glutDeviceGet(GLenum query);
int glutGetModifiers();
int glutLayerGet(GLenum query);
// Font stuff
void glutBitmapCharacter(void* font, int character);
int glutBitmapWidth(void* font, int character);
void glutStrokeCharacter(void* font, int character);
int glutStrokeWidth(void* font, int character);
int glutBitmapLength(void* font, const char* string);
int glutStrokeLength(void* font, const char* string);
// Geometry functions
void glutWireCube(GLdouble size);
void glutSolidCube(GLdouble size);
void glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
void glutWireDodecahedron();
void glutSolidDodecahedron();
void glutWireOctahedron();
void glutSolidOctahedron();
void glutWireTetrahedron();
void glutSolidTetrahedron();
void glutWireIcosahedron();
void glutSolidIcosahedron();
// Teapot rendering functions
void glutWireTeapot(GLdouble size);
void glutSolidTeapot(GLdouble size);
// Game mode functions
void glutGameModeString(const char* string);
int glutEnterGameMode();
void glutLeaveGameMode();
int glutGameModeGet(GLenum query);
// Video resize functions
int glutVideoResizeGet(GLenum query);
void glutSetupVideoResizing();
void glutStopVideoResizing();
void glutVideoResize(int x, int y, int width, int height);
void glutVideoPan(int x, int y, int width, int height);
// Colourmap functions
void glutSetColor(int color, GLfloat red, GLfloat green, GLfloat blue);
GLfloat glutGetColor(int color, int component);
void glutCopyColormap(int window);
// Misc keyboard and joystick functions
void glutIgnoreKeyRepeat(int ignore);
void glutSetKeyRepeat(int repeatMode);
void glutForceJoystickFunc();
// Misc functions
int glutExtensionSupported(const char* extension);
void glutReportErrors();
// -------------------------------------------------
// FreeGLUT extensions
// Additional GLUT key definitions for the special key function
enum {
GLUT_KEY_NUM_LOCK = 0x006D,
GLUT_KEY_BEGIN = 0x006E,
GLUT_KEY_DELETE = 0x006F,
GLUT_KEY_SHIFT_L = 0x0070,
GLUT_KEY_SHIFT_R = 0x0071,
GLUT_KEY_CTRL_L = 0x0072,
GLUT_KEY_CTRL_R = 0x0073,
GLUT_KEY_ALT_L = 0x0074,
GLUT_KEY_ALT_R = 0x0075,
}
// Behavior when the user click on an "x" to close a window
enum {
GLUT_ACTION_EXIT = 0,
GLUT_ACTION_GLUTMAINLOOP_RETURNS = 1,
GLUT_ACTION_CONTINUE_EXECUTION = 2,
}
// Create a new rendering context when the user opens a new window?
enum {
GLUT_CREATE_NEW_CONTEXT = 0,
GLUT_USE_CURRENT_CONTEXT = 1,
}
// glutGet parameters
enum {
GLUT_INIT_STATE = 0x007C,
GLUT_ACTION_ON_WINDOW_CLOSE = 0x01F9,
GLUT_WINDOW_BORDER_WIDTH = 0x01FA,
GLUT_WINDOW_HEADER_HEIGHT = 0x01FB,
GLUT_VERSION = 0x01FC,
GLUT_RENDERING_CONTEXT = 0x01FD,
GLUT_DIRECT_RENDERING = 0x01FE,
GLUT_FULL_SCREEN = 0x01FF,
}
// Context-related flags
enum {
GLUT_INIT_MAJOR_VERSION = 0x0200,
GLUT_INIT_MINOR_VERSION = 0x0201,
GLUT_INIT_FLAGS = 0x0202,
GLUT_INIT_PROFILE = 0x0203,
}
// Flags for glutInitContextFlags
enum {
GLUT_DEBUG = 0x0001,
GLUT_FORWARD_COMPATIBLE = 0x0002,
}
// Flags for glutInitContextProfile
enum {
GLUT_CORE_PROFILE = 0x0001,
GLUT_COMPATIBILITY_PROFILE = 0x0002,
}
// Process loop functions
void glutMainLoopEvent();
void glutLeaveMainLoop();
void glutExit();
// Window management functions
void glutFullScreenToggle();
void glutLeaveFullScreen();
// Window-specific callback functions
void glutMouseWheelFunc(void function(int, int, int, int));
void glutCloseFunc(void function());
void glutWMCloseFunc(void function());
void glutMenuDestroyFunc(void function());
// State setting and retrieval functions
void glutSetOption (GLenum option_flag, int value);
int * glutGetModeValues(GLenum mode, int * size);
void* glutGetWindowData();
void glutSetWindowData(void* data);
void* glutGetMenuData();
void glutSetMenuData(void* data);
// Font stuff
int glutBitmapHeight(void* font);
GLfloat glutStrokeHeight(void* font);
void glutBitmapString(void* font, const char* string);
void glutStrokeString(void* font, const char* string);
// Geometry functions
void glutWireRhombicDodecahedron();
void glutSolidRhombicDodecahedron();
void glutWireSierpinskiSponge (int num_levels, GLdouble offset[3], GLdouble scale);
void glutSolidSierpinskiSponge (int num_levels, GLdouble offset[3], GLdouble scale);
void glutWireCylinder(GLdouble radius, GLdouble height, GLint slices, GLint stacks);
void glutSolidCylinder(GLdouble radius, GLdouble height, GLint slices, GLint stacks);
// Multi-touch/multi-pointer extensions
void glutMultiEntryFunc(void function(int, int));
void glutMultiButtonFunc(void function(int, int, int, int, int));
void glutMultiMotionFunc(void function(int, int, int));
void glutMultiPassiveFunc(void function(int, int, int));
// Initialization functions
void glutInitContextVersion(int majorVersion, int minorVersion);
void glutInitContextFlags(int flags);
void glutInitContextProfile(int profile);
| D |
module android.java.android.bluetooth.BluetoothAdapter_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import9 = android.java.android.bluetooth.BluetoothProfile_d_interface;
import import10 = android.java.android.bluetooth.BluetoothAdapter_LeScanCallback_d_interface;
import import8 = android.java.android.bluetooth.BluetoothProfile_ServiceListener_d_interface;
import import11 = android.java.java.lang.Class_d_interface;
import import4 = android.java.java.util.Set_d_interface;
import import5 = android.java.android.bluetooth.BluetoothServerSocket_d_interface;
import import3 = android.java.android.bluetooth.le.BluetoothLeScanner_d_interface;
import import6 = android.java.java.util.UUID_d_interface;
import import0 = android.java.android.bluetooth.BluetoothAdapter_d_interface;
import import2 = android.java.android.bluetooth.le.BluetoothLeAdvertiser_d_interface;
import import1 = android.java.android.bluetooth.BluetoothDevice_d_interface;
import import7 = android.java.android.content.Context_d_interface;
final class BluetoothAdapter : IJavaObject {
static immutable string[] _d_canCastTo = [
];
@Import static import0.BluetoothAdapter getDefaultAdapter();
@Import import1.BluetoothDevice getRemoteDevice(string);
@Import import1.BluetoothDevice getRemoteDevice(byte[]);
@Import import2.BluetoothLeAdvertiser getBluetoothLeAdvertiser();
@Import import3.BluetoothLeScanner getBluetoothLeScanner();
@Import bool isEnabled();
@Import int getState();
@Import bool enable();
@Import bool disable();
@Import string getAddress();
@Import string getName();
@Import bool setName(string);
@Import int getScanMode();
@Import bool startDiscovery();
@Import bool cancelDiscovery();
@Import bool isDiscovering();
@Import bool isMultipleAdvertisementSupported();
@Import bool isOffloadedFilteringSupported();
@Import bool isOffloadedScanBatchingSupported();
@Import bool isLe2MPhySupported();
@Import bool isLeCodedPhySupported();
@Import bool isLeExtendedAdvertisingSupported();
@Import bool isLePeriodicAdvertisingSupported();
@Import int getLeMaximumAdvertisingDataLength();
@Import import4.Set getBondedDevices();
@Import int getProfileConnectionState(int);
@Import import5.BluetoothServerSocket listenUsingRfcommWithServiceRecord(string, import6.UUID);
@Import import5.BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(string, import6.UUID);
@Import bool getProfileProxy(import7.Context, import8.BluetoothProfile_ServiceListener, int);
@Import void closeProfileProxy(int, import9.BluetoothProfile);
@Import static bool checkBluetoothAddress(string);
@Import bool startLeScan(import10.BluetoothAdapter_LeScanCallback);
@Import bool startLeScan(import6.UUID, import10.BluetoothAdapter_LeScanCallback[]);
@Import void stopLeScan(import10.BluetoothAdapter_LeScanCallback);
@Import import5.BluetoothServerSocket listenUsingL2capChannel();
@Import import5.BluetoothServerSocket listenUsingInsecureL2capChannel();
@Import import11.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Landroid/bluetooth/BluetoothAdapter;";
}
| D |
/**
* Code to handle debugger expression evaluation
*
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1995-1998 by Symantec
* Copyright (C) 2000-2021 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/ee.d, backend/ee.d)
*/
module dmd.backend.ee;
version (SPP) {} else
{
import core.stdc.stdio;
import core.stdc.string;
import core.stdc.time;
import dmd.backend.cc;
import dmd.backend.cdef;
import dmd.backend.global;
import dmd.backend.symtab;
import dmd.backend.type;
import dmd.backend.oper;
import dmd.backend.el;
import dmd.backend.exh;
import dmd.backend.cgcv;
import dmd.backend.symtab;
version (SCPP)
{
import parser;
}
import dmd.backend.iasm;
extern(C++):
nothrow:
version (MARS)
{
__gshared EEcontext eecontext;
}
//////////////////////////////////////
// Convert any symbols generated for the debugger expression to SCstack
// storage class.
void eecontext_convs(SYMIDX marksi)
{
symtab_t *ps;
// Change all generated SCauto's to SCstack's
version (SCPP)
{
ps = &globsym;
}
else version (HTOD)
{
ps = &globsym;
}
else
{
ps = cstate.CSpsymtab;
}
const top = ps.length;
//printf("eecontext_convs(%d,%d)\n",marksi,top);
foreach (u; marksi .. top)
{
auto s = (*ps)[u];
switch (s.Sclass)
{
case SCauto:
case SCregister:
s.Sclass = SCstack;
s.Sfl = FLstack;
break;
default:
break;
}
}
}
////////////////////////////////////////
// Parse the debugger expression.
version (SCPP)
{
void eecontext_parse()
{
if (eecontext.EEimminent)
{ type *t;
Symbol *s;
//printf("imminent\n");
const marksi = globsym.length;
eecontext.EEin++;
s = symbol_genauto(tspvoid);
eecontext.EEelem = func_expr_dtor(true);
t = eecontext.EEelem.ET;
if (tybasic(t.Tty) != TYvoid)
{ uint op;
elem *e;
e = el_unat(OPind,t,el_var(s));
op = tyaggregate(t.Tty) ? OPstreq : OPeq;
eecontext.EEelem = el_bint(op,t,e,eecontext.EEelem);
}
eecontext.EEin--;
eecontext.EEimminent = 0;
eecontext.EEfunc = funcsym_p;
eecontext_convs(marksi);
// Generate the typedef
if (eecontext.EEtypedef && config.fulltypes)
{ Symbol *s;
s = symbol_name(eecontext.EEtypedef,SCtypedef,t);
cv_outsym(s);
symbol_free(s);
}
}
}
}
}
| D |
module lighttp.server;
public import lighttp.server.resource : Resource, CachedResource, TemplatedResource;
public import lighttp.server.router : CustomMethod, Get, Post, Put, Delete;
public import lighttp.server.server : ServerOptions, Server, WebSocket = WebSocketConnection;
| D |
module map.standard_map;
import std.typecons : Tuple;
import std.math : PI, sin;
import map.map;
import map.traits;
private alias ThetaPTuple = Tuple!(real, "theta", real, "p");
auto standardMap(real k) {
return new Map!( (real theta, real p) =>
ThetaPTuple((theta + p) % (2 * PI), (p + k * sin(theta + p)) ) );
}
auto reversedStandardMap(real k) {
return new Map!( (real theta, real p) =>
ThetaPTuple((theta - p + k * sin(theta)) % (2 * PI),
p - k * sin(theta) ));
}
unittest {
auto stdMap = standardMap(0.1);
stdMap.setInitialPoint(0, 0);
assert(stdMap.isAtFixedPoint);
stdMap.reset();
auto points = ThetaPTuple(1.0, 0.5);
stdMap.setInitialPoint(points);
}
| D |
// EXTRA_OBJC_SOURCES: objc_objc_msgSend.m
// REQUIRED_ARGS: -L-framework -LFoundation
extern (C) Class objc_lookUpClass(in char* name);
struct Struct
{
int a, b, c, d, e;
}
extern (Objective-C)
extern class Class
{
stret alloc_stret() @selector("alloc");
fp2ret alloc_fp2ret() @selector("alloc");
fpret alloc_fpret() @selector("alloc");
float32 alloc_float32() @selector("alloc");
double64 alloc_double64() @selector("alloc");
}
extern (Objective-C)
extern class stret
{
stret init() @selector("init");
Struct getValue() @selector("getValue");
void release() @selector("release");
}
extern (Objective-C)
extern class fp2ret
{
fp2ret init() @selector("init");
creal getValue() @selector("getValue");
void release() @selector("release");
}
extern (Objective-C)
extern class fpret
{
fpret init() @selector("init");
real getValue() @selector("getValue");
void release() @selector("release");
}
extern (Objective-C)
extern class float32
{
float32 init() @selector("init");
float getValue() @selector("getValue");
void release() @selector("release");
}
extern (Objective-C)
extern class double64
{
double64 init() @selector("init");
double getValue() @selector("getValue");
void release() @selector("release");
}
void test_stret()
{
auto c = objc_lookUpClass("stret");
auto o = c.alloc_stret().init();
assert(o.getValue() == Struct(3, 3, 3, 3, 3));
o.release();
}
void test_fp2ret()
{
auto c = objc_lookUpClass("fp2ret");
auto o = c.alloc_fp2ret().init();
assert(o.getValue() == 1+3i);
o.release();
}
void test_fpret()
{
auto c = objc_lookUpClass("fpret");
auto o = c.alloc_fpret().init();
assert(o.getValue() == 0.000000000000000002L);
o.release();
}
void test_float32()
{
auto c = objc_lookUpClass("float32");
auto o = c.alloc_float32.init();
assert(o.getValue == 0.2f);
o.release();
}
void test_double64()
{
auto c = objc_lookUpClass("double64");
auto o = c.alloc_double64.init();
assert(o.getValue == 0.2);
o.release();
}
void main()
{
// test_stret();
// test_fp2ret();
test_fpret();
test_float32();
test_double64();
}
| D |
module godot.gdnativeclass;
import std.meta : AliasSeq, staticIndexOf;
import std.traits : Unqual;
import godot.d.meta;
import godot.core;
import godot.c;
import godot.object;
import godot.reference;
@GodotBaseClass struct GDNativeClass
{
static immutable string _GODOT_internal_name = "GDNativeClass";
public:
union { godot_object _godot_object; Reference base; }
alias base this;
alias BaseClasses = AliasSeq!(typeof(base), typeof(base).BaseClasses);
package(godot) void* opCast(T : void*)() const { return cast(void*)_godot_object.ptr; }
godot_object opCast(T : godot_object)() const { return cast(godot_object)_godot_object; }
bool opEquals(in GDNativeClass other) const { return _godot_object.ptr is other._godot_object.ptr; }
GDNativeClass opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
bool opCast(T : bool)() const { return _godot_object.ptr !is null; }
inout(T) opCast(T)() inout if(isGodotBaseClass!T)
{
static assert(staticIndexOf!(GDNativeClass, T.BaseClasses) != -1, "Godot class "~T.stringof~" does not inherit GDNativeClass");
if(_godot_object.ptr is null) return T.init;
String c = String(T._GODOT_internal_name);
if(is_class(c)) return inout(T)(_godot_object);
return T.init;
}
inout(T) opCast(T)() inout if(extendsGodotBaseClass!T)
{
static assert(is(typeof(T.owner) : GDNativeClass) || staticIndexOf!(GDNativeClass, typeof(T.owner).BaseClasses) != -1, "D class "~T.stringof~" does not extend GDNativeClass");
if(_godot_object.ptr is null) return null;
if(has_method(String(`_GDNATIVE_D_typeid`)))
{
Object o = cast(Object)godot_nativescript_get_userdata(opCast!godot_object);
return cast(inout(T))o;
}
return null;
}
static GDNativeClass _new()
{
static godot_class_constructor constructor;
if(constructor is null) constructor = godot_get_class_constructor("GDNativeClass");
if(constructor is null) return typeof(this).init;
return cast(GDNativeClass)(constructor());
}
void _new()
{
static godot_method_bind* mb = null;
if(mb is null) mb = godot_method_bind_get_method("GDNativeClass", "new");
godot_method_bind_ptrcall(mb, cast(godot_object)(this), null);
}
}
| D |
module ud1_arkanoid_d.sound_system;
import derelict.openal.al;
import derelict.ogg.ogg;
import derelict.vorbis.vorbis;
import derelict.vorbis.enc;
import derelict.vorbis.file;
import std.stdio;
enum size_t DYN_BUF_NUMBER = 3; // number buffers in queue
enum size_t DYN_BUF_SIZE = 44000*5; // Buffer size
class Sound {
this() {
vrb_file = null;
source_setted = false;
looped = false;
opened = false;
}
~this() {
reset();
}
void reset() {
if (vrb_file) {
ov_clear(vrb_file);
}
if (buffers.length) {
stop();
alDeleteBuffers(cast(int)buffers.length, buffers.ptr);
buffers = null;
}
vrb_file = null;
source_setted = false;
looped = false;
opened = false;
}
bool open(string filename, bool streamed_) {
reset();
streamed = streamed_;
vrb_file = new OggVorbis_File;
if (ov_fopen(filename.ptr, vrb_file) < 0) {
return false;
}
vrb_info = ov_info(vrb_file, -1);
format = (vrb_info.channels == 1) ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16;
if (streamed) {
block_size = DYN_BUF_SIZE;
dyn_bufs = DYN_BUF_NUMBER;
} else {
block_size = cast(size_t) (ov_pcm_total(vrb_file, -1)*2*vrb_info.channels);
dyn_bufs = 1;
}
for (size_t i = 0; i < dyn_bufs; ++i) {
ALuint bufferId;
alGenBuffers(1, &bufferId);
if (readOggBlock(bufferId, block_size)) {
buffers ~= bufferId;
} else {
return false;
}
}
opened = true;
return true;
}
bool readOggBlock(ALuint buf_id, size_t size) {
if (size < 1)
return false;
byte[] PCM;
PCM.length = size;
size_t total = 0;
long ret;
while (total < size) {
ret = ov_read(vrb_file, &PCM[total], cast(int) (size - total), 0, 2, 1, null);
if (!ret)
break;
total += ret;
}
if (total) {
alBufferData(buf_id, format, &PCM[0], cast(int) (total), vrb_info.rate);
}
return total > 0;
}
void playOnSource(ALuint source_id_, bool looped_) {
if (!opened)
return;
looped = looped_;
if (streamed) {
source_id = source_id_;
source_setted = true;
alSourceQueueBuffers(source_id_, cast(int) buffers.length, &buffers[0]);
} else {
alSourceStop(source_id_);
alSourcei(source_id_, AL_BUFFER, buffers[0]);
}
alSourcePlay(source_id_);
}
void update() {
if (!source_setted)
return;
ALint processed = 0;
alGetSourcei(source_id, AL_BUFFERS_PROCESSED, &processed);
while (processed--) {
ALuint buf_id;
alSourceUnqueueBuffers(source_id, 1, &buf_id);
if (readOggBlock(buf_id, DYN_BUF_SIZE)) {
alSourceQueueBuffers(source_id, 1, &buf_id);
} else {
ov_pcm_seek(vrb_file, 0);
if (readOggBlock(buf_id, DYN_BUF_SIZE)) {
alSourceQueueBuffers(source_id, 1, &buf_id);
}
}
}
}
void stop() {
if (!source_setted)
return;
alSourceStop(source_id);
}
OggVorbis_File *vrb_file;
vorbis_info *vrb_info;
size_t dyn_bufs, block_size;
ALenum format;
ALuint[] buffers;
bool streamed, source_setted, looped, opened;
ALuint source_id;
}
enum size_t SOURCE_NUMBER = 5;
struct SoundSystem {
~this() {
clear();
if (sources.length)
alDeleteSources(cast(int) sources.length, &sources[0]);
alDeleteSources(1, &backgound_source);
alDeleteSources(1, &snd_source);
sources = null;
alcMakeContextCurrent(null);
alcDestroyContext(context);
alcCloseDevice(device);
}
bool initialize() {
device = alcOpenDevice(null); // open default device
if (!device)
return false;
context = alcCreateContext(device, null); // create context
if (!context) {
alcCloseDevice(device);
return false;
}
alcMakeContextCurrent(context); // set active context
alDistanceModel(AL_NONE);
sources.length = SOURCE_NUMBER;
alGenSources(SOURCE_NUMBER, &sources[0]);
alGenSources(1, &backgound_source);
alGenSources(1, &snd_source);
snd = new Sound;
backgound = new Sound;
initialized = true;
return true;
}
void setSndNumber(size_t count) {
if (!initialized)
return;
clear();
for (size_t i = 0; i < count; ++i) {
sounds ~= new Sound;
}
}
bool load(size_t n, string filename) {
if (!initialized)
return false;
assert(n < sounds.length);
return sounds[n].open(filename, false);
}
void play(size_t n, float volume) {
if (!initialized)
return;
if (volume < 0.05f)
return;
ALuint source = sources[source_to_play_ind];
source_to_play_ind = (source_to_play_ind + 1) % sources.length;
alSourcef(source, AL_GAIN, volume);
sounds[n].playOnSource(source, false);
}
bool play(string filename, float volume) {
if (!initialized)
return false;
if (snd.open(filename, false)) {
alSourcef(snd_source, AL_GAIN, volume);
snd.playOnSource(snd_source, false);
return true;
}
return false;
}
bool playBackground(string filename, float volume) {
if (!initialized)
return false;
if (!backgound.open(filename, true))
return false;
alSourcef(backgound_source, AL_GAIN, volume);
backgound.playOnSource(backgound_source, true);
return true;
}
void update() {
if (!initialized)
return;
backgound.update();
}
private:
void clear() {
sounds = null;
}
Sound[] sounds;
Sound backgound, snd;
ALuint[] sources;
ALuint backgound_source, snd_source;
size_t source_to_play_ind;
bool initialized;
ALCdevice *device;
ALCcontext *context;
}
| D |
/* Xlib binding for D language
Copyright 2007 TEISSIER Sylvere sligor(at)free.fr
version 0.1 2007/08/29
This binding is an alpha release and need to be more tested
This file is free software, please read licence.txt for more informations
*/
module std.c.linux.X11.X;
version(USE_XCB):
const uint X_PROTOCOL=11; /* current protocol version */
const uint X_PROTOCOL_REVISION=0; /* current minor version */
/* Resources */
alias ulong XID;
alias ulong Mask;
alias ulong VisualID;
alias ulong Time;
alias XID Atom; //alias needed because of None invariant shared for Atom and XID
alias XID Window;
alias XID Drawable;
alias XID Font;
alias XID Pixmap;
alias XID Cursor;
alias XID Colormap;
alias XID GContext;
alias XID KeySym;
alias uint KeyCode;
/*****************************************************************
* RESERVED RESOURCE AND CONSTANT DEFINITIONS
*****************************************************************/
const XID None=0;/* universal null resource or null atom */
const uint ParentRelative=1; /* border pixmap in CreateWindow and ChangeWindowAttributes special VisualID and special window class passed to CreateWindow */
const uint CopyFromParent=0; /* background pixmap in CreateWindow and ChangeWindowAttributes */
const Window PointerWindow=0; /* destination window in SendEvent */
const Window InputFocus=1; /* destination window in SendEvent */
const Window PointerRoot=1; /* focus window in SetInputFocus */
const Atom AnyPropertyType=0; /* special Atom, passed to GetProperty */
const KeyCode AnyKey=0; /* special Key Code, passed to GrabKey */
const uint AnyButton=0; /* special Button Code, passed to GrabButton */
const XID AllTemporary=0; /* special Resource ID passed to KillClient */
const Time CurrentTime=0; /* special Time */
const KeySym NoSymbol=0; /* special KeySym */
/*****************************************************************
* EVENT DEFINITIONS
*****************************************************************/
/* Input Event Masks. Used as event-mask window attribute and as arguments
to Grab requests. Not to be confused with event names. */
enum EventMask:long
{
NoEventMask =0,
KeyPressMask =1<<0,
KeyReleaseMask =1<<1,
ButtonPressMask =1<<2,
ButtonReleaseMask =1<<3,
EnterWindowMask =1<<4,
LeaveWindowMask =1<<5,
PointerMotionMask =1<<6,
PointerMotionHintMask =1<<7,
Button1MotionMask =1<<8,
Button2MotionMask =1<<9,
Button3MotionMask =1<<10,
Button4MotionMask =1<<11,
Button5MotionMask =1<<12,
ButtonMotionMask =1<<13,
KeymapStateMask =1<<14,
ExposureMask =1<<15,
VisibilityChangeMask =1<<16,
StructureNotifyMask =1<<17,
ResizeRedirectMask =1<<18,
SubstructureNotifyMask =1<<19,
SubstructureRedirectMask=1<<20,
FocusChangeMask =1<<21,
PropertyChangeMask =1<<22,
ColormapChangeMask =1<<23,
OwnerGrabButtonMask =1<<24
};
/* Event names. Used in "type" field in XEvent structures. Not to be
confused with event masks above. They start from 2 because 0 and 1
are reserved in the protocol for errors and replies. */
enum EventType:int
{
KeyPress =2,
KeyRelease =3,
ButtonPress =4,
ButtonRelease =5,
MotionNotify =6,
EnterNotify =7,
LeaveNotify =8,
FocusIn =9,
FocusOut =10,
KeymapNotify =11,
Expose =12,
GraphicsExpose =13,
NoExpose =14,
VisibilityNotify =15,
CreateNotify =16,
DestroyNotify =17,
UnmapNotify =18,
MapNotify =19,
MapRequest =20,
ReparentNotify =21,
ConfigureNotify =22,
ConfigureRequest =23,
GravityNotify =24,
ResizeRequest =25,
CirculateNotify =26,
CirculateRequest =27,
PropertyNotify =28,
SelectionClear =29,
SelectionRequest =30,
SelectionNotify =31,
ColormapNotify =32,
ClientMessage =33,
MappingNotify =34,
LASTEvent =35 /* must be bigger than any event # */
};
/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
state in various key-, mouse-, and button-related events. */
enum KeyMask:uint
{
ShiftMask =1<<0,
LockMask =1<<1,
ControlMask =1<<2,
Mod1Mask =1<<3,
Mod2Mask =1<<4,
Mod3Mask =1<<5,
Mod4Mask =1<<6,
Mod5Mask =1<<7,
AnyModifier =1<<15/* used in GrabButton, GrabKey */
};
/* modifier names. Used to build a SetModifierMapping request or
to read a GetModifierMapping request. These correspond to the
masks defined above. */
enum ModifierName:int
{
ShiftMapIndex =0,
LockMapIndex =1,
ControlMapIndex =2,
Mod1MapIndex =3,
Mod2MapIndex =4,
Mod3MapIndex =5,
Mod4MapIndex =6,
Mod5MapIndex =7
};
enum ButtonMask:int
{
Button1Mask =1<<8,
Button2Mask =1<<9,
Button3Mask =1<<10,
Button4Mask =1<<11,
Button5Mask =1<<12,
AnyModifier =1<<15/* used in GrabButton, GrabKey */
};
enum KeyOrButtonMask:uint
{
ShiftMask =1<<0,
LockMask =1<<1,
ControlMask =1<<2,
Mod1Mask =1<<3,
Mod2Mask =1<<4,
Mod3Mask =1<<5,
Mod4Mask =1<<6,
Mod5Mask =1<<7,
Button1Mask =1<<8,
Button2Mask =1<<9,
Button3Mask =1<<10,
Button4Mask =1<<11,
Button5Mask =1<<12,
AnyModifier =1<<15/* used in GrabButton, GrabKey */
};
/* button names. Used as arguments to GrabButton and as detail in ButtonPress
and ButtonRelease events. Not to be confused with button masks above.
Note that 0 is already defined above as "AnyButton". */
enum ButtonName:int
{
Button1 =1,
Button2 =2,
Button3 =3,
Button4 =4,
Button5 =5
};
/* Notify modes */
enum NotifyModes:int
{
NotifyNormal =0,
NotifyGrab =1,
NotifyUngrab =2,
NotifyWhileGrabbed =3
};
const int NotifyHint =1; /* for MotionNotify events */
/* Notify detail */
enum NotifyDetail:int
{
NotifyAncestor =0,
NotifyVirtual =1,
NotifyInferior =2,
NotifyNonlinear =3,
NotifyNonlinearVirtual =4,
NotifyPointer =5,
NotifyPointerRoot =6,
NotifyDetailNone =7
};
/* Visibility notify */
enum VisibilityNotify:int
{
VisibilityUnobscured =0,
VisibilityPartiallyObscured =1,
VisibilityFullyObscured =2
};
/* Circulation request */
enum CirculationRequest:int
{
PlaceOnTop =0,
PlaceOnBottom =1
};
/* protocol families */
enum ProtocolFamlily:int
{
FamilyInternet =0, /* IPv4 */
FamilyDECnet =1,
FamilyChaos =2,
FamilyServerInterpreted =5, /* authentication families not tied to a specific protocol */
FamilyInternet6 =6 /* IPv6 */
};
/* Property notification */
enum PropertyNotification:int
{
PropertyNewValue =0,
PropertyDelete =1
};
/* Color Map notification */
enum ColorMapNotification:int
{
ColormapUninstalled =0,
ColormapInstalled =1
};
/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
enum GrabMode:int
{
GrabModeSync =0,
GrabModeAsync =1
};
/* GrabPointer, GrabKeyboard reply status */
enum GrabReplyStatus:int
{
GrabSuccess =0,
AlreadyGrabbed =1,
GrabInvalidTime =2,
GrabNotViewable =3,
GrabFrozen =4
};
/* AllowEvents modes */
enum AllowEventMode:int
{
AsyncPointer =0,
SyncPointer =1,
ReplayPointer =2,
AsyncKeyboard =3,
SyncKeyboard =4,
ReplayKeyboard =5,
AsyncBoth =6,
SyncBoth =7
};
/* Used in SetInputFocus, GetInputFocus */
enum InputFocusRevertTo:int
{
RevertToNone =None,
RevertToPointerRoot =PointerRoot,
RevertToParent =2
};
/*****************************************************************
* ERROR CODES
*****************************************************************/
enum XErrorCode:int
{
Success =0, /* everything's okay */
BadRequest =1, /* bad request code */
BadValue =2, /* int parameter out of range */
BadWindow =3, /* parameter not a Window */
BadPixmap =4, /* parameter not a Pixmap */
BadAtom =5, /* parameter not an Atom */
BadCursor =6, /* parameter not a Cursor */
BadFont =7, /* parameter not a Font */
BadMatch =8, /* parameter mismatch */
BadDrawable =9, /* parameter not a Pixmap or Window */
BadAccess =10, /* depending on context:
- key/button already grabbed
- attempt to free an illegal
cmap entry
- attempt to store into a read-only
color map entry.
- attempt to modify the access control
list from other than the local host.
*/
BadAlloc =11, /* insufficient resources */
BadColor =12, /* no such colormap */
BadGC =13, /* parameter not a GC */
BadIDChoice =14, /* choice not in range or already used */
BadName =15, /* font or color name doesn't exist */
BadLength =16, /* Request length incorrect */
BadImplementation =17, /* server is defective */
FirstExtensionError =128,
LastExtensionError =255
};
/*****************************************************************
* WINDOW DEFINITIONS
*****************************************************************/
/* Window classes used by CreateWindow */
/* Note that CopyFromParent is already defined as 0 above */
enum WindowClass:int
{
CopyFromParent =0,
InputOutput =1,
InputOnly =2
};
/* Window attributes for CreateWindow and ChangeWindowAttributes */
enum WindowAttribute:ulong
{
CWBackPixmap =1<<0,
CWBackPixel =1<<1,
CWBorderPixmap =1<<2,
CWBorderPixel =1<<3,
CWBitGravity =1<<4,
CWWinGravity =1<<5,
CWBackingStore =1<<6,
CWBackingPlanes =1<<7,
CWBackingPixel =1<<8,
CWOverrideRedirect =1<<9,
CWSaveUnder =1<<10,
CWEventMask =1<<11,
CWDontPropagate =1<<12,
CWColormap =1<<13,
CWCursor =1<<14
};
/* ConfigureWindow structure */
enum ConfigureWindowStruct:int
{
CWX =1<<0,
CWY =1<<1,
CWWidth =1<<2,
CWHeight =1<<3,
CWBorderWidth =1<<4,
CWSibling =1<<5,
CWStackMode =1<<6
};
/* Bit Gravity */
enum BitGravity:int
{
ForgetGravity =0,
NorthWestGravity =1,
NorthGravity =2,
NorthEastGravity =3,
WestGravity =4,
CenterGravity =5,
EastGravity =6,
SouthWestGravity =7,
SouthGravity =8,
SouthEastGravity =9,
StaticGravity =10
};
/* Window gravity + bit gravity above */
const uint UnmapGravity=0;
/* Used in CreateWindow for backing-store hint */
enum BackingStoreHint:int
{
NotUseful =0,
WhenMapped =1,
Always =2
};
/* Used in GetWindowAttributes reply */
enum MapState:int
{
IsUnmapped =0,
IsUnviewable =1,
IsViewable =2
};
/* Used in ChangeSaveSet */
enum ChangeMode:int
{
SetModeInsert =0,
SetModeDelete =1
};
/* Used in ChangeCloseDownMode */
enum CloseDownMode:int
{
DestroyAll =0,
RetainPermanent =1,
RetainTemporary =2
};
/* Window stacking method (in configureWindow) */
enum WindowStackingMethod:int
{
Above =0,
Below =1,
TopIf =2,
BottomIf =3,
Opposite =4
};
/* Circulation direction */
enum CircularDirection:int
{
RaiseLowest =0,
LowerHighest =1
};
/* Property modes */
enum PropertyMode:int
{
PropModeReplace =0,
PropModePrepend =1,
PropModeAppend =2
};
/*****************************************************************
* GRAPHICS DEFINITIONS
*****************************************************************/
/* graphics functions, as in GC.alu */
enum GraphicFunction:int
{
GXclear =0x0, /* 0 */
GXand =0x1, /* src AND dst */
GXandReverse =0x2, /* src AND NOT dst */
GXcopy =0x3, /* src */
GXandInverted =0x4, /* NOT src AND dst */
GXnoop =0x5, /* dst */
GXxor =0x6, /* src XOR dst */
GXor =0x7, /* src OR dst */
GXnor =0x8, /* NOT src AND NOT dst */
GXequiv =0x9, /* NOT src XOR dst */
GXinvert =0xa, /* NOT dst */
GXorReverse =0xb, /* src OR NOT dst */
GXcopyInverted =0xc, /* NOT src */
GXorInverted =0xd, /* NOT src OR dst */
GXnand =0xe, /* NOT src OR NOT dst */
GXset =0xf /* 1 */
};
/* LineStyle */
enum LineStyle:int
{
LineSolid =0,
LineOnOffDash =1,
LineDoubleDash =2
};
/* capStyle */
enum CapStyle:int
{
CapNotLast =0,
CapButt =1,
CapRound =2,
CapProjecting =3
};
/* joinStyle */
enum JoinStyle:int
{
JoinMiter =0,
JoinRound =1,
JoinBevel =2
};
/* fillStyle */
enum FillStyle:int
{
FillSolid =0,
FillTiled =1,
FillStippled =2,
FillOpaqueStippled =3
};
/* fillRule */
enum FillRule:int
{
EvenOddRule =0,
WindingRule =1
};
/* subwindow mode */
enum SubwindowMode:int
{
ClipByChildren =0,
IncludeInferiors =1
};
/* SetClipRectangles ordering */
enum ClipRectanglesOrdering:int
{
Unsorted =0,
YSorted =1,
YXSorted =2,
YXBanded =3
};
/* CoordinateMode for drawing routines */
enum CoordinateMode:int
{
CoordModeOrigin =0, /* relative to the origin */
CoordModePrevious =1 /* relative to previous point */
};
/* Polygon shapes */
enum PolygonShape:int
{
Complex =0, /* paths may intersect */
Nonconvex =1, /* no paths intersect, but not convex */
Convex =2 /* wholly convex */
};
/* Arc modes for PolyFillArc */
enum ArcMode:int
{
ArcChord =0, /* join endpoints of arc */
ArcPieSlice =1 /* join endpoints to center of arc */
};
/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
GC.stateChanges */
enum GCMask:ulong
{
GCFunction =1<<0,
GCPlaneMask =1<<1,
GCForeground =1<<2,
GCBackground =1<<3,
GCLineWidth =1<<4,
GCLineStyle =1<<5,
GCCapStyle =1<<6,
GCJoinStyle =1<<7,
GCFillStyle =1<<8,
GCFillRule =1<<9,
GCTile =1<<10,
GCStipple =1<<11,
GCTileStipXOrigin =1<<12,
GCTileStipYOrigin =1<<13,
GCFont =1<<14,
GCSubwindowMode =1<<15,
GCGraphicsExposures =1<<16,
GCClipXOrigin =1<<17,
GCClipYOrigin =1<<18,
GCClipMask =1<<19,
GCDashOffset =1<<20,
GCDashList =1<<21,
GCArcMode =1<<22,
};
const uint GCLastBit=22;
/*****************************************************************
* FONTS
*****************************************************************/
/* used in QueryFont -- draw direction */
enum FontDrawDirection:int
{
FontLeftToRight =0,
FontRightToLeft =1,
FontChange =255
}
/*****************************************************************
* IMAGING
*****************************************************************/
/* ImageFormat -- PutImage, GetImage */
enum ImageFormat:int
{
XYBitmap =0, /* depth 1, XYFormat */
XYPixmap =1, /* depth == drawable depth */
ZPixmap =2 /* depth == drawable depth */
};
/*****************************************************************
* COLOR MAP STUFF
*****************************************************************/
/* For CreateColormap */
enum AllocType:int
{
AllocNone =0, /* create map with no entries */
AllocAll =1 /* allocate entire map writeable */
};
/* Flags used in StoreNamedColor, StoreColors */
enum StoreColor:int
{
DoRed =1<<0,
DoGreen =1<<1,
DoBlue =1<<2
};
/*****************************************************************
* CURSOR STUFF
*****************************************************************/
/* QueryBestSize Class */
enum QueryBestSizeClass:int
{
CursorShape =0, /* largest size that can be displayed */
TileShape =1, /* size tiled fastest */
StippleShape =2 /* size stippled fastest */
};
/*****************************************************************
* KEYBOARD/POINTER STUFF
*****************************************************************/
enum AutoRepeatMode:int
{
AutoRepeatModeOff =0,
AutoRepeatModeOn =1,
AutoRepeatModeDefault =2
};
enum LedMode:int
{
LedModeOff =0,
LedModeOn =1
};
/* masks for ChangeKeyboardControl */
enum KBMask:ulong
{
KBKeyClickPercent =1<<0,
KBBellPercent =1<<1,
KBBellPitch =1<<2,
KBBellDuration =1<<3,
KBLed =1<<4,
KBLedMode =1<<5,
KBKey =1<<6,
KBAutoRepeatMode =1<<7
};
enum MappingErrorCode:int
{
MappingSuccess =0,
MappingBusy =1,
MappingFailed =2
};
enum MappingType:int
{
MappingModifier =0,
MappingKeyboard =1,
MappingPointer =2
};
/*****************************************************************
* SCREEN SAVER STUFF
*****************************************************************/
enum ScreenSaverBlancking:int
{
DontPreferBlanking =0,
PreferBlanking =1,
DefaultBlanking =2
};
enum ScreenSaverDisable:int
{
DisableScreenSaver =0,
DisableScreenInterval =0
};
enum ScreenSaverExposure:int
{
DontAllowExposures =0,
AllowExposures =1,
DefaultExposures =2
};
/* for ForceScreenSaver */
enum ScreenSaverMode:int
{
ScreenSaverReset =0,
ScreenSaverActive =1
};
/*****************************************************************
* HOSTS AND CONNECTIONS
*****************************************************************/
/* for ChangeHosts */
enum HostChange:int
{
HostInsert =0,
HostDelete =1
};
/* for ChangeAccessControl */
enum HostAccess:int
{
EnableAccess =1,
DisableAccess =0
};
/* Display classes used in opening the connection
* Note that the statically allocated ones are even numbered and the
* dynamically changeable ones are odd numbered */
enum DisplayClass:int
{
StaticGray =0,
GrayScale =1,
StaticColor =2,
PseudoColor =3,
TrueColor =4,
DirectColor =5
};
/* Byte order used in imageByteOrder and bitmapBitOrder */
enum ByteOrder:int
{
LSBFirst =0,
MSBFirst =1
};
| D |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.