Skip to content

Commit

Permalink
Update Clang to 4.0.0
Browse files Browse the repository at this point in the history
- Clang now depends on CMake to generate its project files, update the
  build script to account for this.
- Clang now reports the "macosx" platform as "macos" update test to
  account for this.
- Add new enum values to PLClangCursorKind.
- Add new enum values to PLClangTypeKind.
  • Loading branch information
mattstevens committed Jun 6, 2017
1 parent dc31c31 commit 4984c02
Show file tree
Hide file tree
Showing 13 changed files with 299 additions and 37 deletions.
Binary file removed Dependencies/LLVM/cfe-3.7.0.src.tar.xz.sig
Binary file not shown.
Binary file not shown.
Binary file added Dependencies/LLVM/cfe-4.0.0.src.tar.xz.sig
Binary file not shown.
Binary file removed Dependencies/LLVM/llvm-3.7.0.src.tar.xz.sig
Binary file not shown.
Binary file not shown.
Binary file added Dependencies/LLVM/llvm-4.0.0.src.tar.xz.sig
Binary file not shown.
2 changes: 1 addition & 1 deletion Dependencies/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LLVM
LLVM and Clang sources.

Version:
3.7 downloaded from http://llvm.org/releases/download.html
4.0 downloaded from http://releases.llvm.org/download.html

License:
"UIUC" BSD-Style license
52 changes: 19 additions & 33 deletions ObjectDoc.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ObjectDoc/PLClangAvailabilityTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ - (void) testDeprecatedAndUnavailable {
}

- (void) testAvailabilityAttribute {
PLClangTranslationUnit *tu = [self translationUnitWithSource: @"void f() __attribute__((availability(macosx,introduced=10.4.3,deprecated=10.6,obsoleted=10.7,message=\"message\")));"];
PLClangTranslationUnit *tu = [self translationUnitWithSource: @"void f() __attribute__((availability(macos,introduced=10.4.3,deprecated=10.6,obsoleted=10.7,message=\"message\")));"];
PLClangCursor *cursor = [tu cursorWithSpelling: @"f"];
XCTAssertNotNil(cursor);
XCTAssertEqual(cursor.availability.kind, PLClangAvailabilityKindUnavailable);
Expand All @@ -75,7 +75,7 @@ - (void) testAvailabilityAttribute {
XCTAssertTrue([cursor.availability.platformAvailabilityEntries count] == 1);

PLClangPlatformAvailability *availability = cursor.availability.platformAvailabilityEntries[0];
XCTAssertEqualObjects(availability.platformName, @"macosx");
XCTAssertEqualObjects(availability.platformName, @"macos");
XCTAssertEqualObjects(availability.message, @"message");

XCTAssertEqual(availability.introducedVersion.major, 10);
Expand Down
161 changes: 161 additions & 0 deletions ObjectDoc/PLClangCursor.h
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,16 @@ typedef NS_ENUM(NSUInteger, PLClangCursorKind) {
*/
PLClangCursorKindObjCSelfExpression = 146,

/**
* An OpenMP array section expression.
*/
PLClangCursorKindOMPArraySectionExpression = 147,

/**
* An Objective-C an @available() check.
*/
PLClangCursorKindObjCAvailabilityCheckExpression = 148,

/* Statements */

/**
Expand Down Expand Up @@ -945,6 +955,121 @@ typedef NS_ENUM(NSUInteger, PLClangCursorKind) {
*/
PLClangCursorKindOMPCancelDirective = 256,

/**
* An OpenMP target data directive.
*/
PLClangCursorKindOMPTargetDataDirective = 257,

/**
* An OpenMP taskloop directive.
*/
PLClangCursorKindOMPTaskLoopDirective = 258,

/**
* An OpenMP taskloop directive.
*/
PLClangCursorKindOMPTaskLoopSimdDirective = 259,

/**
* An OpenMP distribute directive.
*/
PLClangCursorKindOMPDistributeDirective = 260,

/**
* An OpenMP target enter data directive.
*/
PLClangCursorKindOMPTargetEnterDataDirective = 261,

/**
* An OpenMP target exit data directive.
*/
PLClangCursorKindOMPTargetExitDataDirective = 262,

/**
* An OpenMP target parallel directive.
*/
PLClangCursorKindOMPTargetParallelDirective = 263,

/**
* An OpenMP target parallel for directive.
*/
PLClangCursorKindOMPTargetParallelForDirective = 264,

/**
* An OpenMP target update directive.
*/
PLClangCursorKindOMPTargetUpdateDirective = 265,

/**
* An OpenMP distribute parallel for directive.
*/
PLClangCursorKindOMPDistributeParallelForDirective = 266,

/**
* An OpenMP distribute parallel for simd directive.
*/
PLClangCursorKindOMPDistributeParallelForSimdDirective = 267,

/**
* An OpenMP distribute simd directive.
*/
PLClangCursorKindOMPDistributeSimdDirective = 268,

/**
* An OpenMP target parallel for simd directive.
*/
PLClangCursorKindOMPTargetParallelForSimdDirective = 269,

/**
* An OpenMP target simd directive.
*/
PLClangCursorKindOMPTargetSimdDirective = 270,

/**
* An OpenMP teams distribute directive.
*/
PLClangCursorKindOMPTeamsDistributeDirective = 271,

/**
* An OpenMP teams distribute simd directive.
*/
PLClangCursorKindOMPTeamsDistributeSimdDirective = 272,

/**
* An OpenMP teams distribute parallel for simd directive.
*/
PLClangCursorKindOMPTeamsDistributeParallelForSimdDirective = 273,

/**
* An OpenMP teams distribute parallel for directive.
*/
PLClangCursorKindOMPTeamsDistributeParallelForDirective = 274,

/**
* An OpenMP target teams directive.
*/
PLClangCursorKindOMPTargetTeamsDirective = 275,

/**
* An OpenMP target teams distribute directive.
*/
PLClangCursorKindOMPTargetTeamsDistributeDirective = 276,

/**
* An OpenMP target teams distribute parallel for directive.
*/
PLClangCursorKindOMPTargetTeamsDistributeParallelForDirective = 277,

/**
* An OpenMP target teams distribute parallel for simd directive.
*/
PLClangCursorKindOMPTargetTeamsDistributeParallelForSimdDirective = 278,

/**
* An OpenMP target teams distribute simd directive.
*/
PLClangCursorKindOMPTargetTeamsDistributeSimdDirective = 279,

/**
* The translation unit itself.
*
Expand Down Expand Up @@ -1041,6 +1166,21 @@ typedef NS_ENUM(NSUInteger, PLClangCursorKind) {
*/
PLClangCursorKindCUDASharedAttribute = 416,

/**
* A visibility attribute.
*/
PLClangCursorKindVisibilityAttribute = 417,

/**
* A dllexport attribute.
*/
PLClangCursorKindDLLExportAttribute = 418,

/**
* A dllimport attribute.
*/
PLClangCursorKindDLLImportAttribute = 419,

/* Preprocessing */

/**
Expand Down Expand Up @@ -1070,6 +1210,27 @@ typedef NS_ENUM(NSUInteger, PLClangCursorKind) {
*/
PLClangCursorKindModuleImportDeclaration = 600,

/**
* An alias template declaration.
*
* For example:
*
* @code
* template \<typename T> using V = std::map<T*, int, MyCompare<T>>;
* @endcode
*/
PLClangCursorKindTypeAliasTemplateDeclaration = 601,

/**
* A static_assert or _Static_assert node.
*/
PLClangCursorKindStaticAssert = 602,

/**
* A friend declaration.
*/
PLClangCursorKindFriendDeclaration = 603,

/**
* A code completion overload candidate.
*/
Expand Down
93 changes: 93 additions & 0 deletions ObjectDoc/PLClangCursor.m
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ - (PLClangCursorKind) kind {
case CXCursor_ObjCSelfExpr:
return PLClangCursorKindObjCSelfExpression;

case CXCursor_OMPArraySectionExpr:
return PLClangCursorKindOMPArraySectionExpression;

case CXCursor_ObjCAvailabilityCheckExpr:
return PLClangCursorKindObjCAvailabilityCheckExpression;

case CXCursor_UnexposedStmt:
return PLClangCursorKindUnexposedStatement;

Expand Down Expand Up @@ -544,6 +550,75 @@ - (PLClangCursorKind) kind {
case CXCursor_OMPCancelDirective:
return PLClangCursorKindOMPCancelDirective;

case CXCursor_OMPTargetDataDirective:
return PLClangCursorKindOMPTargetDataDirective;

case CXCursor_OMPTaskLoopDirective:
return PLClangCursorKindOMPTaskLoopDirective;

case CXCursor_OMPTaskLoopSimdDirective:
return PLClangCursorKindOMPTaskLoopSimdDirective;

case CXCursor_OMPDistributeDirective:
return PLClangCursorKindOMPDistributeDirective;

case CXCursor_OMPTargetEnterDataDirective:
return PLClangCursorKindOMPTargetEnterDataDirective;

case CXCursor_OMPTargetExitDataDirective:
return PLClangCursorKindOMPTargetExitDataDirective;

case CXCursor_OMPTargetParallelDirective:
return PLClangCursorKindOMPTargetParallelDirective;

case CXCursor_OMPTargetParallelForDirective:
return PLClangCursorKindOMPTargetParallelForDirective;

case CXCursor_OMPTargetUpdateDirective:
return PLClangCursorKindOMPTargetUpdateDirective;

case CXCursor_OMPDistributeParallelForDirective:
return PLClangCursorKindOMPDistributeParallelForDirective;

case CXCursor_OMPDistributeParallelForSimdDirective:
return PLClangCursorKindOMPDistributeParallelForSimdDirective;

case CXCursor_OMPDistributeSimdDirective:
return PLClangCursorKindOMPDistributeSimdDirective;

case CXCursor_OMPTargetParallelForSimdDirective:
return PLClangCursorKindOMPTargetParallelForSimdDirective;

case CXCursor_OMPTargetSimdDirective:
return PLClangCursorKindOMPTargetSimdDirective;

case CXCursor_OMPTeamsDistributeDirective:
return PLClangCursorKindOMPTeamsDistributeDirective;

case CXCursor_OMPTeamsDistributeSimdDirective:
return PLClangCursorKindOMPTeamsDistributeSimdDirective;

case CXCursor_OMPTeamsDistributeParallelForSimdDirective:
return PLClangCursorKindOMPTeamsDistributeParallelForSimdDirective;

case CXCursor_OMPTeamsDistributeParallelForDirective:
return PLClangCursorKindOMPTeamsDistributeParallelForDirective;

case CXCursor_OMPTargetTeamsDirective:
return PLClangCursorKindOMPTargetTeamsDirective;

case CXCursor_OMPTargetTeamsDistributeDirective:
return PLClangCursorKindOMPTargetTeamsDistributeDirective;

case CXCursor_OMPTargetTeamsDistributeParallelForDirective:
return PLClangCursorKindOMPTargetTeamsDistributeParallelForDirective;

case CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective:
return PLClangCursorKindOMPTargetTeamsDistributeParallelForSimdDirective;

case CXCursor_OMPTargetTeamsDistributeSimdDirective:
return PLClangCursorKindOMPTargetTeamsDistributeSimdDirective;

case CXCursor_TranslationUnit:
return PLClangCursorKindTranslationUnit;

Expand Down Expand Up @@ -598,6 +673,15 @@ - (PLClangCursorKind) kind {
case CXCursor_CUDASharedAttr:
return PLClangCursorKindCUDASharedAttribute;

case CXCursor_VisibilityAttr:
return PLClangCursorKindVisibilityAttribute;

case CXCursor_DLLExport:
return PLClangCursorKindDLLExportAttribute;

case CXCursor_DLLImport:
return PLClangCursorKindDLLImportAttribute;

case CXCursor_PreprocessingDirective:
return PLClangCursorKindPreprocessingDirective;

Expand All @@ -613,6 +697,15 @@ - (PLClangCursorKind) kind {
case CXCursor_ModuleImportDecl:
return PLClangCursorKindModuleImportDeclaration;

case CXCursor_TypeAliasTemplateDecl:
return PLClangCursorKindTypeAliasTemplateDeclaration;

case CXCursor_StaticAssert:
return PLClangCursorKindStaticAssert;

case CXCursor_FriendDecl:
return PLClangCursorKindFriendDeclaration;

case CXCursor_OverloadCandidate:
return PLClangCursorKindOverloadCandidate;

Expand Down
15 changes: 14 additions & 1 deletion ObjectDoc/PLClangType.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ typedef NS_ENUM(NSUInteger, PLClangTypeKind) {
/** SEL in Objective-C */
PLClangTypeKindObjCSel = 29,

/** __float128 */
PLClangTypeKindFloat128 = 30,

/** A complex type. */
PLClangTypeKindComplex = 100,

Expand Down Expand Up @@ -166,7 +169,17 @@ typedef NS_ENUM(NSUInteger, PLClangTypeKind) {
PLClangTypeKindDependentSizedArray = 116,

/** A C++ member pointer. */
PLClangTypeKindMemberPointer = 117
PLClangTypeKindMemberPointer = 117,

/** A C++11 auto or C++14 decltype(auto) type. */
PLClangTypeKindAuto = 118,

/**
* A type that was referred to using an elaborated type keyword.
*
* E.g., struct S, or via a qualified name, e.g., N::M::type, or both.
*/
PLClangTypeKindElaborated = 119
};

@interface PLClangType : NSObject
Expand Down
9 changes: 9 additions & 0 deletions ObjectDoc/PLClangType.m
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ - (PLClangTypeKind) kind {
case CXType_ObjCSel:
return PLClangTypeKindObjCSel;

case CXType_Float128:
return PLClangTypeKindFloat128;

case CXType_Complex:
return PLClangTypeKindComplex;

Expand Down Expand Up @@ -187,6 +190,12 @@ - (PLClangTypeKind) kind {

case CXType_MemberPointer:
return PLClangTypeKindMemberPointer;

case CXType_Auto:
return PLClangTypeKindAuto;

case CXType_Elaborated:
return PLClangTypeKindElaborated;
}

// Type is unknown
Expand Down

0 comments on commit 4984c02

Please sign in to comment.