Skip to content

Commit

Permalink
Revert "Emit Function IDs table for Control Flow Guard"
Browse files Browse the repository at this point in the history
The new test fails on the Hexagon bot.  Reverting while I investigate.

This reverts https://reviews.llvm.org/rL322005

This reverts commit b7e0026b4385180c378edc658ec91a39566f2942.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322008 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
amccarth-google committed Jan 8, 2018
1 parent 42eab8a commit b4a3670
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 336 deletions.
2 changes: 0 additions & 2 deletions include/llvm/MC/MCObjectFileInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ class MCObjectFileInfo {
MCSection *PDataSection;
MCSection *XDataSection;
MCSection *SXDataSection;
MCSection *GFIDsSection;

public:
void InitMCObjectFileInfo(const Triple &TT, bool PIC, MCContext &ctx,
Expand Down Expand Up @@ -350,7 +349,6 @@ class MCObjectFileInfo {
MCSection *getPDataSection() const { return PDataSection; }
MCSection *getXDataSection() const { return XDataSection; }
MCSection *getSXDataSection() const { return SXDataSection; }
MCSection *getGFIDsSection() const { return GFIDsSection; }

MCSection *getEHFrameSection() {
return EHFrameSection;
Expand Down
3 changes: 0 additions & 3 deletions include/llvm/MC/MCStreamer.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,6 @@ class MCStreamer {

virtual void EmitCOFFSafeSEH(MCSymbol const *Symbol);

/// \brief Emits the symbol table index of a Symbol into the current section.
virtual void EmitCOFFSymbolIndex(MCSymbol const *Symbol);

/// \brief Emits a COFF section index.
///
/// \param Symbol - Symbol the section number relocation should point to.
Expand Down
1 change: 0 additions & 1 deletion include/llvm/MC/MCWinCOFFStreamer.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class MCWinCOFFStreamer : public MCObjectStreamer {
void EmitCOFFSymbolType(int Type) override;
void EndCOFFSymbolDef() override;
void EmitCOFFSafeSEH(MCSymbol const *Symbol) override;
void EmitCOFFSymbolIndex(MCSymbol const *Symbol) override;
void EmitCOFFSectionIndex(MCSymbol const *Symbol) override;
void EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset) override;
void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Expand Down
10 changes: 0 additions & 10 deletions lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "CodeViewDebug.h"
#include "DwarfDebug.h"
#include "DwarfException.h"
#include "WinCFGuard.h"
#include "WinException.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
Expand Down Expand Up @@ -131,8 +130,6 @@ static const char *const DbgTimerName = "emit";
static const char *const DbgTimerDescription = "Debug Info Emission";
static const char *const EHTimerName = "write_exception";
static const char *const EHTimerDescription = "DWARF Exception Writer";
static const char *const CFGuardName = "Control Flow Guard";
static const char *const CFGuardDescription = "Control Flow Guard Tables";
static const char *const CodeViewLineTablesGroupName = "linetables";
static const char *const CodeViewLineTablesGroupDescription =
"CodeView Line Tables";
Expand Down Expand Up @@ -357,13 +354,6 @@ bool AsmPrinter::doInitialization(Module &M) {
if (ES)
Handlers.push_back(HandlerInfo(ES, EHTimerName, EHTimerDescription,
DWARFGroupName, DWARFGroupDescription));

if (mdconst::extract_or_null<ConstantInt>(
MMI->getModule()->getModuleFlag("cfguard")))
Handlers.push_back(HandlerInfo(new WinCFGuard(this), CFGuardName,
CFGuardDescription, DWARFGroupName,
DWARFGroupDescription));

return false;
}

Expand Down
1 change: 0 additions & 1 deletion lib/CodeGen/AsmPrinter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ add_llvm_library(LLVMAsmPrinter
EHStreamer.cpp
ErlangGCPrinter.cpp
OcamlGCPrinter.cpp
WinCFGuard.cpp
WinException.cpp
CodeViewDebug.cpp

Expand Down
45 changes: 0 additions & 45 deletions lib/CodeGen/AsmPrinter/WinCFGuard.cpp

This file was deleted.

54 changes: 0 additions & 54 deletions lib/CodeGen/AsmPrinter/WinCFGuard.h

This file was deleted.

7 changes: 0 additions & 7 deletions lib/MC/MCAsmStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ class MCAsmStreamer final : public MCStreamer {
void EmitCOFFSymbolType(int Type) override;
void EndCOFFSymbolDef() override;
void EmitCOFFSafeSEH(MCSymbol const *Symbol) override;
void EmitCOFFSymbolIndex(MCSymbol const *Symbol) override;
void EmitCOFFSectionIndex(MCSymbol const *Symbol) override;
void EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset) override;
void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override;
Expand Down Expand Up @@ -654,12 +653,6 @@ void MCAsmStreamer::EmitCOFFSafeSEH(MCSymbol const *Symbol) {
EmitEOL();
}

void MCAsmStreamer::EmitCOFFSymbolIndex(MCSymbol const *Symbol) {
OS << "\t.symidx\t";
Symbol->print(OS, MAI);
EmitEOL();
}

void MCAsmStreamer::EmitCOFFSectionIndex(MCSymbol const *Symbol) {
OS << "\t.secidx\t";
Symbol->print(OS, MAI);
Expand Down
5 changes: 0 additions & 5 deletions lib/MC/MCObjectFileInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,6 @@ void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) {
SXDataSection = Ctx->getCOFFSection(".sxdata", COFF::IMAGE_SCN_LNK_INFO,
SectionKind::getMetadata());

GFIDsSection = Ctx->getCOFFSection(".gfids$y",
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
COFF::IMAGE_SCN_MEM_READ,
SectionKind::getMetadata());

TLSDataSection = Ctx->getCOFFSection(
".tls$", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ |
COFF::IMAGE_SCN_MEM_WRITE,
Expand Down
19 changes: 1 addition & 18 deletions lib/MC/MCParser/COFFAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ class COFFAsmParser : public MCAsmParserExtension {
addDirectiveHandler<&COFFAsmParser::ParseDirectiveType>(".type");
addDirectiveHandler<&COFFAsmParser::ParseDirectiveEndef>(".endef");
addDirectiveHandler<&COFFAsmParser::ParseDirectiveSecRel32>(".secrel32");
addDirectiveHandler<&COFFAsmParser::ParseDirectiveSymIdx>(".symidx");
addDirectiveHandler<&COFFAsmParser::ParseDirectiveSafeSEH>(".safeseh");
addDirectiveHandler<&COFFAsmParser::ParseDirectiveSecIdx>(".secidx");
addDirectiveHandler<&COFFAsmParser::ParseDirectiveSafeSEH>(".safeseh");
addDirectiveHandler<&COFFAsmParser::ParseDirectiveLinkOnce>(".linkonce");

// Win64 EH directives.
Expand Down Expand Up @@ -131,7 +130,6 @@ class COFFAsmParser : public MCAsmParserExtension {
bool ParseDirectiveSecRel32(StringRef, SMLoc);
bool ParseDirectiveSecIdx(StringRef, SMLoc);
bool ParseDirectiveSafeSEH(StringRef, SMLoc);
bool ParseDirectiveSymIdx(StringRef, SMLoc);
bool parseCOMDATType(COFF::COMDATType &Type);
bool ParseDirectiveLinkOnce(StringRef, SMLoc);

Expand Down Expand Up @@ -522,21 +520,6 @@ bool COFFAsmParser::ParseDirectiveSecIdx(StringRef, SMLoc) {
return false;
}

bool COFFAsmParser::ParseDirectiveSymIdx(StringRef, SMLoc) {
StringRef SymbolID;
if (getParser().parseIdentifier(SymbolID))
return TokError("expected identifier in directive");

if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in directive");

MCSymbol *Symbol = getContext().getOrCreateSymbol(SymbolID);

Lex();
getStreamer().EmitCOFFSymbolIndex(Symbol);
return false;
}

/// ::= [ identifier ]
bool COFFAsmParser::parseCOMDATType(COFF::COMDATType &Type) {
StringRef TypeId = getTok().getIdentifier();
Expand Down
2 changes: 0 additions & 2 deletions lib/MC/MCStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,6 @@ void MCStreamer::EmitWinCFIEndProlog(SMLoc Loc) {
void MCStreamer::EmitCOFFSafeSEH(MCSymbol const *Symbol) {
}

void MCStreamer::EmitCOFFSymbolIndex(MCSymbol const *Symbol) {}

void MCStreamer::EmitCOFFSectionIndex(MCSymbol const *Symbol) {
}

Expand Down
11 changes: 0 additions & 11 deletions lib/MC/MCWinCOFFStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,6 @@ void MCWinCOFFStreamer::EmitCOFFSafeSEH(MCSymbol const *Symbol) {
<< COFF::SCT_COMPLEX_TYPE_SHIFT);
}

void MCWinCOFFStreamer::EmitCOFFSymbolIndex(MCSymbol const *Symbol) {
MCSection *Sec = getCurrentSectionOnly();
getAssembler().registerSection(*Sec);
if (Sec->getAlignment() < 4)
Sec->setAlignment(4);

new MCSymbolIdFragment(Symbol, getCurrentSectionOnly());

getAssembler().registerSymbol(*Symbol);
}

void MCWinCOFFStreamer::EmitCOFFSectionIndex(const MCSymbol *Symbol) {
visitUsedSymbol(*Symbol);
MCDataFragment *DF = getOrCreateDataFragment();
Expand Down
Loading

0 comments on commit b4a3670

Please sign in to comment.