Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3895,7 +3895,7 @@ void ASTContext::adjustExceptionSpec(

/// getComplexType - Return the uniqued reference to the type for a complex
/// number with the specified element type.
QualType ASTContext::getComplexType(QualType T) const {
LLVM_ABI QualType ASTContext::getComplexType(QualType T) const {
// Unique pointers, to guarantee there is only one pointer of a particular
// structure.
llvm::FoldingSetNodeID ID;
Expand Down Expand Up @@ -4079,7 +4079,7 @@ QualType ASTContext::getBlockPointerType(QualType T) const {

/// getLValueReferenceType - Return the uniqued reference to the type for an
/// lvalue reference to the specified type.
QualType
LLVM_ABI QualType
ASTContext::getLValueReferenceType(QualType T, bool SpelledAsLValue) const {
assert((!T->isPlaceholderType() ||
T->isSpecificPlaceholderType(BuiltinType::UnknownAny)) &&
Expand Down Expand Up @@ -5251,7 +5251,7 @@ QualType ASTContext::getInjectedClassNameType(CXXRecordDecl *Decl,

/// getTypeDeclType - Return the unique reference to the type for the
/// specified type declaration.
QualType ASTContext::getTypeDeclTypeSlow(const TypeDecl *Decl) const {
LLVM_ABI QualType ASTContext::getTypeDeclTypeSlow(const TypeDecl *Decl) const {
assert(Decl && "Passed null for Decl param");
assert(!Decl->TypeForDecl && "TypeForDecl present in slow case");

Expand Down Expand Up @@ -13125,7 +13125,7 @@ VTableContextBase *ASTContext::getVTableContext() {
return VTContext.get();
}

MangleContext *ASTContext::createMangleContext(const TargetInfo *T) {
LLVM_ABI MangleContext *ASTContext::createMangleContext(const TargetInfo *T) {
if (!T)
T = Target;
switch (T->getCXXABI().getKind()) {
Expand Down
11 changes: 6 additions & 5 deletions clang/lib/AST/Decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/Triple.h"
Expand Down Expand Up @@ -2255,7 +2256,7 @@ bool VarDecl::isInExternCXXContext() const {

VarDecl *VarDecl::getCanonicalDecl() { return getFirstDecl(); }

VarDecl::DefinitionKind
LLVM_ABI VarDecl::DefinitionKind
VarDecl::isThisDeclarationADefinition(ASTContext &C) const {
if (isThisDeclarationADemotedDefinition())
return DeclarationOnly;
Expand Down Expand Up @@ -3763,7 +3764,7 @@ unsigned FunctionDecl::getBuiltinID(bool ConsiderWrapperFunctions) const {
/// getNumParams - Return the number of parameters this function must have
/// based on its FunctionType. This is the length of the ParamInfo array
/// after it has been created.
unsigned FunctionDecl::getNumParams() const {
LLVM_ABI unsigned FunctionDecl::getNumParams() const {
const auto *FPT = getType()->getAs<FunctionProtoType>();
return FPT ? FPT->getNumParams() : 0;
}
Expand Down Expand Up @@ -4200,7 +4201,7 @@ bool FunctionDecl::isTemplateInstantiation() const {
return clang::isTemplateInstantiation(getTemplateSpecializationKind());
}

FunctionDecl *
LLVM_ABI FunctionDecl *
FunctionDecl::getTemplateInstantiationPattern(bool ForDefinition) const {
// If this is a generic lambda call operator specialization, its
// instantiation pattern is always its primary template's pattern
Expand Down Expand Up @@ -4265,7 +4266,7 @@ FunctionDecl::getTemplateSpecializationInfo() const {
TemplateOrSpecialization);
}

const TemplateArgumentList *
LLVM_ABI const TemplateArgumentList *
FunctionDecl::getTemplateSpecializationArgs() const {
if (FunctionTemplateSpecializationInfo *Info =
dyn_cast_if_present<FunctionTemplateSpecializationInfo *>(
Expand Down Expand Up @@ -5143,7 +5144,7 @@ RecordDecl *RecordDecl::CreateDeserialized(const ASTContext &C,
return R;
}

bool RecordDecl::isInjectedClassName() const {
LLVM_ABI bool RecordDecl::isInjectedClassName() const {
return isImplicit() && getDeclName() && getDeclContext()->isRecord() &&
cast<RecordDecl>(getDeclContext())->getDeclName() == getDeclName();
}
Expand Down
15 changes: 8 additions & 7 deletions clang/lib/AST/DeclBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/VersionTuple.h"
Expand Down Expand Up @@ -526,7 +527,7 @@ TranslationUnitDecl *Decl::getTranslationUnitDecl() {
return cast<TranslationUnitDecl>(DC);
}

ASTContext &Decl::getASTContext() const {
LLVM_ABI ASTContext &Decl::getASTContext() const {
return getTranslationUnitDecl()->getASTContext();
}

Expand Down Expand Up @@ -613,7 +614,7 @@ ExternalSourceSymbolAttr *Decl::getExternalSourceSymbolAttr() const {
return nullptr;
}

bool Decl::hasDefiningAttr() const {
LLVM_ABI bool Decl::hasDefiningAttr() const {
return hasAttr<AliasAttr>() || hasAttr<IFuncAttr>() ||
hasAttr<LoaderUninitializedAttr>();
}
Expand Down Expand Up @@ -1047,7 +1048,7 @@ void Decl::addAttr(Attr *A) {
Attrs.insert(I, A);
}

const AttrVec &Decl::getAttrs() const {
LLVM_ABI const AttrVec &Decl::getAttrs() const {
assert(HasAttrs && "No attrs to get!");
return getASTContext().getDeclAttrs(this);
}
Expand All @@ -1065,7 +1066,7 @@ Decl *Decl::castFromDeclContext (const DeclContext *D) {
}
}

DeclContext *Decl::castToDeclContext(const Decl *D) {
LLVM_ABI DeclContext *Decl::castToDeclContext(const Decl *D) {
Decl::Kind DK = D->getKind();
switch(DK) {
#define DECL(NAME, BASE)
Expand Down Expand Up @@ -1291,7 +1292,7 @@ DeclContext::DeclContext(Decl::Kind K) {
setUseQualifiedLookup(false);
}

bool DeclContext::classof(const Decl *D) {
LLVM_ABI bool DeclContext::classof(const Decl *D) {
Decl::Kind DK = D->getKind();
switch (DK) {
#define DECL(NAME, BASE)
Expand Down Expand Up @@ -1662,7 +1663,7 @@ ExternalASTSource::SetExternalVisibleDeclsForName(const DeclContext *DC,
return List.getLookupResult();
}

DeclContext::decl_iterator DeclContext::decls_begin() const {
LLVM_ABI DeclContext::decl_iterator DeclContext::decls_begin() const {
if (hasExternalLexicalStorage())
LoadLexicalDeclsFromExternalStorage();
return decl_iterator(FirstDecl);
Expand Down Expand Up @@ -1891,7 +1892,7 @@ void DeclContext::buildLookupImpl(DeclContext *DCtx, bool Internal) {
}
}

DeclContext::lookup_result
LLVM_ABI DeclContext::lookup_result
DeclContext::lookup(DeclarationName Name) const {
// For transparent DeclContext, we should lookup in their enclosing context.
if (getDeclKind() == Decl::LinkageSpec || getDeclKind() == Decl::Export)
Expand Down
5 changes: 4 additions & 1 deletion clang/lib/AST/DeclTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
#include <optional>
Expand Down Expand Up @@ -549,6 +550,7 @@ void ClassTemplateDecl::LoadLazySpecializations(
loadLazySpecializationsImpl(OnlyPartial);
}

LLVM_ABI
llvm::FoldingSetVector<ClassTemplateSpecializationDecl> &
ClassTemplateDecl::getSpecializations() const {
LoadLazySpecializations();
Expand Down Expand Up @@ -1451,7 +1453,8 @@ void VarTemplateSpecializationDecl::getNameForDiagnostic(
}
}

VarTemplateDecl *VarTemplateSpecializationDecl::getSpecializedTemplate() const {
LLVM_ABI VarTemplateDecl *
VarTemplateSpecializationDecl::getSpecializedTemplate() const {
if (const auto *PartialSpec =
SpecializedTemplate.dyn_cast<SpecializedPartialSpecialization *>())
return PartialSpec->PartialSpecialization->getSpecializedTemplate();
Expand Down
5 changes: 3 additions & 2 deletions clang/lib/AST/Mangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Mangler.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
Expand Down Expand Up @@ -118,7 +119,7 @@ static CCMangling getCallingConvMangling(const ASTContext &Context,
}
}

bool MangleContext::shouldMangleDeclName(const NamedDecl *D) {
LLVM_ABI bool MangleContext::shouldMangleDeclName(const NamedDecl *D) {
const ASTContext &ASTContext = getASTContext();

CCMangling CC = getCallingConvMangling(ASTContext, D);
Expand Down Expand Up @@ -152,7 +153,7 @@ bool MangleContext::shouldMangleDeclName(const NamedDecl *D) {
return shouldMangleCXXName(D);
}

void MangleContext::mangleName(GlobalDecl GD, raw_ostream &Out) {
LLVM_ABI void MangleContext::mangleName(GlobalDecl GD, raw_ostream &Out) {
const ASTContext &ASTContext = getASTContext();
const NamedDecl *D = cast<NamedDecl>(GD.getDecl());

Expand Down
9 changes: 6 additions & 3 deletions clang/lib/AST/Type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include <algorithm>
Expand Down Expand Up @@ -650,7 +651,7 @@ template <> const CountAttributedType *Type::getAs() const {
/// getUnqualifiedDesugaredType - Pull any qualifiers and syntactic
/// sugar off the given type. This should produce an object of the
/// same dynamic type as the canonical type.
const Type *Type::getUnqualifiedDesugaredType() const {
LLVM_ABI const Type *Type::getUnqualifiedDesugaredType() const {
const Type *Cur = this;

while (true) {
Expand Down Expand Up @@ -2302,7 +2303,7 @@ bool Type::hasUnsignedIntegerRepresentation() const {
return isUnsignedIntegerOrEnumerationType();
}

bool Type::isFloatingType() const {
LLVM_ABI bool Type::isFloatingType() const {
if (const auto *BT = dyn_cast<BuiltinType>(CanonicalType))
return BT->isFloatingPoint();
if (const auto *CT = dyn_cast<ComplexType>(CanonicalType))
Expand Down Expand Up @@ -4227,7 +4228,9 @@ static TagDecl *getInterestingTagDecl(TagDecl *decl) {
return decl;
}

TagDecl *TagType::getDecl() const { return getInterestingTagDecl(decl); }
LLVM_ABI TagDecl *TagType::getDecl() const {
return getInterestingTagDecl(decl);
}

bool TagType::isBeingDefined() const { return getDecl()->isBeingDefined(); }

Expand Down
10 changes: 7 additions & 3 deletions clang/lib/Interpreter/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h"
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
Expand Down Expand Up @@ -194,6 +195,7 @@ IncrementalCompilerBuilder::create(std::string TT,
return CreateCI(**ErrOrCC1Args);
}

LLVM_ABI
llvm::Expected<std::unique_ptr<CompilerInstance>>
IncrementalCompilerBuilder::CreateCpp() {
std::vector<const char *> Argv;
Expand Down Expand Up @@ -527,7 +529,9 @@ const CompilerInstance *Interpreter::getCompilerInstance() const {
return CI.get();
}

CompilerInstance *Interpreter::getCompilerInstance() { return CI.get(); }
LLVM_ABI CompilerInstance *Interpreter::getCompilerInstance() {
return CI.get();
}

llvm::Expected<llvm::orc::LLJIT &> Interpreter::getExecutionEngine() {
if (!IncrExecutor) {
Expand Down Expand Up @@ -580,7 +584,7 @@ Interpreter::RegisterPTU(TranslationUnitDecl *TU,
return LastPTU;
}

llvm::Expected<PartialTranslationUnit &>
LLVM_ABI llvm::Expected<PartialTranslationUnit &>
Interpreter::Parse(llvm::StringRef Code) {
// If we have a device parser, parse it first. The generated code will be
// included in the host compilation
Expand Down Expand Up @@ -676,7 +680,7 @@ llvm::Error Interpreter::CreateExecutor() {

void Interpreter::ResetExecutor() { IncrExecutor.reset(); }

llvm::Error Interpreter::Execute(PartialTranslationUnit &T) {
LLVM_ABI llvm::Error Interpreter::Execute(PartialTranslationUnit &T) {
assert(T.TheModule);
LLVM_DEBUG(
llvm::dbgs() << "execute-ptu "
Expand Down
9 changes: 5 additions & 4 deletions clang/lib/Interpreter/InterpreterValuePrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "clang/Interpreter/Value.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Sema.h"

#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/raw_ostream.h"

Expand Down Expand Up @@ -300,16 +300,17 @@ llvm::Expected<Expr *> Interpreter::ExtractValueFromExpr(Expr *E) {
using namespace clang;

// Temporary rvalue struct that need special care.
REPL_EXTERNAL_VISIBILITY void *
REPL_EXTERNAL_VISIBILITY LLVM_ABI void *
__clang_Interpreter_SetValueWithAlloc(void *This, void *OutVal,
void *OpaqueType) {
Value &VRef = *(Value *)OutVal;
VRef = Value(static_cast<Interpreter *>(This), OpaqueType);
return VRef.getPtr();
}

extern "C" void REPL_EXTERNAL_VISIBILITY __clang_Interpreter_SetValueNoAlloc(
void *This, void *OutVal, void *OpaqueType, ...) {
extern "C" LLVM_ABI void REPL_EXTERNAL_VISIBILITY
__clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType,
...) {
Value &VRef = *(Value *)OutVal;
Interpreter *I = static_cast<Interpreter *>(This);
VRef = Value(I, OpaqueType);
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Sema/SemaDeclCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/SaveAndRestore.h"
#include <map>
Expand Down Expand Up @@ -11959,7 +11960,7 @@ EnumDecl *Sema::getStdAlignValT() const {
return cast_or_null<EnumDecl>(StdAlignValT.get(Context.getExternalSource()));
}

NamespaceDecl *Sema::getStdNamespace() const {
LLVM_ABI NamespaceDecl *Sema::getStdNamespace() const {
return cast_or_null<NamespaceDecl>(
StdNamespace.get(Context.getExternalSource()));
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/ADT/SmallVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ template <class Size_T> class SmallVectorBase {
/// capacity for.
///
/// This does not construct or destroy any elements in the vector.
void set_size(size_t N) {
LLVM_ABI void set_size(size_t N) {
assert(N <= capacity()); // implies no overflow in assignment
Size = static_cast<Size_T>(N);
}
Expand Down
Loading
Loading