diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 19:34:23 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2012-08-15 19:34:23 +0000 | 
| commit | 58b69754af0cbff56b1cfce9be9392e4451f6628 (patch) | |
| tree | eacfc83d988e4b9d11114387ae7dc41243f2a363 /lib/Target/CppBackend/CPPBackend.cpp | |
| parent | 0378662f5bd3dbe8305a485b0282bceb8b52f465 (diff) | |
Notes
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
| -rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 33 | 
1 files changed, 29 insertions, 4 deletions
| diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 69f0ff87eda0..c8e757becc72 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -130,6 +130,7 @@ namespace {    private:      void printLinkageType(GlobalValue::LinkageTypes LT);      void printVisibilityType(GlobalValue::VisibilityTypes VisTypes); +    void printThreadLocalMode(GlobalVariable::ThreadLocalMode TLM);      void printCallingConv(CallingConv::ID cc);      void printEscapedString(const std::string& str);      void printCFP(const ConstantFP* CFP); @@ -325,6 +326,26 @@ void CppWriter::printVisibilityType(GlobalValue::VisibilityTypes VisType) {    }  } +void CppWriter::printThreadLocalMode(GlobalVariable::ThreadLocalMode TLM) { +  switch (TLM) { +    case GlobalVariable::NotThreadLocal: +      Out << "GlobalVariable::NotThreadLocal"; +      break; +    case GlobalVariable::GeneralDynamicTLSModel: +      Out << "GlobalVariable::GeneralDynamicTLSModel"; +      break; +    case GlobalVariable::LocalDynamicTLSModel: +      Out << "GlobalVariable::LocalDynamicTLSModel"; +      break; +    case GlobalVariable::InitialExecTLSModel: +      Out << "GlobalVariable::InitialExecTLSModel"; +      break; +    case GlobalVariable::LocalExecTLSModel: +      Out << "GlobalVariable::LocalExecTLSModel"; +      break; +  } +} +  // printEscapedString - Print each character of the specified string, escaping  // it if it is not printable or if it is an escape char.  void CppWriter::printEscapedString(const std::string &Str) { @@ -496,7 +517,7 @@ void CppWriter::printAttributes(const AttrListPtr &PAL,        Out << "Attrs.push_back(PAWI);";        nl(Out);      } -    Out << name << "_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());"; +    Out << name << "_PAL = AttrListPtr::get(Attrs);";      nl(Out);      out(); nl(Out);      Out << '}'; nl(Out); @@ -996,7 +1017,9 @@ void CppWriter::printVariableHead(const GlobalVariable *GV) {    }    if (GV->isThreadLocal()) {      printCppName(GV); -    Out << "->setThreadLocal(true);"; +    Out << "->setThreadLocalMode("; +    printThreadLocalMode(GV->getThreadLocalMode()); +    Out << ");";      nl(Out);    }    if (is_inline) { @@ -1105,7 +1128,7 @@ void CppWriter::printInstruction(const Instruction *I,      nl(Out);      for (SwitchInst::ConstCaseIt i = SI->case_begin(), e = SI->case_end();           i != e; ++i) { -      const ConstantInt* CaseVal = i.getCaseValue(); +      const IntegersSubset CaseVal = i.getCaseValueEx();        const BasicBlock *BB = i.getCaseSuccessor();        Out << iName << "->addCase("            << getOpName(CaseVal) << ", " @@ -2078,7 +2101,9 @@ char CppWriter::ID = 0;  bool CPPTargetMachine::addPassesToEmitFile(PassManagerBase &PM,                                             formatted_raw_ostream &o,                                             CodeGenFileType FileType, -                                           bool DisableVerify) { +                                           bool DisableVerify, +                                           AnalysisID StartAfter, +                                           AnalysisID StopAfter) {    if (FileType != TargetMachine::CGFT_AssemblyFile) return true;    PM.add(new CppWriter(o));    return false; | 
