llvm-project/clang/lib/Basic
Weining Lu 15b65bcd65 [Clang][LoongArch] Add initial LoongArch target and driver support
With the initial support added, clang can compile `helloworld` C
to executable file for loongarch64. For example:

```
$ cat hello.c
int main() {
  printf("Hello, world!\n");
  return 0;
}
$ clang --target=loongarch64-unknown-linux-gnu --gcc-toolchain=xxx --sysroot=xxx hello.c
```

The output a.out can run within qemu or native machine. For example:

```
$ file ./a.out
./a.out: ELF 64-bit LSB pie executable, LoongArch, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-loongarch-lp64d.so.1, for GNU/Linux 5.19.0, with debug_info, not stripped
$ ./a.out
Hello, world!
```

Currently gcc toolchain and sysroot can be found here:
https://github.com/loongson/build-tools/releases/download/2022.08.11/loongarch64-clfs-5.1-cross-tools-gcc-glibc.tar.xz

Reference: https://github.com/loongson/LoongArch-Documentation
The last commit hash (main branch) is:
99016636af64d02dee05e39974d4c1e55875c45b

Note loongarch32 is not fully tested because there is no reference
gcc toolchain yet.

Differential Revision: https://reviews.llvm.org/D130255
2022-08-23 13:47:22 +08:00
..
Targets [Clang][LoongArch] Add initial LoongArch target and driver support 2022-08-23 13:47:22 +08:00
Attributes.cpp [Attributes] Remove AttrSyntax and migrate uses to AttributeCommonInfo::Syntax (NFC) 2022-06-03 12:11:48 -04:00
BuiltinTargetFeatures.h [clang] LLVM_FALLTHROUGH => [[fallthrough]]. NFC 2022-08-08 09:12:46 -07:00
Builtins.cpp [clang] Fix __has_builtin 2022-05-19 11:34:42 -04:00
CLWarnings.cpp Reland "[clang-cl] Accept `#pragma warning(disable : N)` for some N" 2021-09-30 15:03:23 -04:00
CMakeLists.txt [Clang][LoongArch] Add initial LoongArch target and driver support 2022-08-23 13:47:22 +08:00
CharInfo.cpp
CodeGenOptions.cpp [NFC] Remove duplicate isNoBuiltinFunc method 2021-03-10 09:18:55 +01:00
Cuda.cpp [clang] Use value_or instead of getValueOr (NFC) 2022-06-18 23:21:34 -07:00
DarwinSDKInfo.cpp [Clang] Extract availability mapping from VersionMap for watchOS/tvOS 2022-01-05 17:00:03 -08:00
Diagnostic.cpp Improve handling of static assert messages. 2022-06-29 14:57:35 +02:00
DiagnosticIDs.cpp [clang][tablegen] adds human documentation to `WarningOption` 2022-06-10 17:23:00 +00:00
DiagnosticOptions.cpp
ExpressionTraits.cpp
FileEntry.cpp Basic: Add native support for stdin to SourceManager and FileManager 2020-12-23 15:18:50 -08:00
FileManager.cpp [clang] Fix redirection behaviour for cached FileEntryRef 2022-08-05 12:23:38 -07:00
FileSystemStatCache.cpp
IdentifierTable.cpp Fix char8_t in C mode regression from fb65b179 2022-08-03 07:15:30 -07:00
LangOptions.cpp [FPEnv] Allow CompoundStmt to keep FP options 2022-07-03 17:06:26 +07:00
LangStandards.cpp Change default C dialect for PS5 to gnu17/gnu18. 2022-07-12 11:14:56 -07:00
MakeSupport.cpp Ensure newlines at the end of files (NFC) 2022-07-17 15:37:45 -07:00
Module.cpp [clang][modules] Report module maps affecting `no_undeclared_includes` modules 2022-03-07 10:47:46 +01:00
NoSanitizeList.cpp [sanitizer] Add "mainfile" prefix to sanitizer special case list 2022-07-15 10:39:26 -07:00
ObjCRuntime.cpp
OpenCLOptions.cpp [OpenCL] Turn global vector into static array. NFCI. 2022-03-05 19:16:28 +01:00
OpenMPKinds.cpp [OpenMP] Initial parsing and semantic support for 'parallel masked taskloop simd' construct 2022-07-01 08:57:15 -07:00
OperatorPrecedence.cpp
ProfileList.cpp [InstrProf][attempt 2] Add new format for -fprofile-list= 2022-08-04 17:12:56 -07:00
SanitizerSpecialCaseList.cpp
Sanitizers.cpp [clang-cl][sanitizer] Add -fsanitize-address-use-after-return to clang. 2021-06-11 12:07:35 -07:00
Sarif.cpp Add support for specifying the severity of a SARIF Result 2022-08-19 07:14:50 -04:00
SourceLocation.cpp Revert "[clang] Emit SARIF Diagnostics: Create `clang::SarifDocumentWriter` interface" 2022-06-24 07:33:07 -04:00
SourceManager.cpp [clang] SourceManager: fix at SourceManager::getFileIDLoaded for the case of invalid SLockEntry 2022-08-10 16:37:42 +01:00
Stack.cpp
TargetID.cpp [clang] Don't use Optional::getValue (NFC) 2022-06-20 22:59:26 -07:00
TargetInfo.cpp [clang] LLVM_FALLTHROUGH => [[fallthrough]]. NFC 2022-08-08 09:12:46 -07:00
Targets.cpp [Clang][LoongArch] Add initial LoongArch target and driver support 2022-08-23 13:47:22 +08:00
Targets.h
TokenKinds.cpp [Pseudo] Token/TokenStream, PP directive parser. 2022-02-23 17:52:02 +01:00
TypeTraits.cpp [clang] fix frontend crash when evaluating type trait 2022-08-13 00:02:19 +08:00
Version.cpp [NFC][clang] Return underlying strings directly instead of OS.str() 2021-12-09 16:05:46 -08:00
Warnings.cpp
XRayInstr.cpp [clang][cli] Generate and round-trip CodeGen options 2021-02-09 11:43:38 +01:00
XRayLists.cpp