Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trampolines and all of the associated creaky machinery #148

Open
wants to merge 134 commits into
base: clang_tot_upgrade
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
3f9e60c
Initial WiP commit.
AlexVlx Aug 3, 2018
2c59f3b
Re-sync with master.
AlexVlx Aug 3, 2018
1d74c66
Clean some AMP restriction checks. Builtins in [[hc]] / restrict(amp).
AlexVlx Aug 5, 2018
6d8ef16
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Aug 5, 2018
c3f8ced
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Aug 13, 2018
8af9136
We do not need the dysfunctional auto-auto.
AlexVlx Aug 24, 2018
1f3c4ed
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Aug 26, 2018
3046bce
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Aug 31, 2018
f7f0e10
No more Kalmar, no more C++AMP (i.e. concurrency / Concurrency).
AlexVlx Sep 4, 2018
4e8d3b2
We only need to set the AMDGPU_KERNEL calling convention in one place.
AlexVlx Sep 4, 2018
ac9189f
Cleanup leftover references to concurrency::
AlexVlx Sep 4, 2018
abd9ee6
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Sep 5, 2018
5cc0526
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Sep 7, 2018
d494c4a
Re-sync with upstream.
AlexVlx Sep 9, 2018
54f9b4c
Start removing C++AMP from the FE.
AlexVlx Sep 11, 2018
c14476a
We always have HSA therefore we do not need some of the more Byzantin…
AlexVlx Sep 11, 2018
76ad384
We can manually set attributes on function signatures.
AlexVlx Sep 11, 2018
5d18638
Add hc::array capture-by-ref handling. This is mildly yucky due to ou…
AlexVlx Sep 12, 2018
63346b9
Re-sync with upstream.
AlexVlx Sep 13, 2018
ff48d08
Merge properly.
AlexVlx Sep 13, 2018
fa23271
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Sep 13, 2018
a61f29f
Adjust Driver to match HC Next. Add query for alignment as per Module…
AlexVlx Sep 17, 2018
f2060e4
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Sep 19, 2018
ea0c1e7
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Sep 21, 2018
515a97b
Add more implicit includes. Fix Engrish.
AlexVlx Sep 21, 2018
467dd5b
FileCheckify test/Driver/Xarch.c
zmodem Sep 20, 2018
c771d4e
[OpenCL] Diagnose redundant address space conversion
svenvh Sep 20, 2018
f24d61b
[OPENMP] Add support for mapping memory pointed by member pointer.
alexey-bataev Sep 20, 2018
bae2271
[OPENMP] Fix spelling of getLoopCounter (NFC)
mikerice1969 Sep 20, 2018
d727b1e
r342177 introduced a hint in cases where an #included file is not fou…
echristo Sep 20, 2018
b294268
Add testcases for r342667.
echristo Sep 20, 2018
89217e0
[Sema] Retain __restrict qualifiers when substituting a reference type.
epilk Sep 20, 2018
eb6a5e2
Fix an assert in -Wquoted-include-in-framework-header
epilk Sep 20, 2018
50080b2
Remove failing test.
Sep 20, 2018
5128e82
[clang-format] Do not merge short case labels if followed by a block.
owenca Sep 21, 2018
e2a9c2d
[XRay][clang] Propagate -fxray-instrumentation-bundle to -cc1
deanberris Sep 21, 2018
bc8be77
[CodeGen] Add to emitted DebugLoc information about coverage when it'…
calixteman Sep 21, 2018
85bd07b
[CodeComplete] Generate completion fix-its for C code as well
Sep 21, 2018
2ee7b49
[AST] Various optimizations + refactoring in DeclarationName(Table)
riccibruno Sep 21, 2018
8d6a2d4
[AST][NFC] Remove a superfluous enum in ObjCMethodDeclBitfields added…
riccibruno Sep 21, 2018
cd4c97d
NFC: deduplicate isRepeatedBytePattern from clang to LLVM's isBytewis…
jfbastien Sep 21, 2018
c445b88
[AST][NFC] DeclarationName.h : add missing parentheses to silence war…
riccibruno Sep 21, 2018
b645d6b
[OPENMP][NVPTX] Enable support for lastprivates in SPMD constructs.
alexey-bataev Sep 21, 2018
7a19bf7
[OPENMP] Disable emission of the class with vptr if they are not used in
alexey-bataev Sep 21, 2018
b2d3ac3
[CUDA] Ignore uncallable functions when we check for usual deallocators.
Artem-B Sep 21, 2018
b6bc456
[NFC] remove unused variable
jfbastien Sep 21, 2018
6698ed4
[CUDA] Fixed parsing of optional template-argument-list.
Artem-B Sep 21, 2018
4b138fe
Add necessary support for storing code-model to module IR.
cmtice Sep 21, 2018
cfc6865
[analyzer] [NFC] Dead code removal
Sep 21, 2018
1fdf09d
[analyzer] Fix bug in isInevitablySinking
Sep 21, 2018
2f6882b
[analyzer] [NFC] Prefer make_unique over "new"
Sep 21, 2018
c52e713
[analyzer] Associate diagnostics created in checkEndFunction with a r…
Sep 21, 2018
e17c067
[analyzer] Highlight sink nodes in red
Sep 21, 2018
bb168c7
[analyzer] Process state in checkEndFunction in RetainCountChecker
Sep 21, 2018
9432755
Make compare function in r342648 have strict weak ordering.
Weverything Sep 21, 2018
0bd3227
Thread safety analysis: Make sure FactEntrys stored in FactManager ar…
aaronpuchert Sep 21, 2018
b07f902
Fix codemodels.c test case (only test mcmodel-kernel on x86)
cmtice Sep 21, 2018
9bfa193
Thread safety analysis: Make printSCFG compile again [NFC]
aaronpuchert Sep 21, 2018
20617fa
[Lexer] Add udefined_behavior_sanitizer feature
PiJoules Sep 22, 2018
47452b9
Update smart pointer detection for thread safety analysis.
Weverything Sep 22, 2018
ac9ac7b
update the links to use https
sylvestre Sep 22, 2018
e7273db
use the current url for bugzilla
sylvestre Sep 22, 2018
2218268
Fix codemodels.c test case (only test mcmodel=medium on X86).
cmtice Sep 22, 2018
8fe6ec3
Eliminate some unneeded signed/unsigned conversions
aaronpuchert Sep 22, 2018
9b41aff
[Index] Fix header guard naming
MaskRay Sep 22, 2018
e030f03
Fix modules build with shared library.
EricWF Sep 23, 2018
9239b1b
[Index] Report specialization bases as references when IndexImplicitI…
MaskRay Sep 23, 2018
44af756
[CStringSyntaxChecker] Check strlcat sizeof check
devnexen Sep 23, 2018
3c57305
[CMake] Use internal_linkage rather than always_inline for libc++
petrhosek Sep 23, 2018
52c38b0
[analyzer][UninitializedObjectChecker] Using the new const methods of…
Szelethus Sep 23, 2018
0fe0735
Add inherited attributes before parsed attributes.
Meinersbur Sep 24, 2018
837d014
[ARM][AArch64] Add feature +fp16fml
Sep 24, 2018
70ed07c
Fix Wundef NDEBUG warning; NFC
svenvh Sep 24, 2018
70c823c
[Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF with `-fconstant-cf…
Sep 24, 2018
d1659c2
Revert "We allow implicit function declarations as an extension in al…
Sep 24, 2018
a76e827
[VFS] Use llvm::StringMap instead of std::map. NFC
Sep 24, 2018
97d33f4
[CFString][ELF] Fix a missed test causing buildbot failures from 342883.
Sep 24, 2018
d71c479
Revert "rL342883: [Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF w…
Sep 24, 2018
3212f11
[python] [tests] Update test_code_completion
mgorny Sep 24, 2018
feaca0f
Fix the type of 1<<31 integer constants.
d0k Sep 24, 2018
ed40ea3
[Power9] [CLANG] Add __float128 exponent GET and SET builtins
stefanp-ibm Sep 24, 2018
1676538
[CodeGen] Revert commit https://reviews.llvm.org/rL342717
calixteman Sep 24, 2018
129edd7
Update tests for new YAMLIO polymorphic traits
slinder1 Sep 24, 2018
5d971ee
[analyzer] Prevent crashes in FindLastStoreBRVisitor
Sep 24, 2018
3c88e31
[CUDA] Added basic support for compiling with CUDA-10.0
Artem-B Sep 24, 2018
027781b
P0962R1: only use the member form of 'begin' and 'end' in a range-based
zygoloid Sep 24, 2018
2281d09
[www] Update cxx_status to mark P0962R1 as done.
zygoloid Sep 24, 2018
9702c1f
[www] Change 'Clang 7' items from yellow to green now Clang 7 is
zygoloid Sep 24, 2018
3ef5d4e
Driver: render arguments for the embedded bitcode correctly
compnerd Sep 24, 2018
be19764
Annotate LookupResult::clear() as LLVM_ATTRIBUTE_REINITIALIZES to sil…
MaskRay Sep 25, 2018
86b75ed
[OpenCL] Allow zero assignment and comparisons between queue_t type v…
svenvh Sep 25, 2018
7d7cfed
[AST] Squeeze some bits in LinkageComputer::QueryType
riccibruno Sep 25, 2018
59aca6e
[VFS] Add a proxy FS that delegates calls to underlying FS by default.
Sep 25, 2018
08c4b54
[clang-cl] Provide separate flags for all the /O variants
zmodem Sep 25, 2018
c7a35fa
[AArch64] Support adding X[8-15,18] registers as CSRs.
vo4 Sep 25, 2018
e6f2904
[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.
alexey-bataev Sep 25, 2018
ffd59b2
[OPENMP] Fix failed test, NFC.
alexey-bataev Sep 25, 2018
952eb6f
[OPENMP] Fix the test, NFC.
alexey-bataev Sep 25, 2018
5370ce2
Revert "[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file
alexey-bataev Sep 25, 2018
e93bc6f
[analyzer] NFC: Legalize state manager factory injection.
haoNoQ Sep 25, 2018
1665567
P0969R0: allow structured binding of accessible members, not only pub…
zygoloid Sep 25, 2018
05cfeda
[analyzer] NFC: CallDescription: Improve array management.
haoNoQ Sep 25, 2018
98d3542
Reland "[Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF with `-fcon…
Sep 25, 2018
5ef2f8c
Don't emit "will be treated as an identifier character" warning for
zygoloid Sep 25, 2018
2b60a78
[Sema] Use a more civilized hash map to implement -Wduplicate-enum.
epilk Sep 25, 2018
bb14157
[clang-check-codegen][cfstring] Accept either @ or % for progbits to …
Sep 25, 2018
9722575
[analyzer] Add a testing facility for testing relationships between s…
haoNoQ Sep 25, 2018
5c46967
Fix a bot failure from r343042.
epilk Sep 25, 2018
a8c0f8d
[analyzer] Fix a crash on casting symbolic pointers to derived classes.
haoNoQ Sep 26, 2018
23c9975
[OPENMP] Add support for OMP5 requires directive + unified_address cl…
kkwli Sep 26, 2018
1727825
P0859R0: List-initialization is potentially-constant-evaluated and
zygoloid Sep 26, 2018
292441c
[HCC] Fix debug build
emankov Sep 27, 2018
bfb357d
We no longer need to implicitly add the noisy HIP only shared objects.
AlexVlx Sep 29, 2018
c48ae68
Fix erroneous creation of expressions with reference type.
AlexVlx Sep 29, 2018
76e8619
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Oct 2, 2018
f57c821
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Oct 3, 2018
c1668ab
Remove dead-end attemt to provide proper alignof info for setting up …
AlexVlx Oct 3, 2018
9a4cae4
Implicitly include only the HSA include folder, otherwise HIP dies in…
AlexVlx Oct 3, 2018
6c513f5
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Oct 7, 2018
a13db63
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Oct 10, 2018
34e9fe3
We do not support sanitisers for accelerator code, but they should st…
AlexVlx Oct 10, 2018
afb6eac
Remove leftover macro definition.
AlexVlx Oct 10, 2018
0c8fe32
Make by-reference capture of hc::array work with Callable_with_attrib…
AlexVlx Oct 10, 2018
13dd120
Version control mishap.
AlexVlx Oct 10, 2018
42d1914
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Oct 15, 2018
5c4f7e2
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Oct 15, 2018
f509e38
Re-sync with upstream.
AlexVlx Oct 18, 2018
a98b9f5
Re-sync with upstream.
AlexVlx Dec 23, 2018
a876a1d
Merge branch 'feature_trampolines_are_for_babies' of https://github.c…
AlexVlx Dec 23, 2018
37ff576
Temporary fix to match upstream changes.
AlexVlx Jan 2, 2019
d0df70c
Merge branch 'clang_tot_upgrade' of https://github.com/RadeonOpenComp…
AlexVlx Jan 12, 2019
d2c2dc9
Re-sync with upstream.
AlexVlx Jan 15, 2019
9573676
Do not emit bodies of functions excluded by restriction.
AlexVlx Jan 15, 2019
425baad
Prefer static Create functions.
AlexVlx Jan 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions include/clang/AST/DeclCXX.h
Original file line number Diff line number Diff line change
Expand Up @@ -986,9 +986,6 @@ class CXXRecordDecl : public RecordDecl {
#endif
}

/// Returns the deserialization constructor for this class.
CXXMethodDecl *getCXXAMPDeserializationConstructor() const;

/// Determine whether this class has any user-declared constructors.
///
/// When true, a default constructor will not be implicitly declared.
Expand Down
2 changes: 1 addition & 1 deletion include/clang/AST/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -2367,7 +2367,7 @@ class Type : public ExtQualsTypeCommonBase {
friend class ASTReader;
friend class ASTWriter;

/// \brief True if object is of hc::array or Concurrency:type
/// \brief True if object is of hc::array.
bool isGPUArrayType() const;
};

Expand Down
11 changes: 3 additions & 8 deletions include/clang/Basic/Attr.td
Original file line number Diff line number Diff line change
Expand Up @@ -3157,17 +3157,12 @@ def InternalLinkage : InheritableAttr {

// C++AMP attributes

def CXXAMPRestrictAMP : InheritableAttr {
let Spellings = [GNU<"amp">, GNU<"hc">];
def HCRestrictHC : InheritableAttr {
let Spellings = [GNU<"hc">];
let Documentation = [Undocumented];
}

def CXXAMPRestrictAUTO : InheritableAttr {
let Spellings = [GNU<"auto">];
let Documentation = [Undocumented];
}

def CXXAMPRestrictCPU : InheritableAttr {
def HCRestrictCPU : InheritableAttr {
let Spellings = [GNU<"cpu">];
let Documentation = [Undocumented];
}
Expand Down
3 changes: 1 addition & 2 deletions include/clang/Basic/CodeGenOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ CODEGENOPT(ControlFlowGuard , 1, 0) ///< -cfguard
CODEGENOPT(CoverageExtraChecksum, 1, 0) ///< Whether we need a second checksum for functions in GCNO files.
CODEGENOPT(CoverageNoFunctionNamesInData, 1, 0) ///< Do not include function names in GCDA files.
CODEGENOPT(CoverageExitBlockBeforeBody, 1, 0) ///< Whether to emit the exit block before the body blocks in GCNO files.
CODEGENOPT(AMPIsDevice , 1, 0) ///< Set when compiling for C++AMP kernels.
CODEGENOPT(AMPCPU , 1, 0) ///< Set when compiling for C++AMP kernels on CPU.
CODEGENOPT(HCIsDevice , 1, 0) ///< Set when compiling for HC kernels.
CODEGENOPT(CXAAtExit , 1, 1) ///< Use __cxa_atexit for calling destructors.
CODEGENOPT(RegisterGlobalDtorsWithAtExit, 1, 1) ///< Use atexit or __cxa_atexit to register global destructors.
CODEGENOPT(CXXCtorDtorAliases, 1, 0) ///< Emit complete ctors/dtors as linker
Expand Down
4 changes: 2 additions & 2 deletions include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -8672,7 +8672,7 @@ def err_amp_bad_reinterpret_cast_from_pointer_to_functionptr : Error<
def err_amp_memory_operation : Error<
"operator is not supported in amp-compatible codes'">;
def err_amp_unsupported_reference_or_pointer : Error<
"pointer or reference is not allowed as pointed to type, array element type or data member type (except reference to concurrency::array/texture)">;
"pointer or reference is not allowed as pointed to type, array element type or data member type (except reference to hc::array/texture)">;
def err_amp_incompatible : Error<
"the field type is not amp-compatible">;
def err_amp_type_unsupported : Error<
Expand Down Expand Up @@ -8706,7 +8706,7 @@ def err_amp_call_from_cpu_to_amp : Error<
def err_amp_call_from_amp_to_cpu : Error<
"call from AMP-restricted function to CPU-restricted function">;
def err_amp_call_from_both_amp_and_cpu_to_disctint : Error<
"call from both amp and cpu restricted function to disctint restricted function">;
"call from both amp and cpu restricted function to distinct restricted function">;
def err_amp_need_4_byte_aligned : Error<
"variables in AMP-restricted function shall be 4-bytes aligned">;
def err_amp_captured_variable_type : Error<
Expand Down
3 changes: 0 additions & 3 deletions include/clang/Basic/LangOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,7 @@ LANGOPT(GPURelocatableDeviceCode, 1, 0, "generate relocatable device code")

LANGOPT(CPlusPlusAMP , 1, 0, "C++AMP")
LANGOPT(DevicePath , 1, 0, "C++AMP Device Path")
LANGOPT(AMPCPU , 1, 0, "C++AMP CPU Path")
LANGOPT(HSAExtension , 1, 0, "C++AMP Extension for HSA")
LANGOPT(AutoAuto , 1, 0, "Enable auto-auto")
LANGOPT(AutoCompileForAccelerator, 1, 0, "Enable auto-compile-for-accelerator")

LANGOPT(SizedDeallocation , 1, 0, "sized deallocation")
LANGOPT(AlignedAllocation , 1, 0, "aligned allocation")
Expand Down
3 changes: 1 addition & 2 deletions include/clang/Basic/Specifiers.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,7 @@ namespace clang {
enum CPPAMPSpecifier {
CPPAMP_None = 0x0,
CPPAMP_CPU = 0x1,
CPPAMP_AMP = 0x2,
CPPAMP_AUTO = 0x4
CPPAMP_AMP = 0x2
};
} // end namespace clang

Expand Down
4 changes: 2 additions & 2 deletions include/clang/Basic/Version.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define HCC_VERSION_STRING "@HCC_VERSION_STRING@"
#define HCC_VERSION_MAJOR @HCC_VERSION_MAJOR@
#define HCC_VERSION_MINOR @HCC_VERSION_MINOR@
#define HCC_VERSION_PATCH "@HCC_VERSION_PATCH@-@KALMAR_SDK_COMMIT@-@KALMAR_FRONTEND_COMMIT@-@KALMAR_BACKEND_COMMIT@"
#define HCC_VERSION_PATCH "@HCC_VERSION_PATCH@-@HC_SDK_COMMIT@-@HC_FRONTEND_COMMIT@-@HC_BACKEND_COMMIT@"
#define HCC_VERSION_WORKWEEK @HCC_VERSION_PATCH@

#define KALMAR_BACKEND @KALMAR_BACKEND@
#define HC_BACKEND @HC_BACKEND@
12 changes: 0 additions & 12 deletions include/clang/Driver/CC1Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -842,21 +842,9 @@ def fopenmp_host_ir_file_path : Separate<["-"], "fopenmp-host-ir-file-path">,
def famp_is_device : Flag<["-"], "famp-is-device">,
HelpText<"Generate code for AMP kernels">;

def famp_cpu : Flag<["-"], "famp-cpu">,
HelpText<"Generate code for AMP CPU kernels">;

def fhsa_extension : Flag<["-"], "fhsa-ext">,
HelpText<"Enable HSA-specific rules for C++AMP kernels">;

def fno_auto_auto : Flag<["-"], "fno-auto-auto">,
HelpText<"Disable auto-auto feature (Obsolete, use -fauto-auto to explicit enable it instead)">;

def fauto_auto : Flag<["-"], "fauto-auto">,
HelpText<"Enable auto-auto feature">;

def fauto_compile_for_accelerator : Flag<["-"], "fauto-compile-for-accelerator">,
HelpText<"Enable auto-compile-for-accelerator feature">;

} // let Flags = [CC1Option]

//===----------------------------------------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion include/clang/Frontend/FrontendOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class InputKind {
///@{ Languages that the frontend can parse and compile.
C,
CXX,
CXXAMP,
CXXAMP,

ObjC,
ObjCXX,
Expand Down
14 changes: 3 additions & 11 deletions include/clang/Parse/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -718,9 +718,9 @@ class Parser : public CodeCompletionHandler {
return PP.LookAhead(N-1);
}

/// C++ AMP-specific
/// check if the given scope is AMP-restricted
bool IsInAMPFunction(Scope *);
/// HC-specific
/// check if the given scope is [[hc]]
bool IsInHCFunction(Scope *);

public:
/// NextToken - This peeks ahead one token and returns it without
Expand Down Expand Up @@ -1414,9 +1414,6 @@ class Parser : public CodeCompletionHandler {
bool StopAtSemi = true,
bool ConsumeFinalToken = true);

// C++AMP
bool CXXAMPFindRestrictionSeq(CachedTokens &Toks, bool ConsumeFinalToken);

//===--------------------------------------------------------------------===//
// C99 6.9: External Definitions.
struct ParsedAttributesWithRange : ParsedAttributes {
Expand Down Expand Up @@ -2653,11 +2650,6 @@ class Parser : public CodeCompletionHandler {
void ParseBracketDeclarator(Declarator &D);
void ParseMisplacedBracketDeclarator(Declarator &D);

// C++AMP
unsigned ParseRestrictionSpecification(Declarator &D,
ParsedAttributes &Attrs,
SourceLocation &DeclEndLoc);

//===--------------------------------------------------------------------===//
// C++ 7: Declarations [dcl.dcl]

Expand Down
30 changes: 13 additions & 17 deletions include/clang/Sema/Scope.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ class Scope {
/// Used to determine if errors occurred in this scope.
DiagnosticErrorTrap ErrorTrap;

/// C++AMP restriction specifier
unsigned short CXXAMPSpecifier;
/// HC restriction specifier
unsigned short HCSpecifier;

/// A lattice consisting of undefined, a single NRVO candidate variable in
/// this scope, or over-defined. The bit is true when over-defined.
Expand Down Expand Up @@ -386,24 +386,20 @@ class Scope {
return getFlags() & Scope::FunctionPrototypeScope;
}

/// \brief C++AMP restriction specifiers
enum CPPAMPSpecifier {
CPPAMP_None = 0x0,
CPPAMP_CPU = 0x1,
CPPAMP_AMP = 0x2,
CPPAMP_AUTO = 0x4
/// \brief HC restriction specifiers
enum HCSpecifier {
HC_None = 0x0,
HC_CPU = 0x1,
HC_HC = 0x2
};
void setCXXAMPSpecifier(unsigned A) { CXXAMPSpecifier = A; }
void setAMPScope() { CXXAMPSpecifier |= CPPAMP_AMP; }
void setCPUScope() { CXXAMPSpecifier |= CPPAMP_CPU; }
bool isAMPScope() const {
return CXXAMPSpecifier & CPPAMP_AMP;
void setHCSpecifier(unsigned A) { HCSpecifier = A; }
void setHCScope() { HCSpecifier |= HC_HC; }
void setCPUScope() { HCSpecifier |= HC_CPU; }
bool isHCScope() const {
return HCSpecifier & HC_HC;
}
bool isCPUScope() const {
return CXXAMPSpecifier & CPPAMP_CPU;
}
bool isAUTOScope() const {
return CXXAMPSpecifier & CPPAMP_AUTO;
return HCSpecifier & HC_CPU;
}

/// isAtCatchScope - Return true if this scope is \@catch.
Expand Down
82 changes: 25 additions & 57 deletions include/clang/Sema/Sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -1864,9 +1864,9 @@ class Sema {
std::unique_ptr<CorrectionCandidateCallback> CCC = nullptr);

// C++AMP declarator diagnostic functions
bool DiagnoseCXXAMPDecl(Decl* Dcl, bool CheckContainer = false, bool IsInfer = false);
bool IsCXXAMPTileStatic(Declarator &D);
void DiagnosticCXXAMPTileStatic(Declarator &D, Decl *Dcl);
bool DiagnoseHCDecl(Decl* Dcl, bool CheckContainer = false, bool IsInfer = false);
bool IsHCTileStatic(Declarator &D);
void DiagnosticHCTileStatic(Declarator &D, Decl *Dcl);

/// Describes the detailed kind of a template name. Used in diagnostics.
enum class TemplateNameKindForDiagnostics {
Expand Down Expand Up @@ -2070,9 +2070,6 @@ class Sema {
/// \c constexpr in C++11 or has an 'auto' return type in C++14).
bool canSkipFunctionBody(Decl *D);

// C++AMP restriction specifier inferring routine
void TryCXXAMPRestrictionInferring(Decl *D, Stmt *Body);

void computeNRVO(Stmt *Body, sema::FunctionScopeInfo *Scope);
Decl *ActOnFinishFunctionBody(Decl *Decl, Stmt *Body);
Decl *ActOnFinishFunctionBody(Decl *Decl, Stmt *Body, bool IsInstantiation);
Expand Down Expand Up @@ -2552,9 +2549,8 @@ class Sema {
Ovl_NonFunction
};

// C++AMP diagnostic routine on destructor overload resolution
void DiagnoseCXXAMPDtorOverload(FunctionDecl *New,
const LookupResult &Old);
// HC diagnostic routine on destructor overload resolution
void DiagnoseHCDtorOverload(FunctionDecl *New, const LookupResult &Old);

OverloadKind CheckOverload(Scope *S,
FunctionDecl *New,
Expand Down Expand Up @@ -2861,12 +2857,11 @@ class Sema {
OverloadCandidateSet& CandidateSet,
bool PartialOverloading = false);

// C++AMP restriction specifier scope checking routines
bool IsInAMPRestricted();
// HC restriction specifier scope checking routines
bool IsInHCRestricted();
// Determine if in CPU and/or AMP restricted codes
bool IsInAnyExplicitRestricted();
void GetCXXAMPParentRestriction(Scope* SC, bool& ParentCPU,
bool& ParentAMP, bool&ParentAUTO);
void GetHCParentRestriction(Scope *SC, bool &ParentCPU, bool &ParentHC);

// Emit as a 'note' the specific overload candidate
void NoteOverloadCandidate(NamedDecl *Found, FunctionDecl *Fn,
Expand Down Expand Up @@ -2981,8 +2976,8 @@ class Sema {
Expr *Range, ExprResult *CallExpr);

// C++AMP diagnostic routine on overloaded call expressions
void DiagnoseCXXAMPOverloadedCallExpr(SourceLocation LParenLoc,
FunctionDecl* Callee);
void DiagnoseHCOverloadedCallExpr(SourceLocation LParenLoc,
FunctionDecl* Callee);

ExprResult BuildOverloadedCallExpr(Scope *S, Expr *Fn,
UnresolvedLookupExpr *ULE,
Expand Down Expand Up @@ -3175,15 +3170,16 @@ class Sema {
typedef std::function<ExprResult(Sema &, TypoExpr *, TypoCorrection)>
TypoRecoveryCallback;

// C++AMP type checking routine for kernel codes
// TODO: Fix for winter cleanup.
// HC type checking routine for kernel codes
public:
bool IsIncompatibleType(const Type* Ty, bool CheckContainer = false, bool IsInfer = false);

private:
// C++AMP type checking routine for kernel codes
bool IsCXXAMPUnsupportedPointerType(const Type* Ty,
// HC type checking routine for kernel codes
bool IsHCUnsupportedPointerType(const Type *Ty,
bool CheckContainer = false, bool IsInfer = false);
bool IsCXXAMPUnsupportedReferenceType(const Type* Ty,
bool IsHCUnsupportedReferenceType(const Type* Ty,
bool CheckContainer = false, bool IsInfer = false);

bool CppLookupName(LookupResult &R, Scope *S);
Expand Down Expand Up @@ -4419,9 +4415,9 @@ class Sema {
ParmVarDecl *Param,
const Expr *ArgExpr);

// C++AMP diagnotic routine on C++ method call expressions
void DiagnoseCXXAMPMethodCallExpr(SourceLocation LParenLoc,
CXXMethodDecl *Callee);
// HC diagnotic routine on C++ method call expressions
void DiagnoseHCMethodCallExpr(SourceLocation LParenLoc,
CXXMethodDecl *Callee);

/// ActOnCallExpr - Handle a call to Fn with the specified array of arguments.
/// This provides the location of the left/right parens and a list of comma
Expand Down Expand Up @@ -5014,22 +5010,6 @@ class Sema {
void DefineImplicitCopyAssignment(SourceLocation CurrentLocation,
CXXMethodDecl *MethodDecl);

/// Defines an AMP CUP-side serialize function.
void DefineAmpCpuSerializeFunction(SourceLocation CurrentLocation,
CXXMethodDecl *MethodDecl);
/// Defines an AMP GPU-side deserialize function.
void DefineAmpGpuDeSerializeFunction(SourceLocation CurrentLocation,
CXXMethodDecl *MethodDecl);
/// Declare trampoline name lookup code for AMP CPU-side
void DeclareAMPTrampolineName(CXXRecordDecl *ClassDecl,
DeclarationName Name);
/// Declare trampoline code for AMP GPU-side entry
void DeclareAMPTrampoline(CXXRecordDecl *ClassDecl,
DeclarationName Name);
/// Define trampoline code for AMP GPU-side entry
void DefineAMPTrampoline(SourceLocation CurrentLocation,
CXXMethodDecl *OperatorCall);

/// Declare the implicit move assignment operator for the given class.
///
/// \param ClassDecl The Class declaration into which the implicit
Expand Down Expand Up @@ -5941,19 +5921,6 @@ class Sema {
/// \returns true if any work was done, false otherwise.
bool DefineUsedVTables();

/// \brief Test if a given class requires a
/// C++AMP deserializer declaration
bool NeedAMPDeserializer(CXXRecordDecl *ClassDecl);
/// \brief Test if a given class has a C++AMP deserializer declaration
bool HasDeclaredAMPDeserializer(CXXRecordDecl *ClassDecl);

// Declare C++AMP serializer and deserializer
typedef SmallVector<QualType, 16> AMPDeserializerArgs;
void DeclareAMPSerializer(CXXRecordDecl *ClassDecl,
DeclarationName Name);
void DeclareAMPDeserializer(CXXRecordDecl *ClassDecl,
AMPDeserializerArgs *Args);

void AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl);

void ActOnMemInitializers(Decl *ConstructorDecl,
Expand Down Expand Up @@ -6487,10 +6454,10 @@ class Sema {
};

// C++AMP diagnotic routine for template arguments
void DiagnoseCXXAMPTemplateArgument(NamedDecl *Param,
const TemplateArgumentLoc &AL,
NamedDecl *Template,
SourceLocation TemplateLoc);
void DiagnoseHCTemplateArgument(NamedDecl *Param,
const TemplateArgumentLoc &AL,
NamedDecl *Template,
SourceLocation TemplateLoc);

bool CheckTemplateArgument(NamedDecl *Param,
TemplateArgumentLoc &Arg,
Expand Down Expand Up @@ -9668,8 +9635,9 @@ class Sema {
Incompatible
};

// C++AMP diagnostic routine for expressions
void DiagnoseCXXAMPExpr(Expr* Stripped, ExprResult &HS, bool DiagnoseWhenStatic=false);
// HC diagnostic routine for expressions
void DiagnoseHCExpr(Expr *Stripped,
ExprResult &HS, bool DiagnoseWhenStatic = false);

/// DiagnoseAssignmentResult - Emit a diagnostic, if required, for the
/// assignment conversion type specified by ConvTy. This returns true if the
Expand Down
Loading