Follow-up to http://reviews.llvm.org/rL245445
Added more tests for "-mcpu=generic", a crash fixed.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Yes, trying to pass new tests in test/Driver/arm-cortex-cpus.c, without code patch, it crashes
$ clang --target=arm-linux-gnueabi -mcpu=generic hello.c /work/oss_llvm/llvm/include/llvm/ADT/StringRef.h:84: llvm::StringRef::StringRef(const char*, size_t): Assertion `(data || length == 0) && "StringRef cannot be built from a NULL argument with non-null length"' failed. ... #9 0x2b22f25 (anonymous namespace)::._115::getSubArch() const lib/Support/TargetParser.cpp:74:0 #10 0x2b27147 llvm::ARM::getSubArch(unsigned int) lib/Support/TargetParser.cpp:309:0 #11 0x31871a1 clang::driver::tools::arm::getLLVMArchSuffixForARM(llvm::StringRef, llvm::StringRef) tools/clang/lib/Driver/Tools.cpp:6374:0 #12 0x3125da8 clang::driver::ToolChain::ComputeLLVMTriple(llvm::opt::ArgList const&, clang::driver::types::ID) const tools/clang/lib/Driver/ToolChain.cpp:321:0 #13 0x312656c clang::driver::ToolChain::ComputeEffectiveClangTriple(llvm::opt::ArgList const&, clang::driver::types::ID) const tools/clang/lib/Driver/ToolChain.cpp:353:0 #14 0x31726b1 clang::driver::tools::Clang::ConstructJob(clang::driver::Compilation&, clang::driver::JobAction const&, clang::driver::InputInfo const&, llvm::SmallVector<clang::driver::InputInfo, 4u> const&, llvm::opt::ArgList const&, char const*) const tools/clang/lib/Driver/Tools.cpp:3363:0
Comment Actions
Apart from the style nitpick, LGTM. Thanks!
lib/Driver/Tools.cpp | ||
---|---|---|
6139 ↗ | (On Diff #35234) | Please, add curly brackets here for the else case. |