Skip to content

Commit

Permalink
make gong build again
Browse files Browse the repository at this point in the history
update after r256620; merge r282822, r284733, 283043, r272233
  • Loading branch information
nico committed Nov 17, 2016
1 parent 27c612a commit 34dde94
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
5 changes: 2 additions & 3 deletions include/gong/AST/DeclBase.h
Expand Up @@ -58,8 +58,7 @@ class UsingDirectiveDecl;

namespace llvm {
// DeclContext* is only 4-byte aligned on 32-bit systems.
template<>
class PointerLikeTypeTraits<gong::DeclContext*> {
template <> class PointerLikeTypeTraits<gong::DeclContext *> {
typedef gong::DeclContext* PT;
public:
static inline void *getAsVoidPointer(PT P) { return P; }
Expand Down Expand Up @@ -860,7 +859,7 @@ class DeclContext {

DeclContext(Decl::Kind K)
: DeclKind(K), ExternalLexicalStorage(false),
ExternalVisibleStorage(false), LookupPtr(0, false), FirstDecl(0),
ExternalVisibleStorage(false), LookupPtr(), FirstDecl(0),
LastDecl(0) { }

public:
Expand Down
9 changes: 5 additions & 4 deletions include/gong/Frontend/DiagnosticRenderer.h
Expand Up @@ -27,10 +27,11 @@ namespace gong {

class DiagnosticOptions;
//class LangOptions;
class StoredDiagnostic;
//class StoredDiagnostic;

typedef llvm::PointerUnion<const Diagnostic *,
const StoredDiagnostic *> DiagOrStoredDiag;
//typedef llvm::PointerUnion<const Diagnostic *,
// const StoredDiagnostic *> DiagOrStoredDiag;
typedef void* DiagOrStoredDiag;

/// \brief Class to encapsulate the logic for formatting a diagnostic message.
/// Actual "printing" logic is implemented by subclasses.
Expand Down Expand Up @@ -134,7 +135,7 @@ class DiagnosticRenderer {
const SourceManager *SM,
DiagOrStoredDiag D = (Diagnostic *)0);

void emitStoredDiagnostic(StoredDiagnostic &Diag);
//void emitStoredDiagnostic(StoredDiagnostic &Diag);
};

/// Subclass of DiagnosticRender that turns all subdiagostics into explicit
Expand Down
15 changes: 7 additions & 8 deletions lib/AST/Expr.cpp
Expand Up @@ -603,7 +603,7 @@ DeclRefExpr *DeclRefExpr::Create(ASTContext &Context,
if (FoundD)
Size += sizeof(NamedDecl *);

void *Mem = Context.Allocate(Size, llvm::alignOf<DeclRefExpr>());
void *Mem = Context.Allocate(Size, alignof(DeclRefExpr));
return new (Mem) DeclRefExpr(Context, /*QualifierLoc,*/ D,
RefersToEnclosingLocal,
/*NameInfo,*/ L, FoundD, T/*, VK*/);
Expand All @@ -623,7 +623,7 @@ DeclRefExpr *DeclRefExpr::CreateEmpty(ASTContext &Context,
if (HasTemplateKWAndArgsInfo)
Size += ASTTemplateKWAndArgsInfo::sizeFor(NumTemplateArgs);

void *Mem = Context.Allocate(Size, llvm::alignOf<DeclRefExpr>());
void *Mem = Context.Allocate(Size, alignof(DeclRefExpr));
return new (Mem) DeclRefExpr(EmptyShell());
}

Expand Down Expand Up @@ -917,7 +917,7 @@ StringLiteral *StringLiteral::Create(ASTContext &C, StringRef Str,
// any concatenated string tokens.
void *Mem = C.Allocate(sizeof(StringLiteral)+
sizeof(SourceLocation)*(NumStrs-1),
llvm::alignOf<StringLiteral>());
alignof(StringLiteral));
StringLiteral *SL = new (Mem) StringLiteral(Ty);

// OPTIMIZE: could allocate this appended to the StringLiteral.
Expand All @@ -934,7 +934,7 @@ StringLiteral *StringLiteral::Create(ASTContext &C, StringRef Str,
StringLiteral *StringLiteral::CreateEmpty(ASTContext &C, unsigned NumStrs) {
void *Mem = C.Allocate(sizeof(StringLiteral)+
sizeof(SourceLocation)*(NumStrs-1),
llvm::alignOf<StringLiteral>());
alignof(StringLiteral));
StringLiteral *SL = new (Mem) StringLiteral(QualType());
SL->CharByteWidth = 0;
SL->Length = 0;
Expand Down Expand Up @@ -3543,8 +3543,7 @@ ObjCMessageExpr *ObjCMessageExpr::alloc(ASTContext &C,
unsigned NumStoredSelLocs) {
unsigned Size = sizeof(ObjCMessageExpr) + sizeof(void *) +
NumArgs * sizeof(Expr *) + NumStoredSelLocs * sizeof(SourceLocation);
return (ObjCMessageExpr *)C.Allocate(Size,
llvm::AlignOf<ObjCMessageExpr>::Alignment);
return (ObjCMessageExpr *)C.Allocate(Size, alignof(ObjCMessageExpr));
}

void ObjCMessageExpr::getSelectorLocs(
Expand Down Expand Up @@ -3926,7 +3925,7 @@ PseudoObjectExpr *PseudoObjectExpr::Create(ASTContext &Context, EmptyShell sh,
unsigned numSemanticExprs) {
void *buffer = Context.Allocate(sizeof(PseudoObjectExpr) +
(1 + numSemanticExprs) * sizeof(Expr*),
llvm::alignOf<PseudoObjectExpr>());
alignof(PseudoObjectExpr));
return new(buffer) PseudoObjectExpr(sh, numSemanticExprs);
}

Expand Down Expand Up @@ -3955,7 +3954,7 @@ PseudoObjectExpr *PseudoObjectExpr::Create(ASTContext &C, Expr *syntax,

void *buffer = C.Allocate(sizeof(PseudoObjectExpr) +
(1 + semantics.size()) * sizeof(Expr*),
llvm::alignOf<PseudoObjectExpr>());
alignof(PseudoObjectExpr));
return new(buffer) PseudoObjectExpr(type, VK, syntax, semantics,
resultIndex);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Basic/SourceLocation.cpp
Expand Up @@ -23,6 +23,6 @@ PresumedLoc PresumedLoc::build(const SourceManager &SM, SourceLocation Loc) {
if (ID == -1)
return PresumedLoc();
std::pair<unsigned, unsigned> LC = SM.getLineAndColumn(Loc);
return PresumedLoc(SM.getMemoryBuffer(ID)->getBufferIdentifier(), LC.first,
LC.second, SM.getBufferInfo(ID).IncludeLoc);
return PresumedLoc(SM.getMemoryBuffer(ID)->getBufferIdentifier().data(),
LC.first, LC.second, SM.getBufferInfo(ID).IncludeLoc);
}
17 changes: 9 additions & 8 deletions lib/Frontend/TextDiagnostic.cpp
Expand Up @@ -96,16 +96,17 @@ printableTextForNextCharacter(StringRef SourceLine, size_t *i,
begin = reinterpret_cast<unsigned char const *>(&*(SourceLine.begin() + *i));
end = begin + (SourceLine.size() - *i);

if (isLegalUTF8Sequence(begin, end)) {
UTF32 c;
UTF32 *cptr = &c;
if (llvm::isLegalUTF8Sequence(begin, end)) {
llvm::UTF32 c;
llvm::UTF32 *cptr = &c;
unsigned char const *original_begin = begin;
unsigned char const *cp_end = begin+getNumBytesForUTF8(SourceLine[*i]);
unsigned char const *cp_end =
begin + llvm::getNumBytesForUTF8(SourceLine[*i]);

ConversionResult res = ConvertUTF8toUTF32(&begin, cp_end, &cptr, cptr+1,
strictConversion);
llvm::ConversionResult res = llvm::ConvertUTF8toUTF32(
&begin, cp_end, &cptr, cptr + 1, llvm::strictConversion);
(void)res;
assert(conversionOK==res);
assert(llvm::conversionOK==res);
assert(0 < begin-original_begin
&& "we must be further along in the string now");
*i += begin-original_begin;
Expand Down Expand Up @@ -752,7 +753,7 @@ void TextDiagnostic::emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc,
int FID = SM.FindBufferContainingLoc(Loc);
if (FID != -1) {
const llvm::MemoryBuffer* FE = SM.getMemoryBuffer(FID);
if (FE && FE->getBufferIdentifier()) {
if (FE && !FE->getBufferIdentifier().empty()) {
OS << FE->getBufferIdentifier();
//if (FE->getDevice() == 0 && FE->getInode() == 0
// && FE->getFileMode() == 0) {
Expand Down
2 changes: 1 addition & 1 deletion tools/driver/driver.cpp
Expand Up @@ -102,7 +102,7 @@ void ParseDiagnosticArgs(DiagnosticOptions &DiagOpts, int argc,
}

int main(int argc_, const char **argv_) {
llvm::sys::PrintStackTraceOnErrorSignal();
llvm::sys::PrintStackTraceOnErrorSignal(argv_[0]);
llvm::PrettyStackTraceProgram X(argc_, argv_);

llvm::InitializeAllTargets();
Expand Down

0 comments on commit 34dde94

Please sign in to comment.