diff options
author | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | c86b984ea8ecb3e944dc3de48539f4c1f65851ea (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /include/clang/CodeGen | |
parent | c696171ff15f0ee60dea4abfd99a135473c95656 (diff) | |
download | FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.zip FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.tar.gz |
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102
Diffstat (limited to 'include/clang/CodeGen')
-rw-r--r-- | include/clang/CodeGen/BackendUtil.h | 4 | ||||
-rw-r--r-- | include/clang/CodeGen/CGFunctionInfo.h | 35 | ||||
-rw-r--r-- | include/clang/CodeGen/CodeGenABITypes.h | 8 | ||||
-rw-r--r-- | include/clang/CodeGen/CodeGenAction.h | 14 | ||||
-rw-r--r-- | include/clang/CodeGen/ModuleBuilder.h | 4 |
5 files changed, 47 insertions, 18 deletions
diff --git a/include/clang/CodeGen/BackendUtil.h b/include/clang/CodeGen/BackendUtil.h index f8b90b3..07c6183 100644 --- a/include/clang/CodeGen/BackendUtil.h +++ b/include/clang/CodeGen/BackendUtil.h @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_CODEGEN_BACKEND_UTIL_H -#define LLVM_CLANG_CODEGEN_BACKEND_UTIL_H +#ifndef LLVM_CLANG_CODEGEN_BACKENDUTIL_H +#define LLVM_CLANG_CODEGEN_BACKENDUTIL_H #include "clang/Basic/LLVM.h" diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h index 449827e..102d25d 100644 --- a/include/clang/CodeGen/CGFunctionInfo.h +++ b/include/clang/CodeGen/CGFunctionInfo.h @@ -13,8 +13,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_CODEGEN_FUNCTION_INFO_H -#define LLVM_CLANG_CODEGEN_FUNCTION_INFO_H +#ifndef LLVM_CLANG_CODEGEN_CGFUNCTIONINFO_H +#define LLVM_CLANG_CODEGEN_CGFUNCTIONINFO_H #include "clang/AST/CanonicalType.h" #include "clang/AST/Type.h" @@ -87,6 +87,7 @@ private: bool IndirectRealign : 1; // isIndirect() bool SRetAfterThis : 1; // isIndirect() bool InReg : 1; // isDirect() || isExtend() || isIndirect() + bool CanBeFlattened: 1; // isDirect() ABIArgInfo(Kind K) : PaddingType(nullptr), TheKind(K), PaddingInReg(false), InReg(false) {} @@ -97,11 +98,13 @@ public: TheKind(Direct), PaddingInReg(false), InReg(false) {} static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0, - llvm::Type *Padding = nullptr) { + llvm::Type *Padding = nullptr, + bool CanBeFlattened = true) { auto AI = ABIArgInfo(Direct); AI.setCoerceToType(T); AI.setDirectOffset(Offset); AI.setPaddingType(Padding); + AI.setCanBeFlattened(CanBeFlattened); return AI; } static ABIArgInfo getDirectInReg(llvm::Type *T = nullptr) { @@ -265,6 +268,16 @@ public: InAllocaSRet = SRet; } + bool getCanBeFlattened() const { + assert(isDirect() && "Invalid kind!"); + return CanBeFlattened; + } + + void setCanBeFlattened(bool Flatten) { + assert(isDirect() && "Invalid kind!"); + CanBeFlattened = Flatten; + } + void dump() const; }; @@ -339,6 +352,9 @@ class CGFunctionInfo : public llvm::FoldingSetNode { /// Whether this is an instance method. unsigned InstanceMethod : 1; + /// Whether this is a chain call. + unsigned ChainCall : 1; + /// Whether this function is noreturn. unsigned NoReturn : 1; @@ -347,7 +363,7 @@ class CGFunctionInfo : public llvm::FoldingSetNode { /// How many arguments to pass inreg. unsigned HasRegParm : 1; - unsigned RegParm : 4; + unsigned RegParm : 3; RequiredArgs Required; @@ -367,7 +383,8 @@ class CGFunctionInfo : public llvm::FoldingSetNode { public: static CGFunctionInfo *create(unsigned llvmCC, - bool InstanceMethod, + bool instanceMethod, + bool chainCall, const FunctionType::ExtInfo &extInfo, CanQualType resultType, ArrayRef<CanQualType> argTypes, @@ -393,9 +410,14 @@ public: bool isVariadic() const { return Required.allowsOptionalArgs(); } RequiredArgs getRequiredArgs() const { return Required; } + unsigned getNumRequiredArgs() const { + return isVariadic() ? getRequiredArgs().getNumRequiredArgs() : arg_size(); + } bool isInstanceMethod() const { return InstanceMethod; } + bool isChainCall() const { return ChainCall; } + bool isNoReturn() const { return NoReturn; } /// In ARC, whether this function retains its return value. This @@ -446,6 +468,7 @@ public: void Profile(llvm::FoldingSetNodeID &ID) { ID.AddInteger(getASTCallingConvention()); ID.AddBoolean(InstanceMethod); + ID.AddBoolean(ChainCall); ID.AddBoolean(NoReturn); ID.AddBoolean(ReturnsRetained); ID.AddBoolean(HasRegParm); @@ -457,12 +480,14 @@ public: } static void Profile(llvm::FoldingSetNodeID &ID, bool InstanceMethod, + bool ChainCall, const FunctionType::ExtInfo &info, RequiredArgs required, CanQualType resultType, ArrayRef<CanQualType> argTypes) { ID.AddInteger(info.getCC()); ID.AddBoolean(InstanceMethod); + ID.AddBoolean(ChainCall); ID.AddBoolean(info.getNoReturn()); ID.AddBoolean(info.getProducesResult()); ID.AddBoolean(info.getHasRegParm()); diff --git a/include/clang/CodeGen/CodeGenABITypes.h b/include/clang/CodeGen/CodeGenABITypes.h index 2502982..97a9dc8 100644 --- a/include/clang/CodeGen/CodeGenABITypes.h +++ b/include/clang/CodeGen/CodeGenABITypes.h @@ -21,8 +21,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_CODEGEN_ABITYPES_H -#define LLVM_CLANG_CODEGEN_ABITYPES_H +#ifndef LLVM_CLANG_CODEGEN_CODEGENABITYPES_H +#define LLVM_CLANG_CODEGEN_CODEGENABITYPES_H #include "clang/AST/CanonicalType.h" #include "clang/AST/Type.h" @@ -39,6 +39,7 @@ class CXXRecordDecl; class CodeGenOptions; class DiagnosticsEngine; class ObjCMethodDecl; +class CoverageSourceInfo; namespace CodeGen { class CGFunctionInfo; @@ -47,7 +48,8 @@ class CodeGenModule; class CodeGenABITypes { public: - CodeGenABITypes(ASTContext &C, llvm::Module &M, const llvm::DataLayout &TD); + CodeGenABITypes(ASTContext &C, llvm::Module &M, const llvm::DataLayout &TD, + CoverageSourceInfo *CoverageInfo = nullptr); ~CodeGenABITypes(); /// These methods all forward to methods in the private implementation class diff --git a/include/clang/CodeGen/CodeGenAction.h b/include/clang/CodeGen/CodeGenAction.h index 37819c7..f8fd561 100644 --- a/include/clang/CodeGen/CodeGenAction.h +++ b/include/clang/CodeGen/CodeGenAction.h @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_CODEGEN_CODE_GEN_ACTION_H -#define LLVM_CLANG_CODEGEN_CODE_GEN_ACTION_H +#ifndef LLVM_CLANG_CODEGEN_CODEGENACTION_H +#define LLVM_CLANG_CODEGEN_CODEGENACTION_H #include "clang/Frontend/FrontendAction.h" #include <memory> @@ -37,8 +37,8 @@ protected: bool hasIRSupport() const override; - ASTConsumer *CreateASTConsumer(CompilerInstance &CI, - StringRef InFile) override; + std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI, + StringRef InFile) override; void ExecuteAction() override; @@ -52,9 +52,9 @@ public: /// the action will load it from the specified file. void setLinkModule(llvm::Module *Mod) { LinkModule = Mod; } - /// takeModule - Take the generated LLVM module, for use after the action has - /// been run. The result may be null on failure. - llvm::Module *takeModule(); + /// Take the generated LLVM module, for use after the action has been run. + /// The result may be null on failure. + std::unique_ptr<llvm::Module> takeModule(); /// Take the LLVM context used by this action. llvm::LLVMContext *takeLLVMContext(); diff --git a/include/clang/CodeGen/ModuleBuilder.h b/include/clang/CodeGen/ModuleBuilder.h index 4b7236b..f4c3107 100644 --- a/include/clang/CodeGen/ModuleBuilder.h +++ b/include/clang/CodeGen/ModuleBuilder.h @@ -24,6 +24,7 @@ namespace llvm { namespace clang { class DiagnosticsEngine; + class CoverageSourceInfo; class LangOptions; class CodeGenOptions; class TargetOptions; @@ -44,7 +45,8 @@ namespace clang { const std::string &ModuleName, const CodeGenOptions &CGO, const TargetOptions &TO, - llvm::LLVMContext& C); + llvm::LLVMContext& C, + CoverageSourceInfo *CoverageInfo = nullptr); } #endif |