Currently, LLDB (ClangExpressionParser) does not pass clang::TargetOptions::CPU to clang which is supposed to contain the name of the target CPU to generate code for.
So, compiler generates the code for its default CPU (mips32r2 and mips64r2 for MIPS32 and MIPS64 respectively).
This causes problems in evaluating expressions in some cases.
For example, if we are debugging MIPS revision 6 (R6) application, as we do not pass CPU information to the compiler so compiler chooses default target and generates code for mips32r2/mips64r2.
The code generated for expression then fails to run on R6 because instruction set differs for R2 and R6 (few instructions in R2 are not available in R6).
The causes expression to fail.
This patch sets clang::TargetOptions::CPU with appropriate string so that compiler can generate correct code for that target.
name this "target_arch"