From 1abf2cb59b8d63415780a03329307c0997b2670c Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 14 Jul 2011 23:50:31 +0000 Subject: Rename createAsmInfo to createMCAsmInfo and move registration code to MCTargetDesc to prepare for next round of changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135219 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Blackfin/BlackfinMCAsmInfo.cpp | 22 ---------------- lib/Target/Blackfin/BlackfinMCAsmInfo.h | 29 ---------------------- lib/Target/Blackfin/BlackfinTargetMachine.cpp | 3 --- .../Blackfin/MCTargetDesc/BlackfinMCAsmInfo.cpp | 22 ++++++++++++++++ .../Blackfin/MCTargetDesc/BlackfinMCAsmInfo.h | 29 ++++++++++++++++++++++ .../Blackfin/MCTargetDesc/BlackfinMCTargetDesc.cpp | 12 ++++++--- lib/Target/Blackfin/MCTargetDesc/CMakeLists.txt | 5 +++- 7 files changed, 64 insertions(+), 58 deletions(-) delete mode 100644 lib/Target/Blackfin/BlackfinMCAsmInfo.cpp delete mode 100644 lib/Target/Blackfin/BlackfinMCAsmInfo.h create mode 100644 lib/Target/Blackfin/MCTargetDesc/BlackfinMCAsmInfo.cpp create mode 100644 lib/Target/Blackfin/MCTargetDesc/BlackfinMCAsmInfo.h (limited to 'lib/Target/Blackfin') diff --git a/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp b/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp deleted file mode 100644 index 5b9d4a2..0000000 --- a/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===-- BlackfinMCAsmInfo.cpp - Blackfin asm properties -------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the BlackfinMCAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "BlackfinMCAsmInfo.h" - -using namespace llvm; - -BlackfinMCAsmInfo::BlackfinMCAsmInfo(const Target &T, StringRef TT) { - GlobalPrefix = "_"; - CommentString = "//"; - HasSetDirective = false; -} diff --git a/lib/Target/Blackfin/BlackfinMCAsmInfo.h b/lib/Target/Blackfin/BlackfinMCAsmInfo.h deleted file mode 100644 index c372aa2..0000000 --- a/lib/Target/Blackfin/BlackfinMCAsmInfo.h +++ /dev/null @@ -1,29 +0,0 @@ -//===-- BlackfinMCAsmInfo.h - Blackfin asm properties ---------*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the BlackfinMCAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef BLACKFINTARGETASMINFO_H -#define BLACKFINTARGETASMINFO_H - -#include "llvm/ADT/StringRef.h" -#include "llvm/MC/MCAsmInfo.h" - -namespace llvm { - class Target; - - struct BlackfinMCAsmInfo : public MCAsmInfo { - explicit BlackfinMCAsmInfo(const Target &T, StringRef TT); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/Blackfin/BlackfinTargetMachine.cpp b/lib/Target/Blackfin/BlackfinTargetMachine.cpp index ee547e0..a1c9f1c 100644 --- a/lib/Target/Blackfin/BlackfinTargetMachine.cpp +++ b/lib/Target/Blackfin/BlackfinTargetMachine.cpp @@ -12,7 +12,6 @@ #include "BlackfinTargetMachine.h" #include "Blackfin.h" -#include "BlackfinMCAsmInfo.h" #include "llvm/PassManager.h" #include "llvm/Target/TargetRegistry.h" @@ -20,8 +19,6 @@ using namespace llvm; extern "C" void LLVMInitializeBlackfinTarget() { RegisterTargetMachine X(TheBlackfinTarget); - RegisterAsmInfo Y(TheBlackfinTarget); - } BlackfinTargetMachine::BlackfinTargetMachine(const Target &T, diff --git a/lib/Target/Blackfin/MCTargetDesc/BlackfinMCAsmInfo.cpp b/lib/Target/Blackfin/MCTargetDesc/BlackfinMCAsmInfo.cpp new file mode 100644 index 0000000..5b9d4a2 --- /dev/null +++ b/lib/Target/Blackfin/MCTargetDesc/BlackfinMCAsmInfo.cpp @@ -0,0 +1,22 @@ +//===-- BlackfinMCAsmInfo.cpp - Blackfin asm properties -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the BlackfinMCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "BlackfinMCAsmInfo.h" + +using namespace llvm; + +BlackfinMCAsmInfo::BlackfinMCAsmInfo(const Target &T, StringRef TT) { + GlobalPrefix = "_"; + CommentString = "//"; + HasSetDirective = false; +} diff --git a/lib/Target/Blackfin/MCTargetDesc/BlackfinMCAsmInfo.h b/lib/Target/Blackfin/MCTargetDesc/BlackfinMCAsmInfo.h new file mode 100644 index 0000000..c372aa2 --- /dev/null +++ b/lib/Target/Blackfin/MCTargetDesc/BlackfinMCAsmInfo.h @@ -0,0 +1,29 @@ +//===-- BlackfinMCAsmInfo.h - Blackfin asm properties ---------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the BlackfinMCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef BLACKFINTARGETASMINFO_H +#define BLACKFINTARGETASMINFO_H + +#include "llvm/ADT/StringRef.h" +#include "llvm/MC/MCAsmInfo.h" + +namespace llvm { + class Target; + + struct BlackfinMCAsmInfo : public MCAsmInfo { + explicit BlackfinMCAsmInfo(const Target &T, StringRef TT); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/Blackfin/MCTargetDesc/BlackfinMCTargetDesc.cpp b/lib/Target/Blackfin/MCTargetDesc/BlackfinMCTargetDesc.cpp index 521c87d..0fa1471 100644 --- a/lib/Target/Blackfin/MCTargetDesc/BlackfinMCTargetDesc.cpp +++ b/lib/Target/Blackfin/MCTargetDesc/BlackfinMCTargetDesc.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "BlackfinMCTargetDesc.h" +#include "BlackfinMCAsmInfo.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" @@ -29,7 +30,7 @@ using namespace llvm; -MCInstrInfo *createBlackfinMCInstrInfo() { +static MCInstrInfo *createBlackfinMCInstrInfo() { MCInstrInfo *X = new MCInstrInfo(); InitBlackfinMCInstrInfo(X); return X; @@ -41,8 +42,9 @@ extern "C" void LLVMInitializeBlackfinMCInstrInfo() { } -MCSubtargetInfo *createBlackfinMCSubtargetInfo(StringRef TT, StringRef CPU, - StringRef FS) { +static MCSubtargetInfo *createBlackfinMCSubtargetInfo(StringRef TT, + StringRef CPU, + StringRef FS) { MCSubtargetInfo *X = new MCSubtargetInfo(); InitBlackfinMCSubtargetInfo(X, TT, CPU, FS); return X; @@ -52,3 +54,7 @@ extern "C" void LLVMInitializeBlackfinMCSubtargetInfo() { TargetRegistry::RegisterMCSubtargetInfo(TheBlackfinTarget, createBlackfinMCSubtargetInfo); } + +extern "C" void LLVMInitializeBlackfinMCAsmInfo() { + RegisterMCAsmInfo X(TheBlackfinTarget); +} diff --git a/lib/Target/Blackfin/MCTargetDesc/CMakeLists.txt b/lib/Target/Blackfin/MCTargetDesc/CMakeLists.txt index 21e1fce..8cd924f 100644 --- a/lib/Target/Blackfin/MCTargetDesc/CMakeLists.txt +++ b/lib/Target/Blackfin/MCTargetDesc/CMakeLists.txt @@ -1 +1,4 @@ -add_llvm_library(LLVMBlackfinDesc BlackfinMCTargetDesc.cpp) +add_llvm_library(LLVMBlackfinDesc + BlackfinMCTargetDesc.cpp + BlackfinMCAsmInfo.cpp + ) -- cgit v1.1