forked from GPUOpen-Drivers/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged master:1ed2ca68191f into amd-gfx:3a9a669b4cd8
Local branch amd-gfx 3a9a669 Merged master:7979f24954ed into amd-gfx:c0143b8db6c2 Remote branch master 1ed2ca6 [flang][driver] Use --match-full-lines in tests for
- Loading branch information
Showing
114 changed files
with
7,897 additions
and
3,982 deletions.
There are no files selected for viewing
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
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
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
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
10 changes: 10 additions & 0 deletions
10
clang-tools-extra/clangd/test/remote-index/Inputs/Header.h
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace clang { | ||
namespace clangd { | ||
namespace remote { | ||
int getFoo(bool Argument); | ||
char Character; | ||
} // namespace remote | ||
} // namespace clangd | ||
} // namespace clang | ||
|
||
namespace llvm {} // namespace llvm |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "Header.h" | ||
|
||
namespace {} // namespace |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# RUN: rm -rf %t | ||
# RUN: clangd-indexer %S/Inputs/Source.cpp > %t.idx | ||
# RUN: %python %S/pipeline_helper.py --input-file-name=%s --project-root=%S --index-file=%t.idx | FileCheck %s | ||
# REQUIRES: clangd-remote-index | ||
|
||
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}} | ||
# CHECK: "id": 0, | ||
# CHECK-NEXT: "jsonrpc": "2.0", | ||
--- | ||
{"jsonrpc":"2.0","id":1,"method":"workspace/symbol","params":{"query":"Character"}} | ||
# CHECK: "id": 1, | ||
# CHECK-NEXT: "jsonrpc": "2.0", | ||
# CHECK-NEXT: "result": [ | ||
# CHECK-NEXT: { | ||
# CHECK-NEXT: "containerName": "clang::clangd::remote", | ||
# CHECK-NEXT: "kind": 13, | ||
# CHECK-NEXT: "location": { | ||
# CHECK-NEXT: "range": { | ||
# CHECK-NEXT: "end": { | ||
# CHECK-NEXT: "character": {{.*}}, | ||
# CHECK-NEXT: "line": {{.*}} | ||
# CHECK-NEXT: }, | ||
# CHECK-NEXT: "start": { | ||
# CHECK-NEXT: "character": {{.*}}, | ||
# CHECK-NEXT: "line": {{.*}} | ||
# CHECK-NEXT: } | ||
# CHECK-NEXT: }, | ||
# CHECK-NEXT: "uri": "file://{{.*}}/Header.h" | ||
# CHECK-NEXT: }, | ||
# CHECK-NEXT: "name": "Character", | ||
# CHECK-NEXT: "score": {{.*}} | ||
# CHECK-NEXT: } | ||
# CHECK-NEXT: ] | ||
# CHECK-NEXT:} | ||
--- | ||
{"jsonrpc":"2.0","id":4,"method":"shutdown"} | ||
--- | ||
{"jsonrpc":"2.0","method":"exit"} | ||
--- |
75 changes: 75 additions & 0 deletions
75
clang-tools-extra/clangd/test/remote-index/pipeline_helper.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/usr/bin/env python | ||
# | ||
#===- pipeline_helper.py - Remote Index pipeline Helper *- python -------*--===# | ||
# | ||
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# | ||
#===------------------------------------------------------------------------===# | ||
|
||
import argparse | ||
import os | ||
import subprocess | ||
from socket import socket | ||
import sys | ||
import time | ||
import threading | ||
|
||
|
||
def kill_server_after_delay(server_process): | ||
time.sleep(10) | ||
if server_process.poll() is None: | ||
server_process.kill() | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--input-file-name', required=True) | ||
parser.add_argument('--project-root', required=True) | ||
parser.add_argument('--index-file', required=True) | ||
|
||
args = parser.parse_args() | ||
|
||
# Grab an available port. | ||
with socket() as s: | ||
s.bind(('localhost', 0)) | ||
server_address = 'localhost:' + str(s.getsockname()[1]) | ||
|
||
index_server_process = subprocess.Popen([ | ||
'clangd-index-server', '--server-address=' + server_address, | ||
args.index_file, args.project_root | ||
], | ||
stderr=subprocess.PIPE) | ||
|
||
# This will kill index_server_process if it hangs without printing init | ||
# message. | ||
shutdown_thread = threading.Thread( | ||
target=kill_server_after_delay, args=(index_server_process,)) | ||
shutdown_thread.daemon = True | ||
shutdown_thread.start() | ||
|
||
# Wait for the server to warm-up. | ||
found_init_message = False | ||
while index_server_process.poll() is None: | ||
if b'Server listening' in index_server_process.stderr.readline(): | ||
found_init_message = True | ||
break | ||
|
||
if not found_init_message: | ||
sys.exit(1) | ||
|
||
in_file = open(args.input_file_name) | ||
|
||
clangd_process = subprocess.Popen([ | ||
'clangd', '--remote-index-address=' + server_address, | ||
'--project-root=' + args.project_root, '--lit-test', '--sync' | ||
], | ||
stdin=in_file) | ||
|
||
clangd_process.wait() | ||
index_server_process.kill() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Test that we get the expected module flag metadata for the memory profile | ||
// filename. | ||
// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - %s | FileCheck %s --check-prefix=NONE | ||
// RUN: %clang -target x86_64-linux-gnu -fmemory-profile -S -emit-llvm -o - %s | FileCheck %s --check-prefix=DEFAULTNAME | ||
// RUN: %clang -target x86_64-linux-gnu -fmemory-profile=/tmp -S -emit-llvm -o - %s | FileCheck %s --check-prefix=CUSTOMNAME | ||
int main(void) { | ||
return 0; | ||
} | ||
|
||
// NONE-NOT: MemProfProfileFilename | ||
// DEFAULTNAME: !{i32 1, !"MemProfProfileFilename", !"memprof.profraw"} | ||
// CUSTOMNAME: !{i32 1, !"MemProfProfileFilename", !"/tmp{{.*}}memprof.profraw"} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
// RUN: %clangxx -target x86_64-linux-gnu -fmemory-profile %s -### 2>&1 | FileCheck %s | ||
// RUN: %clangxx -target x86_64-linux-gnu -fmemory-profile=foo %s -### 2>&1 | FileCheck %s --check-prefix=DIR | ||
// RUN: %clangxx -target x86_64-linux-gnu -fmemory-profile -fno-memory-profile %s -### 2>&1 | FileCheck %s --check-prefix=OFF | ||
// RUN: %clangxx -target x86_64-linux-gnu -fmemory-profile=foo -fno-memory-profile %s -### 2>&1 | FileCheck %s --check-prefix=OFF | ||
// CHECK: "-cc1" {{.*}} "-fmemory-profile" | ||
// CHECK: ld{{.*}}libclang_rt.memprof{{.*}}libclang_rt.memprof_cxx | ||
// DIR: "-cc1" {{.*}} "-fmemory-profile=foo" | ||
// DIR: ld{{.*}}libclang_rt.memprof{{.*}}libclang_rt.memprof_cxx | ||
// OFF-NOT: "-fmemory-profile" | ||
// OFF-NOT: libclang_rt.memprof |
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
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
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
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
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
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
Oops, something went wrong.