Skip to content

Commit

Permalink
Update master to v3.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zimmski committed Nov 18, 2015
1 parent a780428 commit fbbd582
Show file tree
Hide file tree
Showing 37 changed files with 2,013 additions and 677 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.4
- llvm-toolchain-precise-3.7
packages:
- llvm-3.4
- clang-3.4
- libclang1-3.4
- libclang-3.4-dev
- llvm-3.7
- clang-3.7
- libclang1-3.7
- libclang-3.7-dev

install:
- mkdir -p /home/travis/bin
- sudo ln -s /usr/bin/llvm-config-3.4 /home/travis/bin/llvm-config
- sudo ln -s /usr/lib/llvm-3.4/lib/libclang.so.1 /usr/lib/x86_64-linux-gnu/libclang.so
- sudo ln -s /usr/bin/llvm-config-3.7 /home/travis/bin/llvm-config
- sudo ln -s /usr/lib/llvm-3.7/lib/libclang.so.1 /usr/lib/x86_64-linux-gnu/libclang.so
- sudo ldconfig

- llvm-config --version
Expand Down
32 changes: 16 additions & 16 deletions callingconv_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ import "fmt"
type CallingConv uint32

const (
CallingConv_Default CallingConv = C.CXCallingConv_Default
CallingConv_C = C.CXCallingConv_C
CallingConv_X86StdCall = C.CXCallingConv_X86StdCall
CallingConv_X86FastCall = C.CXCallingConv_X86FastCall
CallingConv_X86ThisCall = C.CXCallingConv_X86ThisCall
CallingConv_X86Pascal = C.CXCallingConv_X86Pascal
CallingConv_AAPCS = C.CXCallingConv_AAPCS
CallingConv_AAPCS_VFP = C.CXCallingConv_AAPCS_VFP
CallingConv_PnaclCall = C.CXCallingConv_PnaclCall
CallingConv_IntelOclBicc = C.CXCallingConv_IntelOclBicc
CallingConv_X86_64Win64 = C.CXCallingConv_X86_64Win64
CallingConv_X86_64SysV = C.CXCallingConv_X86_64SysV
CallingConv_Invalid = C.CXCallingConv_Invalid
CallingConv_Unexposed = C.CXCallingConv_Unexposed
CallingConv_Default CallingConv = C.CXCallingConv_Default
CallingConv_C = C.CXCallingConv_C
CallingConv_X86StdCall = C.CXCallingConv_X86StdCall
CallingConv_X86FastCall = C.CXCallingConv_X86FastCall
CallingConv_X86ThisCall = C.CXCallingConv_X86ThisCall
CallingConv_X86Pascal = C.CXCallingConv_X86Pascal
CallingConv_AAPCS = C.CXCallingConv_AAPCS
CallingConv_AAPCS_VFP = C.CXCallingConv_AAPCS_VFP
CallingConv_IntelOclBicc = C.CXCallingConv_IntelOclBicc
CallingConv_X86_64Win64 = C.CXCallingConv_X86_64Win64
CallingConv_X86_64SysV = C.CXCallingConv_X86_64SysV
CallingConv_X86VectorCall = C.CXCallingConv_X86VectorCall
CallingConv_Invalid = C.CXCallingConv_Invalid
CallingConv_Unexposed = C.CXCallingConv_Unexposed
)

func (cc CallingConv) Spelling() string {
Expand All @@ -43,14 +43,14 @@ func (cc CallingConv) Spelling() string {
return "CallingConv=AAPCS"
case CallingConv_AAPCS_VFP:
return "CallingConv=AAPCS_VFP"
case CallingConv_PnaclCall:
return "CallingConv=PnaclCall"
case CallingConv_IntelOclBicc:
return "CallingConv=IntelOclBicc"
case CallingConv_X86_64Win64:
return "CallingConv=X86_64Win64"
case CallingConv_X86_64SysV:
return "CallingConv=X86_64SysV"
case CallingConv_X86VectorCall:
return "CallingConv=X86VectorCall"
case CallingConv_Invalid:
return "CallingConv=Invalid"
case CallingConv_Unexposed:
Expand Down
158 changes: 158 additions & 0 deletions clang-c/BuildSystem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
#include <stdint.h>

/*==-- clang-c/BuildSystem.h - Utilities for use by build systems -*- C -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This header provides various utilities for use by build systems. *|
|* *|
\*===----------------------------------------------------------------------===*/

#ifndef LLVM_CLANG_C_BUILDSYSTEM_H
#define LLVM_CLANG_C_BUILDSYSTEM_H

#include "clang-c/Platform.h"
#include "clang-c/CXErrorCode.h"
#include "clang-c/CXString.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* \defgroup BUILD_SYSTEM Build system utilities
* @{
*/

/**
* \brief Return the timestamp for use with Clang's
* \c -fbuild-session-timestamp= option.
*/
CINDEX_LINKAGE unsigned long long clang_getBuildSessionTimestamp(void);

/**
* \brief Object encapsulating information about overlaying virtual
* file/directories over the real file system.
*/
typedef struct CXVirtualFileOverlayImpl *CXVirtualFileOverlay;

/**
* \brief Create a \c CXVirtualFileOverlay object.
* Must be disposed with \c clang_VirtualFileOverlay_dispose().
*
* \param options is reserved, always pass 0.
*/
CINDEX_LINKAGE CXVirtualFileOverlay
clang_VirtualFileOverlay_create(unsigned options);

/**
* \brief Map an absolute virtual file path to an absolute real one.
* The virtual path must be canonicalized (not contain "."/"..").
* \returns 0 for success, non-zero to indicate an error.
*/
CINDEX_LINKAGE enum CXErrorCode
clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay,
const char *virtualPath,
const char *realPath);

/**
* \brief Set the case sensitivity for the \c CXVirtualFileOverlay object.
* The \c CXVirtualFileOverlay object is case-sensitive by default, this
* option can be used to override the default.
* \returns 0 for success, non-zero to indicate an error.
*/
CINDEX_LINKAGE enum CXErrorCode
clang_VirtualFileOverlay_setCaseSensitivity(CXVirtualFileOverlay,
int caseSensitive);

/**
* \brief Write out the \c CXVirtualFileOverlay object to a char buffer.
*
* \param options is reserved, always pass 0.
* \param out_buffer_ptr pointer to receive the buffer pointer, which should be
* disposed using \c clang_free().
* \param out_buffer_size pointer to receive the buffer size.
* \returns 0 for success, non-zero to indicate an error.
*/
CINDEX_LINKAGE enum CXErrorCode
clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options,
char **out_buffer_ptr,
unsigned *out_buffer_size);

/**
* \brief free memory allocated by libclang, such as the buffer returned by
* \c CXVirtualFileOverlay() or \c clang_ModuleMapDescriptor_writeToBuffer().
*
* \param buffer memory pointer to free.
*/
CINDEX_LINKAGE void clang_free(void *buffer);

/**
* \brief Dispose a \c CXVirtualFileOverlay object.
*/
CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay);

/**
* \brief Object encapsulating information about a module.map file.
*/
typedef struct CXModuleMapDescriptorImpl *CXModuleMapDescriptor;

/**
* \brief Create a \c CXModuleMapDescriptor object.
* Must be disposed with \c clang_ModuleMapDescriptor_dispose().
*
* \param options is reserved, always pass 0.
*/
CINDEX_LINKAGE CXModuleMapDescriptor
clang_ModuleMapDescriptor_create(unsigned options);

/**
* \brief Sets the framework module name that the module.map describes.
* \returns 0 for success, non-zero to indicate an error.
*/
CINDEX_LINKAGE enum CXErrorCode
clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor,
const char *name);

/**
* \brief Sets the umbrealla header name that the module.map describes.
* \returns 0 for success, non-zero to indicate an error.
*/
CINDEX_LINKAGE enum CXErrorCode
clang_ModuleMapDescriptor_setUmbrellaHeader(CXModuleMapDescriptor,
const char *name);

/**
* \brief Write out the \c CXModuleMapDescriptor object to a char buffer.
*
* \param options is reserved, always pass 0.
* \param out_buffer_ptr pointer to receive the buffer pointer, which should be
* disposed using \c clang_free().
* \param out_buffer_size pointer to receive the buffer size.
* \returns 0 for success, non-zero to indicate an error.
*/
CINDEX_LINKAGE enum CXErrorCode
clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor, unsigned options,
char **out_buffer_ptr,
unsigned *out_buffer_size);

/**
* \brief Dispose a \c CXModuleMapDescriptor object.
*/
CINDEX_LINKAGE void clang_ModuleMapDescriptor_dispose(CXModuleMapDescriptor);

/**
* @}
*/

#ifdef __cplusplus
}
#endif

#endif /* CLANG_C_BUILD_SYSTEM_H */

4 changes: 2 additions & 2 deletions clang-c/CXCompilationDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
|* *|
\*===----------------------------------------------------------------------===*/

#ifndef CLANG_CXCOMPILATIONDATABASE_H
#define CLANG_CXCOMPILATIONDATABASE_H
#ifndef LLVM_CLANG_C_CXCOMPILATIONDATABASE_H
#define LLVM_CLANG_C_CXCOMPILATIONDATABASE_H

#include "clang-c/Platform.h"
#include "clang-c/CXString.h"
Expand Down
66 changes: 66 additions & 0 deletions clang-c/CXErrorCode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#include <stdint.h>

/*===-- clang-c/CXErrorCode.h - C Index Error Codes --------------*- C -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This header provides the CXErrorCode enumerators. *|
|* *|
\*===----------------------------------------------------------------------===*/

#ifndef LLVM_CLANG_C_CXERRORCODE_H
#define LLVM_CLANG_C_CXERRORCODE_H

#include "clang-c/Platform.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* \brief Error codes returned by libclang routines.
*
* Zero (\c CXError_Success) is the only error code indicating success. Other
* error codes, including not yet assigned non-zero values, indicate errors.
*/
enum CXErrorCode {
/**
* \brief No error.
*/
CXError_Success = 0,

/**
* \brief A generic error code, no further details are available.
*
* Errors of this kind can get their own specific error codes in future
* libclang versions.
*/
CXError_Failure = 1,

/**
* \brief libclang crashed while performing the requested operation.
*/
CXError_Crashed = 2,

/**
* \brief The function detected that the arguments violate the function
* contract.
*/
CXError_InvalidArguments = 3,

/**
* \brief An AST deserialization error has occurred.
*/
CXError_ASTReadError = 4
};

#ifdef __cplusplus
}
#endif
#endif

6 changes: 3 additions & 3 deletions clang-c/CXString.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
|* *|
\*===----------------------------------------------------------------------===*/

#ifndef CLANG_CXSTRING_H
#define CLANG_CXSTRING_H
#ifndef LLVM_CLANG_C_CXSTRING_H
#define LLVM_CLANG_C_CXSTRING_H

#include "clang-c/Platform.h"

Expand All @@ -33,7 +33,7 @@ extern "C" {
* \brief A character string.
*
* The \c CXString type is used to return strings from the interface when
* the ownership of that string might different from one call to the next.
* the ownership of that string might differ from one call to the next.
* Use \c clang_getCString() to retrieve the string data and, once finished
* with the string data, call \c clang_disposeString() to free the string.
*/
Expand Down
Loading

0 comments on commit fbbd582

Please sign in to comment.