This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <experimental/coroutine> | |
using namespace std::experimental; | |
struct coro { | |
struct promise_type { | |
coro get_return_object() { | |
auto handle = coroutine_handle<promise_type>::from_promise(*this); | |
return coro(handle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The CMake files in this project contain several additional checks, or examples | |
# of how to use LLVM CMake functions. These additional checks can be disabled by | |
# setting this option to 'OFF'. | |
option(EXAMPLES_CMAKE_TESTS | |
"Enable tests related to the example project's CMake configuration." ON) | |
# Most LLVM projects define '<PROJECTNAME>_SOURCE_DIR' and '_BINARY_DIR' | |
# in their CMake files. These can be used in many ways, such as to | |
# specify the path to our tests in our lit test config, lit.site.cfg.py.in. | |
set(EXAMPLES_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "gtest/gtest.h" | |
#include "llvm/Analysis/PostDominators.h" | |
#include "llvm/IR/IRBuilder.h" | |
#include "llvm/IR/LLVMContext.h" | |
#include "llvm/IR/Module.h" | |
#include "llvm/IR/NoFolder.h" | |
#include "llvm/Passes/PassBuilder.h" | |
static void createCalls(llvm::LLVMContext &context, llvm::Module &module) { | |
llvm::Type *voidType = llvm::Type::getVoidTy(context); |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <iostream> | |
void bar_prologue_outlined() { | |
std::cout << [](int a, float b) -> int { | |
return a * 10 + b * 5; | |
}(1, 2.f) << std::endl; | |
std::cout << [](int a, float b, double c) -> auto { | |
return [a, b, c](const std::string &d) -> int { | |
std::cout << d << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <experimental/coroutine> | |
struct task { | |
struct promise_type { | |
task get_return_object() { return task(); } | |
std::experimental::suspend_never initial_suspend() { return {}; } | |
std::experimental::suspend_never final_suspend() { return {}; } | |
void return_void() {} | |
void unhandled_exception() {} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
===-------------------------------------------------------------------------=== | |
Swift compilation | |
===-------------------------------------------------------------------------=== | |
Total Execution Time: 0.0307 seconds (0.1196 wall clock) | |
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name --- | |
0.0043 ( 39.3%) 0.0091 ( 45.6%) 0.0133 ( 43.4%) 0.0547 ( 45.7%) performSema | |
0.0030 ( 27.5%) 0.0070 ( 35.2%) 0.0100 ( 32.5%) 0.0437 ( 36.5%) performSema-loadStdlib | |
0.0011 ( 10.0%) 0.0011 ( 5.4%) 0.0022 ( 7.0%) 0.0081 ( 6.7%) performSema-parseAndCheckTypes | |
0.0008 ( 7.0%) 0.0009 ( 4.4%) 0.0016 ( 5.3%) 0.0067 ( 5.6%) Type checking / Semantic analysis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Undefined symbols for architecture x86_64: | |
"__T0S2Sx26stringInterpolationSegment_tcs23CustomStringConvertibleRzs20TextOutputStreamableRzlufCSS_Tg5", referenced from: | |
_main in main.o | |
"__T0s27_allocateUninitializedArraySayxG_BptBwlFSS_Tg5", referenced from: | |
_main in main.o | |
"__T0s27_allocateUninitializedArraySayxG_BptBwlFyp_Tg5", referenced from: | |
_main in main.o | |
ld: symbol(s) not found for architecture x86_64 | |
clang: error: linker command failed with exit code 1 (use -v to see invocation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake \ | |
-H$HOME/local/Source/apple/standalone/swift \ | |
-B$HOME/local/Source/apple/standalone/swift-build | |
-G Ninja \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/local/Source/apple/standalone/swift-install \ | |
-DCMAKE_BUILD_TYPE="Release" \ | |
-DSWIFT_PATH_TO_LLVM_SOURCE=$HOME/local/Source/apple/standalone/swift-llvm \ | |
-DSWIFT_PATH_TO_LLVM_BUILD=$HOME/local/Source/apple/standalone/swift-llvm-build \ | |
-DSWIFT_PATH_TO_CLANG_SOURCE=$HOME/local/Source/apple/standalone/swift-clang \ | |
-DSWIFT_PATH_TO_CLANG_BUILD=$HOME/local/Source/apple/standalone/swift-llvm-build \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define NEW_MY_INT_CLASS(num) MyClass<int>(num); | |
int gX = 10; | |
template <class T> | |
class MyClass { | |
private: | |
T Member; | |
public: | |
MyClass(T Member): Member(Member) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clang++ -ftime-report yo.cpp -o yo | |
===-------------------------------------------------------------------------=== | |
Miscellaneous Ungrouped Timers | |
===-------------------------------------------------------------------------=== | |
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name --- | |
0.0350 ( 48.6%) 0.0030 (100.0%) 0.0380 ( 50.7%) 0.0379 ( 51.1%) Code Generation Time | |
0.0370 ( 51.4%) 0.0000 ( 0.0%) 0.0370 ( 49.3%) 0.0363 ( 48.9%) LLVM IR Generation Time | |
0.0720 (100.0%) 0.0030 (100.0%) 0.0750 (100.0%) 0.0742 (100.0%) Total |
NewerOlder